From b04fc6cdb0cdd6375aa878e34fbe9bf46e9b38c9 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sat, 22 Sep 2018 13:30:30 -0400 Subject: [PATCH 01/84] feat(*): Initial commit --- packages/typescript-estree/.gitattributes | 4 + .../.github/ISSUE_TEMPLATE.md | 16 + packages/typescript-estree/.gitignore | 7 + packages/typescript-estree/.npmrc | 1 + packages/typescript-estree/.travis.yml | 21 + packages/typescript-estree/LICENSE | 26 + packages/typescript-estree/README.md | 7 + .../typescript-estree/lib/ast-converter.js | 75 + .../typescript-estree/lib/ast-node-types.js | 161 + .../typescript-estree/lib/convert-comments.js | 146 + packages/typescript-estree/lib/convert.js | 2196 + packages/typescript-estree/lib/node-utils.js | 746 + packages/typescript-estree/package.json | 73 + packages/typescript-estree/parser.js | 181 + .../tests/ast-alignment/.eslintrc.yml | 2 + .../tests/ast-alignment/fixtures-to-test.js | 523 + .../tests/ast-alignment/jest.config.js | 6 + .../tests/ast-alignment/parse.js | 96 + .../tests/ast-alignment/spec.js | 80 + .../tests/ast-alignment/utils.js | 152 + .../fixtures/basics/delete-expression.src.js | 1 + .../basics/do-while-statements.src.js | 6 + .../identifiers-double-underscore.src.js | 9 + .../tests/fixtures/basics/instanceof.src.js | 1 + .../basics/new-with-member-expression.src.js | 1 + .../fixtures/basics/new-without-parens.src.js | 2 + .../fixtures/basics/typeof-expression.src.js | 1 + .../fixtures/basics/update-expression.src.js | 5 + .../fixtures/basics/void-expression.src.js | 2 + .../comments/block-trailing-comment.src.js | 4 + .../comments/comment-within-condition.src.js | 2 + .../export-default-anonymous-class.src.js | 10 + .../fixtures/comments/jsdoc-comment.src.js | 8 + .../comments/jsx-block-comment.src.js | 7 + .../fixtures/comments/jsx-tag-comments.src.js | 10 + .../line-comment-with-block-syntax.src.js | 1 + .../mix-line-and-block-comments.src.js | 3 + .../fixtures/comments/no-comment-regex.src.js | 1 + .../comments/no-comment-template.src.js | 1 + .../comments/surrounding-call-comments.src.js | 5 + .../surrounding-debugger-comments.src.js | 5 + .../surrounding-return-comments.src.js | 5 + .../surrounding-throw-comments.src.js | 5 + .../surrounding-while-loop-comments.src.js | 1 + ...tch-fallthrough-comment-in-function.src.js | 9 + .../switch-fallthrough-comment.src.js | 7 + ...itch-no-default-comment-in-function.src.js | 9 + ...default-comment-in-nested-functions.src.js | 12 + .../comments/switch-no-default-comment.src.js | 5 + .../comments/template-string-block.src.js | 5 + .../as-param-with-params.src.js | 1 + .../arrowFunctions/as-param.src.js | 1 + .../basic-in-binary-expression.src.js | 2 + .../ecma-features/arrowFunctions/basic.src.js | 1 + .../block-body-not-object.src.js | 1 + .../arrowFunctions/block-body.src.js | 1 + .../arrowFunctions/error-dup-params.src.js | 1 + .../arrowFunctions/error-missing-paren.src.js | 1 + .../arrowFunctions/error-not-arrow.src.js | 1 + .../error-numeric-param-multi.src.js | 1 + .../arrowFunctions/error-numeric-param.src.js | 1 + .../arrowFunctions/error-reverse-arrow.src.js | 1 + .../error-strict-default-param-eval.src.js | 1 + .../error-strict-dup-params.src.js | 1 + .../error-strict-eval-return.src.js | 1 + .../arrowFunctions/error-strict-eval.src.js | 1 + .../arrowFunctions/error-strict-octal.src.js | 1 + .../error-strict-param-arguments.src.js | 1 + .../error-strict-param-eval.src.js | 1 + .../error-strict-param-names.src.js | 1 + ...ror-strict-param-no-paren-arguments.src.js | 1 + .../error-strict-param-no-paren-eval.src.js | 1 + .../arrowFunctions/error-two-lines.src.js | 2 + .../arrowFunctions/error-wrapped-param.src.js | 1 + .../arrowFunctions/expression.src.js | 1 + .../ecma-features/arrowFunctions/iife.src.js | 1 + .../arrowFunctions/multiple-params.src.js | 1 + .../arrowFunctions/no-auto-return.src.js | 1 + .../not-strict-arguments.src.js | 1 + .../not-strict-eval-params.src.js | 1 + .../arrowFunctions/not-strict-eval.src.js | 1 + .../arrowFunctions/not-strict-octal.src.js | 1 + .../return-arrow-function.src.js | 1 + .../arrowFunctions/return-sequence.src.js | 1 + .../arrowFunctions/single-param-parens.src.js | 1 + .../single-param-return-identifier.src.js | 1 + .../arrowFunctions/single-param.src.js | 1 + .../binaryLiterals/invalid.src.js | 1 + .../binaryLiterals/lowercase.src.js | 1 + .../binaryLiterals/uppercase.src.js | 1 + .../ecma-features/blockBindings/const.src.js | 1 + .../blockBindings/let-in-switchcase.src.js | 1 + .../ecma-features/blockBindings/let.src.js | 1 + .../classes/class-accessor-properties.src.js | 1 + .../class-computed-static-method.src.js | 1 + .../classes/class-expression.src.js | 1 + .../class-method-named-prototype.src.js | 1 + .../classes/class-method-named-static.src.js | 1 + .../class-method-named-with-space.src.js | 1 + .../classes/class-one-method-super.src.js | 5 + .../classes/class-one-method.src.js | 3 + ...class-static-method-named-prototype.src.js | 1 + .../class-static-method-named-static.src.js | 1 + .../classes/class-static-method.src.js | 1 + ...tic-methods-and-accessor-properties.src.js | 1 + .../class-two-computed-static-methods.src.js | 1 + ...ss-two-methods-computed-constructor.src.js | 1 + .../classes/class-two-methods-semi.src.js | 1 + .../class-two-methods-three-semi.src.js | 1 + .../classes/class-two-methods-two-semi.src.js | 1 + .../classes/class-two-methods.src.js | 1 + ...wo-static-methods-named-constructor.src.js | 1 + .../class-with-constructor-parameters.src.js | 1 + .../class-with-constructor-with-space.src.js | 1 + .../classes/class-with-constructor.src.js | 1 + .../derived-class-assign-to-var.src.js | 1 + .../classes/derived-class-expression.src.js | 1 + .../classes/empty-class-double-semi.src.js | 1 + .../classes/empty-class-semi.src.js | 1 + .../ecma-features/classes/empty-class.src.js | 1 + .../empty-literal-derived-class.src.js | 1 + .../classes/invalid-class-declaration.src.js | 1 + .../invalid-class-setter-declaration.src.js | 1 + .../invalid-class-two-super-classes.src.js | 1 + .../classes/named-class-expression.src.js | 1 + .../named-derived-class-expression.src.js | 1 + .../defaultParams/class-constructor.src.js | 4 + .../defaultParams/class-method.src.js | 4 + .../defaultParams/declaration.src.js | 1 + .../defaultParams/expression.src.js | 1 + .../ecma-features/defaultParams/method.src.js | 1 + .../defaultParams/not-all-params.src.js | 1 + .../arrow-param-array.src.js | 1 + .../arrow-param-nested-array.src.js | 1 + .../arrow-param-nested-object-named.src.js | 1 + .../arrow-param-nested-object.src.js | 1 + .../arrow-param-object.src.js | 1 + .../param-defaults-array.src.js | 1 + .../param-defaults-object-nested.src.js | 1 + .../param-defaults-object.src.js | 1 + .../array-const-undefined.src.js | 1 + .../array-let-undefined.src.js | 1 + .../object-const-named.src.js | 1 + .../object-const-undefined.src.js | 1 + .../object-let-named.src.js | 1 + .../object-let-undefined.src.js | 1 + .../param-array.src.js | 1 + .../param-object-short.src.js | 1 + .../param-object-wrapped.src.xjs | 1 + .../param-object.src.js | 1 + .../destructuring-and-forOf/loop.src.js | 1 + .../complex-destructured.src.js | 1 + .../destructured-array-literal.src.js | 1 + .../destructuring-param.src.js | 1 + ...r-complex-destructured-spread-first.src.js | 1 + .../invalid-not-final-array-empty.src.xjs | 1 + .../multi-destructured.src.js | 1 + .../not-final-array.src.xjs | 1 + .../single-destructured.src.js | 1 + .../var-complex-destructured.src.js | 1 + .../var-destructured-array-literal.src.js | 1 + .../var-multi-destructured.src.js | 1 + .../var-single-destructured.src.js | 1 + .../destructuring/array-member.src.js | 1 + .../destructuring/array-to-array.src.js | 1 + .../destructuring/array-var-undefined.src.js | 1 + .../class-constructor-params-array.src.js | 4 + ...s-constructor-params-defaults-array.src.js | 4 + ...-constructor-params-defaults-object.src.js | 4 + .../class-constructor-params-object.src.js | 4 + .../class-method-params-array.src.js | 4 + .../class-method-params-defaults-array.src.js | 4 + ...class-method-params-defaults-object.src.js | 4 + .../class-method-params-object.src.js | 4 + .../destructuring/defaults-array-all.src.js | 1 + ...efaults-array-longform-nested-multi.src.js | 1 + .../destructuring/defaults-array-multi.src.js | 1 + .../defaults-array-nested-all.src.js | 1 + .../defaults-array-nested-multi.src.js | 1 + .../destructuring/defaults-array.src.js | 1 + .../destructuring/defaults-object-all.src.js | 1 + .../defaults-object-longform-all.src.js | 1 + .../defaults-object-longform-multi.src.js | 1 + .../defaults-object-longform.src.js | 1 + .../defaults-object-mixed-multi.src.js | 1 + .../defaults-object-multi.src.js | 1 + .../defaults-object-nested-all.src.js | 1 + .../defaults-object-nested-multi.src.js | 1 + .../destructuring/defaults-object.src.js | 1 + .../destructured-array-catch.src.js | 7 + .../destructured-object-catch.src.js | 7 + .../invalid-defaults-object-assign.src.js | 1 + .../destructuring/named-param.src.js | 1 + .../destructuring/nested-array.src.js | 1 + .../destructuring/nested-object.src.js | 1 + .../destructuring/object-var-named.src.js | 1 + .../destructuring/object-var-undefined.src.js | 1 + .../destructuring/param-defaults-array.src.js | 1 + .../param-defaults-object-nested.src.js | 1 + .../param-defaults-object.src.js | 1 + .../destructuring/params-array-wrapped.src.js | 1 + .../destructuring/params-array.src.js | 1 + .../destructuring/params-multi-object.src.js | 1 + .../destructuring/params-nested-array.src.js | 1 + .../destructuring/params-nested-object.src.js | 1 + .../params-object-wrapped.src.js | 1 + .../destructuring/params-object.src.js | 1 + .../destructuring/sparse-array.src.js | 1 + .../async-generators.src.js | 3 + .../async-iterator.src.js | 5 + .../dynamic-import.src.js | 1 + .../arg-spread.src.js | 1 + .../destructuring-assign-mirror.src.js | 1 + .../function-parameter-object-spread.src.js | 1 + .../invalid-rest-trailing-comma.src.js | 1 + .../invalid-rest.src.js | 1 + .../object-rest.src.js | 1 + .../property-spread.src.js | 9 + .../shorthand-method-args.src.js | 5 + .../shorthand-methods.src.js | 5 + .../shorthand-properties.src.js | 9 + .../single-spread.src.js | 9 + .../spread-trailing-comma.src.js | 1 + .../two-spread.src.js | 9 + .../optional-catch-binding-finally.src.js | 1 + .../optional-catch-binding.src.js | 1 + .../exponential-operators.src.js | 2 + .../for-of-with-function-initializer.src.js | 1 + .../forOf/for-of-with-var-and-braces.src.js | 3 + .../for-of-with-var-and-no-braces.src.js | 2 + ...lid-for-of-with-const-and-no-braces.src.js | 2 + ...valid-for-of-with-let-and-no-braces.src.js | 2 + .../generators/anonymous-generator.src.js | 1 + .../async-generator-function.src.js | 4 + .../generators/async-generator-method.src.js | 5 + .../generators/double-yield.src.js | 1 + .../empty-generator-declaration.src.js | 1 + .../generators/generator-declaration.src.js | 1 + .../generators/yield-delegation.src.js | 1 + .../yield-without-value-in-call.src.js | 1 + .../yield-without-value-no-semi.src.js | 1 + .../generators/yield-without-value.src.js | 1 + .../globalReturn/return-identifier.src.js | 1 + .../globalReturn/return-no-arg.src.js | 1 + .../globalReturn/return-true.src.js | 1 + .../importMeta/simple-import-meta.src.js | 1 + .../ecma-features/modules/error-delete.src.js | 2 + .../modules/error-function.src.js | 4 + .../ecma-features/modules/error-strict.src.js | 5 + .../modules/export-default-array.src.js | 1 + .../modules/export-default-class.src.js | 3 + .../modules/export-default-expression.src.js | 1 + .../modules/export-default-function.src.js | 1 + .../modules/export-default-named-class.src.js | 3 + .../export-default-named-function.src.js | 1 + .../modules/export-default-number.src.js | 1 + .../modules/export-default-object.src.js | 1 + .../modules/export-default-value.src.js | 1 + .../modules/export-from-batch.src.js | 1 + .../modules/export-from-default.src.js | 1 + .../export-from-named-as-default.src.js | 1 + .../export-from-named-as-specifier.src.js | 1 + .../export-from-named-as-specifiers.src.js | 1 + .../modules/export-from-specifier.src.js | 1 + .../modules/export-from-specifiers.src.js | 1 + .../modules/export-function.src.js | 1 + .../modules/export-named-as-default.src.js | 1 + .../modules/export-named-as-specifier.src.js | 1 + .../modules/export-named-as-specifiers.src.js | 1 + .../modules/export-named-class.src.js | 3 + .../modules/export-named-empty.src.js | 1 + .../modules/export-named-specifier.src.js | 1 + .../export-named-specifiers-comma.src.js | 1 + .../modules/export-named-specifiers.src.js | 1 + .../export-var-anonymous-function.src.js | 1 + .../modules/export-var-number.src.js | 1 + .../ecma-features/modules/export-var.src.js | 1 + ...import-default-and-named-specifiers.src.js | 1 + ...rt-default-and-namespace-specifiers.src.js | 1 + .../modules/import-default-as.src.js | 1 + .../modules/import-default.src.js | 1 + .../modules/import-jquery.src.js | 1 + .../modules/import-module.src.js | 1 + .../modules/import-named-as-specifier.src.js | 1 + .../modules/import-named-as-specifiers.src.js | 1 + .../modules/import-named-empty.src.js | 1 + .../modules/import-named-specifier.src.js | 1 + .../import-named-specifiers-comma.src.js | 1 + .../modules/import-named-specifiers.src.js | 1 + .../modules/import-namespace-specifier.src.js | 1 + .../modules/import-null-as-nil.src.js | 1 + .../modules/invalid-await.src.js | 1 + .../modules/invalid-class.src.js | 1 + ...id-export-batch-missing-from-clause.src.js | 1 + .../modules/invalid-export-batch-token.src.js | 1 + .../invalid-export-default-equal.src.js | 1 + .../invalid-export-default-token.src.js | 1 + .../modules/invalid-export-default.src.js | 1 + .../invalid-export-named-default.src.js | 1 + .../invalid-export-named-extra-comma.src.js | 1 + .../invalid-export-named-middle-comma.src.js | 1 + ...t-default-after-named-after-default.src.js | 1 + .../invalid-import-default-after-named.src.js | 1 + ...rt-default-missing-module-specifier.src.js | 1 + ...lid-import-default-module-specifier.src.js | 1 + .../modules/invalid-import-default.src.js | 1 + ...lid-import-missing-module-specifier.src.js | 1 + .../invalid-import-module-specifier.src.js | 1 + .../invalid-import-named-after-named.src.js | 1 + ...nvalid-import-named-after-namespace.src.js | 1 + ...nvalid-import-named-as-missing-from.src.js | 1 + .../invalid-import-named-extra-comma.src.js | 1 + .../invalid-import-named-middle-comma.src.js | 1 + ...nvalid-import-namespace-after-named.src.js | 1 + ...invalid-import-namespace-missing-as.src.js | 1 + .../newTarget/invalid-new-target.src.js | 1 + .../newTarget/invalid-unknown-property.src.js | 1 + .../newTarget/simple-new-target.src.js | 3 + .../computed-addition-property.src.js | 3 + .../computed-and-identifier.src.js | 1 + .../computed-getter-and-setter.src.js | 1 + .../computed-string-property.src.js | 3 + .../computed-variable-property.src.js | 3 + .../invalid-computed-variable-property.src.js | 3 + ...andalone-computed-variable-property.src.js | 1 + ...standalone-expression-with-addition.src.js | 1 + .../standalone-expression-with-method.src.js | 1 + .../standalone-expression.src.js | 1 + .../error-proto-property.src.js | 8 + .../error-proto-string-property.src.js | 8 + .../strict-duplicate-properties.src.js | 6 + .../strict-duplicate-string-properties.src.js | 6 + .../invalid-method-no-braces.src.js | 3 + .../method-property.src.js | 5 + .../simple-method-named-get.src.js | 4 + .../simple-method-named-set.src.js | 4 + .../simple-method-with-argument.src.js | 5 + .../simple-method-with-string-name.src.js | 4 + .../simple-method.src.js | 4 + .../string-name-method-property.src.js | 5 + .../shorthand-properties.src.js | 9 + .../octalLiterals/invalid.src.js | 1 + .../octalLiterals/lowercase.src.js | 1 + .../octalLiterals/strict-uppercase.src.js | 2 + .../octalLiterals/uppercase.src.js | 1 + .../ecma-features/regex/regexp-simple.src.js | 1 + .../regexUFlag/regex-u-extended-escape.src.js | 1 + .../regex-u-invalid-extended-escape.src.js | 1 + .../regexUFlag/regex-u-simple.src.js | 1 + .../regexYFlag/regexp-y-simple.src.js | 1 + .../restParams/basic-rest.src.js | 1 + .../restParams/class-constructor.src.js | 4 + .../restParams/class-method.src.js | 4 + .../restParams/error-no-default.src.js | 1 + .../restParams/error-not-last.src.js | 1 + .../restParams/func-expression-multi.src.js | 1 + .../restParams/func-expression.src.js | 1 + .../restParams/invalid-rest-param.src.js | 1 + .../restParams/single-rest.src.js | 1 + .../spread/error-invalid-if.src.js | 1 + .../spread/error-invalid-sequence.src.js | 1 + .../spread/multi-function-call.src.js | 1 + .../spread/not-final-param.src.js | 1 + .../spread/simple-function-call.src.js | 1 + .../templateStrings/deeply-nested.src.js | 1 + .../error-octal-literal.src.js | 1 + .../templateStrings/escape-characters.src.js | 1 + .../templateStrings/expressions.src.js | 4 + .../multi-line-template-string.src.js | 6 + .../simple-template-string.src.js | 1 + .../templateStrings/single-dollar-sign.src.js | 1 + .../tagged-no-placeholders.src.js | 1 + .../tagged-template-string.src.js | 4 + .../basic-string-literal.src.js | 1 + .../complex-string-literal.src.js | 1 + .../invalid-empty-escape.src.js | 1 + .../invalid-too-large-escape.src.js | 1 + .../self-closing-tag-inside-tag.src.js | 3 + .../jsx-useJSXTextNode/test-content.src.js | 1 + .../tests/fixtures/jsx/attributes.src.js | 1 + .../fixtures/jsx/element-keyword-name.src.js | 5 + .../fixtures/jsx/embedded-comment.src.js | 1 + .../fixtures/jsx/embedded-conditional.src.js | 1 + .../jsx/embedded-invalid-js-identifier.src.js | 1 + .../tests/fixtures/jsx/embedded-tags.src.js | 1 + .../fixtures/jsx/empty-placeholder.src.js | 1 + .../tests/fixtures/jsx/escape-patterns.src.js | 1 + .../invalid-attribute-missing-equals.src.js | 1 + .../fixtures/jsx/invalid-attribute.src.js | 1 + .../fixtures/jsx/invalid-broken-tag.src.js | 1 + .../jsx/invalid-computed-end-tag-name.src.js | 1 + ...nvalid-computed-string-end-tag-name.src.js | 1 + .../jsx/invalid-embedded-expression.src.js | 1 + .../jsx/invalid-leading-dot-tag-name.src.js | 1 + ...matching-placeholder-in-closing-tag.src.js | 1 + .../jsx/invalid-mismatched-closing-tag.src.js | 1 + .../invalid-mismatched-closing-tags.src.js | 1 + .../invalid-mismatched-dot-tag-name.src.js | 1 + .../invalid-mismatched-namespace-tag.src.js | 1 + ...g-closing-tag-attribute-placeholder.src.js | 1 + .../jsx/invalid-missing-closing-tag.src.js | 1 + .../jsx/invalid-missing-namespace-name.src.js | 1 + .../invalid-missing-namespace-value.src.js | 1 + .../invalid-missing-spread-operator.src.js | 1 + .../invalid-namespace-name-with-docts.src.js | 1 + .../invalid-namespace-value-with-dots.src.js | 1 + ...valid-no-common-parent-with-comment.src.js | 1 + .../jsx/invalid-no-common-parent.src.js | 1 + .../fixtures/jsx/invalid-no-tag-name.src.js | 1 + .../invalid-placeholder-in-closing-tag.src.js | 1 + .../jsx/invalid-trailing-dot-tag-name.src.js | 1 + .../jsx/invalid-unexpected-comma.src.js | 1 + .../fixtures/jsx/japanese-characters.src.js | 1 + .../fixtures/jsx/less-than-operator.src.js | 1 + .../jsx/member-expression-this.src.js | 2 + .../fixtures/jsx/member-expression.src.js | 1 + .../fixtures/jsx/multiple-blank-spaces.src.js | 1 + ...spaced-attribute-and-value-inserted.src.js | 1 + .../jsx/namespaced-name-and-attribute.src.js | 1 + .../jsx/newslines-and-entities.src.js | 1 + .../jsx/self-closing-tag-inside-tag.src.js | 3 + .../jsx/self-closing-tag-with-newline.src.js | 1 + .../fixtures/jsx/self-closing-tag.src.js | 1 + .../tests/fixtures/jsx/spread-child.src.js | 1 + ...tor-attribute-and-regular-attribute.src.js | 1 + .../jsx/spread-operator-attributes.src.js | 1 + .../fixtures/jsx/tag-names-with-dots.src.js | 1 + .../jsx/tag-names-with-multi-dots.src.js | 1 + .../tests/fixtures/jsx/test-content.src.js | 1 + .../trailing-spread-operator-attribute.src.js | 1 + .../jsx/unknown-escape-pattern.src.js | 1 + .../fixtures/tsx/generic-jsx-element.src.tsx | 1 + .../fixtures/tsx/react-typed-props.src.tsx | 12 + .../type-parameter-whitespace-loc.src.ts | 1 + .../type-parameters.src.ts | 1 + ...act-class-with-abstract-constructor.src.ts | 3 + ...abstract-class-with-abstract-method.src.ts | 3 + ...ract-class-with-abstract-properties.src.ts | 4 + ...ass-with-abstract-readonly-property.src.ts | 3 + ...abstract-class-with-optional-method.src.ts | 3 + .../basics/abstract-interface.src.ts | 2 + ...arrow-function-with-type-parameters.src.ts | 3 + .../basics/async-function-expression.src.ts | 2 + ...async-function-with-var-declaration.src.ts | 5 + .../class-with-accessibility-modifiers.src.ts | 10 + .../class-with-definite-assignment.src.ts | 3 + ...ss-with-export-parameter-properties.src.ts | 6 + .../class-with-extends-and-implements.src.ts | 1 + ...class-with-extends-generic-multiple.src.ts | 3 + .../basics/class-with-extends-generic.src.ts | 3 + .../class-with-generic-method-default.src.ts | 3 + .../basics/class-with-generic-method.src.ts | 3 + .../class-with-implements-and-extends.src.ts | 1 + ...ss-with-implements-generic-multiple.src.ts | 3 + .../class-with-implements-generic.src.ts | 3 + .../basics/class-with-implements.src.ts | 3 + .../typescript/basics/class-with-mixin.src.ts | 9 + ...ass-with-optional-computed-property.src.ts | 3 + .../basics/class-with-optional-methods.src.ts | 5 + .../class-with-optional-properties.src.ts | 5 + ...ss-with-optional-property-undefined.src.ts | 4 + ...s-with-private-parameter-properties.src.ts | 6 + ...with-protected-parameter-properties.src.ts | 6 + ...ss-with-public-parameter-properties.src.ts | 6 + ...-with-readonly-parameter-properties.src.ts | 4 + .../class-with-readonly-property.src.ts | 3 + ...ss-with-static-parameter-properties.src.ts | 7 + .../class-with-type-parameter-default.src.ts | 3 + ...lass-with-type-parameter-underscore.src.ts | 1 + .../basics/class-with-type-parameter.src.ts | 3 + .../typescript/basics/const-enum.src.ts | 4 + .../declare-class-with-optional-method.src.ts | 3 + .../typescript/basics/declare-function.src.ts | 1 + .../basics/destructuring-assignment.src.ts | 1 + .../basics/export-assignment.src.ts | 1 + .../export-default-class-with-generic.src.ts | 3 + ...efault-class-with-multiple-generics.src.ts | 3 + .../export-named-class-with-generic.src.ts | 3 + ...-named-class-with-multiple-generics.src.ts | 3 + .../basics/export-named-enum.src.ts | 4 + .../export-type-alias-declaration.src.ts | 1 + .../export-type-class-declaration.src.ts | 3 + .../export-type-function-declaration.src.ts | 1 + .../basics/function-with-await.src.ts | 3 + ...bject-type-with-optional-properties.src.ts | 3 + ...with-object-type-without-annotation.src.ts | 3 + ...-type-parameters-that-have-comments.src.ts | 1 + ...ith-type-parameters-with-constraint.src.ts | 3 + .../function-with-type-parameters.src.ts | 3 + .../function-with-types-assignation.src.ts | 3 + .../basics/function-with-types.src.ts | 3 + ...h-type-parameters-in-type-reference.src.ts | 1 + .../typescript/basics/import-type.src.ts | 2 + .../basics/interface-extends-multiple.src.ts | 3 + .../basics/interface-extends.src.ts | 3 + .../basics/interface-type-parameters.src.ts | 3 + .../interface-with-all-property-types.src.ts | 15 + ...nature-with-parameter-accessibility.src.ts | 3 + ...erface-with-extends-type-parameters.src.ts | 3 + .../basics/interface-with-generic.src.ts | 2 + .../basics/interface-with-jsdoc.src.ts | 7 + .../interface-with-optional-properties.src.ts | 5 + .../interface-without-type-annotation.src.ts | 3 + .../typescript/basics/keyof-operator.src.ts | 1 + .../basics/nested-type-arguments.src.ts | 1 + .../typescript/basics/never-type-param.src.ts | 2 + .../basics/non-null-assertion-operator.src.ts | 4 + ...null-and-undefined-type-annotations.src.ts | 2 + .../object-with-escaped-properties.src.ts | 7 + .../basics/symbol-type-param.src.ts | 1 + ...ion-with-constrained-type-parameter.src.ts | 1 + .../basics/type-alias-declaration.src.ts | 1 + ...ype-alias-object-without-annotation.src.ts | 1 + .../typescript/basics/type-guard.src.ts | 3 + .../basics/type-parameters-comments.src.ts | 3 + .../basics/type-reference-comments.src.ts | 3 + .../typescript/basics/typed-this.src.ts | 3 + .../typescript/basics/unique-symbol.src.ts | 1 + .../var-with-definite-assignment.src.ts | 3 + .../basics/var-with-dotted-type.src.ts | 1 + .../typescript/basics/var-with-type.src.ts | 2 + ...declaration-type-annotation-spacing.src.ts | 1 + ...r-decorator-factory-instance-member.src.ts | 4 + ...sor-decorator-factory-static-member.src.ts | 4 + .../accessor-decorator-instance-member.src.ts | 4 + .../accessor-decorator-static-member.src.ts | 6 + .../class-decorator-factory.src.ts | 4 + .../class-decorators/class-decorator.src.ts | 2 + ...d-decorator-factory-instance-member.src.ts | 4 + ...hod-decorator-factory-static-member.src.ts | 4 + .../method-decorator-instance-member.src.ts | 4 + .../method-decorator-static-member.src.ts | 4 + .../parameter-decorator-constructor.src.ts | 5 + ...decorator-decorator-instance-member.src.ts | 3 + ...r-decorator-decorator-static-member.src.ts | 3 + ...parameter-decorator-instance-member.src.ts | 5 + .../parameter-decorator-static-member.src.ts | 5 + ...y-decorator-factory-instance-member.src.ts | 5 + ...rty-decorator-factory-static-member.src.ts | 6 + .../property-decorator-instance-member.src.ts | 5 + .../property-decorator-static-member.src.ts | 5 + .../class-empty-extends-implements.src.ts | 3 + .../errorRecovery/class-empty-extends.src.ts | 3 + .../class-extends-empty-implements.src.ts | 3 + .../decorator-on-enum-declaration.src.ts | 1 + .../decorator-on-interface-declaration.src.ts | 2 + .../errorRecovery/empty-type-arguments.src.ts | 1 + .../errorRecovery/enum-with-keywords.src.ts | 1 + .../interface-empty-extends.src.ts | 3 + .../interface-property-modifiers.src.ts | 24 + .../call-expression-type-arguments.src.ts | 2 + .../new-expression-type-arguments.src.ts | 1 + ...-template-expression-type-arguments.src.ts | 1 + ...ient-module-declaration-with-import.src.ts | 3 + ...re-namespace-with-exported-function.src.ts | 3 + .../module-with-default-exports.src.ts | 7 + .../nested-internal-module.src.ts | 12 + ...horthand-ambient-module-declaration.src.ts | 1 + .../tests/jsx-known-issues.js | 11 + .../typescript-estree/tests/lib/.eslintrc.yml | 2 + .../tests/lib/__snapshots__/basics.js.snap | 3140 + .../tests/lib/__snapshots__/comments.js.snap | 9303 ++ .../lib/__snapshots__/ecma-features.js.snap | 107244 +++++++++++++++ .../tests/lib/__snapshots__/jsx.js.snap | 10917 ++ .../tests/lib/__snapshots__/parse.js.snap | 190 + .../tests/lib/__snapshots__/tsx.js.snap | 1790 + .../lib/__snapshots__/typescript.js.snap | 68838 +++++++++ .../typescript-estree/tests/lib/basics.js | 50 + .../typescript-estree/tests/lib/comments.js | 50 + .../tests/lib/ecma-features.js | 55 + packages/typescript-estree/tests/lib/jsx.js | 79 + packages/typescript-estree/tests/lib/parse.js | 64 + packages/typescript-estree/tests/lib/tsx.js | 50 + .../typescript-estree/tests/lib/typescript.js | 50 + .../typescript-estree/tools/test-utils.js | 73 + packages/typescript-estree/yarn.lock | 6781 + 576 files changed, 214395 insertions(+) create mode 100644 packages/typescript-estree/.gitattributes create mode 100644 packages/typescript-estree/.github/ISSUE_TEMPLATE.md create mode 100644 packages/typescript-estree/.gitignore create mode 100644 packages/typescript-estree/.npmrc create mode 100644 packages/typescript-estree/.travis.yml create mode 100644 packages/typescript-estree/LICENSE create mode 100644 packages/typescript-estree/README.md create mode 100644 packages/typescript-estree/lib/ast-converter.js create mode 100644 packages/typescript-estree/lib/ast-node-types.js create mode 100644 packages/typescript-estree/lib/convert-comments.js create mode 100644 packages/typescript-estree/lib/convert.js create mode 100644 packages/typescript-estree/lib/node-utils.js create mode 100644 packages/typescript-estree/package.json create mode 100644 packages/typescript-estree/parser.js create mode 100644 packages/typescript-estree/tests/ast-alignment/.eslintrc.yml create mode 100644 packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js create mode 100644 packages/typescript-estree/tests/ast-alignment/jest.config.js create mode 100644 packages/typescript-estree/tests/ast-alignment/parse.js create mode 100644 packages/typescript-estree/tests/ast-alignment/spec.js create mode 100644 packages/typescript-estree/tests/ast-alignment/utils.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/delete-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/do-while-statements.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/identifiers-double-underscore.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/instanceof.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/new-with-member-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/new-without-parens.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/typeof-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/update-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/basics/void-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/block-trailing-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/comment-within-condition.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/export-default-anonymous-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsdoc-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-block-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-tag-comments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/line-comment-with-block-syntax.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/mix-line-and-block-comments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/no-comment-regex.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/no-comment-template.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/surrounding-call-comments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/surrounding-debugger-comments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/surrounding-return-comments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/surrounding-throw-comments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/surrounding-while-loop-comments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment-in-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/template-string-block.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param-with-params.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic-in-binary-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body-not-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-dup-params.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-missing-paren.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-not-arrow.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-reverse-arrow.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-default-param-eval.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-dup-params.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval-return.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-octal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-arguments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-eval.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-names.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-arguments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-eval.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-two-lines.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-wrapped-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/iife.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/multiple-params.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/no-auto-return.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-arguments.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval-params.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-octal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-arrow-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-sequence.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-parens.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-return-identifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/invalid.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/lowercase.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/uppercase.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/const.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let-in-switchcase.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-accessor-properties.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-computed-static-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-prototype.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-static.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-with-space.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method-super.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-prototype.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-static.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-methods-and-accessor-properties.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-computed-static-methods.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-computed-constructor.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-semi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-three-semi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-two-semi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-static-methods-named-constructor.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-parameters.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-with-space.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-assign-to-var.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-double-semi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-semi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-literal-derived-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-declaration.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-setter-declaration.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-two-super-classes.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/named-class-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/classes/named-derived-class-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-constructor.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/declaration.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/not-all-params.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-const-undefined.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-let-undefined.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-named.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-undefined.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-named.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-undefined.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-short.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-wrapped.src.xjs create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-forOf/loop.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/complex-destructured.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructured-array-literal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructuring-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/error-complex-destructured-spread-first.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/invalid-not-final-array-empty.src.xjs create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/multi-destructured.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/not-final-array.src.xjs create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/single-destructured.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-complex-destructured.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-destructured-array-literal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-multi-destructured.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-single-destructured.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-member.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-to-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-var-undefined.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-all.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-longform-nested-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-all.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-all.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-all.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-mixed-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-all.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-array-catch.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-object-catch.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/invalid-defaults-object-assign.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/named-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-named.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-undefined.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object-nested.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array-wrapped.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-multi-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object-wrapped.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/destructuring/sparse-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-generators.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-iterator.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalDynamicImport/dynamic-import.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/function-parameter-object-spread.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/exponentiationOperators/exponential-operators.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-function-initializer.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-braces.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-no-braces.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-const-and-no-braces.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-let-and-no-braces.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/anonymous-generator.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/double-yield.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/empty-generator-declaration.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/generator-declaration.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-delegation.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-in-call.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-no-semi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-identifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-no-arg.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-true.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/importMeta/simple-import-meta.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/error-delete.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/error-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/error-strict.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-number.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-value.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-batch.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-empty.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-anonymous-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-number.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-named-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-namespace-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-as.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-jquery.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-module.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-empty.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-namespace-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/import-null-as-nil.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-await.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-missing-from-clause.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-token.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-equal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-token.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-extra-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-middle-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named-after-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-missing-module-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-module-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-missing-module-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-module-specifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-named.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-namespace.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-as-missing-from.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-extra-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-middle-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-after-named.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-missing-as.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-new-target.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-unknown-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/newTarget/simple-new-target.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-addition-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-and-identifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-getter-and-setter.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-string-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-variable-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-computed-variable-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-addition.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-string-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/invalid-method-no-braces.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/method-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-get.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-set.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-argument.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-string-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/string-name-method-property.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandProperties/shorthand-properties.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/invalid.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/lowercase.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/strict-uppercase.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/uppercase.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/regex/regexp-simple.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-extended-escape.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-invalid-extended-escape.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-simple.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/regexYFlag/regexp-y-simple.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/basic-rest.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-constructor.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-method.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-no-default.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-not-last.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression-multi.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/invalid-rest-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/restParams/single-rest.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-if.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-sequence.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/spread/multi-function-call.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/spread/not-final-param.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/spread/simple-function-call.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/deeply-nested.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/error-octal-literal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/escape-characters.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/expressions.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/multi-line-template-string.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/simple-template-string.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/single-dollar-sign.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-no-placeholders.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-template-string.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/basic-string-literal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/complex-string-literal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-empty-escape.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-too-large-escape.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/test-content.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/attributes.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/element-keyword-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/embedded-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/embedded-conditional.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/embedded-invalid-js-identifier.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/embedded-tags.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/empty-placeholder.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/escape-patterns.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-attribute-missing-equals.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-attribute.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-broken-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-computed-end-tag-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-computed-string-end-tag-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-embedded-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-leading-dot-tag-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tags.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-namespace-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-value.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-missing-spread-operator.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-name-with-docts.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-value-with-dots.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent-with-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-no-tag-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-trailing-dot-tag-name.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-unexpected-comma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/japanese-characters.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/less-than-operator.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/member-expression-this.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/member-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/multiple-blank-spaces.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/namespaced-name-and-attribute.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/newslines-and-entities.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-inside-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-with-newline.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/self-closing-tag.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/spread-child.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/spread-operator-attributes.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/tag-names-with-dots.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/tag-names-with-multi-dots.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/test-content.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/trailing-spread-operator-attribute.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/unknown-escape-pattern.src.js create mode 100644 packages/typescript-estree/tests/fixtures/tsx/generic-jsx-element.src.tsx create mode 100644 packages/typescript-estree/tests/fixtures/tsx/react-typed-props.src.tsx create mode 100644 packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameters.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/abstract-interface.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/async-function-expression.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/async-function-with-var-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-definite-assignment.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-and-implements.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method-default.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-and-extends.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-computed-property.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-methods.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-property.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-default.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/const-enum.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/declare-class-with-optional-method.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/declare-function.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-assignment.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-named-enum.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-type-alias-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-type-class-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-type-function-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-await.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types-assignation.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/import-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends-multiple.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-type-parameters.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-all-property-types.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-jsdoc.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-optional-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-without-type-annotation.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/keyof-operator.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/nested-type-arguments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/never-type-param.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/non-null-assertion-operator.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/object-with-escaped-properties.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/symbol-type-param.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-guard.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-parameters-comments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-reference-comments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-this.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/unique-symbol.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/var-with-definite-assignment.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/var-with-dotted-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/var-with-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/expressions/call-expression-type-arguments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/expressions/new-expression-type-arguments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts create mode 100644 packages/typescript-estree/tests/jsx-known-issues.js create mode 100644 packages/typescript-estree/tests/lib/.eslintrc.yml create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/basics.js.snap create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/comments.js.snap create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/parse.js.snap create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/tsx.js.snap create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap create mode 100644 packages/typescript-estree/tests/lib/basics.js create mode 100644 packages/typescript-estree/tests/lib/comments.js create mode 100644 packages/typescript-estree/tests/lib/ecma-features.js create mode 100644 packages/typescript-estree/tests/lib/jsx.js create mode 100644 packages/typescript-estree/tests/lib/parse.js create mode 100644 packages/typescript-estree/tests/lib/tsx.js create mode 100644 packages/typescript-estree/tests/lib/typescript.js create mode 100644 packages/typescript-estree/tools/test-utils.js create mode 100644 packages/typescript-estree/yarn.lock diff --git a/packages/typescript-estree/.gitattributes b/packages/typescript-estree/.gitattributes new file mode 100644 index 000000000000..b9aad4d12c4d --- /dev/null +++ b/packages/typescript-estree/.gitattributes @@ -0,0 +1,4 @@ +* text=auto +*.js eol=lf +*.ts eol=lf +*.yml eol=lf diff --git a/packages/typescript-estree/.github/ISSUE_TEMPLATE.md b/packages/typescript-estree/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000000..293115d2a1e8 --- /dev/null +++ b/packages/typescript-estree/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,16 @@ +**What version of TypeScript are you using?** + + +**What version of `typescript-estree` are you using?** + + +**What code were you trying to parse?** + +```ts +// Put your code here +``` + +**What did you expect to happen?** + + +**What actually happened?** diff --git a/packages/typescript-estree/.gitignore b/packages/typescript-estree/.gitignore new file mode 100644 index 000000000000..2ff496493963 --- /dev/null +++ b/packages/typescript-estree/.gitignore @@ -0,0 +1,7 @@ +build +coverage +node_modules +npm-debug.log +_test.js +.DS_Store +.vscode \ No newline at end of file diff --git a/packages/typescript-estree/.npmrc b/packages/typescript-estree/.npmrc new file mode 100644 index 000000000000..9cf9495031ec --- /dev/null +++ b/packages/typescript-estree/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/packages/typescript-estree/.travis.yml b/packages/typescript-estree/.travis.yml new file mode 100644 index 000000000000..b5eca5e7d567 --- /dev/null +++ b/packages/typescript-estree/.travis.yml @@ -0,0 +1,21 @@ +language: node_js +cache: + yarn: true + directories: + - node_modules +notifications: + email: false +node_js: + - '10' + - '9' + - '8' + - '6' +install: + - yarn --ignore-engines +script: + - yarn test +after_success: + - npm run travis-deploy-once "npm run semantic-release" +branches: + only: + - master \ No newline at end of file diff --git a/packages/typescript-estree/LICENSE b/packages/typescript-estree/LICENSE new file mode 100644 index 000000000000..fda3b7546aa5 --- /dev/null +++ b/packages/typescript-estree/LICENSE @@ -0,0 +1,26 @@ +TypeScript ESTree + +Originally extracted from: + +TypeScript ESLint Parser +Copyright JS Foundation and other contributors, https://js.foundation + +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/packages/typescript-estree/README.md b/packages/typescript-estree/README.md new file mode 100644 index 000000000000..b3825c5eab9b --- /dev/null +++ b/packages/typescript-estree/README.md @@ -0,0 +1,7 @@ +

DO NOT USE - POC ONLY

+ +# TypeScript ESTree + +A parser that converts TypeScript source code into an [ESTree](https://github.com/estree/estree)-compatible form. + +More docs to follow here soon... (PRs welcome!) diff --git a/packages/typescript-estree/lib/ast-converter.js b/packages/typescript-estree/lib/ast-converter.js new file mode 100644 index 000000000000..2e8cf359a245 --- /dev/null +++ b/packages/typescript-estree/lib/ast-converter.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Converts TypeScript AST into ESTree format. + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const convert = require("./convert"), + convertComments = require("./convert-comments").convertComments, + nodeUtils = require("./node-utils"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Extends and formats a given error object + * @param {Object} error the error object + * @returns {Object} converted error object + */ +function convertError(error) { + return nodeUtils.createError(error.file, error.start, error.message || error.messageText); +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = (ast, extra) => { + + /** + * The TypeScript compiler produced fundamental parse errors when parsing the + * source. + */ + if (ast.parseDiagnostics.length) { + throw convertError(ast.parseDiagnostics[0]); + } + + /** + * Recursively convert the TypeScript AST into an ESTree-compatible AST + */ + const estree = convert({ + node: ast, + parent: null, + ast, + additionalOptions: { + errorOnUnknownASTType: extra.errorOnUnknownASTType || false, + useJSXTextNode: extra.useJSXTextNode || false + } + }); + + /** + * Optionally convert and include all tokens in the AST + */ + if (extra.tokens) { + estree.tokens = nodeUtils.convertTokens(ast); + } + + /** + * Optionally convert and include all comments in the AST + */ + if (extra.comment) { + estree.comments = convertComments(ast, extra.code); + } + + return estree; + +}; diff --git a/packages/typescript-estree/lib/ast-node-types.js b/packages/typescript-estree/lib/ast-node-types.js new file mode 100644 index 000000000000..155abac19973 --- /dev/null +++ b/packages/typescript-estree/lib/ast-node-types.js @@ -0,0 +1,161 @@ +/** + * @fileoverview The AST node types produced by the parser. + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + ArrayExpression: "ArrayExpression", + ArrayPattern: "ArrayPattern", + ArrowFunctionExpression: "ArrowFunctionExpression", + AssignmentExpression: "AssignmentExpression", + AssignmentPattern: "AssignmentPattern", + AwaitExpression: "AwaitExpression", + BinaryExpression: "BinaryExpression", + BlockStatement: "BlockStatement", + BreakStatement: "BreakStatement", + CallExpression: "CallExpression", + CatchClause: "CatchClause", + ClassBody: "ClassBody", + ClassDeclaration: "ClassDeclaration", + ClassExpression: "ClassExpression", + ClassImplements: "ClassImplements", + ClassProperty: "ClassProperty", + ConditionalExpression: "ConditionalExpression", + ContinueStatement: "ContinueStatement", + DebuggerStatement: "DebuggerStatement", + DeclareFunction: "DeclareFunction", + Decorator: "Decorator", + DoWhileStatement: "DoWhileStatement", + EmptyStatement: "EmptyStatement", + ExportAllDeclaration: "ExportAllDeclaration", + ExportDefaultDeclaration: "ExportDefaultDeclaration", + ExportNamedDeclaration: "ExportNamedDeclaration", + ExportSpecifier: "ExportSpecifier", + ExpressionStatement: "ExpressionStatement", + ForInStatement: "ForInStatement", + ForOfStatement: "ForOfStatement", + ForStatement: "ForStatement", + FunctionDeclaration: "FunctionDeclaration", + FunctionExpression: "FunctionExpression", + GenericTypeAnnotation: "GenericTypeAnnotation", + Identifier: "Identifier", + IfStatement: "IfStatement", + Import: "Import", + ImportDeclaration: "ImportDeclaration", + ImportDefaultSpecifier: "ImportDefaultSpecifier", + ImportNamespaceSpecifier: "ImportNamespaceSpecifier", + ImportSpecifier: "ImportSpecifier", + JSXAttribute: "JSXAttribute", + JSXClosingElement: "JSXClosingElement", + JSXElement: "JSXElement", + JSXEmptyExpression: "JSXEmptyExpression", + JSXExpressionContainer: "JSXExpressionContainer", + JSXIdentifier: "JSXIdentifier", + JSXMemberExpression: "JSXMemberExpression", + JSXNamespacedName: "JSXNamespacedName", + JSXOpeningElement: "JSXOpeningElement", + JSXSpreadAttribute: "JSXSpreadAttribute", + JSXSpreadChild: "JSXSpreadChild", + JSXText: "JSXText", + LabeledStatement: "LabeledStatement", + Literal: "Literal", + LogicalExpression: "LogicalExpression", + MemberExpression: "MemberExpression", + MetaProperty: "MetaProperty", + MethodDefinition: "MethodDefinition", + NewExpression: "NewExpression", + ObjectExpression: "ObjectExpression", + ObjectPattern: "ObjectPattern", + Program: "Program", + Property: "Property", + RestElement: "RestElement", + ReturnStatement: "ReturnStatement", + SequenceExpression: "SequenceExpression", + SpreadElement: "SpreadElement", + Super: "Super", + SwitchCase: "SwitchCase", + SwitchStatement: "SwitchStatement", + TaggedTemplateExpression: "TaggedTemplateExpression", + TemplateElement: "TemplateElement", + TemplateLiteral: "TemplateLiteral", + ThisExpression: "ThisExpression", + ThrowStatement: "ThrowStatement", + TryStatement: "TryStatement", + /** + * TS-prefixed nodes + */ + TSAbstractClassProperty: "TSAbstractClassProperty", + TSAbstractKeyword: "TSAbstractKeyword", + TSAbstractMethodDefinition: "TSAbstractMethodDefinition", + TSAnyKeyword: "TSAnyKeyword", + TSArrayType: "TSArrayType", + TSAsyncKeyword: "TSAsyncKeyword", + TSBooleanKeyword: "TSBooleanKeyword", + TSConstructorType: "TSConstructorType", + TSConstructSignature: "TSConstructSignature", + TSDeclareKeyword: "TSDeclareKeyword", + TSEnumDeclaration: "TSEnumDeclaration", + TSEnumMember: "TSEnumMember", + TSExportAssignment: "TSExportAssignment", + TSExportKeyword: "TSExportKeyword", + TSImportType: "TSImportType", + TSLiteralType: "TSLiteralType", + TSIndexSignature: "TSIndexSignature", + TSInterfaceBody: "TSInterfaceBody", + TSInterfaceDeclaration: "TSInterfaceDeclaration", + TSInterfaceHeritage: "TSInterfaceHeritage", + TSFunctionType: "TSFunctionType", + TSMethodSignature: "TSMethodSignature", + TSModuleBlock: "TSModuleBlock", + TSModuleDeclaration: "TSModuleDeclaration", + TSNamespaceFunctionDeclaration: "TSNamespaceFunctionDeclaration", + TSNonNullExpression: "TSNonNullExpression", + TSNeverKeyword: "TSNeverKeyword", + TSNullKeyword: "TSNullKeyword", + TSNumberKeyword: "TSNumberKeyword", + TSObjectKeyword: "TSObjectKeyword", + TSParameterProperty: "TSParameterProperty", + TSPrivateKeyword: "TSPrivateKeyword", + TSPropertySignature: "TSPropertySignature", + TSProtectedKeyword: "TSProtectedKeyword", + TSPublicKeyword: "TSPublicKeyword", + TSQualifiedName: "TSQualifiedName", + TSQuestionToken: "TSQuestionToken", + TSReadonlyKeyword: "TSReadonlyKeyword", + TSStaticKeyword: "TSStaticKeyword", + TSStringKeyword: "TSStringKeyword", + TSSymbolKeyword: "TSSymbolKeyword", + TSTypeAnnotation: "TSTypeAnnotation", + TSTypeLiteral: "TSTypeLiteral", + TSTypeOperator: "TSTypeOperator", + TSTypeParameter: "TSTypeParameter", + TSTypeParameterDeclaration: "TSTypeParameterDeclaration", + TSTypeParameterInstantiation: "TSTypeParameterInstantiation", + TSTypePredicate: "TSTypePredicate", + TSTypeReference: "TSTypeReference", + TSUnionType: "TSUnionType", + TSUndefinedKeyword: "TSUndefinedKeyword", + TSVoidKeyword: "TSVoidKeyword", + UnaryExpression: "UnaryExpression", + UpdateExpression: "UpdateExpression", + VariableDeclaration: "VariableDeclaration", + VariableDeclarator: "VariableDeclarator", + WhileStatement: "WhileStatement", + WithStatement: "WithStatement", + YieldExpression: "YieldExpression" +}; diff --git a/packages/typescript-estree/lib/convert-comments.js b/packages/typescript-estree/lib/convert-comments.js new file mode 100644 index 000000000000..c31e99d8282b --- /dev/null +++ b/packages/typescript-estree/lib/convert-comments.js @@ -0,0 +1,146 @@ +/** + * @fileoverview Convert comment using TypeScript token scanner + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const ts = require("typescript"), + nodeUtils = require("./node-utils"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Converts a TypeScript comment to an Esprima comment. + * @param {boolean} block True if it's a block comment, false if not. + * @param {string} text The text of the comment. + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @param {Location} startLoc The location at which the comment starts. + * @param {Location} endLoc The location at which the comment ends. + * @returns {Object} The comment object. + * @private + */ +function convertTypeScriptCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) { + const comment = { + type: block ? "Block" : "Line", + value: text + }; + + if (typeof start === "number") { + comment.range = [start, end]; + } + + if (typeof startLoc === "object") { + comment.loc = { + start: startLoc, + end: endLoc + }; + } + + return comment; +} + +/** + * Convert comment from TypeScript Triva Scanner. + * @param {Object} triviaScanner TS Scanner + * @param {Object} ast the AST object + * @param {string} code TypeScript code + * @returns {ESTreeComment} the converted ESTreeComment + * @private + */ +function getCommentFromTriviaScanner(triviaScanner, ast, code) { + const kind = triviaScanner.getToken(); + const isBlock = (kind === ts.SyntaxKind.MultiLineCommentTrivia); + const range = { + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + kind: triviaScanner.getToken() + }; + + const comment = code.substring(range.pos, range.end); + const text = (isBlock) ? comment.replace(/^\/\*/, "").replace(/\*\/$/, "") : comment.replace(/^\/\//, ""); + const loc = nodeUtils.getLocFor(range.pos, range.end, ast); + + const esprimaComment = convertTypeScriptCommentToEsprimaComment(isBlock, text, range.pos, range.end, loc.start, loc.end); + + return esprimaComment; +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + convertComments +}; + + +/** + * Convert all comments for the given AST. + * @param {Object} ast the AST object + * @param {string} code the TypeScript code + * @returns {ESTreeComment[]} the converted ESTreeComment + * @private + */ +function convertComments(ast, code) { + const comments = []; + + /** + * Create a TypeScript Scanner, with skipTrivia set to false so that + * we can parse the comments + */ + const triviaScanner = ts.createScanner(ast.languageVersion, false, 0, code); + + let kind = triviaScanner.scan(); + while (kind !== ts.SyntaxKind.EndOfFileToken) { + const start = triviaScanner.getTokenPos(); + const end = triviaScanner.getTextPos(); + + let container = null; + switch (kind) { + case ts.SyntaxKind.SingleLineCommentTrivia: + case ts.SyntaxKind.MultiLineCommentTrivia: { + const comment = getCommentFromTriviaScanner(triviaScanner, ast, code); + + comments.push(comment); + break; + } + case ts.SyntaxKind.CloseBraceToken: + container = nodeUtils.getNodeContainer(ast, start, end); + + if ( + container.kind === ts.SyntaxKind.TemplateMiddle || + container.kind === ts.SyntaxKind.TemplateTail + ) { + kind = triviaScanner.reScanTemplateToken(); + continue; + } + break; + case ts.SyntaxKind.SlashToken: + case ts.SyntaxKind.SlashEqualsToken: + container = nodeUtils.getNodeContainer(ast, start, end); + + if ( + container.kind === ts.SyntaxKind.RegularExpressionLiteral + ) { + kind = triviaScanner.reScanSlashToken(); + continue; + } + break; + default: + break; + } + kind = triviaScanner.scan(); + } + + return comments; +} diff --git a/packages/typescript-estree/lib/convert.js b/packages/typescript-estree/lib/convert.js new file mode 100644 index 000000000000..fd93e601df4f --- /dev/null +++ b/packages/typescript-estree/lib/convert.js @@ -0,0 +1,2196 @@ +/** + * @fileoverview Converts TypeScript AST into ESTree format. + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const nodeUtils = require("./node-utils"), + AST_NODE_TYPES = require("./ast-node-types"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const SyntaxKind = nodeUtils.SyntaxKind; + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +/** + * Converts a TypeScript node into an ESTree node + * @param {Object} config configuration options for the conversion + * @param {TSNode} config.node the TSNode + * @param {TSNode} config.parent the parent TSNode + * @param {TSNode} config.ast the full TypeScript AST + * @param {Object} config.additionalOptions additional options for the conversion + * @param {Object} config.additionalOptions.errorOnUnknownASTType whether whether or not to throw an error if an unknown AST Node Type is encountered + * @returns {ESTreeNode} the converted ESTreeNode + */ +module.exports = function convert(config) { + + const node = config.node; + const parent = config.parent; + const ast = config.ast; + const additionalOptions = config.additionalOptions || {}; + + /** + * Exit early for null and undefined + */ + if (!node) { + return null; + } + + /** + * Create a new ESTree node + */ + let result = { + type: "", + range: [node.getStart(), node.end], + loc: nodeUtils.getLoc(node, ast) + }; + + /** + * Copies the result object into an ESTree node with just a type property. + * This is used only for leaf nodes that have no other properties. + * @returns {void} + */ + function simplyCopy() { + Object.assign(result, { + type: SyntaxKind[node.kind] + }); + } + + /** + * Converts a TypeScript node into an ESTree node. + * @param {TSNode} child the child TSNode + * @returns {ESTreeNode} the converted ESTree node + */ + function convertChild(child) { + return convert({ node: child, parent: node, ast, additionalOptions }); + } + + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param {TSNode} child The TypeScript AST node to convert. + * @returns {ESTreeNode} The type annotation node. + */ + function convertTypeAnnotation(child) { + const annotation = convertChild(child); + const annotationStartCol = child.getFullStart() - 1; + const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); + return { + type: AST_NODE_TYPES.TSTypeAnnotation, + loc, + range: [annotationStartCol, child.end], + typeAnnotation: annotation + }; + } + + /** + * Converts a TSNode's typeArguments array to a flow-like typeParameters node + * @param {TSNode[]} typeArguments TSNode typeArguments + * @returns {TypeParameterInstantiation} TypeParameterInstantiation node + */ + function convertTypeArgumentsToTypeParameters(typeArguments) { + /** + * Even if typeArguments is an empty array, TypeScript sets a `pos` and `end` + * property on the array object so we can safely read the values here + */ + const start = typeArguments.pos - 1; + let end = typeArguments.end + 1; + if (typeArguments && typeArguments.length) { + const firstTypeArgument = typeArguments[0]; + const typeArgumentsParent = firstTypeArgument.parent; + /** + * In the case of the parent being a CallExpression or a TypeReference we have to use + * slightly different logic to calculate the correct end position + */ + if (typeArgumentsParent && (typeArgumentsParent.kind === SyntaxKind.CallExpression || typeArgumentsParent.kind === SyntaxKind.TypeReference)) { + const lastTypeArgument = typeArguments[typeArguments.length - 1]; + const greaterThanToken = nodeUtils.findNextToken(lastTypeArgument, ast); + end = greaterThanToken.end; + } + } + return { + type: AST_NODE_TYPES.TSTypeParameterInstantiation, + range: [ + start, + end + ], + loc: nodeUtils.getLocFor(start, end, ast), + params: typeArguments.map(typeArgument => { + if (nodeUtils.isTypeKeyword(typeArgument.kind)) { + return { + type: AST_NODE_TYPES[`TS${SyntaxKind[typeArgument.kind]}`], + range: [ + typeArgument.getStart(), + typeArgument.getEnd() + ], + loc: nodeUtils.getLoc(typeArgument, ast) + }; + } + if (typeArgument.kind === SyntaxKind.ImportType) { + return convert({ node: typeArgument, parent: null, ast, additionalOptions }); + } + return { + type: AST_NODE_TYPES.TSTypeReference, + range: [ + typeArgument.getStart(), + typeArgument.getEnd() + ], + loc: nodeUtils.getLoc(typeArgument, ast), + typeName: convertChild(typeArgument.typeName || typeArgument), + typeParameters: (typeArgument.typeArguments) + ? convertTypeArgumentsToTypeParameters(typeArgument.typeArguments) + : undefined + }; + }) + }; + } + + /** + * Converts a TSNode's typeParameters array to a flow-like TypeParameterDeclaration node + * @param {TSNode[]} typeParameters TSNode typeParameters + * @returns {TypeParameterDeclaration} TypeParameterDeclaration node + */ + function convertTSTypeParametersToTypeParametersDeclaration(typeParameters) { + const firstTypeParameter = typeParameters[0]; + const lastTypeParameter = typeParameters[typeParameters.length - 1]; + + const greaterThanToken = nodeUtils.findNextToken(lastTypeParameter, ast); + + return { + type: AST_NODE_TYPES.TSTypeParameterDeclaration, + range: [ + firstTypeParameter.pos - 1, + greaterThanToken.end + ], + loc: nodeUtils.getLocFor(firstTypeParameter.pos - 1, greaterThanToken.end, ast), + params: typeParameters.map(typeParameter => { + const name = typeParameter.name.text; + + const constraint = typeParameter.constraint + ? convert({ node: typeParameter.constraint, parent: typeParameter, ast, additionalOptions }) + : undefined; + + const defaultParameter = typeParameter.default + ? convert({ node: typeParameter.default, parent: typeParameter, ast, additionalOptions }) + : typeParameter.default; + + return { + type: AST_NODE_TYPES.TSTypeParameter, + range: [ + typeParameter.getStart(), + typeParameter.getEnd() + ], + loc: nodeUtils.getLoc(typeParameter, ast), + name, + constraint, + default: defaultParameter + }; + }) + }; + } + + /** + * Converts a child into a class implements node. This creates an intermediary + * ClassImplements node to match what Flow does. + * @param {TSNode} child The TypeScript AST node to convert. + * @returns {ESTreeNode} The type annotation node. + */ + function convertClassImplements(child) { + const id = convertChild(child.expression); + const classImplementsNode = { + type: AST_NODE_TYPES.ClassImplements, + loc: id.loc, + range: id.range, + id + }; + if (child.typeArguments && child.typeArguments.length) { + classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters(child.typeArguments); + } + return classImplementsNode; + } + + /** + * Converts a child into a interface heritage node. + * @param {TSNode} child The TypeScript AST node to convert. + * @returns {ESTreeNode} The type annotation node. + */ + function convertInterfaceHeritageClause(child) { + const id = convertChild(child.expression); + const classImplementsNode = { + type: AST_NODE_TYPES.TSInterfaceHeritage, + loc: id.loc, + range: id.range, + id + }; + + if (child.typeArguments && child.typeArguments.length) { + classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters(child.typeArguments); + } + return classImplementsNode; + } + + /** + * Converts an array of TSNode decorators into an array of ESTreeNode decorators + * @param {TSNode[]} decorators An array of TSNode decorators to be converted + * @returns {ESTreeNode[]} an array of converted ESTreeNode decorators + */ + function convertDecorators(decorators) { + if (!decorators || !decorators.length) { + return []; + } + return decorators.map(decorator => { + const expression = convertChild(decorator.expression); + return { + type: AST_NODE_TYPES.Decorator, + range: [decorator.getStart(), decorator.end], + loc: nodeUtils.getLoc(decorator, ast), + expression + }; + }); + } + + /** + * Converts an array of TSNode parameters into an array of ESTreeNode params + * @param {TSNode[]} parameters An array of TSNode params to be converted + * @returns {ESTreeNode[]} an array of converted ESTreeNode params + */ + function convertParameters(parameters) { + if (!parameters || !parameters.length) { + return []; + } + return parameters.map(param => { + const convertedParam = convertChild(param); + if (!param.decorators || !param.decorators.length) { + return convertedParam; + } + return Object.assign(convertedParam, { + decorators: convertDecorators(param.decorators) + }); + }); + } + + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + * @returns {void} + */ + function deeplyCopy() { + const customType = `TS${SyntaxKind[node.kind]}`; + /** + * If the "errorOnUnknownASTType" option is set to true, throw an error, + * otherwise fallback to just inlcuding the unknown type as-is. + */ + if (additionalOptions.errorOnUnknownASTType && !AST_NODE_TYPES[customType]) { + throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`); + } + result.type = customType; + Object + .keys(node) + .filter(key => !(/^(?:_children|kind|parent|pos|end|flags|modifierFlagsCache|jsDoc)$/.test(key))) + .forEach(key => { + if (key === "type") { + result.typeAnnotation = (node.type) ? convertTypeAnnotation(node.type) : null; + } else if (key === "typeArguments") { + result.typeParameters = (node.typeArguments) + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : null; + } else if (key === "typeParameters") { + result.typeParameters = (node.typeParameters) + ? convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters) + : null; + } else if (key === "decorators") { + const decorators = convertDecorators(node.decorators); + if (decorators && decorators.length) { + result.decorators = decorators; + } + } else { + if (Array.isArray(node[key])) { + result[key] = node[key].map(convertChild); + } else if (node[key] && typeof node[key] === "object") { + result[key] = convertChild(node[key]); + } else { + result[key] = node[key]; + } + } + }); + } + + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param {Object} tagName the tagName object from a JSX TSNode + * @param {Object} ast the AST object + * @returns {Object} the converted ESTree name object + */ + function convertTypeScriptJSXTagNameToESTreeName(tagName) { + const tagNameToken = nodeUtils.convertToken(tagName, ast); + + if (tagNameToken.type === AST_NODE_TYPES.JSXMemberExpression) { + + const isNestedMemberExpression = (node.tagName.expression.kind === SyntaxKind.PropertyAccessExpression); + + // Convert TSNode left and right objects into ESTreeNode object + // and property objects + tagNameToken.object = convertChild(node.tagName.expression); + tagNameToken.property = convertChild(node.tagName.name); + + // Assign the appropriate types + tagNameToken.object.type = (isNestedMemberExpression) ? AST_NODE_TYPES.JSXMemberExpression : AST_NODE_TYPES.JSXIdentifier; + tagNameToken.property.type = AST_NODE_TYPES.JSXIdentifier; + if (tagName.expression.kind === SyntaxKind.ThisKeyword) { + tagNameToken.object.name = "this"; + } + } else { + tagNameToken.type = AST_NODE_TYPES.JSXIdentifier; + tagNameToken.name = tagNameToken.value; + } + + delete tagNameToken.value; + + return tagNameToken; + } + + /** + * Applies the given TS modifiers to the given result object. + * @param {TSNode[]} modifiers original TSNodes from the node.modifiers array + * @returns {void} (the current result object will be mutated) + */ + function applyModifiersToResult(modifiers) { + if (!modifiers || !modifiers.length) { + return; + } + /** + * Some modifiers are explicitly handled by applying them as + * boolean values on the result node. As well as adding them + * to the result, we remove them from the array, so that they + * are not handled twice. + */ + const handledModifierIndices = {}; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i]; + switch (modifier.kind) { + /** + * Ignore ExportKeyword and DefaultKeyword, they are handled + * via the fixExports utility function + */ + case SyntaxKind.ExportKeyword: + case SyntaxKind.DefaultKeyword: + handledModifierIndices[i] = true; + break; + case SyntaxKind.ConstKeyword: + result.const = true; + handledModifierIndices[i] = true; + break; + case SyntaxKind.DeclareKeyword: + result.declare = true; + handledModifierIndices[i] = true; + break; + default: + } + } + /** + * If there are still valid modifiers available which have + * not been explicitly handled above, we just convert and + * add the modifiers array to the result node. + */ + const remainingModifiers = modifiers.filter((_, i) => !handledModifierIndices[i]); + if (!remainingModifiers || !remainingModifiers.length) { + return; + } + result.modifiers = remainingModifiers.map(convertChild); + } + + /** + * Uses the current TSNode's end location for its `type` to adjust the location data of the given + * ESTreeNode, which should be the parent of the final typeAnnotation node + * @param {ESTreeNode} typeAnnotationParent The node that will have its location data mutated + * @returns {void} + */ + function fixTypeAnnotationParentLocation(typeAnnotationParent) { + const end = node.type.getEnd(); + typeAnnotationParent.range[1] = end; + const loc = nodeUtils.getLocFor(typeAnnotationParent.range[0], typeAnnotationParent.range[1], ast); + typeAnnotationParent.loc = loc; + } + + /** + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + */ + switch (node.kind) { + + case SyntaxKind.SourceFile: + Object.assign(result, { + type: AST_NODE_TYPES.Program, + body: [], + sourceType: node.externalModuleIndicator ? "module" : "script" + }); + + // filter out unknown nodes for now + node.statements.forEach(statement => { + const convertedStatement = convertChild(statement); + if (convertedStatement) { + result.body.push(convertedStatement); + } + }); + + result.range[1] = node.endOfFileToken.end; + result.loc = nodeUtils.getLocFor(node.getStart(), result.range[1], ast); + break; + + case SyntaxKind.Block: + Object.assign(result, { + type: AST_NODE_TYPES.BlockStatement, + body: node.statements.map(convertChild) + }); + break; + + case SyntaxKind.Identifier: + Object.assign(result, { + type: AST_NODE_TYPES.Identifier, + name: node.text + }); + break; + + case SyntaxKind.WithStatement: + Object.assign(result, { + type: AST_NODE_TYPES.WithStatement, + object: convertChild(node.expression), + body: convertChild(node.statement) + }); + break; + + // Control Flow + + case SyntaxKind.ReturnStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ReturnStatement, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.LabeledStatement: + Object.assign(result, { + type: AST_NODE_TYPES.LabeledStatement, + label: convertChild(node.label), + body: convertChild(node.statement) + }); + break; + + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + Object.assign(result, { + type: SyntaxKind[node.kind], + label: convertChild(node.label) + }); + break; + + // Choice + + case SyntaxKind.IfStatement: + Object.assign(result, { + type: AST_NODE_TYPES.IfStatement, + test: convertChild(node.expression), + consequent: convertChild(node.thenStatement), + alternate: convertChild(node.elseStatement) + }); + break; + + case SyntaxKind.SwitchStatement: + Object.assign(result, { + type: AST_NODE_TYPES.SwitchStatement, + discriminant: convertChild(node.expression), + cases: node.caseBlock.clauses.map(convertChild) + }); + break; + + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + Object.assign(result, { + type: AST_NODE_TYPES.SwitchCase, + test: convertChild(node.expression), + consequent: node.statements.map(convertChild) + }); + break; + + // Exceptions + + case SyntaxKind.ThrowStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ThrowStatement, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.TryStatement: + Object.assign(result, { + type: AST_NODE_TYPES.TryStatement, + block: convert({ node: node.tryBlock, parent: null, ast, additionalOptions }), + handler: convertChild(node.catchClause), + finalizer: convertChild(node.finallyBlock) + }); + break; + + case SyntaxKind.CatchClause: + Object.assign(result, { + type: AST_NODE_TYPES.CatchClause, + param: node.variableDeclaration ? convertChild(node.variableDeclaration.name) : null, + body: convertChild(node.block) + }); + break; + + // Loops + + case SyntaxKind.WhileStatement: + Object.assign(result, { + type: AST_NODE_TYPES.WhileStatement, + test: convertChild(node.expression), + body: convertChild(node.statement) + }); + break; + + /** + * Unlike other parsers, TypeScript calls a "DoWhileStatement" + * a "DoStatement" + */ + case SyntaxKind.DoStatement: + Object.assign(result, { + type: AST_NODE_TYPES.DoWhileStatement, + test: convertChild(node.expression), + body: convertChild(node.statement) + }); + break; + + case SyntaxKind.ForStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ForStatement, + init: convertChild(node.initializer), + test: convertChild(node.condition), + update: convertChild(node.incrementor), + body: convertChild(node.statement) + }); + break; + + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: { + const isAwait = !!(node.awaitModifier && node.awaitModifier.kind === SyntaxKind.AwaitKeyword); + Object.assign(result, { + type: SyntaxKind[node.kind], + left: convertChild(node.initializer), + right: convertChild(node.expression), + body: convertChild(node.statement), + await: isAwait + }); + break; + } + + // Declarations + + case SyntaxKind.FunctionDeclaration: { + + let functionDeclarationType = AST_NODE_TYPES.FunctionDeclaration; + + if (node.modifiers && node.modifiers.length) { + const isDeclareFunction = nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node); + if (isDeclareFunction) { + functionDeclarationType = AST_NODE_TYPES.DeclareFunction; + } + } + + Object.assign(result, { + type: functionDeclarationType, + id: convertChild(node.name), + generator: !!node.asteriskToken, + expression: false, + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + params: convertParameters(node.parameters), + body: convertChild(node.body) + }); + + // Process returnType + if (node.type) { + result.returnType = convertTypeAnnotation(node.type); + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + + } + + case SyntaxKind.VariableDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclarator, + id: convertChild(node.name), + init: convertChild(node.initializer) + }); + + if (node.exclamationToken) { + result.definite = true; + } + + if (node.type) { + result.id.typeAnnotation = convertTypeAnnotation(node.type); + fixTypeAnnotationParentLocation(result.id); + } + break; + } + + case SyntaxKind.VariableStatement: + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarationList.declarations.map(convertChild), + kind: nodeUtils.getDeclarationKind(node.declarationList) + }); + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + break; + + // mostly for for-of, for-in + case SyntaxKind.VariableDeclarationList: + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarations.map(convertChild), + kind: nodeUtils.getDeclarationKind(node) + }); + break; + + // Expressions + + case SyntaxKind.ExpressionStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ExpressionStatement, + expression: convertChild(node.expression) + }); + break; + + case SyntaxKind.ThisKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.ThisExpression + }); + break; + + case SyntaxKind.ArrayLiteralExpression: { + + const arrayAssignNode = nodeUtils.findAncestorOfKind(node, SyntaxKind.BinaryExpression); + const arrayIsInForOf = node.parent && node.parent.kind === SyntaxKind.ForOfStatement; + const arrayIsInForIn = node.parent && node.parent.kind === SyntaxKind.ForInStatement; + let arrayIsInAssignment; + + if (arrayAssignNode) { + if (arrayAssignNode.left === node) { + arrayIsInAssignment = true; + } else { + arrayIsInAssignment = (nodeUtils.findChildOfKind(arrayAssignNode.left, SyntaxKind.ArrayLiteralExpression, ast) === node); + } + } + + // TypeScript uses ArrayLiteralExpression in destructuring assignment, too + if (arrayIsInAssignment || arrayIsInForOf || arrayIsInForIn) { + Object.assign(result, { + type: AST_NODE_TYPES.ArrayPattern, + elements: node.elements.map(convertChild) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ArrayExpression, + elements: node.elements.map(convertChild) + }); + } + break; + + } + + case SyntaxKind.ObjectLiteralExpression: { + + const ancestorNode = nodeUtils.findFirstMatchingAncestor( + node, + parentNode => + (parentNode.kind === SyntaxKind.BinaryExpression || parentNode.kind === SyntaxKind.ArrowFunction) + ); + const objectAssignNode = ( + ancestorNode && + ancestorNode.kind === SyntaxKind.BinaryExpression && + ancestorNode.operatorToken.kind === SyntaxKind.FirstAssignment + ) ? ancestorNode : null; + + let objectIsInAssignment = false; + + if (objectAssignNode) { + if (objectAssignNode.left === node) { + objectIsInAssignment = true; + } else { + objectIsInAssignment = (nodeUtils.findChildOfKind(objectAssignNode.left, SyntaxKind.ObjectLiteralExpression, ast) === node); + } + } + + // TypeScript uses ObjectLiteralExpression in destructuring assignment, too + if (objectIsInAssignment) { + Object.assign(result, { + type: AST_NODE_TYPES.ObjectPattern, + properties: node.properties.map(convertChild) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ObjectExpression, + properties: node.properties.map(convertChild) + }); + } + + break; + + } + + case SyntaxKind.PropertyAssignment: + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: convertChild(node.initializer), + computed: nodeUtils.isComputedProperty(node.name), + method: false, + shorthand: false, + kind: "init" + }); + break; + + case SyntaxKind.ShorthandPropertyAssignment: { + if (node.objectAssignmentInitializer) { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: { + type: AST_NODE_TYPES.AssignmentPattern, + left: convertChild(node.name), + right: convertChild(node.objectAssignmentInitializer), + loc: result.loc, + range: result.range + }, + computed: false, + method: false, + shorthand: true, + kind: "init" + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: convertChild(node.initializer || node.name), + computed: false, + method: false, + shorthand: true, + kind: "init" + }); + } + break; + } + + case SyntaxKind.ComputedPropertyName: + + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: convertChild(node.name), + computed: false, + method: false, + shorthand: true, + kind: "init" + }); + } else { + return convertChild(node.expression); + } + break; + + case SyntaxKind.PropertyDeclaration: { + const isAbstract = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node); + Object.assign(result, { + type: (isAbstract) ? AST_NODE_TYPES.TSAbstractClassProperty : AST_NODE_TYPES.ClassProperty, + key: convertChild(node.name), + value: convertChild(node.initializer), + computed: nodeUtils.isComputedProperty(node.name), + static: nodeUtils.hasStaticModifierFlag(node), + readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined + }); + + if (node.type) { + result.typeAnnotation = convertTypeAnnotation(node.type); + } + + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + if (node.name.kind === SyntaxKind.Identifier && node.questionToken) { + result.optional = true; + } + + if (node.exclamationToken) { + result.definite = true; + } + + if (result.key.type === AST_NODE_TYPES.Literal && node.questionToken) { + result.optional = true; + } + break; + } + + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.MethodDeclaration: { + + const openingParen = nodeUtils.findFirstMatchingToken(node.name, ast, token => { + if (!token || !token.kind) { + return false; + } + return nodeUtils.getTextForTokenKind(token.kind) === "("; + }); + + const methodLoc = ast.getLineAndCharacterOfPosition(openingParen.getStart()), + nodeIsMethod = (node.kind === SyntaxKind.MethodDeclaration), + method = { + type: AST_NODE_TYPES.FunctionExpression, + id: null, + generator: !!node.asteriskToken, + expression: false, + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + body: convertChild(node.body), + range: [node.parameters.pos - 1, result.range[1]], + loc: { + start: { + line: methodLoc.line + 1, + column: methodLoc.character + }, + end: result.loc.end + } + }; + + if (node.type) { + method.returnType = convertTypeAnnotation(node.type); + } + + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + + method.params = node.parameters.map(convertChild); + + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: method, + computed: nodeUtils.isComputedProperty(node.name), + method: nodeIsMethod, + shorthand: false, + kind: "init" + }); + + } else { // class + + /** + * Unlike in object literal methods, class method params can have decorators + */ + method.params = convertParameters(node.parameters); + + /** + * TypeScript class methods can be defined as "abstract" + */ + const methodDefinitionType = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node) + ? AST_NODE_TYPES.TSAbstractMethodDefinition + : AST_NODE_TYPES.MethodDefinition; + + Object.assign(result, { + type: methodDefinitionType, + key: convertChild(node.name), + value: method, + computed: nodeUtils.isComputedProperty(node.name), + static: nodeUtils.hasStaticModifierFlag(node), + kind: "method" + }); + + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + } + + if (result.key.type === AST_NODE_TYPES.Identifier && node.questionToken) { + result.key.optional = true; + } + + if (node.kind === SyntaxKind.GetAccessor) { + result.kind = "get"; + } else if (node.kind === SyntaxKind.SetAccessor) { + result.kind = "set"; + } else if (!result.static && node.name.kind === SyntaxKind.StringLiteral && node.name.text === "constructor") { + result.kind = "constructor"; + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + method.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + + break; + + } + + // TypeScript uses this even for static methods named "constructor" + case SyntaxKind.Constructor: { + + const constructorIsStatic = nodeUtils.hasStaticModifierFlag(node), + constructorIsAbstract = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node), + firstConstructorToken = constructorIsStatic ? nodeUtils.findNextToken(node.getFirstToken(), ast) : node.getFirstToken(), + constructorLoc = ast.getLineAndCharacterOfPosition(node.parameters.pos - 1), + constructor = { + type: AST_NODE_TYPES.FunctionExpression, + id: null, + params: convertParameters(node.parameters), + generator: false, + expression: false, + async: false, + body: convertChild(node.body), + range: [node.parameters.pos - 1, result.range[1]], + loc: { + start: { + line: constructorLoc.line + 1, + column: constructorLoc.character + }, + end: result.loc.end + } + }; + + const constructorIdentifierLocStart = ast.getLineAndCharacterOfPosition(firstConstructorToken.getStart()), + constructorIdentifierLocEnd = ast.getLineAndCharacterOfPosition(firstConstructorToken.getEnd()), + constructorIsComputed = !!node.name && nodeUtils.isComputedProperty(node.name); + + let constructorKey; + + if (constructorIsComputed) { + constructorKey = { + type: AST_NODE_TYPES.Literal, + value: "constructor", + raw: node.name.getText(), + range: [firstConstructorToken.getStart(), firstConstructorToken.end], + loc: { + start: { + line: constructorIdentifierLocStart.line + 1, + column: constructorIdentifierLocStart.character + }, + end: { + line: constructorIdentifierLocEnd.line + 1, + column: constructorIdentifierLocEnd.character + } + } + }; + } else { + constructorKey = { + type: AST_NODE_TYPES.Identifier, + name: "constructor", + range: [firstConstructorToken.getStart(), firstConstructorToken.end], + loc: { + start: { + line: constructorIdentifierLocStart.line + 1, + column: constructorIdentifierLocStart.character + }, + end: { + line: constructorIdentifierLocEnd.line + 1, + column: constructorIdentifierLocEnd.character + } + } + }; + } + + Object.assign(result, { + type: constructorIsAbstract ? AST_NODE_TYPES.TSAbstractMethodDefinition : AST_NODE_TYPES.MethodDefinition, + key: constructorKey, + value: constructor, + computed: constructorIsComputed, + static: constructorIsStatic, + kind: (constructorIsStatic || constructorIsComputed) ? "method" : "constructor" + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + break; + + } + + case SyntaxKind.FunctionExpression: + Object.assign(result, { + type: AST_NODE_TYPES.FunctionExpression, + id: convertChild(node.name), + generator: !!node.asteriskToken, + params: convertParameters(node.parameters), + body: convertChild(node.body), + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + expression: false + }); + + // Process returnType + if (node.type) { + result.returnType = convertTypeAnnotation(node.type); + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + break; + + case SyntaxKind.SuperKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Super + }); + break; + + case SyntaxKind.ArrayBindingPattern: + Object.assign(result, { + type: AST_NODE_TYPES.ArrayPattern, + elements: node.elements.map(convertChild) + }); + break; + + // occurs with missing array elements like [,] + case SyntaxKind.OmittedExpression: + return null; + + case SyntaxKind.ObjectBindingPattern: + Object.assign(result, { + type: AST_NODE_TYPES.ObjectPattern, + properties: node.elements.map(convertChild) + }); + break; + + case SyntaxKind.BindingElement: + + if (parent.kind === SyntaxKind.ArrayBindingPattern) { + const arrayItem = convert({ node: node.name, parent, ast, additionalOptions }); + + if (node.initializer) { + Object.assign(result, { + type: AST_NODE_TYPES.AssignmentPattern, + left: arrayItem, + right: convertChild(node.initializer) + }); + } else if (node.dotDotDotToken) { + Object.assign(result, { + type: AST_NODE_TYPES.RestElement, + argument: arrayItem + }); + } else { + return arrayItem; + } + } else if (parent.kind === SyntaxKind.ObjectBindingPattern) { + + if (node.dotDotDotToken) { + Object.assign(result, { + type: AST_NODE_TYPES.RestElement, + argument: convertChild(node.propertyName || node.name) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.propertyName || node.name), + value: convertChild(node.name), + computed: Boolean(node.propertyName && node.propertyName.kind === SyntaxKind.ComputedPropertyName), + method: false, + shorthand: !node.propertyName, + kind: "init" + }); + } + + if (node.initializer) { + result.value = { + type: AST_NODE_TYPES.AssignmentPattern, + left: convertChild(node.name), + right: convertChild(node.initializer), + range: [node.name.getStart(), node.initializer.end], + loc: nodeUtils.getLocFor(node.name.getStart(), node.initializer.end, ast) + }; + } + } + break; + + + case SyntaxKind.ArrowFunction: + Object.assign(result, { + type: AST_NODE_TYPES.ArrowFunctionExpression, + generator: false, + id: null, + params: convertParameters(node.parameters), + body: convertChild(node.body), + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + expression: node.body.kind !== SyntaxKind.Block + }); + + // Process returnType + if (node.type) { + result.returnType = convertTypeAnnotation(node.type); + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + break; + + case SyntaxKind.YieldExpression: + Object.assign(result, { + type: AST_NODE_TYPES.YieldExpression, + delegate: !!node.asteriskToken, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.AwaitExpression: + Object.assign(result, { + type: AST_NODE_TYPES.AwaitExpression, + argument: convertChild(node.expression) + }); + break; + + // Template Literals + + case SyntaxKind.NoSubstitutionTemplateLiteral: + Object.assign(result, { + type: AST_NODE_TYPES.TemplateLiteral, + quasis: [ + { + type: AST_NODE_TYPES.TemplateElement, + value: { + raw: ast.text.slice(node.getStart() + 1, node.end - 1), + cooked: node.text + }, + tail: true, + range: result.range, + loc: result.loc + } + ], + expressions: [] + }); + break; + + case SyntaxKind.TemplateExpression: + Object.assign(result, { + type: AST_NODE_TYPES.TemplateLiteral, + quasis: [convertChild(node.head)], + expressions: [] + }); + + node.templateSpans.forEach(templateSpan => { + result.expressions.push(convertChild(templateSpan.expression)); + result.quasis.push(convertChild(templateSpan.literal)); + }); + break; + + case SyntaxKind.TaggedTemplateExpression: + Object.assign(result, { + type: AST_NODE_TYPES.TaggedTemplateExpression, + typeParameters: (node.typeArguments) + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : undefined, + tag: convertChild(node.tag), + quasi: convertChild(node.template) + }); + break; + + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: { + const tail = (node.kind === SyntaxKind.TemplateTail); + Object.assign(result, { + type: AST_NODE_TYPES.TemplateElement, + value: { + raw: ast.text.slice(node.getStart() + 1, node.end - (tail ? 1 : 2)), + cooked: node.text + }, + tail + }); + break; + } + + // Patterns + + case SyntaxKind.SpreadElement: { + let type = AST_NODE_TYPES.SpreadElement; + + if (node.parent && + node.parent.parent && + node.parent.parent.kind === SyntaxKind.BinaryExpression + ) { + if (node.parent.parent.left === node.parent) { + type = AST_NODE_TYPES.RestElement; + } else if (node.parent.parent.right === node.parent) { + type = AST_NODE_TYPES.SpreadElement; + } + } + + Object.assign(result, { + type, + argument: convertChild(node.expression) + }); + break; + } + case SyntaxKind.SpreadAssignment: { + let type = AST_NODE_TYPES.SpreadElement; + + if (node.parent && + node.parent.parent && + node.parent.parent.kind === SyntaxKind.BinaryExpression + ) { + if (node.parent.parent.right === node.parent) { + type = AST_NODE_TYPES.SpreadElement; + } else if (node.parent.parent.left === node.parent) { + type = AST_NODE_TYPES.RestElement; + } + } + + Object.assign(result, { + type, + argument: convertChild(node.expression) + }); + break; + } + + case SyntaxKind.Parameter: { + let parameter; + + if (node.dotDotDotToken) { + parameter = convertChild(node.name); + Object.assign(result, { + type: AST_NODE_TYPES.RestElement, + argument: parameter + }); + } else if (node.initializer) { + parameter = convertChild(node.name); + Object.assign(result, { + type: AST_NODE_TYPES.AssignmentPattern, + left: parameter, + right: convertChild(node.initializer) + }); + } else { + parameter = convert({ node: node.name, parent, ast, additionalOptions }); + result = parameter; + } + + if (node.type) { + parameter.typeAnnotation = convertTypeAnnotation(node.type); + fixTypeAnnotationParentLocation(parameter); + } + + if (node.questionToken) { + parameter.optional = true; + } + + if (node.modifiers) { + return { + type: AST_NODE_TYPES.TSParameterProperty, + range: [node.getStart(), node.end], + loc: nodeUtils.getLoc(node, ast), + accessibility: nodeUtils.getTSNodeAccessibility(node) || undefined, + readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined, + parameter: result + }; + } + + break; + + } + + // Classes + + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: { + + const heritageClauses = node.heritageClauses || []; + + let classNodeType = SyntaxKind[node.kind]; + let lastClassToken = heritageClauses.length ? heritageClauses[heritageClauses.length - 1] : node.name; + + if (node.typeParameters && node.typeParameters.length) { + const lastTypeParameter = node.typeParameters[node.typeParameters.length - 1]; + + if (!lastClassToken || lastTypeParameter.pos > lastClassToken.pos) { + lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast); + } + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + + if (node.modifiers && node.modifiers.length) { + + /** + * TypeScript class declarations can be defined as "abstract" + */ + if (node.kind === SyntaxKind.ClassDeclaration) { + if (nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)) { + classNodeType = `TSAbstract${classNodeType}`; + } + } + + /** + * We need check for modifiers, and use the last one, as there + * could be multiple before the open brace + */ + const lastModifier = node.modifiers[node.modifiers.length - 1]; + + if (!lastClassToken || lastModifier.pos > lastClassToken.pos) { + lastClassToken = nodeUtils.findNextToken(lastModifier, ast); + } + + } else if (!lastClassToken) { // no name + lastClassToken = node.getFirstToken(); + } + + const openBrace = nodeUtils.findNextToken(lastClassToken, ast); + const superClass = heritageClauses.find(clause => clause.token === SyntaxKind.ExtendsKeyword); + + if (superClass) { + if (superClass.types.length > 1) { + throw nodeUtils.createError(ast, superClass.types[1].pos, "Classes can only extend a single class."); + } + + if (superClass.types[0] && superClass.types[0].typeArguments) { + result.superTypeParameters = convertTypeArgumentsToTypeParameters(superClass.types[0].typeArguments); + } + } + + const implementsClause = heritageClauses.find(clause => clause.token === SyntaxKind.ImplementsKeyword); + + Object.assign(result, { + type: classNodeType, + id: convertChild(node.name), + body: { + type: AST_NODE_TYPES.ClassBody, + body: [], + + // TODO: Fix location info + range: [openBrace.getStart(), result.range[1]], + loc: nodeUtils.getLocFor(openBrace.getStart(), node.end, ast) + }, + superClass: (superClass && superClass.types[0] ? convertChild(superClass.types[0].expression) : null) + }); + + if (implementsClause) { + result.implements = implementsClause.types.map(convertClassImplements); + } + + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + + const filteredMembers = node.members.filter(nodeUtils.isESTreeClassMember); + + if (filteredMembers.length) { + result.body.body = filteredMembers.map(convertChild); + } + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + + } + + // Modules + case SyntaxKind.ModuleBlock: + Object.assign(result, { + type: AST_NODE_TYPES.TSModuleBlock, + body: node.statements.map(convertChild) + }); + break; + + case SyntaxKind.ImportDeclaration: + Object.assign(result, { + type: AST_NODE_TYPES.ImportDeclaration, + source: convertChild(node.moduleSpecifier), + specifiers: [] + }); + + if (node.importClause) { + if (node.importClause.name) { + result.specifiers.push(convertChild(node.importClause)); + } + + if (node.importClause.namedBindings) { + if (node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { + result.specifiers.push(convertChild(node.importClause.namedBindings)); + } else { + result.specifiers = result.specifiers.concat(node.importClause.namedBindings.elements.map(convertChild)); + } + } + } + + break; + + case SyntaxKind.NamespaceImport: + Object.assign(result, { + type: AST_NODE_TYPES.ImportNamespaceSpecifier, + local: convertChild(node.name) + }); + break; + + case SyntaxKind.ImportSpecifier: + Object.assign(result, { + type: AST_NODE_TYPES.ImportSpecifier, + local: convertChild(node.name), + imported: convertChild(node.propertyName || node.name) + }); + break; + + case SyntaxKind.ImportClause: + Object.assign(result, { + type: AST_NODE_TYPES.ImportDefaultSpecifier, + local: convertChild(node.name) + }); + + // have to adjust location information due to tree differences + result.range[1] = node.name.end; + result.loc = nodeUtils.getLocFor(result.range[0], result.range[1], ast); + break; + + case SyntaxKind.NamedImports: + Object.assign(result, { + type: AST_NODE_TYPES.ImportDefaultSpecifier, + local: convertChild(node.name) + }); + break; + + case SyntaxKind.ExportDeclaration: + if (node.exportClause) { + Object.assign(result, { + type: AST_NODE_TYPES.ExportNamedDeclaration, + source: convertChild(node.moduleSpecifier), + specifiers: node.exportClause.elements.map(convertChild), + declaration: null + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ExportAllDeclaration, + source: convertChild(node.moduleSpecifier) + }); + } + break; + + case SyntaxKind.ExportSpecifier: + Object.assign(result, { + type: AST_NODE_TYPES.ExportSpecifier, + local: convertChild(node.propertyName || node.name), + exported: convertChild(node.name) + }); + break; + + case SyntaxKind.ExportAssignment: + if (node.isExportEquals) { + Object.assign(result, { + type: AST_NODE_TYPES.TSExportAssignment, + expression: convertChild(node.expression) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: convertChild(node.expression) + }); + } + break; + + // Unary Operations + + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: { + const operator = nodeUtils.getTextForTokenKind(node.operator); + Object.assign(result, { + /** + * ESTree uses UpdateExpression for ++/-- + */ + type: /^(?:\+\+|--)$/.test(operator) ? AST_NODE_TYPES.UpdateExpression : AST_NODE_TYPES.UnaryExpression, + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + argument: convertChild(node.operand) + }); + break; + } + + case SyntaxKind.DeleteExpression: + Object.assign(result, { + type: AST_NODE_TYPES.UnaryExpression, + operator: "delete", + prefix: true, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.VoidExpression: + Object.assign(result, { + type: AST_NODE_TYPES.UnaryExpression, + operator: "void", + prefix: true, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.TypeOfExpression: + Object.assign(result, { + type: AST_NODE_TYPES.UnaryExpression, + operator: "typeof", + prefix: true, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.TypeOperator: + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeOperator, + operator: nodeUtils.getTextForTokenKind(node.operator), + typeAnnotation: convertChild(node.type) + }); + break; + + // Binary Operations + + case SyntaxKind.BinaryExpression: + + // TypeScript uses BinaryExpression for sequences as well + if (nodeUtils.isComma(node.operatorToken)) { + Object.assign(result, { + type: AST_NODE_TYPES.SequenceExpression, + expressions: [] + }); + + const left = convertChild(node.left), + right = convertChild(node.right); + + if (left.type === AST_NODE_TYPES.SequenceExpression) { + result.expressions = result.expressions.concat(left.expressions); + } else { + result.expressions.push(left); + } + + if (right.type === AST_NODE_TYPES.SequenceExpression) { + result.expressions = result.expressions.concat(right.expressions); + } else { + result.expressions.push(right); + } + + } else if (node.operatorToken && node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { + Object.assign(result, { + type: AST_NODE_TYPES.AssignmentExpression, + operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), + left: convertChild(node.left), + right: convertChild(node.right) + }); + } else { + Object.assign(result, { + type: nodeUtils.getBinaryExpressionType(node.operatorToken), + operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), + left: convertChild(node.left), + right: convertChild(node.right) + }); + + // if the binary expression is in a destructured array, switch it + if (result.type === AST_NODE_TYPES.AssignmentExpression) { + const upperArrayNode = nodeUtils.findAncestorOfKind(node, SyntaxKind.ArrayLiteralExpression), + upperArrayAssignNode = upperArrayNode && nodeUtils.findAncestorOfKind(upperArrayNode, SyntaxKind.BinaryExpression); + + let upperArrayIsInAssignment; + + if (upperArrayAssignNode) { + if (upperArrayAssignNode.left === upperArrayNode) { + upperArrayIsInAssignment = true; + } else { + upperArrayIsInAssignment = (nodeUtils.findChildOfKind(upperArrayAssignNode.left, SyntaxKind.ArrayLiteralExpression, ast) === upperArrayNode); + } + } + + if (upperArrayIsInAssignment) { + delete result.operator; + result.type = AST_NODE_TYPES.AssignmentPattern; + } + } + } + break; + + case SyntaxKind.PropertyAccessExpression: + if (nodeUtils.isJSXToken(parent)) { + const jsxMemberExpression = { + type: AST_NODE_TYPES.MemberExpression, + object: convertChild(node.expression), + property: convertChild(node.name) + }; + const isNestedMemberExpression = (node.expression.kind === SyntaxKind.PropertyAccessExpression); + if (node.expression.kind === SyntaxKind.ThisKeyword) { + jsxMemberExpression.object.name = "this"; + } + + jsxMemberExpression.object.type = (isNestedMemberExpression) ? AST_NODE_TYPES.MemberExpression : AST_NODE_TYPES.JSXIdentifier; + jsxMemberExpression.property.type = AST_NODE_TYPES.JSXIdentifier; + Object.assign(result, jsxMemberExpression); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.MemberExpression, + object: convertChild(node.expression), + property: convertChild(node.name), + computed: false + }); + } + break; + + case SyntaxKind.ElementAccessExpression: + Object.assign(result, { + type: AST_NODE_TYPES.MemberExpression, + object: convertChild(node.expression), + property: convertChild(node.argumentExpression), + computed: true + }); + break; + + case SyntaxKind.ConditionalExpression: + Object.assign(result, { + type: AST_NODE_TYPES.ConditionalExpression, + test: convertChild(node.condition), + consequent: convertChild(node.whenTrue), + alternate: convertChild(node.whenFalse) + }); + break; + + case SyntaxKind.CallExpression: + Object.assign(result, { + type: AST_NODE_TYPES.CallExpression, + callee: convertChild(node.expression), + arguments: node.arguments.map(convertChild) + }); + if (node.typeArguments && node.typeArguments.length) { + result.typeParameters = convertTypeArgumentsToTypeParameters(node.typeArguments); + } + break; + + case SyntaxKind.NewExpression: + Object.assign(result, { + type: AST_NODE_TYPES.NewExpression, + callee: convertChild(node.expression), + arguments: (node.arguments) ? node.arguments.map(convertChild) : [] + }); + if (node.typeArguments && node.typeArguments.length) { + result.typeParameters = convertTypeArgumentsToTypeParameters(node.typeArguments); + } + break; + + case SyntaxKind.MetaProperty: { + const newToken = nodeUtils.convertToken(node.getFirstToken(), ast); + Object.assign(result, { + type: AST_NODE_TYPES.MetaProperty, + meta: { + type: AST_NODE_TYPES.Identifier, + range: newToken.range, + loc: newToken.loc, + name: nodeUtils.getTextForTokenKind(node.keywordToken) + }, + property: convertChild(node.name) + }); + break; + } + + // Literals + + case SyntaxKind.StringLiteral: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + raw: ast.text.slice(result.range[0], result.range[1]) + }); + if (parent.name && parent.name === node) { + result.value = node.text; + } else { + result.value = nodeUtils.unescapeStringLiteralText(node.text); + } + break; + + case SyntaxKind.NumericLiteral: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: Number(node.text), + raw: ast.text.slice(result.range[0], result.range[1]) + }); + break; + + case SyntaxKind.RegularExpressionLiteral: { + const pattern = node.text.slice(1, node.text.lastIndexOf("/")); + const flags = node.text.slice(node.text.lastIndexOf("/") + 1); + + let regex = null; + try { + regex = new RegExp(pattern, flags); + } catch (exception) { + regex = null; + } + + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: regex, + raw: node.text, + regex: { + pattern, + flags + } + }); + break; + } + + case SyntaxKind.TrueKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: true, + raw: "true" + }); + break; + + case SyntaxKind.FalseKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: false, + raw: "false" + }); + break; + + case SyntaxKind.NullKeyword: { + if (nodeUtils.isWithinTypeAnnotation(node)) { + Object.assign(result, { + type: AST_NODE_TYPES.TSNullKeyword + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: null, + raw: "null" + }); + } + break; + } + + case SyntaxKind.ImportKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Import + }); + break; + + case SyntaxKind.EmptyStatement: + case SyntaxKind.DebuggerStatement: + simplyCopy(); + break; + + // JSX + + case SyntaxKind.JsxElement: + Object.assign(result, { + type: AST_NODE_TYPES.JSXElement, + openingElement: convertChild(node.openingElement), + closingElement: convertChild(node.closingElement), + children: node.children.map(convertChild) + }); + + break; + + case SyntaxKind.JsxSelfClosingElement: { + /** + * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, + * TypeScript does not seem to have the idea of openingElement when tag is self-closing + */ + node.kind = SyntaxKind.JsxOpeningElement; + + const openingElement = convertChild(node); + openingElement.selfClosing = true; + + Object.assign(result, { + type: AST_NODE_TYPES.JSXElement, + openingElement, + closingElement: null, + children: [] + }); + + break; + + } + + case SyntaxKind.JsxOpeningElement: + Object.assign(result, { + type: AST_NODE_TYPES.JSXOpeningElement, + typeParameters: (node.typeArguments) + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : undefined, + selfClosing: false, + name: convertTypeScriptJSXTagNameToESTreeName(node.tagName), + attributes: node.attributes.properties.map(convertChild) + }); + break; + + case SyntaxKind.JsxClosingElement: + Object.assign(result, { + type: AST_NODE_TYPES.JSXClosingElement, + name: convertTypeScriptJSXTagNameToESTreeName(node.tagName) + }); + break; + + case SyntaxKind.JsxExpression: { + const eloc = ast.getLineAndCharacterOfPosition(result.range[0] + 1); + const expression = (node.expression) ? convertChild(node.expression) : { + type: AST_NODE_TYPES.JSXEmptyExpression, + loc: { + start: { + line: eloc.line + 1, + column: eloc.character + }, + end: { + line: result.loc.end.line, + column: result.loc.end.column - 1 + } + }, + range: [result.range[0] + 1, result.range[1] - 1] + }; + + Object.assign(result, { + type: node.dotDotDotToken + ? AST_NODE_TYPES.JSXSpreadChild + : AST_NODE_TYPES.JSXExpressionContainer, + expression + }); + + break; + + } + + case SyntaxKind.JsxAttribute: { + const attributeName = nodeUtils.convertToken(node.name, ast); + attributeName.type = AST_NODE_TYPES.JSXIdentifier; + attributeName.name = attributeName.value; + delete attributeName.value; + + Object.assign(result, { + type: AST_NODE_TYPES.JSXAttribute, + name: attributeName, + value: convertChild(node.initializer) + }); + + break; + + } + + /** + * The JSX AST changed the node type for string literals + * inside a JSX Element from `Literal` to `JSXText`. We + * provide a flag to support both types until `Literal` + * node type is deprecated in ESLint v5. + */ + case SyntaxKind.JsxText: { + const start = node.getFullStart(); + const end = node.getEnd(); + + const type = (additionalOptions.useJSXTextNode) + ? AST_NODE_TYPES.JSXText : AST_NODE_TYPES.Literal; + + Object.assign(result, { + type, + value: ast.text.slice(start, end), + raw: ast.text.slice(start, end) + }); + + result.loc = nodeUtils.getLocFor(start, end, ast); + result.range = [start, end]; + + break; + } + + case SyntaxKind.JsxSpreadAttribute: + Object.assign(result, { + type: AST_NODE_TYPES.JSXSpreadAttribute, + argument: convertChild(node.expression) + }); + + break; + + case SyntaxKind.FirstNode: { + Object.assign(result, { + type: AST_NODE_TYPES.TSQualifiedName, + left: convertChild(node.left), + right: convertChild(node.right) + }); + + break; + } + + // TypeScript specific + + case SyntaxKind.ParenthesizedExpression: + return convert({ node: node.expression, parent, ast, additionalOptions }); + + /** + * Convert TypeAliasDeclaration node into VariableDeclaration + * to allow core rules such as "semi" to work automatically + */ + case SyntaxKind.TypeAliasDeclaration: { + const typeAliasDeclarator = { + type: AST_NODE_TYPES.VariableDeclarator, + id: convertChild(node.name), + init: convertChild(node.type), + range: [node.name.getStart(), node.end] + }; + + typeAliasDeclarator.loc = nodeUtils.getLocFor(typeAliasDeclarator.range[0], typeAliasDeclarator.range[1], ast); + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + typeAliasDeclarator.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclaration, + kind: nodeUtils.getDeclarationKind(node), + declarations: [typeAliasDeclarator] + }); + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + + } + + case SyntaxKind.MethodSignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSMethodSignature, + optional: nodeUtils.isOptional(node), + computed: nodeUtils.isComputedProperty(node.name), + key: convertChild(node.name), + params: convertParameters(node.parameters), + typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null, + readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), + export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + if (node.typeParameters) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + + break; + } + + case SyntaxKind.PropertySignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSPropertySignature, + optional: nodeUtils.isOptional(node) || undefined, + computed: nodeUtils.isComputedProperty(node.name), + key: convertChild(node.name), + typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : undefined, + initializer: convertChild(node.initializer) || undefined, + readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + break; + } + + case SyntaxKind.IndexSignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSIndexSignature, + index: convertChild(node.parameters[0]), + typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null, + readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), + export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + break; + } + + case SyntaxKind.ConstructSignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSConstructSignature, + params: convertParameters(node.parameters), + typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null + }); + + if (node.typeParameters) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + + break; + } + + case SyntaxKind.InterfaceDeclaration: { + const interfaceHeritageClauses = node.heritageClauses || []; + + let interfaceLastClassToken = interfaceHeritageClauses.length ? interfaceHeritageClauses[interfaceHeritageClauses.length - 1] : node.name; + + if (node.typeParameters && node.typeParameters.length) { + const interfaceLastTypeParameter = node.typeParameters[node.typeParameters.length - 1]; + + if (!interfaceLastClassToken || interfaceLastTypeParameter.pos > interfaceLastClassToken.pos) { + interfaceLastClassToken = nodeUtils.findNextToken(interfaceLastTypeParameter, ast); + } + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); + } + + const hasImplementsClause = interfaceHeritageClauses.length > 0; + const hasAbstractKeyword = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node); + const interfaceOpenBrace = nodeUtils.findNextToken(interfaceLastClassToken, ast); + + const interfaceBody = { + type: AST_NODE_TYPES.TSInterfaceBody, + body: node.members.map(member => convertChild(member)), + range: [interfaceOpenBrace.getStart(), result.range[1]], + loc: nodeUtils.getLocFor(interfaceOpenBrace.getStart(), node.end, ast) + }; + + Object.assign(result, { + abstract: hasAbstractKeyword, + type: AST_NODE_TYPES.TSInterfaceDeclaration, + body: interfaceBody, + id: convertChild(node.name), + heritage: hasImplementsClause ? interfaceHeritageClauses[0].types.map(convertInterfaceHeritageClause) : [] + }); + /** + * Semantically, decorators are not allowed on interface declarations, + * but the TypeScript compiler will parse them and produce a valid AST, + * so we handle them here too. + */ + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + + } + + case SyntaxKind.FirstTypeNode: + Object.assign(result, { + type: AST_NODE_TYPES.TSTypePredicate, + parameterName: convertChild(node.parameterName), + typeAnnotation: convertTypeAnnotation(node.type) + }); + /** + * Specific fix for type-guard location data + */ + result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; + result.typeAnnotation.range = result.typeAnnotation.typeAnnotation.range; + break; + + case SyntaxKind.ImportType: + Object.assign(result, { + type: AST_NODE_TYPES.TSImportType, + isTypeOf: !!node.isTypeOf, + parameter: convertChild(node.argument), + qualifier: convertChild(node.qualifier), + typeParameters: node.typeArguments ? convertTypeArgumentsToTypeParameters(node.typeArguments) : null + }); + break; + + case SyntaxKind.EnumDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.TSEnumDeclaration, + id: convertChild(node.name), + members: node.members.map(convertChild) + }); + // apply modifiers first... + applyModifiersToResult(node.modifiers); + // ...then check for exports + result = nodeUtils.fixExports(node, result, ast); + /** + * Semantically, decorators are not allowed on enum declarations, + * but the TypeScript compiler will parse them and produce a valid AST, + * so we handle them here too. + */ + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + break; + } + + case SyntaxKind.EnumMember: { + Object.assign(result, { + type: AST_NODE_TYPES.TSEnumMember, + id: convertChild(node.name) + }); + if (node.initializer) { + result.initializer = convertChild(node.initializer); + } + break; + } + + case SyntaxKind.AbstractKeyword: { + Object.assign(result, { + type: AST_NODE_TYPES.TSAbstractKeyword + }); + break; + } + + case SyntaxKind.ModuleDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.TSModuleDeclaration, + id: convertChild(node.name) + }); + if (node.body) { + result.body = convertChild(node.body); + } + // apply modifiers first... + applyModifiersToResult(node.modifiers); + // ...then check for exports + result = nodeUtils.fixExports(node, result, ast); + break; + } + + default: + deeplyCopy(); + } + + return result; + +}; diff --git a/packages/typescript-estree/lib/node-utils.js b/packages/typescript-estree/lib/node-utils.js new file mode 100644 index 000000000000..c4da3d32b99a --- /dev/null +++ b/packages/typescript-estree/lib/node-utils.js @@ -0,0 +1,746 @@ +/** + * @fileoverview Utilities for finding and converting TSNodes into ESTreeNodes + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const ts = require("typescript"), + unescape = require("lodash.unescape"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +const SyntaxKind = ts.SyntaxKind; + +const ASSIGNMENT_OPERATORS = [ + SyntaxKind.EqualsToken, + SyntaxKind.PlusEqualsToken, + SyntaxKind.MinusEqualsToken, + SyntaxKind.AsteriskEqualsToken, + SyntaxKind.SlashEqualsToken, + SyntaxKind.PercentEqualsToken, + SyntaxKind.LessThanLessThanEqualsToken, + SyntaxKind.GreaterThanGreaterThanEqualsToken, + SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, + SyntaxKind.AmpersandEqualsToken, + SyntaxKind.BarEqualsToken, + SyntaxKind.CaretEqualsToken +]; + +const LOGICAL_OPERATORS = [ + SyntaxKind.BarBarToken, + SyntaxKind.AmpersandAmpersandToken +]; + +const TOKEN_TO_TEXT = {}; +TOKEN_TO_TEXT[SyntaxKind.OpenBraceToken] = "{"; +TOKEN_TO_TEXT[SyntaxKind.CloseBraceToken] = "}"; +TOKEN_TO_TEXT[SyntaxKind.OpenParenToken] = "("; +TOKEN_TO_TEXT[SyntaxKind.CloseParenToken] = ")"; +TOKEN_TO_TEXT[SyntaxKind.OpenBracketToken] = "["; +TOKEN_TO_TEXT[SyntaxKind.CloseBracketToken] = "]"; +TOKEN_TO_TEXT[SyntaxKind.DotToken] = "."; +TOKEN_TO_TEXT[SyntaxKind.DotDotDotToken] = "..."; +TOKEN_TO_TEXT[SyntaxKind.SemicolonToken] = ";"; +TOKEN_TO_TEXT[SyntaxKind.CommaToken] = ","; +TOKEN_TO_TEXT[SyntaxKind.LessThanToken] = "<"; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanToken] = ">"; +TOKEN_TO_TEXT[SyntaxKind.LessThanEqualsToken] = "<="; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanEqualsToken] = ">="; +TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsToken] = "=="; +TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsToken] = "!="; +TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsEqualsToken] = "==="; +TOKEN_TO_TEXT[SyntaxKind.InstanceOfKeyword] = "instanceof"; +TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsEqualsToken] = "!=="; +TOKEN_TO_TEXT[SyntaxKind.EqualsGreaterThanToken] = "=>"; +TOKEN_TO_TEXT[SyntaxKind.PlusToken] = "+"; +TOKEN_TO_TEXT[SyntaxKind.MinusToken] = "-"; +TOKEN_TO_TEXT[SyntaxKind.AsteriskToken] = "*"; +TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskToken] = "**"; +TOKEN_TO_TEXT[SyntaxKind.SlashToken] = "/"; +TOKEN_TO_TEXT[SyntaxKind.PercentToken] = "%"; +TOKEN_TO_TEXT[SyntaxKind.PlusPlusToken] = "++"; +TOKEN_TO_TEXT[SyntaxKind.MinusMinusToken] = "--"; +TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanToken] = "<<"; +TOKEN_TO_TEXT[SyntaxKind.LessThanSlashToken] = ">"; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanToken] = ">>>"; +TOKEN_TO_TEXT[SyntaxKind.AmpersandToken] = "&"; +TOKEN_TO_TEXT[SyntaxKind.BarToken] = "|"; +TOKEN_TO_TEXT[SyntaxKind.CaretToken] = "^"; +TOKEN_TO_TEXT[SyntaxKind.ExclamationToken] = "!"; +TOKEN_TO_TEXT[SyntaxKind.TildeToken] = "~"; +TOKEN_TO_TEXT[SyntaxKind.AmpersandAmpersandToken] = "&&"; +TOKEN_TO_TEXT[SyntaxKind.BarBarToken] = "||"; +TOKEN_TO_TEXT[SyntaxKind.QuestionToken] = "?"; +TOKEN_TO_TEXT[SyntaxKind.ColonToken] = ":"; +TOKEN_TO_TEXT[SyntaxKind.EqualsToken] = "="; +TOKEN_TO_TEXT[SyntaxKind.PlusEqualsToken] = "+="; +TOKEN_TO_TEXT[SyntaxKind.MinusEqualsToken] = "-="; +TOKEN_TO_TEXT[SyntaxKind.AsteriskEqualsToken] = "*="; +TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskEqualsToken] = "**="; +TOKEN_TO_TEXT[SyntaxKind.SlashEqualsToken] = "/="; +TOKEN_TO_TEXT[SyntaxKind.PercentEqualsToken] = "%="; +TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanEqualsToken] = "<<="; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanEqualsToken] = ">>="; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken] = ">>>="; +TOKEN_TO_TEXT[SyntaxKind.AmpersandEqualsToken] = "&="; +TOKEN_TO_TEXT[SyntaxKind.BarEqualsToken] = "|="; +TOKEN_TO_TEXT[SyntaxKind.CaretEqualsToken] = "^="; +TOKEN_TO_TEXT[SyntaxKind.AtToken] = "@"; +TOKEN_TO_TEXT[SyntaxKind.InKeyword] = "in"; +TOKEN_TO_TEXT[SyntaxKind.UniqueKeyword] = "unique"; +TOKEN_TO_TEXT[SyntaxKind.KeyOfKeyword] = "keyof"; +TOKEN_TO_TEXT[SyntaxKind.NewKeyword] = "new"; +TOKEN_TO_TEXT[SyntaxKind.ImportKeyword] = "import"; + +/** + * Find the first matching child based on the given sourceFile and predicate function. + * @param {TSNode} node The current TSNode + * @param {Object} sourceFile The full AST source file + * @param {Function} predicate The predicate function to apply to each checked child + * @returns {TSNode|undefined} a matching child TSNode + */ +function findFirstMatchingChild(node, sourceFile, predicate) { + const children = node.getChildren(sourceFile); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child && predicate(child)) { + return child; + } + + const grandChild = findFirstMatchingChild(child, sourceFile, predicate); + if (grandChild) { + return grandChild; + } + } + return undefined; +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + /** + * Expose the enum of possible TSNode `kind`s. + */ + SyntaxKind, + isAssignmentOperator, + isLogicalOperator, + getTextForTokenKind, + isESTreeClassMember, + hasModifier, + isComma, + getBinaryExpressionType, + getLocFor, + getLoc, + isToken, + isJSXToken, + getDeclarationKind, + getTSNodeAccessibility, + hasStaticModifierFlag, + findNextToken, + findFirstMatchingToken, + findChildOfKind, + findFirstMatchingAncestor, + findAncestorOfKind, + hasJSXAncestor, + unescapeStringLiteralText, + isComputedProperty, + isOptional, + fixExports, + getTokenType, + convertToken, + convertTokens, + getNodeContainer, + isWithinTypeAnnotation, + isTypeKeyword, + isComment, + isJSDocComment, + createError +}; + +/** + * Returns true if the given TSToken is the assignment operator + * @param {TSToken} operator the operator token + * @returns {boolean} is assignment + */ +function isAssignmentOperator(operator) { + return ASSIGNMENT_OPERATORS.indexOf(operator.kind) > -1; +} + +/** + * Returns true if the given TSToken is a logical operator + * @param {TSToken} operator the operator token + * @returns {boolean} is a logical operator + */ +function isLogicalOperator(operator) { + return LOGICAL_OPERATORS.indexOf(operator.kind) > -1; +} + +/** + * Returns the string form of the given TSToken SyntaxKind + * @param {number} kind the token's SyntaxKind + * @returns {string} the token applicable token as a string + */ +function getTextForTokenKind(kind) { + return TOKEN_TO_TEXT[kind]; +} + +/** + * Returns true if the given TSNode is a valid ESTree class member + * @param {TSNode} node TypeScript AST node + * @returns {boolean} is valid ESTree class member + */ +function isESTreeClassMember(node) { + return node.kind !== SyntaxKind.SemicolonClassElement; +} + +/** + * Checks if a TSNode has a modifier + * @param {SyntaxKind} modifierKind TypeScript SyntaxKind modifier + * @param {TSNode} node TypeScript AST node + * @returns {boolean} has the modifier specified + */ +function hasModifier(modifierKind, node) { + return !!node.modifiers && !!node.modifiers.length && node.modifiers.some(modifier => modifier.kind === modifierKind); +} + +/** + * Returns true if the given TSToken is a comma + * @param {TSToken} token the TypeScript token + * @returns {boolean} is comma + */ +function isComma(token) { + return token.kind === SyntaxKind.CommaToken; +} + +/** + * Returns true if the given TSNode is a comment + * @param {TSNode} node the TypeScript node + * @returns {boolean} is commment + */ +function isComment(node) { + return node.kind === SyntaxKind.SingleLineCommentTrivia || node.kind === SyntaxKind.MultiLineCommentTrivia; +} + +/** + * Returns true if the given TSNode is a JSDoc comment + * @param {TSNode} node the TypeScript node + * @returns {boolean} is JSDoc comment + */ +function isJSDocComment(node) { + return node.kind === SyntaxKind.JSDocComment; +} + +/** + * Returns the binary expression type of the given TSToken + * @param {TSToken} operator the operator token + * @returns {string} the binary expression type + */ +function getBinaryExpressionType(operator) { + if (isAssignmentOperator(operator)) { + return "AssignmentExpression"; + } else if (isLogicalOperator(operator)) { + return "LogicalExpression"; + } + return "BinaryExpression"; +} + +/** + * Returns line and column data for the given start and end positions, + * for the given AST + * @param {Object} start start data + * @param {Object} end end data + * @param {Object} ast the AST object + * @returns {Object} the loc data + */ +function getLocFor(start, end, ast) { + const startLoc = ast.getLineAndCharacterOfPosition(start), + endLoc = ast.getLineAndCharacterOfPosition(end); + + return { + start: { + line: startLoc.line + 1, + column: startLoc.character + }, + end: { + line: endLoc.line + 1, + column: endLoc.character + } + }; +} + +/** + * Returns line and column data for the given ESTreeNode or ESTreeToken, + * for the given AST + * @param {ESTreeToken|ESTreeNode} nodeOrToken the ESTreeNode or ESTreeToken + * @param {Object} ast the AST object + * @returns {Object} the loc data + */ +function getLoc(nodeOrToken, ast) { + return getLocFor(nodeOrToken.getStart(), nodeOrToken.end, ast); +} + +/** + * Returns true if a given TSNode is a token + * @param {TSNode} node the TSNode + * @returns {boolean} is a token + */ +function isToken(node) { + return node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken; +} + +/** + * Returns true if a given TSNode is a JSX token + * @param {TSNode} node TSNode to be checked + * @returns {boolean} is a JSX token + */ +function isJSXToken(node) { + return ( + node.kind >= SyntaxKind.JsxElement && + node.kind <= SyntaxKind.JsxAttribute + ); +} + +/** + * Returns true if the given TSNode.kind value corresponds to a type keyword + * @param {number} kind TypeScript SyntaxKind + * @returns {boolean} is a type keyword + */ +function isTypeKeyword(kind) { + switch (kind) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.VoidKeyword: + return true; + default: + return false; + } +} + +/** + * Returns the declaration kind of the given TSNode + * @param {TSNode} node TypeScript AST node + * @returns {string} declaration kind + */ +function getDeclarationKind(node) { + switch (node.kind) { + case SyntaxKind.TypeAliasDeclaration: + return "type"; + case SyntaxKind.VariableDeclarationList: + if (node.flags & ts.NodeFlags.Let) { + return "let"; + } + if (node.flags & ts.NodeFlags.Const) { + return "const"; + } + return "var"; + default: + throw "Unable to determine declaration kind."; + } +} + +/** + * Gets a TSNode's accessibility level + * @param {TSNode} node The TSNode + * @returns {string | null} accessibility "public", "protected", "private", or null + */ +function getTSNodeAccessibility(node) { + const modifiers = node.modifiers; + if (!modifiers) { + return null; + } + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i]; + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + return "public"; + case SyntaxKind.ProtectedKeyword: + return "protected"; + case SyntaxKind.PrivateKeyword: + return "private"; + default: + continue; + } + } + return null; +} + +/** + * Returns true if the given TSNode has the modifier flag set which corresponds + * to the static keyword. + * @param {TSNode} node The TSNode + * @returns {boolean} whether or not the static modifier flag is set + */ +function hasStaticModifierFlag(node) { + /** + * TODO: Remove dependency on private TypeScript method + */ + return Boolean(ts.getModifierFlags(node) & ts.ModifierFlags.Static); +} + +/** + * Finds the next token based on the previous one and its parent + * @param {TSToken} previousToken The previous TSToken + * @param {TSNode} parent The parent TSNode + * @returns {TSToken} the next TSToken + */ +function findNextToken(previousToken, parent) { + /** + * TODO: Remove dependency on private TypeScript method + */ + return ts.findNextToken(previousToken, parent); +} + +/** + * Find the first matching token based on the given predicate function. + * @param {TSToken} previousToken The previous TSToken + * @param {TSNode} parent The parent TSNode + * @param {Function} predicate The predicate function to apply to each checked token + * @returns {TSToken|undefined} a matching TSToken + */ +function findFirstMatchingToken(previousToken, parent, predicate) { + while (previousToken) { + if (predicate(previousToken)) { + return previousToken; + } + previousToken = findNextToken(previousToken, parent); + } + return undefined; +} + +/** + * Finds the first child TSNode which matches the given kind + * @param {TSNode} node The parent TSNode + * @param {number} kind The TSNode kind to match against + * @param {Object} sourceFile The full AST source file + * @returns {TSNode|undefined} a matching TSNode + */ +function findChildOfKind(node, kind, sourceFile) { + return findFirstMatchingChild(node, sourceFile, child => child.kind === kind); +} + +/** + * Find the first matching ancestor based on the given predicate function. + * @param {TSNode} node The current TSNode + * @param {Function} predicate The predicate function to apply to each checked ancestor + * @returns {TSNode|undefined} a matching parent TSNode + */ +function findFirstMatchingAncestor(node, predicate) { + while (node) { + if (predicate(node)) { + return node; + } + node = node.parent; + } + return undefined; +} + +/** + * Finds the first parent TSNode which mastches the given kind + * @param {TSNode} node The current TSNode + * @param {number} kind The TSNode kind to match against + * @returns {TSNode|undefined} a matching parent TSNode + */ +function findAncestorOfKind(node, kind) { + return findFirstMatchingAncestor(node, parent => parent.kind === kind); +} + + +/** + * Returns true if a given TSNode has a JSX token within its hierarchy + * @param {TSNode} node TSNode to be checked + * @returns {boolean} has JSX ancestor + */ +function hasJSXAncestor(node) { + return !!findFirstMatchingAncestor(node, isJSXToken); +} + +/** + * Unescape the text content of string literals, e.g. & -> & + * @param {string} text The escaped string literal text. + * @returns {string} The unescaped string literal text. + */ +function unescapeStringLiteralText(text) { + return unescape(text); +} + +/** + * Returns true if a given TSNode is a computed property + * @param {TSNode} node TSNode to be checked + * @returns {boolean} is Computed Property + */ +function isComputedProperty(node) { + return node.kind === SyntaxKind.ComputedPropertyName; +} + +/** + * Returns true if a given TSNode is optional (has QuestionToken) + * @param {TSNode} node TSNode to be checked + * @returns {boolean} is Optional + */ +function isOptional(node) { + return (node.questionToken) + ? (node.questionToken.kind === SyntaxKind.QuestionToken) : false; +} + +/** + * Returns true if the given TSNode is within the context of a "typeAnnotation", + * which effectively means - is it coming from its parent's `type` or `types` property + * @param {TSNode} node TSNode to be checked + * @returns {boolean} is within "typeAnnotation context" + */ +function isWithinTypeAnnotation(node) { + return node.parent.type === node || (node.parent.types && node.parent.types.indexOf(node) > -1); +} + +/** + * Fixes the exports of the given TSNode + * @param {TSNode} node the TSNode + * @param {Object} result result + * @param {Object} ast the AST + * @returns {TSNode} the TSNode with fixed exports + */ +function fixExports(node, result, ast) { + // check for exports + if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) { + const exportKeyword = node.modifiers[0], + nextModifier = node.modifiers[1], + lastModifier = node.modifiers[node.modifiers.length - 1], + declarationIsDefault = nextModifier && (nextModifier.kind === SyntaxKind.DefaultKeyword), + varToken = findNextToken(lastModifier, ast); + + result.range[0] = varToken.getStart(); + result.loc = getLocFor(result.range[0], result.range[1], ast); + + const declarationType = declarationIsDefault ? "ExportDefaultDeclaration" : "ExportNamedDeclaration"; + + const newResult = { + type: declarationType, + declaration: result, + range: [exportKeyword.getStart(), result.range[1]], + loc: getLocFor(exportKeyword.getStart(), result.range[1], ast) + }; + + if (!declarationIsDefault) { + newResult.specifiers = []; + newResult.source = null; + } + + return newResult; + + } + + return result; +} + +/** + * Returns the type of a given ESTreeToken + * @param {ESTreeToken} token the ESTreeToken + * @returns {string} the token type + */ +function getTokenType(token) { + // Need two checks for keywords since some are also identifiers + if (token.originalKeywordKind) { + + switch (token.originalKeywordKind) { + case SyntaxKind.NullKeyword: + return "Null"; + + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + case SyntaxKind.TypeKeyword: + case SyntaxKind.ModuleKeyword: + return "Identifier"; + + default: + return "Keyword"; + } + } + + if (token.kind >= SyntaxKind.FirstKeyword && token.kind <= SyntaxKind.LastFutureReservedWord) { + if (token.kind === SyntaxKind.FalseKeyword || token.kind === SyntaxKind.TrueKeyword) { + return "Boolean"; + } + + return "Keyword"; + } + + if (token.kind >= SyntaxKind.FirstPunctuation && token.kind <= SyntaxKind.LastBinaryOperator) { + return "Punctuator"; + } + + if (token.kind >= SyntaxKind.NoSubstitutionTemplateLiteral && token.kind <= SyntaxKind.TemplateTail) { + return "Template"; + } + + switch (token.kind) { + case SyntaxKind.NumericLiteral: + return "Numeric"; + + case SyntaxKind.JsxText: + return "JSXText"; + + case SyntaxKind.StringLiteral: + + // A TypeScript-StringLiteral token with a TypeScript-JsxAttribute or TypeScript-JsxElement parent, + // must actually be an ESTree-JSXText token + if (token.parent && (token.parent.kind === SyntaxKind.JsxAttribute || token.parent.kind === SyntaxKind.JsxElement)) { + return "JSXText"; + } + + return "String"; + + case SyntaxKind.RegularExpressionLiteral: + return "RegularExpression"; + + case SyntaxKind.Identifier: + case SyntaxKind.ConstructorKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + + // falls through + default: + } + + // Some JSX tokens have to be determined based on their parent + if (token.parent) { + if (token.kind === SyntaxKind.Identifier && token.parent.kind === SyntaxKind.PropertyAccessExpression && hasJSXAncestor(token)) { + return "JSXIdentifier"; + } + + if (isJSXToken(token.parent)) { + if (token.kind === SyntaxKind.PropertyAccessExpression) { + return "JSXMemberExpression"; + } + + if (token.kind === SyntaxKind.Identifier) { + return "JSXIdentifier"; + } + } + } + + return "Identifier"; +} + +/** + * Extends and formats a given ESTreeToken, for a given AST + * @param {ESTreeToken} token the ESTreeToken + * @param {Object} ast the AST object + * @returns {ESTreeToken} the converted ESTreeToken + */ +function convertToken(token, ast) { + const start = (token.kind === SyntaxKind.JsxText) ? token.getFullStart() : token.getStart(), + end = token.getEnd(), + value = ast.text.slice(start, end), + newToken = { + type: getTokenType(token), + value, + range: [start, end], + loc: getLocFor(start, end, ast) + }; + + if (newToken.type === "RegularExpression") { + newToken.regex = { + pattern: value.slice(1, value.lastIndexOf("/")), + flags: value.slice(value.lastIndexOf("/") + 1) + }; + } + + return newToken; +} + +/** + * Converts all tokens for the given AST + * @param {Object} ast the AST object + * @returns {ESTreeToken[]} the converted ESTreeTokens + */ +function convertTokens(ast) { + const result = []; + /** + * @param {TSNode} node the TSNode + * @returns {undefined} + */ + function walk(node) { + // TypeScript generates tokens for types in JSDoc blocks. Comment tokens + // and their children should not be walked or added to the resulting tokens list. + if (isComment(node) || isJSDocComment(node)) { + return; + } + + if (isToken(node) && node.kind !== SyntaxKind.EndOfFileToken) { + const converted = convertToken(node, ast); + + if (converted) { + result.push(converted); + } + } else { + node.getChildren().forEach(walk); + } + } + walk(ast); + return result; +} + +/** + * Get container token node between range + * @param {Object} ast the AST object + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @returns {TSToken} typescript container token + * @private + */ +function getNodeContainer(ast, start, end) { + let container = null; + + /** + * @param {TSNode} node the TSNode + * @returns {undefined} + */ + function walk(node) { + const nodeStart = node.pos; + const nodeEnd = node.end; + + if (start >= nodeStart && end <= nodeEnd) { + if (isToken(node)) { + container = node; + } else { + node.getChildren().forEach(walk); + } + } + } + walk(ast); + + return container; +} + +/** + * @param {Object} ast the AST object + * @param {int} start the index at which the error starts + * @param {string} message the error message + * @returns {Object} converted error object + */ +function createError(ast, start, message) { + const loc = ast.getLineAndCharacterOfPosition(start); + return { + index: start, + lineNumber: loc.line + 1, + column: loc.character, + message + }; +} diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json new file mode 100644 index 000000000000..2f0895cdd49d --- /dev/null +++ b/packages/typescript-estree/package.json @@ -0,0 +1,73 @@ +{ + "name": "typescript-estree", + "description": "A parser that converts TypeScript source code into an ESTree compatible form", + "homepage": "https://github.com/JamesHenry/typescript-estree", + "main": "parser.js", + "version": "0.0.0-development", + "files": [ + "lib", + "parser.js" + ], + "engines": { + "node": ">=6.14.0" + }, + "repository": "JamesHenry/typescript-estree", + "bugs": { + "url": "https://github.com/JamesHenry/typescript-estree/issues" + }, + "license": "BSD-2-Clause", + "devDependencies": { + "babel-code-frame": "6.26.0", + "babylon": "7.0.0-beta.39", + "cz-conventional-changelog": "2.1.0", + "glob": "7.1.2", + "husky": "0.14.3", + "jest": "23.1.0", + "lint-staged": "7.3.0", + "lodash.isplainobject": "4.0.6", + "semantic-release": "^15.9.16", + "shelljs": "0.8.2", + "typescript": "~3.0.1", + "travis-deploy-once": "^5.0.8" + }, + "keywords": [ + "ast", + "estree", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax" + ], + "scripts": { + "test": "npm run unit-tests && npm run ast-alignment-tests", + "unit-tests": "jest", + "ast-alignment-tests": "jest --config=./tests/ast-alignment/jest.config.js", + "precommit": "npm test && lint-staged", + "cz": "git-cz", + "semantic-release": "semantic-release", + "travis-deploy-once": "travis-deploy-once" + }, + "dependencies": { + "lodash.unescape": "4.0.1", + "semver": "5.5.0" + }, + "peerDependencies": { + "typescript": "*" + }, + "lint-staged": {}, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + }, + "jest": { + "testEnvironment": "node", + "testRegex": "tests/lib/.+\\.js$", + "testPathIgnorePatterns": [], + "collectCoverage": true, + "coverageReporters": [ + "text-summary" + ] + } +} diff --git a/packages/typescript-estree/parser.js b/packages/typescript-estree/parser.js new file mode 100644 index 000000000000..cbab9a789326 --- /dev/null +++ b/packages/typescript-estree/parser.js @@ -0,0 +1,181 @@ +/** + * @fileoverview Parser that converts TypeScript into ESTree format. + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +const astNodeTypes = require("./lib/ast-node-types"), + ts = require("typescript"), + convert = require("./lib/ast-converter"), + semver = require("semver"); + +const SUPPORTED_TYPESCRIPT_VERSIONS = require("./package.json").devDependencies.typescript; +const ACTIVE_TYPESCRIPT_VERSION = ts.version; +const isRunningSupportedTypeScriptVersion = semver.satisfies(ACTIVE_TYPESCRIPT_VERSION, SUPPORTED_TYPESCRIPT_VERSIONS); + +let extra; +let warnedAboutTSVersion = false; + +/** + * Resets the extra config object + * @returns {void} + */ +function resetExtra() { + extra = { + tokens: null, + range: false, + loc: false, + comment: false, + comments: [], + tolerant: false, + errors: [], + strict: false, + ecmaFeatures: {}, + useJSXTextNode: false, + log: console.log + }; +} + +//------------------------------------------------------------------------------ +// Parser +//------------------------------------------------------------------------------ + +/** + * Parses the given source code to produce a valid AST + * @param {mixed} code TypeScript code + * @param {Object} options configuration object for the parser + * @returns {Object} the AST + */ +function generateAST(code, options) { + const toString = String; + + if (typeof code !== "string" && !(code instanceof String)) { + code = toString(code); + } + + resetExtra(); + + if (typeof options !== "undefined") { + extra.range = (typeof options.range === "boolean") && options.range; + extra.loc = (typeof options.loc === "boolean") && options.loc; + + if (extra.loc && options.source !== null && options.source !== undefined) { + extra.source = toString(options.source); + } + + if (typeof options.tokens === "boolean" && options.tokens) { + extra.tokens = []; + } + if (typeof options.comment === "boolean" && options.comment) { + extra.comment = true; + extra.comments = []; + } + if (typeof options.tolerant === "boolean" && options.tolerant) { + extra.errors = []; + } + + if (options.ecmaFeatures && typeof options.ecmaFeatures === "object") { + // pass through jsx option + extra.ecmaFeatures.jsx = options.ecmaFeatures.jsx; + } + + /** + * Allow the user to cause the parser to error if it encounters an unknown AST Node Type + * (used in testing). + */ + if (options.errorOnUnknownASTType) { + extra.errorOnUnknownASTType = true; + } + + if (typeof options.useJSXTextNode === "boolean" && options.useJSXTextNode) { + extra.useJSXTextNode = true; + } + + /** + * Allow the user to override the function used for logging + */ + if (typeof options.loggerFn === "function") { + extra.log = options.loggerFn; + } else if (options.loggerFn === false) { + extra.log = Function.prototype; + } + } + + if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { + const border = "============="; + const versionWarning = [ + border, + "WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.", + "You may find that it works just fine, or you may not.", + `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, + `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, + "Please only submit bug reports when using the officially supported version.", + border + ]; + extra.log(versionWarning.join("\n\n")); + warnedAboutTSVersion = true; + } + + // Even if jsx option is set in typescript compiler, filename still has to + // contain .tsx file extension + const FILENAME = (extra.ecmaFeatures.jsx) ? "estree.tsx" : "estree.ts"; + + const compilerHost = { + fileExists() { + return true; + }, + getCanonicalFileName() { + return FILENAME; + }, + getCurrentDirectory() { + return ""; + }, + getDefaultLibFileName() { + return "lib.d.ts"; + }, + + // TODO: Support Windows CRLF + getNewLine() { + return "\n"; + }, + getSourceFile(filename) { + return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true); + }, + readFile() { + return null; + }, + useCaseSensitiveFileNames() { + return true; + }, + writeFile() { + return null; + } + }; + + const program = ts.createProgram([FILENAME], { + noResolve: true, + target: ts.ScriptTarget.Latest, + jsx: extra.ecmaFeatures.jsx ? "preserve" : undefined + }, compilerHost); + + const ast = program.getSourceFile(FILENAME); + + extra.code = code; + return convert(ast, extra); +} + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +exports.version = require("./package.json").version; + +exports.parse = function parse(code, options) { + return generateAST(code, options); +}; + +exports.AST_NODE_TYPES = astNodeTypes; diff --git a/packages/typescript-estree/tests/ast-alignment/.eslintrc.yml b/packages/typescript-estree/tests/ast-alignment/.eslintrc.yml new file mode 100644 index 000000000000..e19b2cfa824a --- /dev/null +++ b/packages/typescript-estree/tests/ast-alignment/.eslintrc.yml @@ -0,0 +1,2 @@ +env: + jest: true diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js new file mode 100644 index 000000000000..6461434f0235 --- /dev/null +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js @@ -0,0 +1,523 @@ +"use strict"; + +const path = require("path"); +const glob = require("glob"); + +/** + * JSX fixtures which have known issues for typescript-estree + */ +const jsxFilesWithKnownIssues = require("../jsx-known-issues").map(f => f.replace("jsx/", "")); + +/** + * Current random error difference on jsx/invalid-no-tag-name.src.js + * TSEP - SyntaxError + * Babylon - RangeError + * + * Reported here: https://github.com/babel/babylon/issues/674 + */ +jsxFilesWithKnownIssues.push("invalid-no-tag-name"); + +/** + * Custom constructs/concepts used in this file: + * + * type Pattern = string; // used for node-glob matching + * + * interface FixturePatternConfig { + * pattern: Pattern, + * config?: { + * babylonParserOptions: any, + * typeScriptESTreeOptions: any + * } + * } + */ + +/** + * Globally track which fixtures need to be parsed with sourceType: "module" + * so that they can be added with the correct FixturePatternConfig + */ +let fixturesRequiringSourceTypeModule = []; + +/** + * Utility to generate a FixturePatternConfig object containing the glob pattern for specific subsections of the fixtures/ directory, + * including the capability to ignore specific nested patterns. + * + * @param {string} fixturesSubPath the sub-path within the fixtures/ directory + * @param {Object?} config an optional configuration object with optional sub-paths to ignore and/or parse with sourceType: module + * @returns {FixturePatternConfig} an object containing the glob pattern and optional additional config + */ +function createFixturePatternConfigFor(fixturesSubPath, config) { + if (!fixturesSubPath) { + return ""; + } + config = config || {}; + config.ignore = config.ignore || []; + config.fileType = config.fileType || "js"; + config.parseWithSourceTypeModule = config.parseWithSourceTypeModule || []; + /** + * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". + * Babylon does not have an equivalent feature (although perhaps it might come in the future https://github.com/babel/babylon/issues/440), + * so we have to specify the "sourceType" we want to use. + * + * By default we have configured babylon to use "script", but for any fixtures specified in the parseWithSourceTypeModule array we need "module". + * + * First merge the fixtures which need to be parsed with sourceType: "module" into the + * ignore list, and then add their full config into the global array. + */ + if (config.parseWithSourceTypeModule.length) { + config.ignore = [].concat(config.ignore, config.parseWithSourceTypeModule); + fixturesRequiringSourceTypeModule = [].concat(fixturesRequiringSourceTypeModule, config.parseWithSourceTypeModule.map( + fixture => ({ + // It needs to be the full path from within fixtures/ for the pattern + pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, + config: { babylonParserOptions: { sourceType: "module" } } + }) + )); + } + return { + pattern: `${fixturesSubPath}/!(${config.ignore.join("|")}).src.${config.fileType}` + }; +} + +/** + * An array of FixturePatternConfigs + */ +let fixturePatternConfigsToTest = [ + createFixturePatternConfigFor("basics"), + + createFixturePatternConfigFor("comments", { + ignore: [ + "export-default-anonymous-class", // needs to be parsed with `sourceType: "module"` + /** + * Template strings seem to also be affected by the difference in opinion between different parsers in: + * https://github.com/babel/babylon/issues/673 + */ + "no-comment-template", // Purely AST diffs + "template-string-block" // Purely AST diffs + ] + }), + + createFixturePatternConfigFor("ecma-features/templateStrings", { + ignore: [ + "**/*" + ] + }), + + createFixturePatternConfigFor("ecma-features/experimentalObjectRestSpread", { + ignore: [ + /** + * Trailing comma is not permitted after a "RestElement" in Babylon + */ + "invalid-rest-trailing-comma" + ] + }), + + createFixturePatternConfigFor("ecma-features/arrowFunctions", { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "error-dup-params", // babylon parse errors + "error-dup-params", // babylon parse errors + "error-strict-dup-params", // babylon parse errors + "error-strict-octal", // babylon parse errors + "error-two-lines" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/binaryLiterals"), + createFixturePatternConfigFor("ecma-features/blockBindings"), + + createFixturePatternConfigFor("ecma-features/classes", { + ignore: [ + /** + * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. + */ + "class-one-method-super", // babylon parse errors + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "invalid-class-declaration", // babylon parse errors + "invalid-class-setter-declaration" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/defaultParams"), + + createFixturePatternConfigFor("ecma-features/destructuring", { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "invalid-defaults-object-assign" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/destructuring-and-arrowFunctions"), + createFixturePatternConfigFor("ecma-features/destructuring-and-blockBindings"), + createFixturePatternConfigFor("ecma-features/destructuring-and-defaultParams"), + createFixturePatternConfigFor("ecma-features/destructuring-and-forOf"), + + createFixturePatternConfigFor("ecma-features/destructuring-and-spread", { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "error-complex-destructured-spread-first" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/experimentalAsyncIteration"), + createFixturePatternConfigFor("ecma-features/experimentalDynamicImport"), + createFixturePatternConfigFor("ecma-features/exponentiationOperators"), + + createFixturePatternConfigFor("ecma-features/forOf", { + ignore: [ + /** + * TypeScript, espree and acorn parse this fine - esprima, flow and babylon do not... + */ + "for-of-with-function-initializer" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/generators"), + createFixturePatternConfigFor("ecma-features/globalReturn"), + + createFixturePatternConfigFor("ecma-features/modules", { + ignore: [ + /** + * TypeScript, flow and babylon parse this fine - esprima, espree and acorn do not... + */ + "invalid-export-default", // typescript-estree parse errors + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "invalid-export-named-default", // babylon parse errors + "invalid-import-default-module-specifier", // babylon parse errors + "invalid-import-module-specifier", // babylon parse errors + /** + * Deleting local variable in strict mode + */ + "error-delete", // babylon parse errors + /** + * 'with' in strict mode + */ + "error-strict" // babylon parse errors + ], + parseWithSourceTypeModule: [ + "export-default-array", + "export-default-class", + "export-default-expression", + "export-default-function", + "export-default-named-class", + "export-default-named-function", + "export-default-number", + "export-default-object", + "export-default-value", + "export-from-batch", + "export-from-default", + "export-from-named-as-default", + "export-from-named-as-specifier", + "export-from-named-as-specifiers", + "export-from-specifier", + "export-from-specifiers", + "export-function", + "export-named-as-default", + "export-named-as-specifier", + "export-named-as-specifiers", + "export-named-class", + "export-named-empty", + "export-named-specifier", + "export-named-specifiers-comma", + "export-named-specifiers", + "export-var-anonymous-function", + "export-var-number", + "export-var", + "import-default-and-named-specifiers", + "import-default-and-namespace-specifiers", + "import-default-as", + "import-default", + "import-jquery", + "import-module", + "import-named-as-specifier", + "import-named-as-specifiers", + "import-named-empty", + "import-named-specifier", + "import-named-specifiers-comma", + "import-named-specifiers", + "import-namespace-specifier", + "import-null-as-nil", + "invalid-await", + "invalid-class" + ] + }), + + createFixturePatternConfigFor("ecma-features/newTarget", { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "invalid-new-target", // babylon parse errors + "invalid-unknown-property" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/objectLiteralComputedProperties"), + + createFixturePatternConfigFor("ecma-features/objectLiteralDuplicateProperties", { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "error-proto-property", // babylon parse errors + "error-proto-string-property" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/objectLiteralShorthandMethods"), + createFixturePatternConfigFor("ecma-features/objectLiteralShorthandProperties"), + createFixturePatternConfigFor("ecma-features/octalLiterals"), + createFixturePatternConfigFor("ecma-features/regex"), + createFixturePatternConfigFor("ecma-features/regexUFlag"), + createFixturePatternConfigFor("ecma-features/regexYFlag"), + + createFixturePatternConfigFor("ecma-features/restParams", { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + "error-no-default", // babylon parse errors + "error-not-last" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("ecma-features/spread"), + createFixturePatternConfigFor("ecma-features/unicodeCodePointEscapes"), + createFixturePatternConfigFor("jsx", { ignore: jsxFilesWithKnownIssues }), + createFixturePatternConfigFor("jsx-useJSXTextNode"), + + /* ================================================== */ + + /** + * TSX-SPECIFIC FILES + */ + + createFixturePatternConfigFor("tsx", { + fileType: "tsx", + ignore: [ + /** + * AST difference + */ + "react-typed-props", + /** + * currently babylon not supported + */ + "generic-jsx-element" + ] + }), + + /* ================================================== */ + + /** + * TYPESCRIPT-SPECIFIC FILES + */ + + createFixturePatternConfigFor("typescript/babylon-convergence", { fileType: "ts" }), + + createFixturePatternConfigFor("typescript/basics", { + fileType: "ts", + ignore: [ + /** + * Other babylon parse errors relating to invalid syntax. + */ + "abstract-class-with-abstract-constructor", // babylon parse errors + "class-with-export-parameter-properties", // babylon parse errors + "class-with-optional-methods", // babylon parse errors + "class-with-static-parameter-properties", // babylon parse errors + "interface-with-all-property-types", // babylon parse errors + "interface-with-construct-signature-with-parameter-accessibility", // babylon parse errors + "class-with-implements-and-extends", // babylon parse errors + "var-with-definite-assignment", // babylon parse errors + "class-with-definite-assignment", // babylon parse errors + /** + * typescript-estree erroring, but babylon not. + */ + "arrow-function-with-type-parameters", // typescript-estree parse errors + /** + * Babylon: ClassDeclaration + abstract: true + * tsep: TSAbstractClassDeclaration + */ + "abstract-class-with-abstract-properties", + /** + * Babylon: ClassProperty + abstract: true + * tsep: TSAbstractClassProperty + */ + "abstract-class-with-abstract-readonly-property", + /** + * Babylon: TSExpressionWithTypeArguments + * tsep: ClassImplements + */ + "class-with-implements-generic-multiple", + "class-with-implements-generic", + "class-with-implements", + "class-with-extends-and-implements", + /** + * Babylon: TSDeclareFunction + declare: true + * tsep: DeclareFunction + */ + "declare-function", + /** + * Other major AST differences (e.g. fundamentally different node types) + */ + "class-with-mixin", + "function-with-types-assignation", + "interface-extends-multiple", + "interface-extends", + "interface-type-parameters", + "interface-with-extends-type-parameters", + "interface-with-generic", + "interface-with-jsdoc", + "interface-with-optional-properties", + "interface-without-type-annotation", + "type-alias-declaration-with-constrained-type-parameter", + "type-alias-declaration", + "type-alias-object-without-annotation", + "typed-this", + "export-type-function-declaration", + "export-type-class-declaration", + "abstract-interface", + "export-type-alias-declaration", + "unique-symbol", + "keyof-operator", + /** + * tsep bug - Program.body[0].expression.left.properties[0].value.right is currently showing up + * as `ArrayPattern`, babylon, acorn and espree say it should be `ArrayExpression` + * TODO: Fix this + */ + "destructuring-assignment", + /** + * Babylon bug for optional or abstract methods? + */ + "abstract-class-with-abstract-method", // babylon parse errors + "abstract-class-with-optional-method", // babylon parse errors + "declare-class-with-optional-method", // babylon parse errors + /** + * Awaiting feedback on Babylon issue https://github.com/babel/babylon/issues/700 + */ + "class-with-private-parameter-properties", + "class-with-protected-parameter-properties", + "class-with-public-parameter-properties", + "class-with-readonly-parameter-properties", + /** + * Not yet supported in Babylon https://github.com/babel/babel/issues/7749 + */ + "import-type", + "import-type-with-type-parameters-in-type-reference" + ], + parseWithSourceTypeModule: [ + "export-named-enum", + "export-assignment", + "export-default-class-with-generic", + "export-default-class-with-multiple-generics", + "export-named-class-with-generic", + "export-named-class-with-multiple-generics" + ] + }), + + createFixturePatternConfigFor("typescript/decorators/accessor-decorators", { fileType: "ts" }), + createFixturePatternConfigFor("typescript/decorators/class-decorators", { fileType: "ts" }), + createFixturePatternConfigFor("typescript/decorators/method-decorators", { fileType: "ts" }), + createFixturePatternConfigFor("typescript/decorators/parameter-decorators", { fileType: "ts" }), + createFixturePatternConfigFor("typescript/decorators/property-decorators", { fileType: "ts" }), + + createFixturePatternConfigFor("typescript/expressions", { + fileType: "ts", + ignore: [ + /** + * currently babylon not supported + */ + "tagged-template-expression-type-arguments" + ] + }), + + createFixturePatternConfigFor("typescript/errorRecovery", { + fileType: "ts", + ignore: [ + /** + * AST difference + */ + "interface-empty-extends", + /** + * TypeScript-specific tests taken from "errorRecovery". Babylon is not being as forgiving as the TypeScript compiler here. + */ + "class-empty-extends-implements", // babylon parse errors + "class-empty-extends", // babylon parse errors + "decorator-on-enum-declaration", // babylon parse errors + "decorator-on-interface-declaration", // babylon parse errors + "interface-property-modifiers", // babylon parse errors + "enum-with-keywords" // babylon parse errors + ] + }), + + createFixturePatternConfigFor("typescript/namespaces-and-modules", { + fileType: "ts", + ignore: [ + /** + * Minor AST difference + */ + "nested-internal-module", + /** + * Babylon: TSDeclareFunction + * tsep: TSNamespaceFunctionDeclaration + */ + "declare-namespace-with-exported-function" + ] + }) +]; + +/** + * Add in all the fixtures which need to be parsed with sourceType: "module" + */ +fixturePatternConfigsToTest = [].concat(fixturePatternConfigsToTest, fixturesRequiringSourceTypeModule); + +/** + * interface Fixture { + * filename: string, + * config?: any + * } + */ +const fixturesToTest = []; +const fixturesDirPath = path.join(__dirname, "../fixtures"); + +/** + * Resolve the glob patterns into actual Fixture files that we can run assertions for... + */ +fixturePatternConfigsToTest.forEach(fixturePatternConfig => { + /** + * Find the fixture files which match the given pattern + */ + const matchingFixtures = glob.sync(`${fixturesDirPath}/${fixturePatternConfig.pattern}`, {}); + matchingFixtures.forEach(filename => { + fixturesToTest.push({ + filename, + config: fixturePatternConfig.config + }); + }); +}); + +module.exports = fixturesToTest; diff --git a/packages/typescript-estree/tests/ast-alignment/jest.config.js b/packages/typescript-estree/tests/ast-alignment/jest.config.js new file mode 100644 index 000000000000..2a310d0ddf36 --- /dev/null +++ b/packages/typescript-estree/tests/ast-alignment/jest.config.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = { + testEnvironment: "node", + testRegex: "spec\\.js$" +}; diff --git a/packages/typescript-estree/tests/ast-alignment/parse.js b/packages/typescript-estree/tests/ast-alignment/parse.js new file mode 100644 index 000000000000..3dc7d7a07627 --- /dev/null +++ b/packages/typescript-estree/tests/ast-alignment/parse.js @@ -0,0 +1,96 @@ +"use strict"; + +const codeFrame = require("babel-code-frame"); +const parseUtils = require("./utils"); + +function createError(message, line, column) { + // Construct an error similar to the ones thrown by Babylon. + const error = new SyntaxError(`${message} (${line}:${column})`); + error.loc = { + line, + column + }; + return error; +} + +function parseWithBabylonPluginTypescript(text, parserOptions) { + parserOptions = parserOptions || {}; + const babylon = require("babylon"); + return babylon.parse(text, Object.assign({ + sourceType: "script", + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + ranges: true, + plugins: [ + "jsx", + "typescript", + "objectRestSpread", + "decorators", + "classProperties", + "asyncGenerators", + "dynamicImport", + "estree" + ] + }, parserOptions)); +} + +function parseWithTypeScriptESTree(text, parserOptions) { + parserOptions = parserOptions || {}; + const parser = require("../../parser"); + try { + return parser.parse(text, Object.assign({ + loc: true, + range: true, + tokens: false, + comment: false, + useJSXTextNode: true, + errorOnUnknownASTType: true, + ecmaFeatures: { + jsx: true + } + }, parserOptions)); + } catch (e) { + throw createError( + e.message, + e.lineNumber, + e.column + ); + } +} + +module.exports = function parse(text, opts) { + + /** + * Always return a consistent interface, there will be times when we expect both + * parsers to fail to parse the invalid source. + */ + const result = { + parseError: null, + ast: null + }; + + try { + switch (opts.parser) { + case "typescript-estree": + result.ast = parseUtils.normalizeNodeTypes(parseWithTypeScriptESTree(text, opts.typeScriptESTreeOptions)); + break; + case "babylon-plugin-typescript": + result.ast = parseUtils.normalizeNodeTypes(parseWithBabylonPluginTypescript(text, opts.babylonParserOptions)); + break; + default: + throw new Error("Please provide a valid parser: either \"typescript-estree\" or \"babylon-plugin-typescript\""); + } + } catch (error) { + const loc = error.loc; + if (loc) { + error.codeFrame = codeFrame(text, loc.line, loc.column + 1, { + highlightCode: true + }); + error.message += `\n${error.codeFrame}`; + } + result.parseError = error; + } + + return result; + +}; diff --git a/packages/typescript-estree/tests/ast-alignment/spec.js b/packages/typescript-estree/tests/ast-alignment/spec.js new file mode 100644 index 000000000000..562a5a39d175 --- /dev/null +++ b/packages/typescript-estree/tests/ast-alignment/spec.js @@ -0,0 +1,80 @@ +"use strict"; + +const fs = require("fs"); + +const parse = require("./parse"); +const parseUtils = require("./utils"); +const fixturesToTest = require("./fixtures-to-test"); + +fixturesToTest.forEach(fixture => { + + const filename = fixture.filename; + const source = fs.readFileSync(filename, "utf8").replace(/\r\n/g, "\n"); + + /** + * Parse with typescript-estree + */ + const typeScriptESTreeResult = parse(source, { + parser: "typescript-estree", + typeScriptESTreeOptions: (fixture.config && fixture.config.typeScriptESTreeOptions) ? fixture.config.typeScriptESTreeOptions : null + }); + + /** + * Parse the source with babylon typescript-plugin + */ + const babylonTypeScriptPluginResult = parse(source, { + parser: "babylon-plugin-typescript", + babylonParserOptions: (fixture.config && fixture.config.babylonParserOptions) ? fixture.config.babylonParserOptions : null + }); + + /** + * If babylon fails to parse the source, ensure that typescript-estree has the same fundamental issue + */ + if (babylonTypeScriptPluginResult.parseError) { + /** + * FAIL: babylon errored but typescript-estree did not + */ + if (!typeScriptESTreeResult.parseError) { + test(`TEST FAIL [BABYLON ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { + expect(typeScriptESTreeResult.parseError).toEqual(babylonTypeScriptPluginResult.parseError); + }); + return; + } + /** + * Both parsers errored - this is OK as long as the errors are of the same "type" + */ + test(`[Both parsers error as expected] - ${filename}`, () => { + expect(babylonTypeScriptPluginResult.parseError.name).toEqual(typeScriptESTreeResult.parseError.name); + }); + return; + } + + /** + * FAIL: typescript-estree errored but babylon did not + */ + if (typeScriptESTreeResult.parseError) { + test(`TEST FAIL [TSEP ERRORED, BUT BABYLON DID NOT] - ${filename}`, () => { + expect(babylonTypeScriptPluginResult.parseError).toEqual(typeScriptESTreeResult.parseError); + }); + return; + } + + /** + * No errors, assert the two ASTs match + */ + test(`${filename}`, () => { + expect(babylonTypeScriptPluginResult.ast).toBeTruthy(); + expect(typeScriptESTreeResult.ast).toBeTruthy(); + /** + * Perform some extra formatting steps on the babylon AST before comparing + */ + expect( + parseUtils.removeLocationDataFromProgramNode( + parseUtils.preprocessBabylonAST(babylonTypeScriptPluginResult.ast) + ) + ).toEqual( + parseUtils.removeLocationDataFromProgramNode(typeScriptESTreeResult.ast) + ); + }); + +}); diff --git a/packages/typescript-estree/tests/ast-alignment/utils.js b/packages/typescript-estree/tests/ast-alignment/utils.js new file mode 100644 index 000000000000..9e6aea5bdc94 --- /dev/null +++ b/packages/typescript-estree/tests/ast-alignment/utils.js @@ -0,0 +1,152 @@ +"use strict"; + +const isPlainObject = require("lodash.isplainobject"); + +/** + * By default, pretty-format (within Jest matchers) retains the names/types of nodes from the babylon AST, + * quick and dirty way to avoid that is to JSON.stringify and then JSON.parser the + * ASTs before comparing them with pretty-format + * + * @param {Object} ast raw AST + * @returns {Object} normalized AST + */ +function normalizeNodeTypes(ast) { + return JSON.parse(JSON.stringify(ast)); +} + +/** + * Removes the given keys from the given AST object recursively + * @param {Object} obj A JavaScript object to remove keys from + * @param {Object[]} keysToOmit Names and predicate functions use to determine what keys to omit from the final object + * @returns {Object} formatted object + */ +function omitDeep(obj, keysToOmit) { + keysToOmit = keysToOmit || []; + function shouldOmit(keyName, val) { + if (!keysToOmit || !keysToOmit.length) { + return false; + } + for (const keyConfig of keysToOmit) { + if (keyConfig.key !== keyName) { + continue; + } + return keyConfig.predicate(val); + } + return false; + } + + for (const key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + const val = obj[key]; + if (isPlainObject(val)) { + if (shouldOmit(key, val)) { + delete obj[key]; + // re-run with the same arguments + // in case the object has multiple keys to omit + return omitDeep(obj, keysToOmit); + } + omitDeep(val, keysToOmit); + } else if (Array.isArray(val)) { + if (shouldOmit(key, val)) { + delete obj[key]; + // re-run with the same arguments + // in case the object has multiple keys to omit + return omitDeep(obj, keysToOmit); + } + for (const i of val) { + omitDeep(i, keysToOmit); + } + } else if (shouldOmit(key, val)) { + delete obj[key]; + // re-run with the same arguments + // in case the object has multiple keys to omit + return omitDeep(obj, keysToOmit); + } + } + return obj; +} + +/** + * Common predicates for Babylon AST preprocessing + */ +const always = () => true; +const ifNumber = (val) => typeof val === "number"; + +/** + * - Babylon wraps the "Program" node in an extra "File" node, normalize this for simplicity for now... + * - Remove "start" and "end" values from Babylon nodes to reduce unimportant noise in diffs ("loc" data will still be in + * each final AST and compared). + * + * @param {Object} ast raw babylon AST + * @returns {Object} processed babylon AST + */ +function preprocessBabylonAST(ast) { + return omitDeep(ast.program, [ + { + key: "start", + // only remove the "start" number (not the "start" object within loc) + predicate: ifNumber + }, + { + key: "end", + // only remove the "end" number (not the "end" object within loc) + predicate: ifNumber + }, + { + key: "identifierName", + predicate: always + }, + { + key: "extra", + predicate: always + }, + { + key: "directives", + predicate: always + }, + { + key: "directive", + predicate: always + }, + { + key: "innerComments", + predicate: always + }, + { + key: "leadingComments", + predicate: always + }, + { + key: "trailingComments", + predicate: always + }, + { + key: "guardedHandlers", + predicate: always + } + ]); +} + +/** + * There is currently a really awkward difference in location data for Program nodes + * between different parsers in the ecosystem. Hack around this by removing the data + * before comparing the ASTs. + * + * See: https://github.com/babel/babylon/issues/673 + * + * @param {Object} ast the raw AST with a Program node at its top level + * @returns {Object} the ast with the location data removed from the Program node + */ +function removeLocationDataFromProgramNode(ast) { + delete ast.loc; + delete ast.range; + return ast; +} + +module.exports = { + normalizeNodeTypes, + preprocessBabylonAST, + removeLocationDataFromProgramNode +}; diff --git a/packages/typescript-estree/tests/fixtures/basics/delete-expression.src.js b/packages/typescript-estree/tests/fixtures/basics/delete-expression.src.js new file mode 100644 index 000000000000..23cb06466d66 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/delete-expression.src.js @@ -0,0 +1 @@ +delete foo.bar; diff --git a/packages/typescript-estree/tests/fixtures/basics/do-while-statements.src.js b/packages/typescript-estree/tests/fixtures/basics/do-while-statements.src.js new file mode 100644 index 000000000000..f2c72e8efc56 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/do-while-statements.src.js @@ -0,0 +1,6 @@ +do; while(1); + +var i = 0; +do { + i += 1; +} while (i < 5); diff --git a/packages/typescript-estree/tests/fixtures/basics/identifiers-double-underscore.src.js b/packages/typescript-estree/tests/fixtures/basics/identifiers-double-underscore.src.js new file mode 100644 index 000000000000..b765d562e143 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/identifiers-double-underscore.src.js @@ -0,0 +1,9 @@ +var __test = 'ff'; + +class __Foo { + +} + +function __Bar() { + +} diff --git a/packages/typescript-estree/tests/fixtures/basics/instanceof.src.js b/packages/typescript-estree/tests/fixtures/basics/instanceof.src.js new file mode 100644 index 000000000000..909f769f83de --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/instanceof.src.js @@ -0,0 +1 @@ +'' instanceof Set \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/basics/new-with-member-expression.src.js b/packages/typescript-estree/tests/fixtures/basics/new-with-member-expression.src.js new file mode 100644 index 000000000000..01c67fc786c0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/new-with-member-expression.src.js @@ -0,0 +1 @@ +new foo.bar(); diff --git a/packages/typescript-estree/tests/fixtures/basics/new-without-parens.src.js b/packages/typescript-estree/tests/fixtures/basics/new-without-parens.src.js new file mode 100644 index 000000000000..fd30dda06abe --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/new-without-parens.src.js @@ -0,0 +1,2 @@ +function X () {} +new X; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/basics/typeof-expression.src.js b/packages/typescript-estree/tests/fixtures/basics/typeof-expression.src.js new file mode 100644 index 000000000000..43d0ea77840c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/typeof-expression.src.js @@ -0,0 +1 @@ +typeof 'str' diff --git a/packages/typescript-estree/tests/fixtures/basics/update-expression.src.js b/packages/typescript-estree/tests/fixtures/basics/update-expression.src.js new file mode 100644 index 000000000000..1c94b625bd2e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/update-expression.src.js @@ -0,0 +1,5 @@ +var i = 0; +function f() { + i++; +} +f(); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/basics/void-expression.src.js b/packages/typescript-estree/tests/fixtures/basics/void-expression.src.js new file mode 100644 index 000000000000..7da947c9a451 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/basics/void-expression.src.js @@ -0,0 +1,2 @@ +void 4; +void(3); diff --git a/packages/typescript-estree/tests/fixtures/comments/block-trailing-comment.src.js b/packages/typescript-estree/tests/fixtures/comments/block-trailing-comment.src.js new file mode 100644 index 000000000000..2a6819ff0b13 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/block-trailing-comment.src.js @@ -0,0 +1,4 @@ +{ + a(); + //comment +} diff --git a/packages/typescript-estree/tests/fixtures/comments/comment-within-condition.src.js b/packages/typescript-estree/tests/fixtures/comments/comment-within-condition.src.js new file mode 100644 index 000000000000..b997605defc4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/comment-within-condition.src.js @@ -0,0 +1,2 @@ +/* foo */ +if (/* bar */ a) {} diff --git a/packages/typescript-estree/tests/fixtures/comments/export-default-anonymous-class.src.js b/packages/typescript-estree/tests/fixtures/comments/export-default-anonymous-class.src.js new file mode 100644 index 000000000000..d0a26e4ede9e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/export-default-anonymous-class.src.js @@ -0,0 +1,10 @@ +/** + * this is anonymous class. + */ +export default class { + /** + * this is method1. + */ + method1(){ + } +} diff --git a/packages/typescript-estree/tests/fixtures/comments/jsdoc-comment.src.js b/packages/typescript-estree/tests/fixtures/comments/jsdoc-comment.src.js new file mode 100644 index 000000000000..29298a12b52f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsdoc-comment.src.js @@ -0,0 +1,8 @@ +/** + * This is a function. + * @param {String} bar some string + * @returns {String} returns bar + */ +function foo(bar) { + return bar; +} diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-block-comment.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-block-comment.src.js new file mode 100644 index 000000000000..5abfb88e92f2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-block-comment.src.js @@ -0,0 +1,7 @@ +const pure = () => { + return ( + + {/*COMMENT*/} + + ); +} diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-tag-comments.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-tag-comments.src.js new file mode 100644 index 000000000000..ef679a1ad20e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-tag-comments.src.js @@ -0,0 +1,10 @@ +const pure = () => { + return ( + + + ); +} + diff --git a/packages/typescript-estree/tests/fixtures/comments/line-comment-with-block-syntax.src.js b/packages/typescript-estree/tests/fixtures/comments/line-comment-with-block-syntax.src.js new file mode 100644 index 000000000000..88994dd62b4a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/line-comment-with-block-syntax.src.js @@ -0,0 +1 @@ +// /*test*/ diff --git a/packages/typescript-estree/tests/fixtures/comments/mix-line-and-block-comments.src.js b/packages/typescript-estree/tests/fixtures/comments/mix-line-and-block-comments.src.js new file mode 100644 index 000000000000..c49bcf6bcad6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/mix-line-and-block-comments.src.js @@ -0,0 +1,3 @@ +//foo +var zzz /*aaa*/ = 777; +//bar diff --git a/packages/typescript-estree/tests/fixtures/comments/no-comment-regex.src.js b/packages/typescript-estree/tests/fixtures/comments/no-comment-regex.src.js new file mode 100644 index 000000000000..c33c7617e144 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/no-comment-regex.src.js @@ -0,0 +1 @@ +const regex = /no comment\/**foo/; diff --git a/packages/typescript-estree/tests/fixtures/comments/no-comment-template.src.js b/packages/typescript-estree/tests/fixtures/comments/no-comment-template.src.js new file mode 100644 index 000000000000..f22e6f94cf4f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/no-comment-template.src.js @@ -0,0 +1 @@ +const str = `${__dirname}/test/*.js`; diff --git a/packages/typescript-estree/tests/fixtures/comments/surrounding-call-comments.src.js b/packages/typescript-estree/tests/fixtures/comments/surrounding-call-comments.src.js new file mode 100644 index 000000000000..6cbc4bf61de5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/surrounding-call-comments.src.js @@ -0,0 +1,5 @@ +function a() { + /* before */ + foo(); + /* after */ +} diff --git a/packages/typescript-estree/tests/fixtures/comments/surrounding-debugger-comments.src.js b/packages/typescript-estree/tests/fixtures/comments/surrounding-debugger-comments.src.js new file mode 100644 index 000000000000..b292546b44fb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/surrounding-debugger-comments.src.js @@ -0,0 +1,5 @@ +function a() { + /* before */ + debugger; + /* after */ +} diff --git a/packages/typescript-estree/tests/fixtures/comments/surrounding-return-comments.src.js b/packages/typescript-estree/tests/fixtures/comments/surrounding-return-comments.src.js new file mode 100644 index 000000000000..ae67152408fb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/surrounding-return-comments.src.js @@ -0,0 +1,5 @@ +function a() { + /* before */ + return; + /* after */ +} diff --git a/packages/typescript-estree/tests/fixtures/comments/surrounding-throw-comments.src.js b/packages/typescript-estree/tests/fixtures/comments/surrounding-throw-comments.src.js new file mode 100644 index 000000000000..0ebc974917b4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/surrounding-throw-comments.src.js @@ -0,0 +1,5 @@ +function a() { + /* before */ + throw 55; + /* after */ +} diff --git a/packages/typescript-estree/tests/fixtures/comments/surrounding-while-loop-comments.src.js b/packages/typescript-estree/tests/fixtures/comments/surrounding-while-loop-comments.src.js new file mode 100644 index 000000000000..2134f68be4fe --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/surrounding-while-loop-comments.src.js @@ -0,0 +1 @@ +function f() { /* infinite */ while (true) { } /* bar */ var each; } diff --git a/packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment-in-function.src.js b/packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment-in-function.src.js new file mode 100644 index 000000000000..e71465ae63f7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment-in-function.src.js @@ -0,0 +1,9 @@ +function bar(foo) { + switch(foo) { + // foo + case 1: + // falls through + case 2: + doIt(); + } +} diff --git a/packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment.src.js b/packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment.src.js new file mode 100644 index 000000000000..3b8bb8eed40d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/switch-fallthrough-comment.src.js @@ -0,0 +1,7 @@ +switch(foo) { + // foo + case 1: + // falls through + case 2: + doIt(); +} diff --git a/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-function.src.js b/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-function.src.js new file mode 100644 index 000000000000..80983bd211ab --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-function.src.js @@ -0,0 +1,9 @@ +function bar(a) { + switch (a) { + case 2: + break; + case 1: + break; + //no default + } +} diff --git a/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js b/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js new file mode 100644 index 000000000000..03508aea0a72 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js @@ -0,0 +1,12 @@ +module.exports = function(context) { + + function isConstant(node) { + switch (node.type) { + case "SequenceExpression": + return isConstant(node.expressions[node.expressions.length - 1]); + // no default + } + return false; + } + +}; diff --git a/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment.src.js b/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment.src.js new file mode 100644 index 000000000000..5febe2bccac5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/switch-no-default-comment.src.js @@ -0,0 +1,5 @@ +switch (a) { + case 1: + break; + //no default +} diff --git a/packages/typescript-estree/tests/fixtures/comments/template-string-block.src.js b/packages/typescript-estree/tests/fixtures/comments/template-string-block.src.js new file mode 100644 index 000000000000..19351f45e710 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/template-string-block.src.js @@ -0,0 +1,5 @@ +`${name}`; +{ + /* TODO comment comment comment */ + 1 + 1; +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param-with-params.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param-with-params.src.js new file mode 100644 index 000000000000..248cc450ad83 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param-with-params.src.js @@ -0,0 +1 @@ +foo((x, y) => {}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param.src.js new file mode 100644 index 000000000000..fffb35c56227 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param.src.js @@ -0,0 +1 @@ +foo(() => {}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic-in-binary-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic-in-binary-expression.src.js new file mode 100644 index 000000000000..5549093124c0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic-in-binary-expression.src.js @@ -0,0 +1,2 @@ +(a => ({})) + 1; +((a => ({})) + 1); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic.src.js new file mode 100644 index 000000000000..ad0d3df63fe9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic.src.js @@ -0,0 +1 @@ +() => "test"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body-not-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body-not-object.src.js new file mode 100644 index 000000000000..5ee5169b312b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body-not-object.src.js @@ -0,0 +1 @@ +e => { label: 42 }; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body.src.js new file mode 100644 index 000000000000..f7902e3a3386 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body.src.js @@ -0,0 +1 @@ +e => { 42; }; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-dup-params.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-dup-params.src.js new file mode 100644 index 000000000000..38395bd1c5d0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-dup-params.src.js @@ -0,0 +1 @@ +(a, a) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-missing-paren.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-missing-paren.src.js new file mode 100644 index 000000000000..e17b13c8d6da --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-missing-paren.src.js @@ -0,0 +1 @@ +(a, (b)) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-not-arrow.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-not-arrow.src.js new file mode 100644 index 000000000000..72cbc0fc5d85 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-not-arrow.src.js @@ -0,0 +1 @@ +left = (aSize.width/2) - () \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param-multi.src.js new file mode 100644 index 000000000000..e4b6d3900abb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param-multi.src.js @@ -0,0 +1 @@ +(10, 20) => 0; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param.src.js new file mode 100644 index 000000000000..0ce82a509cb3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param.src.js @@ -0,0 +1 @@ +(10) => 0; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-reverse-arrow.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-reverse-arrow.src.js new file mode 100644 index 000000000000..31aa8cee2ae4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-reverse-arrow.src.js @@ -0,0 +1 @@ +() <= 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-default-param-eval.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-default-param-eval.src.js new file mode 100644 index 000000000000..4f8c006ac014 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-default-param-eval.src.js @@ -0,0 +1 @@ +"use strict"; (eval = 10) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-dup-params.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-dup-params.src.js new file mode 100644 index 000000000000..f93258b365f4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-dup-params.src.js @@ -0,0 +1 @@ +"use strict"; (a, a) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval-return.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval-return.src.js new file mode 100644 index 000000000000..4a9a5d2c3010 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval-return.src.js @@ -0,0 +1 @@ +"use strict"; (eval) => 42 \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval.src.js new file mode 100644 index 000000000000..6bba987d7e07 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval.src.js @@ -0,0 +1 @@ +(eval) => { "use strict"; 42 } \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-octal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-octal.src.js new file mode 100644 index 000000000000..e199dc28811f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-octal.src.js @@ -0,0 +1 @@ +"use strict"; (a) => 00; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-arguments.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-arguments.src.js new file mode 100644 index 000000000000..15617f88e041 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-arguments.src.js @@ -0,0 +1 @@ +"use strict"; (arguments, a) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-eval.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-eval.src.js new file mode 100644 index 000000000000..672a5206c66d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-eval.src.js @@ -0,0 +1 @@ +"use strict"; (eval, a) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-names.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-names.src.js new file mode 100644 index 000000000000..672a5206c66d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-names.src.js @@ -0,0 +1 @@ +"use strict"; (eval, a) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-arguments.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-arguments.src.js new file mode 100644 index 000000000000..40c40bf9436f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-arguments.src.js @@ -0,0 +1 @@ +"use strict"; arguments => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-eval.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-eval.src.js new file mode 100644 index 000000000000..87f875602b53 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-eval.src.js @@ -0,0 +1 @@ +"use strict"; eval => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-two-lines.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-two-lines.src.js new file mode 100644 index 000000000000..22213ad116bc --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-two-lines.src.js @@ -0,0 +1,2 @@ +var a = () + => 0; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-wrapped-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-wrapped-param.src.js new file mode 100644 index 000000000000..77cf2b5b8381 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-wrapped-param.src.js @@ -0,0 +1 @@ +((a)) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/expression.src.js new file mode 100644 index 000000000000..046e74ece9c3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/expression.src.js @@ -0,0 +1 @@ +(x => x); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/iife.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/iife.src.js new file mode 100644 index 000000000000..37a088a0f158 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/iife.src.js @@ -0,0 +1 @@ +e => ({ property: 42 }); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/multiple-params.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/multiple-params.src.js new file mode 100644 index 000000000000..26ac16e44cfa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/multiple-params.src.js @@ -0,0 +1 @@ +(a, b) => "test"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/no-auto-return.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/no-auto-return.src.js new file mode 100644 index 000000000000..2c9dd12d0481 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/no-auto-return.src.js @@ -0,0 +1 @@ +(a, b) => { 42; }; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-arguments.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-arguments.src.js new file mode 100644 index 000000000000..7ea5c0a45076 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-arguments.src.js @@ -0,0 +1 @@ +arguments => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval-params.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval-params.src.js new file mode 100644 index 000000000000..5a51236aa6f8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval-params.src.js @@ -0,0 +1 @@ +(eval, a) => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval.src.js new file mode 100644 index 000000000000..db0c68fe0aef --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval.src.js @@ -0,0 +1 @@ +eval => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-octal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-octal.src.js new file mode 100644 index 000000000000..0e6918d7d43c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-octal.src.js @@ -0,0 +1 @@ +(a) => 00; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-arrow-function.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-arrow-function.src.js new file mode 100644 index 000000000000..535922a77760 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-arrow-function.src.js @@ -0,0 +1 @@ +x => y => 42; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-sequence.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-sequence.src.js new file mode 100644 index 000000000000..ee165aec01a0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-sequence.src.js @@ -0,0 +1 @@ +(x) => ((y, z) => (x, y, z)); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-parens.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-parens.src.js new file mode 100644 index 000000000000..cf5e9932c5e7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-parens.src.js @@ -0,0 +1 @@ +(e) => "test"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-return-identifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-return-identifier.src.js new file mode 100644 index 000000000000..fdbaa2c998ee --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-return-identifier.src.js @@ -0,0 +1 @@ +(sun) => earth; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param.src.js new file mode 100644 index 000000000000..49a04ad0bcf9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param.src.js @@ -0,0 +1 @@ +e => "test"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/invalid.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/invalid.src.js new file mode 100644 index 000000000000..719fc33cbe40 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/invalid.src.js @@ -0,0 +1 @@ +0b102; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/lowercase.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/lowercase.src.js new file mode 100644 index 000000000000..edde9a3b5977 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/lowercase.src.js @@ -0,0 +1 @@ +0b101; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/uppercase.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/uppercase.src.js new file mode 100644 index 000000000000..9cb6f2fb1b5c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/uppercase.src.js @@ -0,0 +1 @@ +0B101; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/const.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/const.src.js new file mode 100644 index 000000000000..70b0430bf3e2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/const.src.js @@ -0,0 +1 @@ +const foo = bar; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let-in-switchcase.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let-in-switchcase.src.js new file mode 100644 index 000000000000..5df03fa0b726 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let-in-switchcase.src.js @@ -0,0 +1 @@ +switch (answer) { case 42: let t = 42; break; } diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let.src.js new file mode 100644 index 000000000000..c85081ab6c40 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let.src.js @@ -0,0 +1 @@ +let foo = bar; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-accessor-properties.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-accessor-properties.src.js new file mode 100644 index 000000000000..5788395aaa33 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-accessor-properties.src.js @@ -0,0 +1 @@ +class A {get a(){} set b(c){};}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-computed-static-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-computed-static-method.src.js new file mode 100644 index 000000000000..f960fe06cd30 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-computed-static-method.src.js @@ -0,0 +1 @@ +class A {static [a](){};}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-expression.src.js new file mode 100644 index 000000000000..ac7ea1bef0c9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-expression.src.js @@ -0,0 +1 @@ +(class {}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-prototype.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-prototype.src.js new file mode 100644 index 000000000000..5f8f86aeebe0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-prototype.src.js @@ -0,0 +1 @@ +class A {prototype(){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-static.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-static.src.js new file mode 100644 index 000000000000..4b8882f7305c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-static.src.js @@ -0,0 +1 @@ +class A {static(){};}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-with-space.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-with-space.src.js new file mode 100644 index 000000000000..3e1360594e06 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-with-space.src.js @@ -0,0 +1 @@ +class A {withSpace () {}} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method-super.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method-super.src.js new file mode 100644 index 000000000000..304405d389ef --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method-super.src.js @@ -0,0 +1,5 @@ +class A { + a(){ + super(); + } +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method.src.js new file mode 100644 index 000000000000..cbae5822e572 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method.src.js @@ -0,0 +1,3 @@ +class A { + a(){} +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-prototype.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-prototype.src.js new file mode 100644 index 000000000000..9a2019e9b33c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-prototype.src.js @@ -0,0 +1 @@ +class A {static ["prototype"](){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-static.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-static.src.js new file mode 100644 index 000000000000..947d978d328b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-static.src.js @@ -0,0 +1 @@ +class A {static static(){};}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method.src.js new file mode 100644 index 000000000000..dea98b8d153d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method.src.js @@ -0,0 +1 @@ +class A {static a(){};}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-methods-and-accessor-properties.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-methods-and-accessor-properties.src.js new file mode 100644 index 000000000000..5efab6d986b6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-methods-and-accessor-properties.src.js @@ -0,0 +1 @@ +class A {static a(){} static get a(){} static set a(b){} }; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-computed-static-methods.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-computed-static-methods.src.js new file mode 100644 index 000000000000..8a3d1cf96ae8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-computed-static-methods.src.js @@ -0,0 +1 @@ +class A {static[a](){}; static[b](){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-computed-constructor.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-computed-constructor.src.js new file mode 100644 index 000000000000..66a3500ba613 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-computed-constructor.src.js @@ -0,0 +1 @@ +class A {"constructor"(){} ["constructor"](){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-semi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-semi.src.js new file mode 100644 index 000000000000..eae3cf562544 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-semi.src.js @@ -0,0 +1 @@ +class A {a(){};b(){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-three-semi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-three-semi.src.js new file mode 100644 index 000000000000..db2c06ce65d4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-three-semi.src.js @@ -0,0 +1 @@ +class A {;a(){};b(){};}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-two-semi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-two-semi.src.js new file mode 100644 index 000000000000..30f2b72c83b6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-two-semi.src.js @@ -0,0 +1 @@ +class A {a(){};b(){};}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods.src.js new file mode 100644 index 000000000000..b30e1d968e3c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods.src.js @@ -0,0 +1 @@ +class A {a(){}b(){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-static-methods-named-constructor.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-static-methods-named-constructor.src.js new file mode 100644 index 000000000000..57bbee9df047 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-static-methods-named-constructor.src.js @@ -0,0 +1 @@ +class A {static constructor(){} static constructor(){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-parameters.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-parameters.src.js new file mode 100644 index 000000000000..92ffc4912b13 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-parameters.src.js @@ -0,0 +1 @@ +class A {constructor(foo, bar){}} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-with-space.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-with-space.src.js new file mode 100644 index 000000000000..af3f316ec017 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-with-space.src.js @@ -0,0 +1 @@ +class A {constructor (){}}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor.src.js new file mode 100644 index 000000000000..00fcd7be15ef --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor.src.js @@ -0,0 +1 @@ +class A {constructor(){}}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-assign-to-var.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-assign-to-var.src.js new file mode 100644 index 000000000000..fba446ff6e45 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-assign-to-var.src.js @@ -0,0 +1 @@ +var x = class A extends 0{}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-expression.src.js new file mode 100644 index 000000000000..b5e6e62ea087 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-expression.src.js @@ -0,0 +1 @@ +(class extends 0{}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-double-semi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-double-semi.src.js new file mode 100644 index 000000000000..a650fd681397 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-double-semi.src.js @@ -0,0 +1 @@ +class A {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-semi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-semi.src.js new file mode 100644 index 000000000000..e14455cbb559 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-semi.src.js @@ -0,0 +1 @@ +class A {;}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class.src.js new file mode 100644 index 000000000000..a650fd681397 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class.src.js @@ -0,0 +1 @@ +class A {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-literal-derived-class.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-literal-derived-class.src.js new file mode 100644 index 000000000000..5903f34f08bd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-literal-derived-class.src.js @@ -0,0 +1 @@ +class A extends 0 {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-declaration.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-declaration.src.js new file mode 100644 index 000000000000..c3498222f8fa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-declaration.src.js @@ -0,0 +1 @@ +class {}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-setter-declaration.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-setter-declaration.src.js new file mode 100644 index 000000000000..98433ba8b00a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-setter-declaration.src.js @@ -0,0 +1 @@ +class A { set foo() {}}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-two-super-classes.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-two-super-classes.src.js new file mode 100644 index 000000000000..dbac127c0814 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-two-super-classes.src.js @@ -0,0 +1 @@ +class A extends B, C {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-class-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-class-expression.src.js new file mode 100644 index 000000000000..9829e5d0ddd1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-class-expression.src.js @@ -0,0 +1 @@ +(class A {}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-derived-class-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-derived-class-expression.src.js new file mode 100644 index 000000000000..cb8f8a94b99b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-derived-class-expression.src.js @@ -0,0 +1 @@ +(class A extends 0{}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-constructor.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-constructor.src.js new file mode 100644 index 000000000000..901358c2f16c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-constructor.src.js @@ -0,0 +1,4 @@ +class A { + constructor(foo='bar') { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-method.src.js new file mode 100644 index 000000000000..cb113e755fff --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-method.src.js @@ -0,0 +1,4 @@ +class A { + foo(bar='baz') { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/declaration.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/declaration.src.js new file mode 100644 index 000000000000..7885715f86b0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/declaration.src.js @@ -0,0 +1 @@ +function f(a = 1) {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/expression.src.js new file mode 100644 index 000000000000..25993b363d55 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/expression.src.js @@ -0,0 +1 @@ +x = function(y = 1) {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/method.src.js new file mode 100644 index 000000000000..2537287de022 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/method.src.js @@ -0,0 +1 @@ +x = { f: function(a=1) {} } \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/not-all-params.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/not-all-params.src.js new file mode 100644 index 000000000000..3bfab96a2698 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/not-all-params.src.js @@ -0,0 +1 @@ +var foo = function(a, b = 42, c) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-array.src.js new file mode 100644 index 000000000000..c2f38722e62b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-array.src.js @@ -0,0 +1 @@ +([y]) => x; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js new file mode 100644 index 000000000000..75bb19b495b8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js @@ -0,0 +1 @@ +([y, [x]]) => x; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js new file mode 100644 index 000000000000..c2a809e04a22 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js @@ -0,0 +1 @@ +({foo: y, a:{bar: x}}) => x; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js new file mode 100644 index 000000000000..177cd72468dd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js @@ -0,0 +1 @@ +({y, a:{x}}) => x; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-object.src.js new file mode 100644 index 000000000000..7f6a1fb1436e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-object.src.js @@ -0,0 +1 @@ +({y}) => x; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-array.src.js new file mode 100644 index 000000000000..7fa2d1940626 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-array.src.js @@ -0,0 +1 @@ +([x = 10]) => x \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js new file mode 100644 index 000000000000..410eed8cc78f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js @@ -0,0 +1 @@ +({x = 10, y: { z = 10 }}) => [x, z] \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object.src.js new file mode 100644 index 000000000000..c6b403750620 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object.src.js @@ -0,0 +1 @@ +({x = 10}) => x \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-const-undefined.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-const-undefined.src.js new file mode 100644 index 000000000000..0ff51d044822 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-const-undefined.src.js @@ -0,0 +1 @@ +const [a] = []; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-let-undefined.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-let-undefined.src.js new file mode 100644 index 000000000000..c705f581d5a1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-let-undefined.src.js @@ -0,0 +1 @@ +let [a] = []; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-named.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-named.src.js new file mode 100644 index 000000000000..67a0d1a4e9c7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-named.src.js @@ -0,0 +1 @@ +const {a:b} = {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-undefined.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-undefined.src.js new file mode 100644 index 000000000000..80b78cb8d264 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-undefined.src.js @@ -0,0 +1 @@ +const {a} = {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-named.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-named.src.js new file mode 100644 index 000000000000..53b1654cb828 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-named.src.js @@ -0,0 +1 @@ +let {a:b} = {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-undefined.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-undefined.src.js new file mode 100644 index 000000000000..51c02f8b6ed1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-undefined.src.js @@ -0,0 +1 @@ +let {a} = {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-array.src.js new file mode 100644 index 000000000000..b233ca5bd452 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-array.src.js @@ -0,0 +1 @@ +function f([x] = [1]) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-short.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-short.src.js new file mode 100644 index 000000000000..0821397f396c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-short.src.js @@ -0,0 +1 @@ +({f({x} = {x: 10}) {}}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-wrapped.src.xjs b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-wrapped.src.xjs new file mode 100644 index 000000000000..1740302f8291 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-wrapped.src.xjs @@ -0,0 +1 @@ +({f: function({x} = {x: 10}) {}}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object.src.js new file mode 100644 index 000000000000..753d7b471310 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object.src.js @@ -0,0 +1 @@ +f = function({x} = {x: 10}) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-forOf/loop.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-forOf/loop.src.js new file mode 100644 index 000000000000..7751aeddd636 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-forOf/loop.src.js @@ -0,0 +1 @@ +for ([a] of foo); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/complex-destructured.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/complex-destructured.src.js new file mode 100644 index 000000000000..a14d109bf05d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/complex-destructured.src.js @@ -0,0 +1 @@ +[{ a, b }, ...c] = d; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructured-array-literal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructured-array-literal.src.js new file mode 100644 index 000000000000..aa3e6bed2221 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructured-array-literal.src.js @@ -0,0 +1 @@ +[a, ...[b, c]] = d; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructuring-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructuring-param.src.js new file mode 100644 index 000000000000..28bec5ed0b4e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructuring-param.src.js @@ -0,0 +1 @@ +function a([a, b, ...[ok]]) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/error-complex-destructured-spread-first.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/error-complex-destructured-spread-first.src.js new file mode 100644 index 000000000000..eee98799d22b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/error-complex-destructured-spread-first.src.js @@ -0,0 +1 @@ +[...c, { a, b }] = d; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/invalid-not-final-array-empty.src.xjs b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/invalid-not-final-array-empty.src.xjs new file mode 100644 index 000000000000..6154cfe049dd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/invalid-not-final-array-empty.src.xjs @@ -0,0 +1 @@ +[...a, ] = b; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/multi-destructured.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/multi-destructured.src.js new file mode 100644 index 000000000000..c7f6aa97b292 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/multi-destructured.src.js @@ -0,0 +1 @@ +[a, ...b] = c; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/not-final-array.src.xjs b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/not-final-array.src.xjs new file mode 100644 index 000000000000..cb9a2a141cc8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/not-final-array.src.xjs @@ -0,0 +1 @@ +[...a, b] = c; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/single-destructured.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/single-destructured.src.js new file mode 100644 index 000000000000..0be6e5d967b2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/single-destructured.src.js @@ -0,0 +1 @@ +[...a] = b; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-complex-destructured.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-complex-destructured.src.js new file mode 100644 index 000000000000..dabf00dc6ecb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-complex-destructured.src.js @@ -0,0 +1 @@ +var [{ a, b }, ...c] = d; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-destructured-array-literal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-destructured-array-literal.src.js new file mode 100644 index 000000000000..ed56a2030533 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-destructured-array-literal.src.js @@ -0,0 +1 @@ +var [a, ...[b, c]] = d; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-multi-destructured.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-multi-destructured.src.js new file mode 100644 index 000000000000..897bcba9d9b1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-multi-destructured.src.js @@ -0,0 +1 @@ +var [a, ...b] = c; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-single-destructured.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-single-destructured.src.js new file mode 100644 index 000000000000..e6dc8d642048 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-single-destructured.src.js @@ -0,0 +1 @@ +var [...a] = b; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-member.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-member.src.js new file mode 100644 index 000000000000..ca7265689821 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-member.src.js @@ -0,0 +1 @@ +[ok.v] = 20; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-to-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-to-array.src.js new file mode 100644 index 000000000000..e03adeba1880 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-to-array.src.js @@ -0,0 +1 @@ +[a, b] = [b, a]; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-var-undefined.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-var-undefined.src.js new file mode 100644 index 000000000000..a802dde0d6b0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-var-undefined.src.js @@ -0,0 +1 @@ +var [a] = []; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-array.src.js new file mode 100644 index 000000000000..8a926b84c4f1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-array.src.js @@ -0,0 +1,4 @@ +class A { + consturctor([foo, bar]) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-array.src.js new file mode 100644 index 000000000000..9afe8da6814b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-array.src.js @@ -0,0 +1,4 @@ +class A { + consturctor([foo=3, bar=4]) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-object.src.js new file mode 100644 index 000000000000..c840ebe15cfb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-object.src.js @@ -0,0 +1,4 @@ +class A { + consturctor({foo=3, bar=4}) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-object.src.js new file mode 100644 index 000000000000..49bb33c2b093 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-object.src.js @@ -0,0 +1,4 @@ +class A { + consturctor({foo, bar}) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-array.src.js new file mode 100644 index 000000000000..93e433f196b4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-array.src.js @@ -0,0 +1,4 @@ +class A { + foo([bar, baz]) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-array.src.js new file mode 100644 index 000000000000..d11458520d7f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-array.src.js @@ -0,0 +1,4 @@ +class A { + foo([bar=3, baz=4]) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-object.src.js new file mode 100644 index 000000000000..ff1eb4c59cf0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-object.src.js @@ -0,0 +1,4 @@ +class A { + foo({bar=3, baz=3}) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-object.src.js new file mode 100644 index 000000000000..32683cf92773 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-object.src.js @@ -0,0 +1,4 @@ +class A { + foo({bar, baz}) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-all.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-all.src.js new file mode 100644 index 000000000000..7fa55d7113f0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-all.src.js @@ -0,0 +1 @@ +var [x = 10, y = 5, z = 1] = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-longform-nested-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-longform-nested-multi.src.js new file mode 100644 index 000000000000..7845a89ab06d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-longform-nested-multi.src.js @@ -0,0 +1 @@ +var {x: x, y: y, z: { a: a = 10} } = b; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-multi.src.js new file mode 100644 index 000000000000..e0030d18850c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-multi.src.js @@ -0,0 +1 @@ +var [x = 10, y, z] = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-all.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-all.src.js new file mode 100644 index 000000000000..1925b1e2da93 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-all.src.js @@ -0,0 +1 @@ +var [x = 10, [ z = 10]] = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-multi.src.js new file mode 100644 index 000000000000..aa0c025c20aa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-multi.src.js @@ -0,0 +1 @@ +var [x = 10, [ z ]] = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array.src.js new file mode 100644 index 000000000000..f95384c66e05 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array.src.js @@ -0,0 +1 @@ +[x=10] = x \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-all.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-all.src.js new file mode 100644 index 000000000000..d56d776aabc7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-all.src.js @@ -0,0 +1 @@ +var {x = 10, y = 5, z = 1} = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-all.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-all.src.js new file mode 100644 index 000000000000..df414e99e402 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-all.src.js @@ -0,0 +1 @@ +var {x: x = 10, y: y = 10, z: z = 10} = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-multi.src.js new file mode 100644 index 000000000000..c48fc3b89460 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-multi.src.js @@ -0,0 +1 @@ +var {x: x, y: y = 10, z: z} = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform.src.js new file mode 100644 index 000000000000..f030020d5c02 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform.src.js @@ -0,0 +1 @@ +var { x: x = 10 } = x; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-mixed-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-mixed-multi.src.js new file mode 100644 index 000000000000..3c186ea51cd9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-mixed-multi.src.js @@ -0,0 +1 @@ +var {x, y: y = 10, z} = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-multi.src.js new file mode 100644 index 000000000000..48796e029fb4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-multi.src.js @@ -0,0 +1 @@ +var {x = 10, y, z} = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-all.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-all.src.js new file mode 100644 index 000000000000..ebf4aa8a643d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-all.src.js @@ -0,0 +1 @@ +var {x = 10, y: { z = 10}} = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-multi.src.js new file mode 100644 index 000000000000..603208cc936d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-multi.src.js @@ -0,0 +1 @@ +var {x = 10, y: { z }} = a; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object.src.js new file mode 100644 index 000000000000..8735e3d0fe7a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object.src.js @@ -0,0 +1 @@ +var {x = 10} = x \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-array-catch.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-array-catch.src.js new file mode 100644 index 000000000000..e187c79d3822 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-array-catch.src.js @@ -0,0 +1,7 @@ +function x({a}) { + try { + var {b} = a; + } + catch([stack]) { + } +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-object-catch.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-object-catch.src.js new file mode 100644 index 000000000000..2d2d277b17a6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-object-catch.src.js @@ -0,0 +1,7 @@ +function x({a}) { + try { + var {b} = a; + } + catch({stack}) { + } +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/invalid-defaults-object-assign.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/invalid-defaults-object-assign.src.js new file mode 100644 index 000000000000..f4c0d85bef87 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/invalid-defaults-object-assign.src.js @@ -0,0 +1 @@ +({ Object=0, String=0 }) = {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/named-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/named-param.src.js new file mode 100644 index 000000000000..5f3ddae50e29 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/named-param.src.js @@ -0,0 +1 @@ +({ responseText: text } = res); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-array.src.js new file mode 100644 index 000000000000..1cf79a3aa752 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-array.src.js @@ -0,0 +1 @@ +var [x, , [, z]] = [1,2,[3,4]]; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-object.src.js new file mode 100644 index 000000000000..3f6c5d2ec278 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-object.src.js @@ -0,0 +1 @@ +var {x: y, z: { a: b } } = { x: "3", z: { a: "b" } }; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-named.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-named.src.js new file mode 100644 index 000000000000..8a2d98a6946a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-named.src.js @@ -0,0 +1 @@ +var {a:b} = {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-undefined.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-undefined.src.js new file mode 100644 index 000000000000..945bf61102bd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-undefined.src.js @@ -0,0 +1 @@ +var {a} = {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-array.src.js new file mode 100644 index 000000000000..e2545e8519ac --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-array.src.js @@ -0,0 +1 @@ +function a([x = 10]) {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object-nested.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object-nested.src.js new file mode 100644 index 000000000000..baf01aa25d68 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object-nested.src.js @@ -0,0 +1 @@ +function a({x = 10, y: { z = 10 }}) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object.src.js new file mode 100644 index 000000000000..a18df31a40c6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object.src.js @@ -0,0 +1 @@ +function a({x = 10}) {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array-wrapped.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array-wrapped.src.js new file mode 100644 index 000000000000..b623ac7f45b7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array-wrapped.src.js @@ -0,0 +1 @@ +(function x([ a, b ]){}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array.src.js new file mode 100644 index 000000000000..fda9c68945b0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array.src.js @@ -0,0 +1 @@ +function x([ a, b ]){}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-multi-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-multi-object.src.js new file mode 100644 index 000000000000..1b212bc385af --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-multi-object.src.js @@ -0,0 +1 @@ +function x(a, { b }){}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-array.src.js new file mode 100644 index 000000000000..6544066786ea --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-array.src.js @@ -0,0 +1 @@ +function a([x, , [, z]]) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-object.src.js new file mode 100644 index 000000000000..78e865b16bfd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-object.src.js @@ -0,0 +1 @@ +function a({x: y, z: { a: b } }) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object-wrapped.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object-wrapped.src.js new file mode 100644 index 000000000000..c9f34398d78b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object-wrapped.src.js @@ -0,0 +1 @@ +(function x({ a, b }){}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object.src.js new file mode 100644 index 000000000000..5a71f3507199 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object.src.js @@ -0,0 +1 @@ +function x({ a, b }){}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/sparse-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/sparse-array.src.js new file mode 100644 index 000000000000..d17fce97a39b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/sparse-array.src.js @@ -0,0 +1 @@ +[a,,b] = array; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-generators.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-generators.src.js new file mode 100644 index 000000000000..75fcd2647be0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-generators.src.js @@ -0,0 +1,3 @@ +async function* foo() { + +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-iterator.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-iterator.src.js new file mode 100644 index 000000000000..742ec47ad7ba --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-iterator.src.js @@ -0,0 +1,5 @@ +async function foo() { + for await (const item of items) { + + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalDynamicImport/dynamic-import.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalDynamicImport/dynamic-import.src.js new file mode 100644 index 000000000000..18dff34f73a5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalDynamicImport/dynamic-import.src.js @@ -0,0 +1 @@ +import('foo').then(main); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js new file mode 100644 index 000000000000..99da0c5393ec --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js @@ -0,0 +1 @@ +function c({a, ...b}) {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js new file mode 100644 index 000000000000..0caa3fab4a96 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js @@ -0,0 +1 @@ +({a, ...b} = {a, ...b}) diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/function-parameter-object-spread.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/function-parameter-object-spread.src.js new file mode 100644 index 000000000000..29fda8e4a120 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/function-parameter-object-spread.src.js @@ -0,0 +1 @@ +function foo({...bar}) { } diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js new file mode 100644 index 000000000000..39ef542fe289 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js @@ -0,0 +1 @@ +var { x, y, ...z, } = foo; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js new file mode 100644 index 000000000000..a38d92cf9298 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js @@ -0,0 +1 @@ +var { x, y, ...foo.bar } = { x: 1, y: 2, a: 3, b: 4 }; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js new file mode 100644 index 000000000000..4d733791c65d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js @@ -0,0 +1 @@ +var { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js new file mode 100644 index 000000000000..1ef4ef44c8a6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js @@ -0,0 +1,9 @@ +var foo, + get, + set; + +var x = { + foo: foo, + get: get, + ...set.foo +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js new file mode 100644 index 000000000000..4247e4a5494d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js @@ -0,0 +1,5 @@ +({ + initialize({someVar, otherVar, ...options}) { + // ... do some stuff with options ... + } +}); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js new file mode 100644 index 000000000000..2eb0d18f575b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js @@ -0,0 +1,5 @@ +var x = { + initialize({someVar, otherVar, ...options}) { + // ... do some stuff with options ... + } +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js new file mode 100644 index 000000000000..11d8c39bfa8b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js @@ -0,0 +1,9 @@ +var foo, + get, + set; + +var x = { + foo, + get, + ...set +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js new file mode 100644 index 000000000000..e287012c47b9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js @@ -0,0 +1,9 @@ +var foo, + get, + set; + +var x = { + foo: foo, + get: get, + ...set +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js new file mode 100644 index 000000000000..a2841df60224 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js @@ -0,0 +1 @@ +({ a, b, ...c, }) diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js new file mode 100644 index 000000000000..85d5f34a0076 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js @@ -0,0 +1,9 @@ +var foo, + get, + set; + +var x = { + foo: foo, + ...get, + ...set +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js new file mode 100644 index 000000000000..7ac791c528ec --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js @@ -0,0 +1 @@ +try {} catch {} finally {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding.src.js new file mode 100644 index 000000000000..0c6986fd88c6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding.src.js @@ -0,0 +1 @@ +try {} catch {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/exponentiationOperators/exponential-operators.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/exponentiationOperators/exponential-operators.src.js new file mode 100644 index 000000000000..b04a6f38a508 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/exponentiationOperators/exponential-operators.src.js @@ -0,0 +1,2 @@ +var x = 2 ** 3; +x **= 4; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-function-initializer.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-function-initializer.src.js new file mode 100644 index 000000000000..be6ee7a07961 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-function-initializer.src.js @@ -0,0 +1 @@ +for (var i = function() { return 10 in [] } of list) process(x); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-braces.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-braces.src.js new file mode 100644 index 000000000000..090dccf02df6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-braces.src.js @@ -0,0 +1,3 @@ +for (var x of foo) { + doSomething(); +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-no-braces.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-no-braces.src.js new file mode 100644 index 000000000000..3e0f665bcb3f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-no-braces.src.js @@ -0,0 +1,2 @@ +for (var x of foo) + doSomething(); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-const-and-no-braces.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-const-and-no-braces.src.js new file mode 100644 index 000000000000..409abfa0c48b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-const-and-no-braces.src.js @@ -0,0 +1,2 @@ +for (const x of foo) + doSomething(); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-let-and-no-braces.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-let-and-no-braces.src.js new file mode 100644 index 000000000000..7d9d367e23a0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-let-and-no-braces.src.js @@ -0,0 +1,2 @@ +for (let x of foo) + doSomething(); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/anonymous-generator.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/anonymous-generator.src.js new file mode 100644 index 000000000000..e582946f6565 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/anonymous-generator.src.js @@ -0,0 +1 @@ +(function* () { yield v }); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-function.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-function.src.js new file mode 100644 index 000000000000..59fbab7761a6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-function.src.js @@ -0,0 +1,4 @@ + +async function *foo() { + +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-method.src.js new file mode 100644 index 000000000000..475794bf0c0b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-method.src.js @@ -0,0 +1,5 @@ +class C { + async * f() { + const x = yield* g(); + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/double-yield.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/double-yield.src.js new file mode 100644 index 000000000000..e026a3373e9f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/double-yield.src.js @@ -0,0 +1 @@ +(function* () { yield yield 10 }); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/empty-generator-declaration.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/empty-generator-declaration.src.js new file mode 100644 index 000000000000..669935546a20 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/empty-generator-declaration.src.js @@ -0,0 +1 @@ +function* t() {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/generator-declaration.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/generator-declaration.src.js new file mode 100644 index 000000000000..3690a57479ab --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/generator-declaration.src.js @@ -0,0 +1 @@ +function* test () { yield *v }; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-delegation.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-delegation.src.js new file mode 100644 index 000000000000..fc14d64df717 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-delegation.src.js @@ -0,0 +1 @@ +(function* () { yield *v }); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-in-call.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-in-call.src.js new file mode 100644 index 000000000000..d30055ca0870 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-in-call.src.js @@ -0,0 +1 @@ +(function* () { fn(yield); }); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-no-semi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-no-semi.src.js new file mode 100644 index 000000000000..5fc869289ee9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-no-semi.src.js @@ -0,0 +1 @@ +(function* () { yield }); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value.src.js new file mode 100644 index 000000000000..75c83be2ff92 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value.src.js @@ -0,0 +1 @@ +(function* () { yield; }); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-identifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-identifier.src.js new file mode 100644 index 000000000000..aa6758b0cd89 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-identifier.src.js @@ -0,0 +1 @@ +return fooz; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-no-arg.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-no-arg.src.js new file mode 100644 index 000000000000..f312410bd34c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-no-arg.src.js @@ -0,0 +1 @@ +return; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-true.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-true.src.js new file mode 100644 index 000000000000..c1c6922d1dfe --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-true.src.js @@ -0,0 +1 @@ +return true; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/importMeta/simple-import-meta.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/importMeta/simple-import-meta.src.js new file mode 100644 index 000000000000..bd14f9431ae7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/importMeta/simple-import-meta.src.js @@ -0,0 +1 @@ +import.meta.url; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-delete.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-delete.src.js new file mode 100644 index 000000000000..eb6dc52a826d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-delete.src.js @@ -0,0 +1,2 @@ +import x from "x"; +delete x; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-function.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-function.src.js new file mode 100644 index 000000000000..cdc0cd394494 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-function.src.js @@ -0,0 +1,4 @@ +function x() { + export default friends; +} + diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-strict.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-strict.src.js new file mode 100644 index 000000000000..a17a321127ac --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-strict.src.js @@ -0,0 +1,5 @@ +import house from "house"; + +with (house) { + console.log(roof); +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-array.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-array.src.js new file mode 100644 index 000000000000..d6d1738de67e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-array.src.js @@ -0,0 +1 @@ +export default []; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-class.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-class.src.js new file mode 100644 index 000000000000..3509c96a752f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-class.src.js @@ -0,0 +1,3 @@ +export default class { + +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-expression.src.js new file mode 100644 index 000000000000..f30c184a1ae0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-expression.src.js @@ -0,0 +1 @@ +export default (1 + 2); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-function.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-function.src.js new file mode 100644 index 000000000000..ea9b101e1c22 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-function.src.js @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-class.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-class.src.js new file mode 100644 index 000000000000..b2ded7d41d9d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-class.src.js @@ -0,0 +1,3 @@ +export default class Test { + +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-function.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-function.src.js new file mode 100644 index 000000000000..386baca17315 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-function.src.js @@ -0,0 +1 @@ +export default function foo() {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-number.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-number.src.js new file mode 100644 index 000000000000..7a4e8a723a40 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-number.src.js @@ -0,0 +1 @@ +export default 42; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-object.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-object.src.js new file mode 100644 index 000000000000..f8266ca25f5d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-object.src.js @@ -0,0 +1 @@ +export default { foo: 1 }; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-value.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-value.src.js new file mode 100644 index 000000000000..f7b318b3f637 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-value.src.js @@ -0,0 +1 @@ +export default foo; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-batch.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-batch.src.js new file mode 100644 index 000000000000..9ec8f63ab2fd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-batch.src.js @@ -0,0 +1 @@ +export * from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-default.src.js new file mode 100644 index 000000000000..2c7930d925cb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-default.src.js @@ -0,0 +1 @@ +export {default} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-default.src.js new file mode 100644 index 000000000000..5be9a685aabd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-default.src.js @@ -0,0 +1 @@ +export {foo as default} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifier.src.js new file mode 100644 index 000000000000..9fff903bd969 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifier.src.js @@ -0,0 +1 @@ +export {foo as bar} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifiers.src.js new file mode 100644 index 000000000000..4461d79e3bf3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifiers.src.js @@ -0,0 +1 @@ +export {foo as default, bar} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifier.src.js new file mode 100644 index 000000000000..83b7b67c51ce --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifier.src.js @@ -0,0 +1 @@ +export {foo} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifiers.src.js new file mode 100644 index 000000000000..35c2762a2954 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifiers.src.js @@ -0,0 +1 @@ +export {foo, bar} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-function.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-function.src.js new file mode 100644 index 000000000000..768586d72c59 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-function.src.js @@ -0,0 +1 @@ +export function foo () {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-default.src.js new file mode 100644 index 000000000000..5d32a24de0a9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-default.src.js @@ -0,0 +1 @@ +export {foo as default}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifier.src.js new file mode 100644 index 000000000000..e7820a6f027c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifier.src.js @@ -0,0 +1 @@ +export {foo as bar}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifiers.src.js new file mode 100644 index 000000000000..ff57927839e8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifiers.src.js @@ -0,0 +1 @@ +export {foo as default, bar}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-class.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-class.src.js new file mode 100644 index 000000000000..3cb35e97ee95 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-class.src.js @@ -0,0 +1,3 @@ +export class Test { + +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-empty.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-empty.src.js new file mode 100644 index 000000000000..cb0ff5c3b541 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-empty.src.js @@ -0,0 +1 @@ +export {}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifier.src.js new file mode 100644 index 000000000000..df5f5e609e93 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifier.src.js @@ -0,0 +1 @@ +export {foo}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers-comma.src.js new file mode 100644 index 000000000000..61bc40fd77ea --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers-comma.src.js @@ -0,0 +1 @@ +export {foo, bar,}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers.src.js new file mode 100644 index 000000000000..fdbc94275097 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers.src.js @@ -0,0 +1 @@ +export {foo, bar}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-anonymous-function.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-anonymous-function.src.js new file mode 100644 index 000000000000..f8af28821237 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-anonymous-function.src.js @@ -0,0 +1 @@ +export var foo = function () {}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-number.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-number.src.js new file mode 100644 index 000000000000..e2e71aa4fc6d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-number.src.js @@ -0,0 +1 @@ +export var foo = 1; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var.src.js new file mode 100644 index 000000000000..62da3e60183c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var.src.js @@ -0,0 +1 @@ +export var bar; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-named-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-named-specifiers.src.js new file mode 100644 index 000000000000..e544977b3acf --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-named-specifiers.src.js @@ -0,0 +1 @@ +import foo, {bar} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-namespace-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-namespace-specifiers.src.js new file mode 100644 index 000000000000..084fa0cdd14a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-namespace-specifiers.src.js @@ -0,0 +1 @@ +import foo, * as bar from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-as.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-as.src.js new file mode 100644 index 000000000000..96c936db1040 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-as.src.js @@ -0,0 +1 @@ +import {default as foo} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default.src.js new file mode 100644 index 000000000000..8d1420050a85 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default.src.js @@ -0,0 +1 @@ +import foo from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-jquery.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-jquery.src.js new file mode 100644 index 000000000000..ea74241b4bab --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-jquery.src.js @@ -0,0 +1 @@ +import $ from "jquery" diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-module.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-module.src.js new file mode 100644 index 000000000000..c0748305d535 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-module.src.js @@ -0,0 +1 @@ +import "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifier.src.js new file mode 100644 index 000000000000..769f3b3d0cb2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifier.src.js @@ -0,0 +1 @@ +import {bar as baz} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifiers.src.js new file mode 100644 index 000000000000..5198ead3cde7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifiers.src.js @@ -0,0 +1 @@ +import {bar as baz, xyz} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-empty.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-empty.src.js new file mode 100644 index 000000000000..5faab37ebb44 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-empty.src.js @@ -0,0 +1 @@ +import {} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifier.src.js new file mode 100644 index 000000000000..fc80c74dd71d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifier.src.js @@ -0,0 +1 @@ +import {bar} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers-comma.src.js new file mode 100644 index 000000000000..c2e95853d61f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers-comma.src.js @@ -0,0 +1 @@ +import {bar, baz,} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers.src.js new file mode 100644 index 000000000000..2fb83c2349cc --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers.src.js @@ -0,0 +1 @@ +import {bar, baz} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-namespace-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-namespace-specifier.src.js new file mode 100644 index 000000000000..e55c0775003b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-namespace-specifier.src.js @@ -0,0 +1 @@ +import * as foo from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-null-as-nil.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-null-as-nil.src.js new file mode 100644 index 000000000000..ced8a86bb836 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-null-as-nil.src.js @@ -0,0 +1 @@ +import { null as nil } from "bar" diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-await.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-await.src.js new file mode 100644 index 000000000000..91cd4f3b2b1f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-await.src.js @@ -0,0 +1 @@ +export var await; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-class.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-class.src.js new file mode 100644 index 000000000000..a6e68e983892 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-class.src.js @@ -0,0 +1 @@ +export default class {} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-missing-from-clause.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-missing-from-clause.src.js new file mode 100644 index 000000000000..3f576881e6c5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-missing-from-clause.src.js @@ -0,0 +1 @@ +export * diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-token.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-token.src.js new file mode 100644 index 000000000000..32cb28ea92ba --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-token.src.js @@ -0,0 +1 @@ +export * + diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-equal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-equal.src.js new file mode 100644 index 000000000000..0dfb038eb536 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-equal.src.js @@ -0,0 +1 @@ +export default = 42 diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-token.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-token.src.js new file mode 100644 index 000000000000..a0af03d2e65f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-token.src.js @@ -0,0 +1 @@ +export {default} + diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default.src.js new file mode 100644 index 000000000000..8dfa0a19a948 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default.src.js @@ -0,0 +1 @@ +export default from "foo" diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-default.src.js new file mode 100644 index 000000000000..8f3cde5c9618 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-default.src.js @@ -0,0 +1 @@ +export {default} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-extra-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-extra-comma.src.js new file mode 100644 index 000000000000..40bb7fe8ade6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-extra-comma.src.js @@ -0,0 +1 @@ +export {foo,baz,,} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-middle-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-middle-comma.src.js new file mode 100644 index 000000000000..ff3424cc6027 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-middle-comma.src.js @@ -0,0 +1 @@ +export {foo,,baz} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named-after-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named-after-default.src.js new file mode 100644 index 000000000000..69aac7e8e153 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named-after-default.src.js @@ -0,0 +1 @@ +import foo, {bar}, foo from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named.src.js new file mode 100644 index 000000000000..5be12dab64a6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named.src.js @@ -0,0 +1 @@ +import {bar}, foo from "foo" diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-missing-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-missing-module-specifier.src.js new file mode 100644 index 000000000000..ddf557475a4a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-missing-module-specifier.src.js @@ -0,0 +1 @@ +import foo diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-module-specifier.src.js new file mode 100644 index 000000000000..16e3ea289785 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-module-specifier.src.js @@ -0,0 +1 @@ +import foo from bar; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default.src.js new file mode 100644 index 000000000000..6399a1a6620d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default.src.js @@ -0,0 +1 @@ +import default from "foo" diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-missing-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-missing-module-specifier.src.js new file mode 100644 index 000000000000..338ebc128b7e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-missing-module-specifier.src.js @@ -0,0 +1 @@ +import { foo, bar } diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-module-specifier.src.js new file mode 100644 index 000000000000..15dda167c6bd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-module-specifier.src.js @@ -0,0 +1 @@ +export {foo} from bar diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-named.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-named.src.js new file mode 100644 index 000000000000..a0557bf0ea54 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-named.src.js @@ -0,0 +1 @@ +import {bar}, {foo} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-namespace.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-namespace.src.js new file mode 100644 index 000000000000..24cede9de625 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-namespace.src.js @@ -0,0 +1 @@ +import * as foo, {bar} from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-as-missing-from.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-as-missing-from.src.js new file mode 100644 index 000000000000..5d7daedfbd96 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-as-missing-from.src.js @@ -0,0 +1 @@ +import {default as foo} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-extra-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-extra-comma.src.js new file mode 100644 index 000000000000..fd0b19b89bd5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-extra-comma.src.js @@ -0,0 +1 @@ +import {foo,baz,,} from 'toast'; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-middle-comma.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-middle-comma.src.js new file mode 100644 index 000000000000..467552325fd2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-middle-comma.src.js @@ -0,0 +1 @@ +import {foo,,baz} from 'toast'; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-after-named.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-after-named.src.js new file mode 100644 index 000000000000..09d0d344e633 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-after-named.src.js @@ -0,0 +1 @@ +import {bar}, * as foo from "foo"; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-missing-as.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-missing-as.src.js new file mode 100644 index 000000000000..4382a94adbfb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-missing-as.src.js @@ -0,0 +1 @@ +import * from "foo" diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-new-target.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-new-target.src.js new file mode 100644 index 000000000000..46b13d0e56be --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-new-target.src.js @@ -0,0 +1 @@ +var x = new.target; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-unknown-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-unknown-property.src.js new file mode 100644 index 000000000000..dc1b123d55d7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-unknown-property.src.js @@ -0,0 +1 @@ +var f = function() { new.unknown_property; } diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/simple-new-target.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/simple-new-target.src.js new file mode 100644 index 000000000000..44b77c7aacb6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/simple-new-target.src.js @@ -0,0 +1,3 @@ +function f() { + var x = new.target; +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-addition-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-addition-property.src.js new file mode 100644 index 000000000000..9c3cf5a43a0a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-addition-property.src.js @@ -0,0 +1,3 @@ +var x = { + [5 + 5]: foo +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-and-identifier.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-and-identifier.src.js new file mode 100644 index 000000000000..cbc10a6adc96 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-and-identifier.src.js @@ -0,0 +1 @@ +({[x]: 10, y: 20}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-getter-and-setter.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-getter-and-setter.src.js new file mode 100644 index 000000000000..8b7a70fd3a66 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-getter-and-setter.src.js @@ -0,0 +1 @@ +({get [x]() {}, set [x](v) {}}); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-string-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-string-property.src.js new file mode 100644 index 000000000000..d555f8aaa3b9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-string-property.src.js @@ -0,0 +1,3 @@ +var x = { + ["hey"]: foo +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-variable-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-variable-property.src.js new file mode 100644 index 000000000000..7f41c2c10c4a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-variable-property.src.js @@ -0,0 +1,3 @@ +var x = { + [bar]: foo +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-computed-variable-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-computed-variable-property.src.js new file mode 100644 index 000000000000..77380e2ad357 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-computed-variable-property.src.js @@ -0,0 +1,3 @@ +var x = { + [bar] +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js new file mode 100644 index 000000000000..8925311d4766 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js @@ -0,0 +1 @@ +({[x]}); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-addition.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-addition.src.js new file mode 100644 index 000000000000..14e5e1dcb0b8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-addition.src.js @@ -0,0 +1 @@ +({["x" + "y"]: 10}); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-method.src.js new file mode 100644 index 000000000000..eafa2481f503 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-method.src.js @@ -0,0 +1 @@ +({[x]: function() {}}); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression.src.js new file mode 100644 index 000000000000..0d7e62648fe2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression.src.js @@ -0,0 +1 @@ +({[x]: 10}); diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-property.src.js new file mode 100644 index 000000000000..5fc4a41be350 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-property.src.js @@ -0,0 +1,8 @@ +"use strict"; + +var proto = {}; + +var x = { + __proto__: proto, + __proto__: proto +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-string-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-string-property.src.js new file mode 100644 index 000000000000..8761b73461ca --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-string-property.src.js @@ -0,0 +1,8 @@ +"use strict"; + +var proto = {}; + +var x = { + "__proto__": proto, + "__proto__": proto +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js new file mode 100644 index 000000000000..3942db82641a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js @@ -0,0 +1,6 @@ +"use strict"; + +var x = { + y: 'first', + y: 'second' +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js new file mode 100644 index 000000000000..0f2b2710246e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js @@ -0,0 +1,6 @@ +"use strict"; + +var x = { + "y": "first", + "y": "second" +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/invalid-method-no-braces.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/invalid-method-no-braces.src.js new file mode 100644 index 000000000000..6fd56ea339eb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/invalid-method-no-braces.src.js @@ -0,0 +1,3 @@ +x = { + method() 42 +};; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/method-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/method-property.src.js new file mode 100644 index 000000000000..5c09849b2e79 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/method-property.src.js @@ -0,0 +1,5 @@ +var x = { + foo() { + return bar; + } +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-get.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-get.src.js new file mode 100644 index 000000000000..b7f03cdef933 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-get.src.js @@ -0,0 +1,4 @@ +x = { + get() { + } +};; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-set.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-set.src.js new file mode 100644 index 000000000000..33ce0e95c298 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-set.src.js @@ -0,0 +1,4 @@ +x = { + set() { + } +};; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-argument.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-argument.src.js new file mode 100644 index 000000000000..db824acd2671 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-argument.src.js @@ -0,0 +1,5 @@ +x = { + method(test) { + + } +};; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-string-name.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-string-name.src.js new file mode 100644 index 000000000000..345b88844421 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-string-name.src.js @@ -0,0 +1,4 @@ +x = { + "method"() { + } +};; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method.src.js new file mode 100644 index 000000000000..0a69310519e1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method.src.js @@ -0,0 +1,4 @@ +x = { + method() { + } +};; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/string-name-method-property.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/string-name-method-property.src.js new file mode 100644 index 000000000000..0c168a31648e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/string-name-method-property.src.js @@ -0,0 +1,5 @@ +var x = { + "foo"() { + return bar; + } +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandProperties/shorthand-properties.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandProperties/shorthand-properties.src.js new file mode 100644 index 000000000000..1b881004b3c1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandProperties/shorthand-properties.src.js @@ -0,0 +1,9 @@ +var foo, + get, + set; + +var x = { + foo, + get, + set +}; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/invalid.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/invalid.src.js new file mode 100644 index 000000000000..d0074ff52156 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/invalid.src.js @@ -0,0 +1 @@ +0o12z; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/lowercase.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/lowercase.src.js new file mode 100644 index 000000000000..7655a4ee496e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/lowercase.src.js @@ -0,0 +1 @@ +0o717; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/strict-uppercase.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/strict-uppercase.src.js new file mode 100644 index 000000000000..5bf66b1e2072 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/strict-uppercase.src.js @@ -0,0 +1,2 @@ +"use strict"; +0O717; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/uppercase.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/uppercase.src.js new file mode 100644 index 000000000000..a5af9801c940 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/uppercase.src.js @@ -0,0 +1 @@ +0O717; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regex/regexp-simple.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/regex/regexp-simple.src.js new file mode 100644 index 000000000000..68f882c4ed36 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/regex/regexp-simple.src.js @@ -0,0 +1 @@ +var foo = /foo./; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-extended-escape.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-extended-escape.src.js new file mode 100644 index 000000000000..97c9442e5a4e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-extended-escape.src.js @@ -0,0 +1 @@ +var x = /[\u{0000000000000061}-\u{7A}]/u; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-invalid-extended-escape.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-invalid-extended-escape.src.js new file mode 100644 index 000000000000..07db7a79d553 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-invalid-extended-escape.src.js @@ -0,0 +1 @@ +var x = /\u{110000}/u; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-simple.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-simple.src.js new file mode 100644 index 000000000000..c31d75552b1e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-simple.src.js @@ -0,0 +1 @@ +var foo = /foo/u; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexYFlag/regexp-y-simple.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/regexYFlag/regexp-y-simple.src.js new file mode 100644 index 000000000000..ab3585070d91 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/regexYFlag/regexp-y-simple.src.js @@ -0,0 +1 @@ +var foo = /foo/y; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/basic-rest.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/basic-rest.src.js new file mode 100644 index 000000000000..c7d2b9477c55 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/basic-rest.src.js @@ -0,0 +1 @@ +function f(a, ...b) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-constructor.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-constructor.src.js new file mode 100644 index 000000000000..03407bf25900 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-constructor.src.js @@ -0,0 +1,4 @@ +class A { + constructor(...foo) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-method.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-method.src.js new file mode 100644 index 000000000000..48319379e161 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-method.src.js @@ -0,0 +1,4 @@ +class A { + foo(...bar) { + } +} diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-no-default.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-no-default.src.js new file mode 100644 index 000000000000..6de42c245a52 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-no-default.src.js @@ -0,0 +1 @@ +function f(a, ...b = 0); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-not-last.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-not-last.src.js new file mode 100644 index 000000000000..309cc7573260 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-not-last.src.js @@ -0,0 +1 @@ +function f(a, ...b, c); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression-multi.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression-multi.src.js new file mode 100644 index 000000000000..68f41d812e6c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression-multi.src.js @@ -0,0 +1 @@ +var x = function(a, ...b) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression.src.js new file mode 100644 index 000000000000..a7984c62a640 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression.src.js @@ -0,0 +1 @@ +var x = function (...a) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/invalid-rest-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/invalid-rest-param.src.js new file mode 100644 index 000000000000..49f73ed38546 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/invalid-rest-param.src.js @@ -0,0 +1 @@ +function x(...{ a }){}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/single-rest.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/single-rest.src.js new file mode 100644 index 000000000000..9c90dd499935 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/restParams/single-rest.src.js @@ -0,0 +1 @@ +function f(...b) {}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-if.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-if.src.js new file mode 100644 index 000000000000..360727b872ef --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-if.src.js @@ -0,0 +1 @@ +if (b,...a, ); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-sequence.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-sequence.src.js new file mode 100644 index 000000000000..98458f83d68c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-sequence.src.js @@ -0,0 +1 @@ +(b, ...a); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/multi-function-call.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/spread/multi-function-call.src.js new file mode 100644 index 000000000000..49237c1f1480 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/spread/multi-function-call.src.js @@ -0,0 +1 @@ +foo(a, ...b); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/not-final-param.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/spread/not-final-param.src.js new file mode 100644 index 000000000000..7510298b7ca0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/spread/not-final-param.src.js @@ -0,0 +1 @@ +func(...a, b); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/simple-function-call.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/spread/simple-function-call.src.js new file mode 100644 index 000000000000..1cc736a0c23c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/spread/simple-function-call.src.js @@ -0,0 +1 @@ +foo(...a); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/deeply-nested.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/deeply-nested.src.js new file mode 100644 index 000000000000..4dc0eeb08a34 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/deeply-nested.src.js @@ -0,0 +1 @@ +raw`hello ${`nested ${`deeply` + {}} blah`}`; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/error-octal-literal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/error-octal-literal.src.js new file mode 100644 index 000000000000..31c66a405763 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/error-octal-literal.src.js @@ -0,0 +1 @@ +`\07`; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/escape-characters.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/escape-characters.src.js new file mode 100644 index 000000000000..4163a542c54e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/escape-characters.src.js @@ -0,0 +1 @@ +var ts = `\\n\\r\\b\\v\\t\\f\\\n\\\r\n`; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/expressions.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/expressions.src.js new file mode 100644 index 000000000000..bbe595e9ecfe --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/expressions.src.js @@ -0,0 +1,4 @@ +var a = 5; +var b = 'Fred'; + +`Hello ${b}. a + 5 = ${a + 5}`; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/multi-line-template-string.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/multi-line-template-string.src.js new file mode 100644 index 000000000000..4d4d65d91ce5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/multi-line-template-string.src.js @@ -0,0 +1,6 @@ +`The last man on Earth + sat alone in a room. + There was + a knock + on the + door...`; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/simple-template-string.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/simple-template-string.src.js new file mode 100644 index 000000000000..1e6428494f65 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/simple-template-string.src.js @@ -0,0 +1 @@ +`42`; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/single-dollar-sign.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/single-dollar-sign.src.js new file mode 100644 index 000000000000..6788caf51477 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/single-dollar-sign.src.js @@ -0,0 +1 @@ +var ts = `$`; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-no-placeholders.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-no-placeholders.src.js new file mode 100644 index 000000000000..02458f045eb3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-no-placeholders.src.js @@ -0,0 +1 @@ +foo`foo`; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-template-string.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-template-string.src.js new file mode 100644 index 000000000000..61a0bdac2e5f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-template-string.src.js @@ -0,0 +1,4 @@ +function tag() { + console.log(arguments); +} +tag`a is ${a} while b is ${b}.`; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/basic-string-literal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/basic-string-literal.src.js new file mode 100644 index 000000000000..9edb72773067 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/basic-string-literal.src.js @@ -0,0 +1 @@ +"\u{714E}\u{8336}"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/complex-string-literal.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/complex-string-literal.src.js new file mode 100644 index 000000000000..ac32b40609c0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/complex-string-literal.src.js @@ -0,0 +1 @@ +"\u{20BB7}\u{10FFFF}\u{1}"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-empty-escape.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-empty-escape.src.js new file mode 100644 index 000000000000..5d58cb32306b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-empty-escape.src.js @@ -0,0 +1 @@ +"\u{}"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-too-large-escape.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-too-large-escape.src.js new file mode 100644 index 000000000000..30b7cd791f31 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-too-large-escape.src.js @@ -0,0 +1 @@ +"\u{FFFFFF}"; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js new file mode 100644 index 000000000000..b1b254055e2e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js @@ -0,0 +1,3 @@ +
+ +
diff --git a/packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/test-content.src.js b/packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/test-content.src.js new file mode 100644 index 000000000000..ffaed57254f4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx-useJSXTextNode/test-content.src.js @@ -0,0 +1 @@ +
@test content
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/attributes.src.js b/packages/typescript-estree/tests/fixtures/jsx/attributes.src.js new file mode 100644 index 000000000000..5de9359ff361 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/attributes.src.js @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/element-keyword-name.src.js b/packages/typescript-estree/tests/fixtures/jsx/element-keyword-name.src.js new file mode 100644 index 000000000000..55faaf141dc2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/element-keyword-name.src.js @@ -0,0 +1,5 @@ +
+ + + + diff --git a/packages/typescript-estree/tests/fixtures/jsx/embedded-comment.src.js b/packages/typescript-estree/tests/fixtures/jsx/embedded-comment.src.js new file mode 100644 index 000000000000..9ccfd89113d4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/embedded-comment.src.js @@ -0,0 +1 @@ +{/* this is a comment */}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/embedded-conditional.src.js b/packages/typescript-estree/tests/fixtures/jsx/embedded-conditional.src.js new file mode 100644 index 000000000000..44134ac352b9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/embedded-conditional.src.js @@ -0,0 +1 @@ + : } />; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/embedded-invalid-js-identifier.src.js b/packages/typescript-estree/tests/fixtures/jsx/embedded-invalid-js-identifier.src.js new file mode 100644 index 000000000000..5138ffb14237 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/embedded-invalid-js-identifier.src.js @@ -0,0 +1 @@ +

7x invalid-js-identifier
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/embedded-tags.src.js b/packages/typescript-estree/tests/fixtures/jsx/embedded-tags.src.js new file mode 100644 index 000000000000..48260fa6544a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/embedded-tags.src.js @@ -0,0 +1 @@ + right=monkeys /> gorillas />; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/empty-placeholder.src.js b/packages/typescript-estree/tests/fixtures/jsx/empty-placeholder.src.js new file mode 100644 index 000000000000..7e7ae12a57fa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/empty-placeholder.src.js @@ -0,0 +1 @@ +
{}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/escape-patterns.src.js b/packages/typescript-estree/tests/fixtures/jsx/escape-patterns.src.js new file mode 100644 index 000000000000..b218700ab0f5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/escape-patterns.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-attribute-missing-equals.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-attribute-missing-equals.src.js new file mode 100644 index 000000000000..c4bdb625c16c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-attribute-missing-equals.src.js @@ -0,0 +1 @@ +
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-attribute.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-attribute.src.js new file mode 100644 index 000000000000..a3d16ade8f01 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-attribute.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-broken-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-broken-tag.src.js new file mode 100644 index 000000000000..20899cb988ae --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-broken-tag.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-leading-dot-tag-name.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-leading-dot-tag-name.src.js new file mode 100644 index 000000000000..297c850a4931 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-leading-dot-tag-name.src.js @@ -0,0 +1 @@ +<.a>; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js new file mode 100644 index 000000000000..e2b8b4aabcc6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js @@ -0,0 +1 @@ +
stuff
; diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tag.src.js new file mode 100644 index 000000000000..70b531344460 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tag.src.js @@ -0,0 +1 @@ +
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tags.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tags.src.js new file mode 100644 index 000000000000..cdb02a657ee0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-closing-tags.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js new file mode 100644 index 000000000000..aed52724e824 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-namespace-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-namespace-tag.src.js new file mode 100644 index 000000000000..bbda65c72d7c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-mismatched-namespace-tag.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js new file mode 100644 index 000000000000..b6d9a638840e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag.src.js new file mode 100644 index 000000000000..7c7493261deb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-closing-tag.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-name.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-name.src.js new file mode 100644 index 000000000000..203ca0836b8f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-name.src.js @@ -0,0 +1 @@ +<:a />; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-value.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-value.src.js new file mode 100644 index 000000000000..52bc77e33ac1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-namespace-value.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-spread-operator.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-spread-operator.src.js new file mode 100644 index 000000000000..2d96e2fa71cb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-missing-spread-operator.src.js @@ -0,0 +1 @@ +
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-name-with-docts.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-name-with-docts.src.js new file mode 100644 index 000000000000..4c9e774a3c74 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-name-with-docts.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-value-with-dots.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-value-with-dots.src.js new file mode 100644 index 000000000000..f3a9fdc0e4f8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-namespace-value-with-dots.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent-with-comment.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent-with-comment.src.js new file mode 100644 index 000000000000..0c8bde149a88 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent-with-comment.src.js @@ -0,0 +1 @@ +var x =
one
/* intervening comment */
two
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent.src.js new file mode 100644 index 000000000000..7f8c0f612b39 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-no-common-parent.src.js @@ -0,0 +1 @@ +var x =
one
two
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-no-tag-name.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-no-tag-name.src.js new file mode 100644 index 000000000000..a365ca6f5564 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-no-tag-name.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js new file mode 100644 index 000000000000..cff69dd9a082 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js @@ -0,0 +1 @@ +
stuff
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-trailing-dot-tag-name.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-trailing-dot-tag-name.src.js new file mode 100644 index 000000000000..40585f15c755 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-trailing-dot-tag-name.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-unexpected-comma.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-unexpected-comma.src.js new file mode 100644 index 000000000000..afdfc83b1575 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-unexpected-comma.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/japanese-characters.src.js b/packages/typescript-estree/tests/fixtures/jsx/japanese-characters.src.js new file mode 100644 index 000000000000..750d3539568e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/japanese-characters.src.js @@ -0,0 +1 @@ +<日本語>; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/less-than-operator.src.js b/packages/typescript-estree/tests/fixtures/jsx/less-than-operator.src.js new file mode 100644 index 000000000000..d2b623552527 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/less-than-operator.src.js @@ -0,0 +1 @@ +(
) < x; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/member-expression-this.src.js b/packages/typescript-estree/tests/fixtures/jsx/member-expression-this.src.js new file mode 100644 index 000000000000..a9ab134d4b48 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/member-expression-this.src.js @@ -0,0 +1,2 @@ +; +; diff --git a/packages/typescript-estree/tests/fixtures/jsx/member-expression.src.js b/packages/typescript-estree/tests/fixtures/jsx/member-expression.src.js new file mode 100644 index 000000000000..a5cd092d6ed2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/member-expression.src.js @@ -0,0 +1 @@ + diff --git a/packages/typescript-estree/tests/fixtures/jsx/multiple-blank-spaces.src.js b/packages/typescript-estree/tests/fixtures/jsx/multiple-blank-spaces.src.js new file mode 100644 index 000000000000..8283d5e183d2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/multiple-blank-spaces.src.js @@ -0,0 +1 @@ + ; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js b/packages/typescript-estree/tests/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js new file mode 100644 index 000000000000..6cd67fa28f0f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js @@ -0,0 +1 @@ + {value} ; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/namespaced-name-and-attribute.src.js b/packages/typescript-estree/tests/fixtures/jsx/namespaced-name-and-attribute.src.js new file mode 100644 index 000000000000..eb59e59d6b6b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/namespaced-name-and-attribute.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/newslines-and-entities.src.js b/packages/typescript-estree/tests/fixtures/jsx/newslines-and-entities.src.js new file mode 100644 index 000000000000..adcbb4c63a2c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/newslines-and-entities.src.js @@ -0,0 +1 @@ +\nbar\nbaz\r\n; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-inside-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-inside-tag.src.js new file mode 100644 index 000000000000..b1b254055e2e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-inside-tag.src.js @@ -0,0 +1,3 @@ +
+ +
diff --git a/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-with-newline.src.js b/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-with-newline.src.js new file mode 100644 index 000000000000..11d5cedfff0b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag-with-newline.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag.src.js b/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag.src.js new file mode 100644 index 000000000000..461e8955c72a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/self-closing-tag.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/spread-child.src.js b/packages/typescript-estree/tests/fixtures/jsx/spread-child.src.js new file mode 100644 index 000000000000..48ce23c9bd02 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/spread-child.src.js @@ -0,0 +1 @@ +
{...[0]}
diff --git a/packages/typescript-estree/tests/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js b/packages/typescript-estree/tests/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js new file mode 100644 index 000000000000..ee11c44f484f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js @@ -0,0 +1 @@ +
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/spread-operator-attributes.src.js b/packages/typescript-estree/tests/fixtures/jsx/spread-operator-attributes.src.js new file mode 100644 index 000000000000..99d6539aae2e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/spread-operator-attributes.src.js @@ -0,0 +1 @@ +
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/tag-names-with-dots.src.js b/packages/typescript-estree/tests/fixtures/jsx/tag-names-with-dots.src.js new file mode 100644 index 000000000000..6d5813d15dfa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/tag-names-with-dots.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/tag-names-with-multi-dots.src.js b/packages/typescript-estree/tests/fixtures/jsx/tag-names-with-multi-dots.src.js new file mode 100644 index 000000000000..78a3d60d40d7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/tag-names-with-multi-dots.src.js @@ -0,0 +1 @@ +; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/test-content.src.js b/packages/typescript-estree/tests/fixtures/jsx/test-content.src.js new file mode 100644 index 000000000000..ffaed57254f4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/test-content.src.js @@ -0,0 +1 @@ +
@test content
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/trailing-spread-operator-attribute.src.js b/packages/typescript-estree/tests/fixtures/jsx/trailing-spread-operator-attribute.src.js new file mode 100644 index 000000000000..ee9ab396dbff --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/trailing-spread-operator-attribute.src.js @@ -0,0 +1 @@ +
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/jsx/unknown-escape-pattern.src.js b/packages/typescript-estree/tests/fixtures/jsx/unknown-escape-pattern.src.js new file mode 100644 index 000000000000..d300d95f45ca --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/unknown-escape-pattern.src.js @@ -0,0 +1 @@ +
; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/tsx/generic-jsx-element.src.tsx b/packages/typescript-estree/tests/fixtures/tsx/generic-jsx-element.src.tsx new file mode 100644 index 000000000000..7a620161439c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/tsx/generic-jsx-element.src.tsx @@ -0,0 +1 @@ + data={12} /> diff --git a/packages/typescript-estree/tests/fixtures/tsx/react-typed-props.src.tsx b/packages/typescript-estree/tests/fixtures/tsx/react-typed-props.src.tsx new file mode 100644 index 000000000000..ebeccee4f4f1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/tsx/react-typed-props.src.tsx @@ -0,0 +1,12 @@ +import * as React from 'react' +type Props = { + title: string +} + +export default function App(props: Props) { + return ( +

+ {props.title} +

+ ) +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts b/packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts new file mode 100644 index 000000000000..56d367c193d4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts @@ -0,0 +1 @@ +function f< T >() {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameters.src.ts b/packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameters.src.ts new file mode 100644 index 000000000000..526137f30906 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/babylon-convergence/type-parameters.src.ts @@ -0,0 +1 @@ +function f() {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts new file mode 100644 index 000000000000..66b70824ae24 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts @@ -0,0 +1,3 @@ +export abstract class AbstractSocket { + abstract constructor(); +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts new file mode 100644 index 000000000000..537036b92f84 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts @@ -0,0 +1,3 @@ +export abstract class AbstractSocket { + abstract createSocket(): Promise; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts new file mode 100644 index 000000000000..42128953cb7d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts @@ -0,0 +1,4 @@ +abstract class Foo { + abstract bar; + abstract baz = 3; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts new file mode 100644 index 000000000000..8c28567ce8e7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts @@ -0,0 +1,3 @@ +abstract class Foo { + public abstract readonly foo = 'string'; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts new file mode 100644 index 000000000000..f39ba3fc0b8c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts @@ -0,0 +1,3 @@ +export abstract class AbstractSocket { + createSocket?(): Promise; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-interface.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-interface.src.ts new file mode 100644 index 000000000000..8fafeca6066c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/abstract-interface.src.ts @@ -0,0 +1,2 @@ +export abstract interface I { +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts new file mode 100644 index 000000000000..a50543105d12 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts @@ -0,0 +1,3 @@ +(b: X): X => { + return b; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/async-function-expression.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/async-function-expression.src.ts new file mode 100644 index 000000000000..7849af4e1bca --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/async-function-expression.src.ts @@ -0,0 +1,2 @@ +(async function test() { +})(); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/async-function-with-var-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/async-function-with-var-declaration.src.ts new file mode 100644 index 000000000000..e691825b8056 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/async-function-with-var-declaration.src.ts @@ -0,0 +1,5 @@ +async function test() { + var foo = 'foo'; + let bar = 'bar'; + const fooBar = 'fooBar'; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts new file mode 100644 index 000000000000..14b2f8e38750 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts @@ -0,0 +1,10 @@ +class Foo { + private bar : string; + public static baz : number; + public getBar () { + return this.bar; + } + protected setBar (bar : string) { + this.bar = bar; + } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-definite-assignment.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-definite-assignment.src.ts new file mode 100644 index 000000000000..b1882b9f280d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-definite-assignment.src.ts @@ -0,0 +1,3 @@ +class X { + a!: string; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts new file mode 100644 index 000000000000..f1befb271eef --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts @@ -0,0 +1,6 @@ +class Foo { + constructor(export a: string) { + + } +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-and-implements.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-and-implements.src.ts new file mode 100644 index 000000000000..fe7ea2560e59 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-and-implements.src.ts @@ -0,0 +1 @@ +class ClassWithParentAndInterface extends MyOtherClass implements MyInterface {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts new file mode 100644 index 000000000000..a37bc0a5d9b8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts @@ -0,0 +1,3 @@ +class Foo
extends Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic.src.ts new file mode 100644 index 000000000000..0c32155ff2f6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-extends-generic.src.ts @@ -0,0 +1,3 @@ +class Foo extends Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method-default.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method-default.src.ts new file mode 100644 index 000000000000..957a382b419a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method-default.src.ts @@ -0,0 +1,3 @@ +class Foo { + getBar() {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method.src.ts new file mode 100644 index 000000000000..abef5e5909c6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-generic-method.src.ts @@ -0,0 +1,3 @@ +class Foo { + getBar() {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-and-extends.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-and-extends.src.ts new file mode 100644 index 000000000000..fe44fc7ba1b2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-and-extends.src.ts @@ -0,0 +1 @@ +class ClassWithParentAndInterface implements MyInterface extends MyOtherClass {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts new file mode 100644 index 000000000000..0a02bc2081f4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts @@ -0,0 +1,3 @@ +class Foo implements Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic.src.ts new file mode 100644 index 000000000000..b18efb98d086 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements-generic.src.ts @@ -0,0 +1,3 @@ +class Foo implements Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements.src.ts new file mode 100644 index 000000000000..321a2ea746ae --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-implements.src.ts @@ -0,0 +1,3 @@ +class Foo implements Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin.src.ts new file mode 100644 index 000000000000..975b36a3e7d1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin.src.ts @@ -0,0 +1,9 @@ +function M>(Base: T) { + return class extends Base { } +} + +class X extends M(C) implements I { } + +class C { } +interface I { } +type Constructor = new (...args: any[]) => T; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-computed-property.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-computed-property.src.ts new file mode 100644 index 000000000000..5dd15f31b2a1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-computed-property.src.ts @@ -0,0 +1,3 @@ +class X { + private ['foo']? = undefined; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-methods.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-methods.src.ts new file mode 100644 index 000000000000..2fe152d3d419 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-methods.src.ts @@ -0,0 +1,5 @@ +class Foo { + foo?(); + bar?(): string; + private baz?(): string; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-properties.src.ts new file mode 100644 index 000000000000..536aab8062dc --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-properties.src.ts @@ -0,0 +1,5 @@ +class Foo { + foo?; + bar? : string; + private baz? : string; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts new file mode 100644 index 000000000000..126d595430f0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts @@ -0,0 +1,4 @@ +class X { + private foo? = undefined; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts new file mode 100644 index 000000000000..f806c1ee9f8a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts @@ -0,0 +1,6 @@ +class Foo { + constructor(private firstName: string, + private readonly lastName: string, + private age: number = 30, + private readonly student: boolean = false) {} +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts new file mode 100644 index 000000000000..1abd3446ff0d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts @@ -0,0 +1,6 @@ +class Foo { + constructor(protected firstName: string, + protected readonly lastName: string, + protected age: number = 30, + protected readonly student: boolean = false) {} +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts new file mode 100644 index 000000000000..cf2ee5a5062e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts @@ -0,0 +1,6 @@ +class Foo { + constructor(public firstName: string, + public readonly lastName: string, + public age: number = 30, + public readonly student: boolean = false) {} +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts new file mode 100644 index 000000000000..2525c6720f21 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts @@ -0,0 +1,4 @@ +class Foo { + constructor(readonly firstName: string, + readonly lastName: string = 'Smith') {} +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-property.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-property.src.ts new file mode 100644 index 000000000000..feb96572fa88 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-readonly-property.src.ts @@ -0,0 +1,3 @@ +class Foo { + public readonly foo = 'string'; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts new file mode 100644 index 000000000000..b11377560f8c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts @@ -0,0 +1,7 @@ +class Foo { + constructor(static a: string) { + + } +} + + diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-default.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-default.src.ts new file mode 100644 index 000000000000..b416539347d4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-default.src.ts @@ -0,0 +1,3 @@ +class Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts new file mode 100644 index 000000000000..f68d76c805e6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts @@ -0,0 +1 @@ +class A<__P> {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter.src.ts new file mode 100644 index 000000000000..4c6ce17948cb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-type-parameter.src.ts @@ -0,0 +1,3 @@ +class Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/const-enum.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/const-enum.src.ts new file mode 100644 index 000000000000..40f9491211d2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/const-enum.src.ts @@ -0,0 +1,4 @@ +const enum Foo { + foo = 1, + bar +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/declare-class-with-optional-method.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/declare-class-with-optional-method.src.ts new file mode 100644 index 000000000000..ecb4a4e11487 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/declare-class-with-optional-method.src.ts @@ -0,0 +1,3 @@ +declare class Foo { + bar?(): any; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/declare-function.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/declare-function.src.ts new file mode 100644 index 000000000000..4f4d10709f56 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/declare-function.src.ts @@ -0,0 +1 @@ +declare function foo(bar: string): string; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment.src.ts new file mode 100644 index 000000000000..d29509f70afd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment.src.ts @@ -0,0 +1 @@ +({ foo = [] } = bar); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-assignment.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-assignment.src.ts new file mode 100644 index 000000000000..36a5d0e319d8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-assignment.src.ts @@ -0,0 +1 @@ +export = foo; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-generic.src.ts new file mode 100644 index 000000000000..8b0d9acbf807 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-generic.src.ts @@ -0,0 +1,3 @@ +export default class { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts new file mode 100644 index 000000000000..7eb59ca4e0c7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts @@ -0,0 +1,3 @@ +export default class { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-generic.src.ts new file mode 100644 index 000000000000..ad37e87c5551 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-generic.src.ts @@ -0,0 +1,3 @@ +export class Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts new file mode 100644 index 000000000000..9abd7bb1623e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts @@ -0,0 +1,3 @@ +export class Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-enum.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-enum.src.ts new file mode 100644 index 000000000000..b651108672c9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-named-enum.src.ts @@ -0,0 +1,4 @@ +export enum Foo { + foo = 1, + bar +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-alias-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-alias-declaration.src.ts new file mode 100644 index 000000000000..d166857d8a5e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-alias-declaration.src.ts @@ -0,0 +1 @@ +export type TestAlias = string | number; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-class-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-class-declaration.src.ts new file mode 100644 index 000000000000..a7999bbcaa15 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-class-declaration.src.ts @@ -0,0 +1,3 @@ +export type TestClassProps = { + count: number +}; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-function-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-function-declaration.src.ts new file mode 100644 index 000000000000..1948b43ead29 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-type-function-declaration.src.ts @@ -0,0 +1 @@ +export type TestCallback = (a: number) => void; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-await.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-await.src.ts new file mode 100644 index 000000000000..e867dc45d20a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-await.src.ts @@ -0,0 +1,3 @@ +async function hope(future) { + await future; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts new file mode 100644 index 000000000000..49837b4a1505 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts @@ -0,0 +1,3 @@ +function foo({bar, baz}: {bar?: string, baz?}) { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts new file mode 100644 index 000000000000..bd3604de9f7f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts @@ -0,0 +1,3 @@ +function foo({bar, baz}: {bar: string, baz}) { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts new file mode 100644 index 000000000000..1b328010c98b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts @@ -0,0 +1 @@ +function compare() {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts new file mode 100644 index 000000000000..f3c4d2eaa906 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts @@ -0,0 +1,3 @@ +function a(b: X): X { + return b; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters.src.ts new file mode 100644 index 000000000000..cd0bdc5cc45b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-type-parameters.src.ts @@ -0,0 +1,3 @@ +function a(b: X): X { + return b; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types-assignation.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types-assignation.src.ts new file mode 100644 index 000000000000..b6d3f08924a0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types-assignation.src.ts @@ -0,0 +1,3 @@ +function message(name:string, age:number = 100, ...args:Array):string { + return name; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types.src.ts new file mode 100644 index 000000000000..57eb3a476d15 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-with-types.src.ts @@ -0,0 +1,3 @@ +function message(name:string):string { + return name; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts new file mode 100644 index 000000000000..2c8acc12d369 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts @@ -0,0 +1 @@ +type X = A>; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/import-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/import-type.src.ts new file mode 100644 index 000000000000..00e3ba6afc1e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/import-type.src.ts @@ -0,0 +1,2 @@ +type A = typeof import('A'); +type B = import("B").X; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends-multiple.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends-multiple.src.ts new file mode 100644 index 000000000000..e3b646613572 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends-multiple.src.ts @@ -0,0 +1,3 @@ +interface Foo extends Bar,Baz { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends.src.ts new file mode 100644 index 000000000000..1cc0e41709ea --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-extends.src.ts @@ -0,0 +1,3 @@ +interface Foo extends Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-type-parameters.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-type-parameters.src.ts new file mode 100644 index 000000000000..d2c9ee32ff79 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-type-parameters.src.ts @@ -0,0 +1,3 @@ +interface Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-all-property-types.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-all-property-types.src.ts new file mode 100644 index 000000000000..90f0c80ebc41 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-all-property-types.src.ts @@ -0,0 +1,15 @@ +interface Foo { + baa: number; + bar?: number; + [bax]: string; + [baz]?: string; + [eee: number]: string; + [fff?: number]: string; + doo(): void; + doo?(a, b, c): void; + [loo]?(a, b, c): void; + boo(a, b, c): void; + new (a, b?): string; + new (a, b?): string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts new file mode 100644 index 000000000000..4d52aa4cc16c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts @@ -0,0 +1,3 @@ +interface Test { + new (public x, private y); +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts new file mode 100644 index 000000000000..5387a76cc744 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts @@ -0,0 +1,3 @@ +interface Foo extends Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-generic.src.ts new file mode 100644 index 000000000000..ec88864d2f07 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-generic.src.ts @@ -0,0 +1,2 @@ +interface Test { +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-jsdoc.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-jsdoc.src.ts new file mode 100644 index 000000000000..698a393860f3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-jsdoc.src.ts @@ -0,0 +1,7 @@ +interface Test { + /** + * Comment Line 1 + * @baz bar + */ + foo(bar); +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-optional-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-optional-properties.src.ts new file mode 100644 index 000000000000..448d419a81cd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-optional-properties.src.ts @@ -0,0 +1,5 @@ +interface test { + foo?; + bar?: string; + baz?(foo, bar?: string, baz?); +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-without-type-annotation.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-without-type-annotation.src.ts new file mode 100644 index 000000000000..31f184e8e67a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-without-type-annotation.src.ts @@ -0,0 +1,3 @@ +interface test { + foo; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/keyof-operator.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/keyof-operator.src.ts new file mode 100644 index 000000000000..d4cf1df7a5f0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/keyof-operator.src.ts @@ -0,0 +1 @@ +type x = keyof foo; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/nested-type-arguments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/nested-type-arguments.src.ts new file mode 100644 index 000000000000..1e9f54230af3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/nested-type-arguments.src.ts @@ -0,0 +1 @@ +var nestedArray: Array>> \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/never-type-param.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/never-type-param.src.ts new file mode 100644 index 000000000000..bff38e99ba01 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/never-type-param.src.ts @@ -0,0 +1,2 @@ +const x: X; +Observable.empty(); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/non-null-assertion-operator.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/non-null-assertion-operator.src.ts new file mode 100644 index 000000000000..18e73855fd2e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/non-null-assertion-operator.src.ts @@ -0,0 +1,4 @@ +function processEntity(e?: Entity) { + validateEntity(e); + let s = e!.name; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts new file mode 100644 index 000000000000..7d6b5821f389 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts @@ -0,0 +1,2 @@ +let x: null; +let y: undefined; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/object-with-escaped-properties.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/object-with-escaped-properties.src.ts new file mode 100644 index 000000000000..430a8bad251d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/object-with-escaped-properties.src.ts @@ -0,0 +1,7 @@ +({ '__': null }); + +({ '__'() {} }); + +({ ['__']: null }); + +class X { '__' = null } diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/symbol-type-param.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/symbol-type-param.src.ts new file mode 100644 index 000000000000..b5b19ced740e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/symbol-type-param.src.ts @@ -0,0 +1 @@ +function test(abc: Map) {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts new file mode 100644 index 000000000000..0c5e89163a40 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts @@ -0,0 +1 @@ +type Result = Success | Failure \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration.src.ts new file mode 100644 index 000000000000..c2067d850774 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-declaration.src.ts @@ -0,0 +1 @@ +type Result = Success | Failure \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts new file mode 100644 index 000000000000..5c542c940ace --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts @@ -0,0 +1 @@ +type foo = {bar: string, baz}; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard.src.ts new file mode 100644 index 000000000000..cd0aad9a869c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard.src.ts @@ -0,0 +1,3 @@ +function isString(x: any): x is string { + return typeof x === 'string' +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-parameters-comments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-parameters-comments.src.ts new file mode 100644 index 000000000000..b79b05bda402 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-parameters-comments.src.ts @@ -0,0 +1,3 @@ +foo< /* comment 1 */ A /* comment 2 */ >(); +function bar< /* aaa */ A /* bbb */ >() { } +function baz< /* aaa */ A /* bbb */ = Foo >() { } diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-reference-comments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-reference-comments.src.ts new file mode 100644 index 000000000000..3ca1f8dbb282 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-reference-comments.src.ts @@ -0,0 +1,3 @@ +class AudioBufferList { + mBuffers: interop.Reference; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-this.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-this.src.ts new file mode 100644 index 000000000000..398775778522 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-this.src.ts @@ -0,0 +1,3 @@ +interface UIElement { + addClickListener(onclick: (this: void, e: Event) => void): void; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/unique-symbol.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/unique-symbol.src.ts new file mode 100644 index 000000000000..6d1be9873bdb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/unique-symbol.src.ts @@ -0,0 +1 @@ +type A = unique symbol; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-definite-assignment.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-definite-assignment.src.ts new file mode 100644 index 000000000000..60906317fcad --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-definite-assignment.src.ts @@ -0,0 +1,3 @@ +const x!: string; +var y!: number; +let z!: object; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-dotted-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-dotted-type.src.ts new file mode 100644 index 000000000000..ff0a1885271c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-dotted-type.src.ts @@ -0,0 +1 @@ +var foo: A.B.C; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-type.src.ts new file mode 100644 index 000000000000..547ca4bd9180 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/var-with-type.src.ts @@ -0,0 +1,2 @@ +var name:string = "Nicholas"; +var foo: string = "Bar"; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts new file mode 100644 index 000000000000..03b1ebddffb6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts @@ -0,0 +1 @@ +let x : string; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts new file mode 100644 index 000000000000..24f2b53691d1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts @@ -0,0 +1,4 @@ +class Point { + @configurable(false) + get x() { return this._x; } +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts new file mode 100644 index 000000000000..f48e71052ebe --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts @@ -0,0 +1,4 @@ +class Other { + @foo({ baz: true }) + static get bar() { return this._bar; } +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts new file mode 100644 index 000000000000..4cea72889f61 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts @@ -0,0 +1,4 @@ +class P { + @hidden + get z() { return this._z; } +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts new file mode 100644 index 000000000000..f9b2964c0f70 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts @@ -0,0 +1,6 @@ +class User { + @adminonly + static set y(a) { + this._y = a; + } +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts new file mode 100644 index 000000000000..873263376e30 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts @@ -0,0 +1,4 @@ +@Component({ + selector: 'foo', +}) +class FooComponent {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts new file mode 100644 index 000000000000..a72a8ff5dcb1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts @@ -0,0 +1,2 @@ +@sealed +class Qux {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts new file mode 100644 index 000000000000..12898791abbd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts @@ -0,0 +1,4 @@ +class B { + @onlyRead(false) + instanceMethod() {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts new file mode 100644 index 000000000000..735541ffeb71 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts @@ -0,0 +1,4 @@ +class C { + @Foo(false) + static staticMethod() {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts new file mode 100644 index 000000000000..a0e5e11a6190 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts @@ -0,0 +1,4 @@ +class A { + @onlyRead + instanceMethod() {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts new file mode 100644 index 000000000000..59fc47fe0825 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts @@ -0,0 +1,4 @@ +class D { + @Foo + static staticMethod() {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts new file mode 100644 index 000000000000..066334bf8743 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts @@ -0,0 +1,5 @@ +class Service { + constructor(@Inject(APP_CONFIG) config: AppConfig) { + this.title = config.title; + } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts new file mode 100644 index 000000000000..9b8c50c51fe5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts @@ -0,0 +1,3 @@ +class Foo { + bar(@special(true) baz: number) {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts new file mode 100644 index 000000000000..26013fa26279 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts @@ -0,0 +1,3 @@ +class StaticFoo { + static bar(@special(true) baz: number) {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts new file mode 100644 index 000000000000..fa5f4902a309 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts @@ -0,0 +1,5 @@ +class Greeter { + greet(@required name: string) { + return "Hello " + name + "!"; + } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts new file mode 100644 index 000000000000..ad512a2c2640 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts @@ -0,0 +1,5 @@ +class StaticGreeter { + static greet(@required name: string) { + return "Hello " + name + "!"; + } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts new file mode 100644 index 000000000000..4e618d12dc37 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts @@ -0,0 +1,5 @@ +class SomeComponent { + @Input() data; + @Output() + click = new EventEmitter(); +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts new file mode 100644 index 000000000000..c49b797bf305 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts @@ -0,0 +1,6 @@ +class A { + @configurable(true) static prop1; + + @configurable(false) + static prop2; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts new file mode 100644 index 000000000000..8b13a2f4c09b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts @@ -0,0 +1,5 @@ +class B { + @foo x; + @bar + y; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts new file mode 100644 index 000000000000..df529500e508 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts @@ -0,0 +1,5 @@ +class C { + @baz static a; + @qux + static b; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts new file mode 100644 index 000000000000..0d08522dbc07 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts @@ -0,0 +1,3 @@ +class Foo extends implements Bar { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends.src.ts new file mode 100644 index 000000000000..47a27e783f28 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-empty-extends.src.ts @@ -0,0 +1,3 @@ +class Foo extends { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts new file mode 100644 index 000000000000..42b4c0565f4b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts @@ -0,0 +1,3 @@ +class Foo extends Bar implements { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts new file mode 100644 index 000000000000..c5d3bb05ffc8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts @@ -0,0 +1 @@ +@dec enum E {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts new file mode 100644 index 000000000000..adb33f8e53bd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts @@ -0,0 +1,2 @@ +@deco() +interface M {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts new file mode 100644 index 000000000000..d0a415f25ae5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts @@ -0,0 +1 @@ +const foo: Foo<> \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts new file mode 100644 index 000000000000..a568bf4fcc43 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts @@ -0,0 +1 @@ +export private public protected static readonly abstract async enum X {} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts new file mode 100644 index 000000000000..dae1275e6b11 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts @@ -0,0 +1,3 @@ +interface Foo extends { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts new file mode 100644 index 000000000000..02c0c9131844 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts @@ -0,0 +1,24 @@ +interface Foo { + bar: string = 'a'; + public a: string; + private b: string; + protected c: string; + static d: string; + export e: string; + readonly f: string; + + public [baz: string]: string; + private [baz: string]: string; + protected [baz: string]: string; + static [baz: string]: string; + export [baz: string]: string; + readonly [baz: string]: string; + + public g(bar: string): void; + private h(bar: string): void; + protected i(bar: string): void; + static j(bar: string): void; + export k(bar: string): void; + readonly l(bar: string): void; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/expressions/call-expression-type-arguments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/expressions/call-expression-type-arguments.src.ts new file mode 100644 index 000000000000..2421c8b7a8c2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/expressions/call-expression-type-arguments.src.ts @@ -0,0 +1,2 @@ +foo(); +foo(); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/expressions/new-expression-type-arguments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/expressions/new-expression-type-arguments.src.ts new file mode 100644 index 000000000000..7e38b6d3d662 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/expressions/new-expression-type-arguments.src.ts @@ -0,0 +1 @@ +const a = new A(); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts b/packages/typescript-estree/tests/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts new file mode 100644 index 000000000000..aff1105de138 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts @@ -0,0 +1 @@ +foo`baz`; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts new file mode 100644 index 000000000000..9b551c215336 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts @@ -0,0 +1,3 @@ +declare module "i-use-things" { + import fs from 'fs'; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts new file mode 100644 index 000000000000..403557868e70 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts @@ -0,0 +1,3 @@ +declare namespace d3 { + export function select(selector: string): Selection; +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts new file mode 100644 index 000000000000..ae4410a51bd3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts @@ -0,0 +1,7 @@ +module "foo" { + export default class C { + method(): C {}; + } + export default function bar() {} +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts new file mode 100644 index 000000000000..3b55650bc894 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts @@ -0,0 +1,12 @@ +module A { + + export var x = 'hello world' + export class Point { + constructor(public x: number, public y: number) { } + } + export module B { + export interface Id { + name: string; + } + } +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts new file mode 100644 index 000000000000..b8df95b7de58 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts @@ -0,0 +1 @@ +declare module "hot-new-module"; diff --git a/packages/typescript-estree/tests/jsx-known-issues.js b/packages/typescript-estree/tests/jsx-known-issues.js new file mode 100644 index 000000000000..92cb4d661cc9 --- /dev/null +++ b/packages/typescript-estree/tests/jsx-known-issues.js @@ -0,0 +1,11 @@ +"use strict"; + +/** + * Export the list to allow it to be used within both unit and AST comparison tests + */ +module.exports = [ + "jsx/embedded-tags", // https://github.com/Microsoft/TypeScript/issues/7410 + "jsx/namespaced-attribute-and-value-inserted", // https://github.com/Microsoft/TypeScript/issues/7411 + "jsx/namespaced-name-and-attribute", // https://github.com/Microsoft/TypeScript/issues/7411 + "jsx/invalid-namespace-value-with-dots" // https://github.com/Microsoft/TypeScript/issues/7411 +]; diff --git a/packages/typescript-estree/tests/lib/.eslintrc.yml b/packages/typescript-estree/tests/lib/.eslintrc.yml new file mode 100644 index 000000000000..e19b2cfa824a --- /dev/null +++ b/packages/typescript-estree/tests/lib/.eslintrc.yml @@ -0,0 +1,2 @@ +env: + jest: true diff --git a/packages/typescript-estree/tests/lib/__snapshots__/basics.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/basics.js.snap new file mode 100644 index 000000000000..68590ebf8bfe --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/basics.js.snap @@ -0,0 +1,3140 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`basics fixtures/delete-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 14, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "delete", + "prefix": true, + "range": Array [ + 0, + 14, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "delete", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/do-while-statements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "EmptyStatement", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "DoWhileStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "i", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 25, + ], + "type": "VariableDeclaration", + }, + Object { + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "name": "i", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "operator": "+=", + "range": Array [ + 34, + 40, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 29, + 43, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 26, + 58, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "name": "i", + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "operator": "<", + "range": Array [ + 51, + 56, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "BinaryExpression", + }, + "type": "DoWhileStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Keyword", + "value": "do", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "Keyword", + "value": "do", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "Punctuator", + "value": "+=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 44, + 49, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 15, + "line": 6, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/identifiers-double-underscore.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "__test", + "range": Array [ + 4, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "raw": "'ff'", + "type": "Literal", + "value": "ff", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 32, + 36, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "__Foo", + "range": Array [ + 26, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 20, + 36, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 55, + 59, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "name": "__Bar", + "range": Array [ + 47, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "params": Array [], + "range": Array [ + 38, + 59, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 60, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 10, + ], + "type": "Identifier", + "value": "__test", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "String", + "value": "'ff'", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 20, + 25, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 26, + 31, + ], + "type": "Identifier", + "value": "__Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 38, + 46, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 47, + 52, + ], + "type": "Identifier", + "value": "__Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 7, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/instanceof.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "raw": "''", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "instanceof", + "range": Array [ + 0, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "Set", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "String", + "value": "''", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 13, + ], + "type": "Keyword", + "value": "instanceof", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "Set", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/new-with-member-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 4, + 11, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "NewExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/new-without-parens.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 16, + ], + "type": "FunctionDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "X", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 22, + ], + "type": "NewExpression", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/typeof-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "'str'", + "type": "Literal", + "value": "str", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "typeof", + "prefix": true, + "range": Array [ + 0, + 12, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "'str'", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/update-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "i", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "operator": "++", + "prefix": false, + "range": Array [ + 28, + 31, + ], + "type": "UpdateExpression", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 24, + 34, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "f", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 11, + 34, + ], + "type": "FunctionDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "name": "f", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 11, + 19, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Punctuator", + "value": "++", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`basics fixtures/void-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "void", + "prefix": true, + "range": Array [ + 0, + 6, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "void", + "prefix": true, + "range": Array [ + 8, + 15, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 12, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/comments.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/comments.js.snap new file mode 100644 index 000000000000..41309c3f7edc --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/comments.js.snap @@ -0,0 +1,9303 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Comments fixtures/block-trailing-comment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "BlockStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 15, + 24, + ], + "type": "Line", + "value": "comment", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/comment-within-condition.src 1`] = ` +Object { + "body": Array [ + Object { + "alternate": null, + "consequent": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 30, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "type": "IfStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Block", + "value": " foo ", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 23, + ], + "type": "Block", + "value": " bar ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Keyword", + "value": "if", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/export-default-anonymous-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "method1", + "range": Array [ + 103, + 110, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 103, + 119, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 112, + 119, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "params": Array [], + "range": Array [ + 110, + 119, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 57, + 121, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 51, + 121, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 36, + 121, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "type": "Block", + "value": "* + * this is anonymous class. + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 63, + 98, + ], + "type": "Block", + "value": "* + * this is method1. + ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 36, + 122, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "range": Array [ + 43, + 50, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 51, + 56, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 103, + 110, + ], + "type": "Identifier", + "value": "method1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 111, + 112, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 118, + 119, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "range": Array [ + 120, + 121, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/jsdoc-comment.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "name": "bar", + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 123, + 134, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "range": Array [ + 117, + 136, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 108, + 111, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "name": "bar", + "range": Array [ + 112, + 115, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 99, + 136, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 98, + ], + "type": "Block", + "value": "* + * This is a function. + * @param {String} bar some string + * @returns {String} returns bar + ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 99, + 137, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 99, + 107, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 108, + 111, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 111, + 112, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 112, + 115, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 123, + 129, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 135, + 136, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/jsx-block-comment.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "pure", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 47, + 60, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 61, + 72, + ], + "type": "JSXEmptyExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 60, + 73, + ], + "type": "JSXExpressionContainer", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 73, + 82, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "name": "Foo", + "range": Array [ + 84, + 87, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 82, + 88, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 43, + 46, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 42, + 47, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 42, + 88, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 95, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 97, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 97, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 97, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 97, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 61, + 72, + ], + "type": "Block", + "value": "COMMENT", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 98, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "pure", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 47, + 60, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 73, + 82, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 84, + 87, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 87, + 88, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 93, + 94, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 5, + "line": 6, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/jsx-tag-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "pure", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 103, + 112, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "name": "Foo", + "range": Array [ + 114, + 117, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 112, + 118, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 43, + 46, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 42, + 103, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 42, + 118, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 125, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 127, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 127, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 127, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 127, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 59, + 68, + ], + "type": "Line", + "value": " single", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 81, + 92, + ], + "type": "Block", + "value": " block ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 129, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "pure", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 103, + 112, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 113, + 114, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 114, + 117, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 13, + "line": 7, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 123, + 124, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 8, + }, + "start": Object { + "column": 5, + "line": 8, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/line-comment-with-block-syntax.src 1`] = ` +Object { + "body": Array [], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "Line", + "value": " /*test*/", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 12, + 12, + ], + "sourceType": "script", + "tokens": Array [], + "type": "Program", +} +`; + +exports[`Comments fixtures/mix-line-and-block-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "zzz", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 24, + 27, + ], + "raw": "777", + "type": "Literal", + "value": 777, + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 6, + 28, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Line", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Block", + "value": "aaa", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "Line", + "value": "bar", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 6, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "zzz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Numeric", + "value": "777", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/no-comment-regex.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "regex", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 33, + ], + "raw": "/no comment\\\\/**foo/", + "regex": Object { + "flags": "", + "pattern": "no comment\\\\/**foo", + }, + "type": "Literal", + "value": null, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 33, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + "value": "regex", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 33, + ], + "regex": Object { + "flags": "", + "pattern": "no comment\\\\/**foo", + }, + "type": "RegularExpression", + "value": "/no comment\\\\/**foo/", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/no-comment-template.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "str", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "expressions": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "__dirname", + "range": Array [ + 15, + 24, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": "", + "raw": "", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 36, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "/test/*.js", + "raw": "/test/*.js", + }, + }, + ], + "range": Array [ + 12, + 36, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 36, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "str", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Template", + "value": "\`\${", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 24, + ], + "type": "Identifier", + "value": "__dirname", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 36, + ], + "type": "Template", + "value": "}/test/*.js\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/surrounding-call-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "foo", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 60, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 60, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 31, + ], + "type": "Block", + "value": " before ", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 47, + 58, + ], + "type": "Block", + "value": " after ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 61, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/surrounding-debugger-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 45, + ], + "type": "DebuggerStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 63, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 63, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 31, + ], + "type": "Block", + "value": " before ", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 50, + 61, + ], + "type": "Block", + "value": " after ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 64, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 44, + ], + "type": "Keyword", + "value": "debugger", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/surrounding-return-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 61, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 61, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 31, + ], + "type": "Block", + "value": " before ", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 48, + 59, + ], + "type": "Block", + "value": " after ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 62, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/surrounding-throw-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 42, + 44, + ], + "raw": "55", + "type": "Literal", + "value": 55, + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 45, + ], + "type": "ThrowStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 63, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 63, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 31, + ], + "type": "Block", + "value": " before ", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 50, + 61, + ], + "type": "Block", + "value": " after ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 64, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "Keyword", + "value": "throw", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 42, + 44, + ], + "type": "Numeric", + "value": "55", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/surrounding-while-loop-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 46, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 41, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "WhileStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 65, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "name": "each", + "range": Array [ + 61, + 65, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 65, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "range": Array [ + 61, + 65, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 66, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 68, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 68, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 29, + ], + "type": "Block", + "value": " infinite ", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 56, + ], + "type": "Block", + "value": " bar ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 69, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 35, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 41, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 60, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 60, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 65, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "range": Array [ + 61, + 65, + ], + "type": "Identifier", + "value": "each", + }, + Object { + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 67, + "line": 1, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/switch-fallthrough-comment.src 1`] = ` +Object { + "body": Array [ + Object { + "cases": Array [ + Object { + "consequent": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 29, + 36, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "SwitchCase", + }, + Object { + "consequent": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "name": "doIt", + "range": Array [ + 82, + 86, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 82, + 88, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 82, + 89, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 66, + 89, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 71, + 72, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 91, + ], + "type": "SwitchStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "Line", + "value": " foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 45, + 61, + ], + "type": "Line", + "value": " falls through", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 92, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "switch", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 29, + 33, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 66, + 70, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 82, + 86, + ], + "type": "Identifier", + "value": "doIt", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 87, + 88, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/switch-fallthrough-comment-in-function.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "cases": Array [ + Object { + "consequent": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 61, + 68, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "SwitchCase", + }, + Object { + "consequent": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "name": "doIt", + "range": Array [ + 126, + 130, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 126, + 132, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 126, + 133, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 106, + 133, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 111, + 112, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 24, + 139, + ], + "type": "SwitchStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 141, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 141, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "Line", + "value": " foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 81, + 97, + ], + "type": "Line", + "value": " falls through", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 142, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "Keyword", + "value": "switch", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 61, + 65, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 106, + 110, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 111, + 112, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 126, + 130, + ], + "type": "Identifier", + "value": "doIt", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 16, + "line": 7, + }, + }, + "range": Array [ + 130, + 131, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "range": Array [ + 132, + 133, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 138, + 139, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 140, + 141, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/switch-no-default-comment.src 1`] = ` +Object { + "body": Array [ + Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "BreakStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 39, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "type": "SwitchStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 44, + 56, + ], + "type": "Line", + "value": "no default", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "switch", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 33, + 38, + ], + "type": "Keyword", + "value": "break", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/switch-no-default-comment-in-function.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 63, + 69, + ], + "type": "BreakStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 43, + 69, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "SwitchCase", + }, + Object { + "consequent": Array [ + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 98, + 104, + ], + "type": "BreakStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 104, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 83, + 84, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 131, + ], + "type": "SwitchStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 133, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 133, + ], + "type": "FunctionDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 113, + 125, + ], + "type": "Line", + "value": "no default", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 134, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Keyword", + "value": "switch", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 43, + 47, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 63, + 68, + ], + "type": "Keyword", + "value": "break", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 82, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 98, + 103, + ], + "type": "Keyword", + "value": "break", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 103, + 104, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 130, + 131, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 132, + 133, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/switch-no-default-comment-in-nested-functions.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "module", + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "exports", + "range": Array [ + 7, + 14, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 14, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 286, + ], + "right": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "argument": Object { + "arguments": Array [ + Object { + "computed": true, + "loc": Object { + "end": Object { + "column": 79, + "line": 6, + }, + "start": Object { + "column": 34, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 50, + "line": 6, + }, + "start": Object { + "column": 34, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 6, + }, + "start": Object { + "column": 34, + "line": 6, + }, + }, + "name": "node", + "range": Array [ + 172, + 176, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 6, + }, + "start": Object { + "column": 39, + "line": 6, + }, + }, + "name": "expressions", + "range": Array [ + 177, + 188, + ], + "type": "Identifier", + }, + "range": Array [ + 172, + 188, + ], + "type": "MemberExpression", + }, + "property": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 74, + "line": 6, + }, + "start": Object { + "column": 51, + "line": 6, + }, + }, + "object": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 67, + "line": 6, + }, + "start": Object { + "column": 51, + "line": 6, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 6, + }, + "start": Object { + "column": 51, + "line": 6, + }, + }, + "name": "node", + "range": Array [ + 189, + 193, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 67, + "line": 6, + }, + "start": Object { + "column": 56, + "line": 6, + }, + }, + "name": "expressions", + "range": Array [ + 194, + 205, + ], + "type": "Identifier", + }, + "range": Array [ + 189, + 205, + ], + "type": "MemberExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 74, + "line": 6, + }, + "start": Object { + "column": 68, + "line": 6, + }, + }, + "name": "length", + "range": Array [ + 206, + 212, + ], + "type": "Identifier", + }, + "range": Array [ + 189, + 212, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 78, + "line": 6, + }, + "start": Object { + "column": 51, + "line": 6, + }, + }, + "operator": "-", + "range": Array [ + 189, + 216, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 78, + "line": 6, + }, + "start": Object { + "column": 77, + "line": 6, + }, + }, + "range": Array [ + 215, + 216, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", + }, + "range": Array [ + 172, + 217, + ], + "type": "MemberExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 6, + }, + "start": Object { + "column": 23, + "line": 6, + }, + }, + "name": "isConstant", + "range": Array [ + 161, + 171, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 80, + "line": 6, + }, + "start": Object { + "column": 23, + "line": 6, + }, + }, + "range": Array [ + 161, + 218, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 81, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 154, + 219, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 81, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 111, + 219, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 116, + 136, + ], + "raw": "\\"SequenceExpression\\"", + "type": "Literal", + "value": "SequenceExpression", + }, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "node", + "range": Array [ + 86, + 90, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "name": "type", + "range": Array [ + 91, + 95, + ], + "type": "Identifier", + }, + "range": Array [ + 86, + 95, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 78, + 255, + ], + "type": "SwitchStatement", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, + }, + "range": Array [ + 271, + 276, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 264, + 277, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 68, + 283, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "isConstant", + "range": Array [ + 51, + 61, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "name": "node", + "range": Array [ + 62, + 66, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 42, + 283, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 286, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "context", + "range": Array [ + 26, + 33, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 17, + 286, + ], + "type": "FunctionExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 287, + ], + "type": "ExpressionStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 232, + 245, + ], + "type": "Line", + "value": " no default", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 288, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Identifier", + "value": "exports", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "Identifier", + "value": "context", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 42, + 50, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 51, + 61, + ], + "type": "Identifier", + "value": "isConstant", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 62, + 66, + ], + "type": "Identifier", + "value": "node", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 78, + 84, + ], + "type": "Keyword", + "value": "switch", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 86, + 90, + ], + "type": "Identifier", + "value": "node", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 91, + 95, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 95, + 96, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 97, + 98, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 111, + 115, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 116, + 136, + ], + "type": "String", + "value": "\\"SequenceExpression\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 154, + 160, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 6, + }, + "start": Object { + "column": 23, + "line": 6, + }, + }, + "range": Array [ + 161, + 171, + ], + "type": "Identifier", + "value": "isConstant", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 6, + }, + "start": Object { + "column": 33, + "line": 6, + }, + }, + "range": Array [ + 171, + 172, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 6, + }, + "start": Object { + "column": 34, + "line": 6, + }, + }, + "range": Array [ + 172, + 176, + ], + "type": "Identifier", + "value": "node", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 6, + }, + "start": Object { + "column": 38, + "line": 6, + }, + }, + "range": Array [ + 176, + 177, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 6, + }, + "start": Object { + "column": 39, + "line": 6, + }, + }, + "range": Array [ + 177, + 188, + ], + "type": "Identifier", + "value": "expressions", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 6, + }, + "start": Object { + "column": 50, + "line": 6, + }, + }, + "range": Array [ + 188, + 189, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 6, + }, + "start": Object { + "column": 51, + "line": 6, + }, + }, + "range": Array [ + 189, + 193, + ], + "type": "Identifier", + "value": "node", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 6, + }, + "start": Object { + "column": 55, + "line": 6, + }, + }, + "range": Array [ + 193, + 194, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 67, + "line": 6, + }, + "start": Object { + "column": 56, + "line": 6, + }, + }, + "range": Array [ + 194, + 205, + ], + "type": "Identifier", + "value": "expressions", + }, + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 6, + }, + "start": Object { + "column": 67, + "line": 6, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 74, + "line": 6, + }, + "start": Object { + "column": 68, + "line": 6, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "Identifier", + "value": "length", + }, + Object { + "loc": Object { + "end": Object { + "column": 76, + "line": 6, + }, + "start": Object { + "column": 75, + "line": 6, + }, + }, + "range": Array [ + 213, + 214, + ], + "type": "Punctuator", + "value": "-", + }, + Object { + "loc": Object { + "end": Object { + "column": 78, + "line": 6, + }, + "start": Object { + "column": 77, + "line": 6, + }, + }, + "range": Array [ + 215, + 216, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 6, + }, + "start": Object { + "column": 78, + "line": 6, + }, + }, + "range": Array [ + 216, + 217, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 6, + }, + "start": Object { + "column": 79, + "line": 6, + }, + }, + "range": Array [ + 217, + 218, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 81, + "line": 6, + }, + "start": Object { + "column": 80, + "line": 6, + }, + }, + "range": Array [ + 218, + 219, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 254, + 255, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 264, + 270, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, + }, + "range": Array [ + 271, + 276, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 9, + }, + "start": Object { + "column": 20, + "line": 9, + }, + }, + "range": Array [ + 276, + 277, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 282, + 283, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 12, + }, + }, + "range": Array [ + 285, + 286, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 12, + }, + "start": Object { + "column": 1, + "line": 12, + }, + }, + "range": Array [ + 286, + 287, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/template-string-block.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "expressions": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 3, + 7, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": "", + "raw": "", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "", + "raw": "", + }, + }, + ], + "range": Array [ + 0, + 9, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 56, + 57, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "operator": "+", + "range": Array [ + 56, + 61, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 56, + 62, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 11, + 64, + ], + "type": "BlockStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 17, + 51, + ], + "type": "Block", + "value": " TODO comment comment comment ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 65, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Template", + "value": "\`\${", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Template", + "value": "}\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap new file mode 100644 index 000000000000..1b3cad147936 --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap @@ -0,0 +1,107244 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ecmaFeatures fixtures/arrowFunctions/as-param.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 4, + 12, + ], + "type": "ArrowFunctionExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/as-param-with-params.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 4, + 16, + ], + "type": "ArrowFunctionExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/basic.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 12, + ], + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 12, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 12, + ], + "type": "String", + "value": "\\"test\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 7, + 9, + ], + "type": "ObjectExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 1, + 10, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "+", + "range": Array [ + 0, + 15, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "left": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "properties": Array [], + "range": Array [ + 25, + 27, + ], + "type": "ObjectExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 19, + 28, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "operator": "+", + "range": Array [ + 18, + 33, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 35, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/block-body.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 12, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 12, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 4, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/block-body-not-object.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "body": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "ExpressionStatement", + }, + "label": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "label", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 16, + ], + "type": "LabeledStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 18, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 18, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 4, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + "value": "label", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-dup-params.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 12, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-missing-paren.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-not-arrow.src 1`] = `"Expression expected."`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-numeric-param.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-numeric-param-multi.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-reverse-arrow.src 1`] = `"Expression expected."`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-default-param-eval.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 24, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 14, + 31, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 32, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-dup-params.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 26, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 27, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-eval.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 24, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 25, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 30, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 24, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-eval-return.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 26, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 26, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Numeric", + "value": "42", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-octal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "raw": "00", + "type": "Literal", + "value": 0, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 23, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "Numeric", + "value": "00", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 34, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "arguments", + "range": Array [ + 15, + 24, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 34, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 35, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 24, + ], + "type": "Identifier", + "value": "arguments", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 34, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-eval.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 29, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-names.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 29, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-no-paren-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "arguments", + "range": Array [ + 14, + 23, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 29, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 23, + ], + "type": "Identifier", + "value": "arguments", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-no-paren-eval.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 14, + 24, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-two-lines.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 8, + 16, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/error-wrapped-param.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/arrowFunctions/expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 1, + 7, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/iife.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "property", + "range": Array [ + 8, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 8, + 20, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + }, + ], + "range": Array [ + 6, + 22, + ], + "type": "ObjectExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 23, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 4, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Identifier", + "value": "property", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/multiple-params.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 16, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "type": "String", + "value": "\\"test\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/no-auto-return.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 17, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "arguments", + "range": Array [ + 0, + 9, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 15, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Identifier", + "value": "arguments", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 10, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 10, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 7, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 10, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval-params.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "eval", + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 15, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + "value": "eval", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-octal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "raw": "00", + "type": "Literal", + "value": 0, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 9, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Numeric", + "value": "00", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/return-arrow-function.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 5, + 12, + ], + "type": "ArrowFunctionExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 12, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 4, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/return-sequence.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "async": false, + "body": Object { + "expressions": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 26, + ], + "type": "SequenceExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 8, + 27, + ], + "type": "ArrowFunctionExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 28, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/single-param.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 11, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 4, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "String", + "value": "\\"test\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/single-param-parens.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, + ], + "raw": "\\"test\\"", + "type": "Literal", + "value": "test", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 13, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, + ], + "type": "String", + "value": "\\"test\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "earth", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "sun", + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 14, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + "value": "sun", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + "value": "earth", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/binaryLiterals/lowercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0b101", + "type": "Literal", + "value": 5, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Numeric", + "value": "0b101", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/binaryLiterals/uppercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0B101", + "type": "Literal", + "value": 5, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Numeric", + "value": "0B101", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/blockBindings/const.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/blockBindings/let.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/blockBindings/let-in-switchcase.src 1`] = ` +Object { + "body": Array [ + Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "t", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 37, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 38, + ], + "type": "VariableDeclaration", + }, + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "BreakStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 45, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "answer", + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "type": "SwitchStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "switch", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + "value": "answer", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + "value": "t", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 37, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 44, + ], + "type": "Keyword", + "value": "break", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-accessor-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 14, + 18, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 29, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 24, + 29, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 31, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-computed-static-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 23, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 19, + 23, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 25, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "superClass": null, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-method-named-prototype.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "prototype", + "range": Array [ + 9, + 18, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 18, + 22, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "type": "Identifier", + "value": "prototype", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-method-named-static.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "static", + "range": Array [ + 9, + 15, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 19, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 15, + 19, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-method-named-with-space.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "withSpace", + "range": Array [ + 9, + 18, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 24, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 19, + 24, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 25, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "type": "Identifier", + "value": "withSpace", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-one-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 15, + 19, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-one-method-super.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "Super", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 34, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 15, + 41, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "Keyword", + "value": "super", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-static-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 21, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 17, + 21, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-static-method-named-prototype.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 28, + ], + "raw": "\\"prototype\\"", + "type": "Literal", + "value": "prototype", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 33, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 33, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 29, + 33, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 34, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 28, + ], + "type": "String", + "value": "\\"prototype\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-static-method-named-static.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "static", + "range": Array [ + 16, + 22, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 26, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 22, + 26, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 28, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 21, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 17, + 21, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 38, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 34, + 38, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 56, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 56, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 51, + 56, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 58, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 58, + "line": 1, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 49, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 58, + "line": 1, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-two-computed-static-methods.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 18, + 22, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 37, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 33, + 37, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 38, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-two-methods.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 10, + 14, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 19, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 15, + 19, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 20, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 26, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 22, + 26, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 41, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 46, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 46, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 42, + 46, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 47, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "String", + "value": "\\"constructor\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 41, + ], + "type": "String", + "value": "\\"constructor\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-two-methods-semi.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 10, + 14, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 16, + 20, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-two-methods-three-semi.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 15, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 11, + 15, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 17, + 21, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-two-methods-two-semi.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 10, + 14, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 16, + 20, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 22, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 16, + 27, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 31, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 27, + 31, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 39, + 50, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 54, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "range": Array [ + 52, + 54, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 50, + 54, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 55, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 55, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 27, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 50, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-with-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 9, + 20, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 24, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 20, + 24, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 25, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 20, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-with-constructor-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 9, + 20, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 32, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 20, + 32, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 33, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 20, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/class-with-constructor-with-space.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 9, + 20, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 25, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 21, + 25, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 26, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 20, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/derived-class-assign-to-var.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 27, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 27, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/derived-class-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 18, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/empty-class.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 10, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/empty-class-double-semi.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 10, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/empty-class-semi.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/empty-literal-derived-class.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 15, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/invalid-class-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/invalid-class-setter-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 22, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 17, + 22, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; + +exports[`ecmaFeatures fixtures/classes/named-class-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 11, + ], + "superClass": null, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/classes/named-derived-class-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 20, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/defaultParams/class-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 44, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 37, + 44, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 35, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, + ], + "raw": "'bar'", + "type": "Literal", + "value": "bar", + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 25, + 44, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 46, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, + ], + "type": "String", + "value": "'bar'", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/defaultParams/class-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 36, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 27, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 27, + ], + "raw": "'baz'", + "type": "Literal", + "value": "baz", + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 17, + 36, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 38, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 27, + ], + "type": "String", + "value": "'baz'", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/defaultParams/declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 0, + 20, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/defaultParams/expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 22, + ], + "right": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 4, + 22, + ], + "type": "FunctionExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/defaultParams/method.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 27, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 9, + 25, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 4, + 27, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/defaultParams/not-all-params.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "type": "AssignmentPattern", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 10, + 35, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 35, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 18, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/array-member.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "ok", + "range": Array [ + 1, + 3, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "range": Array [ + 1, + 5, + ], + "type": "MemberExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "20", + "type": "Literal", + "value": 20, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 3, + ], + "type": "Identifier", + "value": "ok", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "v", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "20", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/array-to-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 15, + ], + "right": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/array-var-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "ArrayPattern", + }, + "init": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-array.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "consturctor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 45, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 45, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 36, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 25, + 45, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 47, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "consturctor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "consturctor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 49, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 42, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 40, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 25, + 49, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 51, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "consturctor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "consturctor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 49, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 42, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 27, + 32, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 34, + 39, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 26, + 40, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 25, + 49, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 51, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "consturctor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-object.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "consturctor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 45, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 45, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 27, + 30, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 32, + 35, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 26, + 36, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 25, + 45, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 47, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "consturctor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-method-params-array.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 37, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 28, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 17, + 37, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 24, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 32, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 17, + 41, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 19, + 24, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 24, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 26, + 31, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 18, + 32, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 17, + 41, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/class-method-params-object.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 37, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 19, + 22, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 24, + 27, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 18, + 28, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 17, + 37, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 10, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-array-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "AssignmentPattern", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 26, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 15, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 32, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 22, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 20, + 32, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 4, + 34, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 38, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-array-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 18, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-array-nested-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 22, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 23, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 18, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 19, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 23, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 4, + 12, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "x", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 18, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 20, + 25, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 4, + 26, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-longform.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 15, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 4, + 17, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-longform-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 14, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 27, + 36, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 36, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 4, + 37, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 41, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 36, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 20, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 22, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 27, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 31, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 6, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 8, + 17, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 19, + 20, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 21, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 14, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 18, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-nested-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 18, + 24, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 24, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 16, + 25, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 4, + 26, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 21, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 18, + 19, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 16, + 21, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 4, + 22, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 26, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/destructured-array-catch.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "block": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "method": false, + "range": Array [ + 35, + 36, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 34, + 37, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 42, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 46, + ], + "type": "BlockStatement", + }, + "finalizer": null, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 69, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "param": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "name": "stack", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 55, + 62, + ], + "type": "ArrayPattern", + }, + "range": Array [ + 49, + 69, + ], + "type": "CatchClause", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 69, + ], + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 71, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 11, + 14, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 49, + 54, + ], + "type": "Keyword", + "value": "catch", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + "value": "stack", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/destructured-object-catch.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "block": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "method": false, + "range": Array [ + 35, + 36, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 34, + 37, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 42, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 46, + ], + "type": "BlockStatement", + }, + "finalizer": null, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 69, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "param": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "name": "stack", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "method": false, + "range": Array [ + 56, + 61, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "name": "stack", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 55, + 62, + ], + "type": "ObjectPattern", + }, + "range": Array [ + 49, + 69, + ], + "type": "CatchClause", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 69, + ], + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 71, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 11, + 14, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 49, + 54, + ], + "type": "Keyword", + "value": "catch", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + "value": "stack", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "Object", + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "Object", + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "String", + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "String", + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 29, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + "value": "Object", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + "value": "String", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/named-param.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "responseText", + "range": Array [ + 3, + 15, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 21, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "text", + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 29, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "res", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 15, + ], + "type": "Identifier", + "value": "responseText", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + "value": "text", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "res", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/nested-array.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + null, + Object { + "elements": Array [ + null, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 15, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "ArrayPattern", + }, + "init": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + ], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 29, + ], + "type": "ArrayExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 30, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/nested-object.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 22, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 20, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 14, + 22, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 4, + 24, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 29, + 35, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 35, + ], + "raw": "\\"3\\"", + "type": "Literal", + "value": "3", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 37, + 50, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 42, + 48, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 48, + ], + "raw": "\\"b\\"", + "type": "Literal", + "value": "b", + }, + }, + ], + "range": Array [ + 40, + 50, + ], + "type": "ObjectExpression", + }, + }, + ], + "range": Array [ + 27, + 52, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 52, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 53, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 53, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "String", + "value": "\\"3\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 48, + ], + "type": "String", + "value": "\\"b\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/object-var-named.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 8, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 9, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 12, + 14, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/object-var-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 6, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 7, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 10, + 12, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/param-defaults-array.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 19, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 23, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/param-defaults-object.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 18, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 11, + 19, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 23, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/param-defaults-object-nested.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 18, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 20, + 33, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 25, + 31, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 23, + 33, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 11, + 34, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 38, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/params-array.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 19, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 22, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/params-array-wrapped.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 20, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/params-multi-object.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 14, + 19, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 22, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/params-nested-array.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 27, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + null, + Object { + "elements": Array [ + null, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 22, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 23, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 27, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/params-nested-object.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 16, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 18, + 29, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 23, + 27, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 21, + 29, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 11, + 31, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 35, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/params-object.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 14, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 11, + 19, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 22, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/params-object-wrapped.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 15, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 18, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 12, + 20, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring/sparse-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + null, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "array", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + "value": "array", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 10, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 15, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 3, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 10, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 8, + 9, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 7, + 10, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 1, + 11, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 17, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 2, + 5, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 8, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 20, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 19, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 12, + 20, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 1, + 21, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 27, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 5, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 3, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 1, + 4, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 10, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 8, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 15, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "x", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 8, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 8, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 9, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 15, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "x", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "ArrayExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 8, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 8, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 15, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 13, + 23, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 1, + 24, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 35, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "]", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "ArrayPattern", + }, + "init": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "ArrayPattern", + }, + "init": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 7, + 10, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 6, + 11, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 14, + 16, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 7, + 8, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 6, + 9, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 12, + 14, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 8, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 9, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 12, + 14, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 6, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 7, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 10, + 12, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 20, + ], + "right": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 0, + 24, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 30, + ], + "right": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 15, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 26, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 20, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], + "range": Array [ + 19, + 26, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 4, + 30, + ], + "type": "FunctionExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": true, + "range": Array [ + 2, + 21, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 6, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 7, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 16, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], + "range": Array [ + 10, + 17, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 3, + 21, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 1, + 22, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-forOf/loop.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "EmptyStatement", + }, + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 4, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 1, + 9, + ], + "type": "ObjectPattern", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "ok", + "range": Array [ + 22, + 24, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 25, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 26, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 30, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "Identifier", + "value": "ok", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "RestElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 9, + 10, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 7, + 15, + ], + "type": "ObjectPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 13, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/single-destructured.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 10, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 7, + 8, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 5, + 13, + ], + "type": "ObjectPattern", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 20, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 24, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 17, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 18, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 12, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 10, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 26, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "await": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 59, + 67, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "item", + "range": Array [ + 44, + 48, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 38, + 48, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 27, + 67, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "name": "items", + "range": Array [ + 52, + 57, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 69, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 69, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 70, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 31, + 36, + ], + "type": "Identifier", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 38, + 43, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "Identifier", + "value": "item", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 49, + 51, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 52, + 57, + ], + "type": "Identifier", + "value": "items", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "main", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Import", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "CallExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "then", + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 18, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "'foo'", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + "value": "then", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + "value": "main", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 11, + 20, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 24, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 3, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 1, + 10, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 22, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 15, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 13, + 22, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 13, + 21, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 26, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 9, + 10, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 16, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 4, + 19, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 9, + 10, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 16, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 4, + 18, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 23, + 27, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 29, + 33, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 35, + 39, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 41, + 45, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + }, + ], + "range": Array [ + 21, + 47, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 42, + 50, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 56, + 64, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "name": "foo", + "range": Array [ + 77, + 80, + ], + "type": "Identifier", + }, + "range": Array [ + 73, + 80, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 70, + 80, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 36, + 82, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 82, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 83, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 84, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 70, + 73, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 8, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 77, + 80, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "initialize", + "range": Array [ + 7, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 7, + 104, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 51, + 104, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 19, + 26, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 28, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 28, + 36, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 28, + 36, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "name": "options", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 38, + 48, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 18, + 49, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 17, + 104, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 1, + 106, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 108, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 109, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "Identifier", + "value": "initialize", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 19, + 26, + ], + "type": "Identifier", + "value": "someVar", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 28, + 36, + ], + "type": "Identifier", + "value": "otherVar", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 38, + 41, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + "value": "options", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 2, + }, + "start": Object { + "column": 45, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 2, + }, + "start": Object { + "column": 46, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 2, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 103, + 104, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 105, + 106, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "initialize", + "range": Array [ + 14, + 24, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 14, + 111, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 58, + 111, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 26, + 33, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 26, + 33, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 26, + 33, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 35, + 43, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 35, + 43, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 35, + 43, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "name": "options", + "range": Array [ + 48, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 45, + 55, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 25, + 56, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 24, + 111, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 8, + 113, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 113, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 114, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 114, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 24, + ], + "type": "Identifier", + "value": "initialize", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "Identifier", + "value": "someVar", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 35, + 43, + ], + "type": "Identifier", + "value": "otherVar", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "range": Array [ + 48, + 55, + ], + "type": "Identifier", + "value": "options", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 2, + }, + "start": Object { + "column": 45, + "line": 2, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 2, + }, + "start": Object { + "column": 46, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 2, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 113, + 114, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 42, + 45, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 51, + 54, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 63, + 66, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 36, + 68, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 68, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 69, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 70, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 60, + 63, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 63, + 66, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 42, + 50, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 56, + 64, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 70, + 76, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 36, + 78, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 78, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 79, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 80, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 70, + 73, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 4, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 1, + 16, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 42, + 50, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 59, + 62, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 56, + 62, + ], + "type": "SpreadElement", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 71, + 74, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 36, + 76, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 76, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 77, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 56, + 59, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "range": Array [ + 59, + 62, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 68, + 71, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 71, + 74, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` +Object { + "body": Array [ + Object { + "block": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "BlockStatement", + }, + "finalizer": null, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "param": null, + "range": Array [ + 7, + 15, + ], + "type": "CatchClause", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Keyword", + "value": "catch", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` +Object { + "body": Array [ + Object { + "block": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "BlockStatement", + }, + "finalizer": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "param": null, + "range": Array [ + 7, + 15, + ], + "type": "CatchClause", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Keyword", + "value": "catch", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "Keyword", + "value": "finally", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/exponentiationOperators/exponential-operators.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "**", + "range": Array [ + 8, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "**=", + "range": Array [ + 16, + 23, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 16, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Punctuator", + "value": "**", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Punctuator", + "value": "**=", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/forOf/for-of-with-function-initializer.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 61, + 62, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 60, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 53, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 63, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 64, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "operator": "in", + "range": Array [ + 33, + 41, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 41, + ], + "type": "ArrayExpression", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 41, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 43, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 43, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 43, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 43, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 64, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "name": "list", + "range": Array [ + 47, + 51, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 65, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 46, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 51, + ], + "type": "Identifier", + "value": "list", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 60, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 60, + ], + "type": "Identifier", + "value": "process", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 60, + "line": 1, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 39, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 41, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + "value": "doSomething", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 23, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 36, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 37, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 34, + ], + "type": "Identifier", + "value": "doSomething", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 39, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 12, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + "value": "doSomething", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 23, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 36, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 37, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 34, + ], + "type": "Identifier", + "value": "doSomething", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/anonymous-generator.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "delegate": false, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 25, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "v", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/async-generator-function.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 1, + 27, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 1, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/async-generator-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "f", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 63, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + "init": Object { + "argument": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "name": "g", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "range": Array [ + 53, + 56, + ], + "type": "CallExpression", + }, + "delegate": true, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 46, + 56, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 42, + 56, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 36, + 57, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 63, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 23, + 63, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 65, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 65, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 66, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 46, + 51, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + "value": "g", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 3, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/double-yield.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "delegate": false, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 30, + ], + "type": "YieldExpression", + }, + "delegate": false, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 30, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 32, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 27, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/empty-generator-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "t", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 16, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "t", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/generator-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "delegate": true, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 30, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 25, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "v", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/yield-delegation.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "delegate": true, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 24, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 26, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "v", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/yield-without-value.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": null, + "delegate": false, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 24, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 24, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/yield-without-value-in-call.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "argument": null, + "delegate": false, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "YieldExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "fn", + "range": Array [ + 16, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 25, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 26, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 28, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 28, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/generators/yield-without-value-no-semi.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": null, + "delegate": false, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 23, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/globalReturn/return-identifier.src 1`] = ` +Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "fooz", + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + "value": "fooz", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/globalReturn/return-no-arg.src 1`] = ` +Object { + "body": Array [ + Object { + "argument": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/globalReturn/return-true.src 1`] = ` +Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/importMeta/simple-import-meta.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "import", + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "meta", + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 11, + ], + "type": "MetaProperty", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "url", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 15, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + "value": "meta", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "url", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/error-delete.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "raw": "\\"x\\"", + "type": "Literal", + "value": "x", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 8, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "delete", + "prefix": true, + "range": Array [ + 19, + 27, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "String", + "value": "\\"x\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Keyword", + "value": "delete", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/error-function.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "friends", + "range": Array [ + 31, + 38, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 16, + 39, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 41, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 23, + 30, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "Identifier", + "value": "friends", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/error-strict.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 25, + ], + "raw": "\\"house\\"", + "type": "Literal", + "value": "house", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "house", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 12, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + Object { + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "name": "roof", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "name": "console", + "range": Array [ + 44, + 51, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "log", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "range": Array [ + 44, + 55, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 44, + 61, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 44, + 62, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 41, + 64, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "house", + "range": Array [ + 34, + 39, + ], + "type": "Identifier", + }, + "range": Array [ + 28, + 64, + ], + "type": "WithStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 65, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + "value": "house", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 25, + ], + "type": "String", + "value": "\\"house\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "Keyword", + "value": "with", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 34, + 39, + ], + "type": "Identifier", + "value": "house", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 44, + 51, + ], + "type": "Identifier", + "value": "console", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + "value": "log", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + "value": "roof", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-array.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 25, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "operator": "+", + "range": Array [ + 16, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-function.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 15, + 29, + ], + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-named-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 21, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 30, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-named-function.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 15, + 32, + ], + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-number.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-object.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + }, + ], + "range": Array [ + 15, + 25, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-default-value.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-from-batch.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "type": "ExportAllDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 19, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-from-default.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 27, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 15, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 15, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 27, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-from-named-as-default.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 22, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-from-named-as-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 30, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 18, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 30, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-from-named-as-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 39, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "range": Array [ + 24, + 27, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 22, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 33, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 39, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-from-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 23, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 23, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-from-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-function.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 7, + 25, + ], + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-as-default.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 22, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-as-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 18, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-as-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "range": Array [ + 24, + 27, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 22, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 22, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-named-specifiers-comma.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-var.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-var-anonymous-function.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 17, + 31, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 31, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 32, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/export-var-number.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 18, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 19, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-default.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-default-and-named-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "ImportDefaultSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 31, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "ImportDefaultSpecifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "range": Array [ + 12, + 20, + ], + "type": "ImportNamespaceSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 31, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-default-as.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 15, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-jquery.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 22, + ], + "raw": "\\"jquery\\"", + "type": "Literal", + "value": "jquery", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "$", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 8, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "$", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 22, + ], + "type": "String", + "value": "\\"jquery\\"", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-module.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-named-as-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 30, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 18, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 30, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-named-as-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 35, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 18, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "xyz", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "xyz", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "range": Array [ + 20, + 23, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "xyz", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 29, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 35, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-named-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-named-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 23, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 23, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-named-specifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-named-specifiers-comma.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 29, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 29, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-namespace-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 26, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 15, + ], + "type": "ImportNamespaceSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 26, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/import-null-as-nil.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 33, + ], + "raw": "\\"bar\\"", + "type": "Literal", + "value": "bar", + }, + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "null", + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "nil", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "range": Array [ + 9, + 20, + ], + "type": "ImportSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Null", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "nil", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 33, + ], + "type": "String", + "value": "\\"bar\\"", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/invalid-await.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "await", + "range": Array [ + 11, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "Keyword", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/invalid-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-named-default.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 15, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 15, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-module-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "bar", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; + +exports[`ecmaFeatures fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; + +exports[`ecmaFeatures fixtures/newTarget/invalid-new-target.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "new", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "target", + "range": Array [ + 12, + 18, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 18, + ], + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 18, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 18, + ], + "type": "Identifier", + "value": "target", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/newTarget/invalid-unknown-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "new", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "unknown_property", + "range": Array [ + 25, + 41, + ], + "type": "Identifier", + }, + "range": Array [ + 21, + 41, + ], + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 42, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 44, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 8, + 44, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 41, + ], + "type": "Identifier", + "value": "unknown_property", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/newTarget/simple-new-target.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "new", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "target", + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + }, + "range": Array [ + 27, + 37, + ], + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 23, + 37, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 38, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 40, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 40, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "target", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "operator": "+", + "range": Array [ + 15, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "BinaryExpression", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 14, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 8, + 28, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 16, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "20", + "type": "Literal", + "value": 20, + }, + }, + ], + "range": Array [ + 1, + 17, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Numeric", + "value": "20", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 14, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 9, + 14, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 29, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 23, + 29, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 1, + 30, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 5, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + "value": "v", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 20, + ], + "raw": "\\"hey\\"", + "type": "Literal", + "value": "hey", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 14, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 8, + 28, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "String", + "value": "\\"hey\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 14, + 24, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 8, + 26, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 26, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], + "range": Array [ + 1, + 10, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "raw": "\\"x\\"", + "type": "Literal", + "value": "x", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "operator": "+", + "range": Array [ + 3, + 12, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "raw": "\\"y\\"", + "type": "Literal", + "value": "y", + }, + "type": "BinaryExpression", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 17, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], + "range": Array [ + 1, + 18, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "type": "String", + "value": "\\"x\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "String", + "value": "\\"y\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 20, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 7, + 20, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 1, + 21, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "proto", + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 30, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "name": "__proto__", + "range": Array [ + 43, + 52, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 43, + 59, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "name": "proto", + "range": Array [ + 54, + 59, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "name": "__proto__", + "range": Array [ + 62, + 71, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 62, + 78, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "name": "proto", + "range": Array [ + 73, + 78, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 40, + 80, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 36, + 80, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 81, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 81, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + "value": "proto", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 43, + 52, + ], + "type": "Identifier", + "value": "__proto__", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 54, + 59, + ], + "type": "Identifier", + "value": "proto", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 62, + 71, + ], + "type": "Identifier", + "value": "__proto__", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 73, + 78, + ], + "type": "Identifier", + "value": "proto", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 1, + "line": 8, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "proto", + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 30, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 43, + 54, + ], + "raw": "\\"__proto__\\"", + "type": "Literal", + "value": "__proto__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 43, + 61, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "name": "proto", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 64, + 75, + ], + "raw": "\\"__proto__\\"", + "type": "Literal", + "value": "__proto__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 64, + 82, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "name": "proto", + "range": Array [ + 77, + 82, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 40, + 84, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 36, + 84, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 85, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 85, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + "value": "proto", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 43, + 54, + ], + "type": "String", + "value": "\\"__proto__\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + "value": "proto", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 64, + 75, + ], + "type": "String", + "value": "\\"__proto__\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 77, + 82, + ], + "type": "Identifier", + "value": "proto", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 1, + "line": 8, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "name": "y", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 26, + 36, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 29, + 36, + ], + "raw": "'first'", + "type": "Literal", + "value": "first", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "name": "y", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "method": false, + "range": Array [ + 39, + 50, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 42, + 50, + ], + "raw": "'second'", + "type": "Literal", + "value": "second", + }, + }, + ], + "range": Array [ + 23, + 52, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 52, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 53, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 53, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "String", + "value": "'first'", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 42, + 50, + ], + "type": "String", + "value": "'second'", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 26, + 29, + ], + "raw": "\\"y\\"", + "type": "Literal", + "value": "y", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 26, + 38, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 31, + 38, + ], + "raw": "\\"first\\"", + "type": "Literal", + "value": "first", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 41, + 44, + ], + "raw": "\\"y\\"", + "type": "Literal", + "value": "y", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "method": false, + "range": Array [ + 41, + 54, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 46, + 54, + ], + "raw": "\\"second\\"", + "type": "Literal", + "value": "second", + }, + }, + ], + "range": Array [ + 23, + 56, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 56, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 57, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 57, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "String", + "value": "\\"y\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "String", + "value": "\\"first\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "String", + "value": "\\"y\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 46, + 54, + ], + "type": "String", + "value": "\\"second\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 14, + 47, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 30, + 41, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 47, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 17, + 47, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 8, + 49, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 49, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 28, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "method", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 10, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 19, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 16, + 26, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 4, + 28, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + "value": "method", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 10, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 13, + 23, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 4, + 25, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "set", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 10, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 13, + 23, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 4, + 25, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 33, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "method", + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 10, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 23, + 31, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "test", + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 16, + 31, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 4, + 33, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + "value": "method", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 30, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 18, + ], + "raw": "\\"method\\"", + "type": "Literal", + "value": "method", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 10, + 28, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 18, + 28, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 4, + 30, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 18, + ], + "type": "String", + "value": "\\"method\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 14, + 49, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 32, + 43, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 19, + 49, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 8, + 51, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 51, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 53, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 42, + 45, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 51, + 54, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 60, + 63, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "method": false, + "range": Array [ + 60, + 63, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 60, + 63, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 36, + 65, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 65, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 66, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 67, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 60, + 63, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; + +exports[`ecmaFeatures fixtures/octalLiterals/lowercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0o717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Numeric", + "value": "0o717", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/octalLiterals/strict-uppercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "type": "Numeric", + "value": "0O717", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/octalLiterals/uppercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Numeric", + "value": "0O717", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/regex/regexp-simple.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo./", + "regex": Object { + "flags": "", + "pattern": "foo.", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "regex": Object { + "flags": "", + "pattern": "foo.", + }, + "type": "RegularExpression", + "value": "/foo./", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 40, + ], + "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 40, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 40, + ], + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", + }, + "type": "RegularExpression", + "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "raw": "/\\\\u{110000}/u", + "regex": Object { + "flags": "u", + "pattern": "\\\\u{110000}", + }, + "type": "Literal", + "value": null, + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "regex": Object { + "flags": "u", + "pattern": "\\\\u{110000}", + }, + "type": "RegularExpression", + "value": "/\\\\u{110000}/u", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/regexUFlag/regex-u-simple.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo/u", + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "RegularExpression", + "value": "/foo/u", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/regexYFlag/regexp-y-simple.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo/y", + "regex": Object { + "flags": "y", + "pattern": "foo", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "regex": Object { + "flags": "y", + "pattern": "foo", + }, + "type": "RegularExpression", + "value": "/foo/y", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/basic-rest.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 0, + 22, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/class-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 25, + 41, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/class-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 33, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 17, + 33, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 35, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/error-no-default.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 22, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 0, + 24, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/error-not-last.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "RestElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 23, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/func-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 8, + 26, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 26, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/func-expression-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 8, + 28, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/invalid-rest-param.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 14, + 19, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 19, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 0, + 22, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/restParams/single-rest.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 0, + 19, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/spread/error-invalid-if.src 1`] = `"Expression expected."`; + +exports[`ecmaFeatures fixtures/spread/error-invalid-sequence.src 1`] = `"Expression expected."`; + +exports[`ecmaFeatures fixtures/spread/multi-function-call.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "SpreadElement", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/spread/not-final-param.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "SpreadElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "func", + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "func", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/spread/simple-function-call.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "type": "SpreadElement", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/deeply-nested.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasi": Object { + "expressions": Array [ + Object { + "expressions": Array [ + Object { + "left": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 30, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "deeply", + "raw": "deeply", + }, + }, + ], + "range": Array [ + 22, + 30, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "operator": "+", + "range": Array [ + 22, + 35, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 33, + 35, + ], + "type": "ObjectExpression", + }, + "type": "BinaryExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 22, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": "nested ", + "raw": "nested ", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 42, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": " blah", + "raw": " blah", + }, + }, + ], + "range": Array [ + 12, + 42, + ], + "type": "TemplateLiteral", + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 12, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": "hello ", + "raw": "hello ", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 44, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "", + "raw": "", + }, + }, + ], + "range": Array [ + 3, + 44, + ], + "type": "TemplateLiteral", + }, + "range": Array [ + 0, + 44, + ], + "tag": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "raw", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "type": "TaggedTemplateExpression", + }, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "raw", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 12, + ], + "type": "Template", + "value": "\`hello \${", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 22, + ], + "type": "Template", + "value": "\`nested \${", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 30, + ], + "type": "Template", + "value": "\`deeply\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 42, + ], + "type": "Template", + "value": "} blah\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 44, + ], + "type": "Template", + "value": "}\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/error-octal-literal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "7", + "raw": "\\\\07", + }, + }, + ], + "range": Array [ + 0, + 5, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Template", + "value": "\`\\\\07\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/escape-characters.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "ts", + "range": Array [ + 4, + 6, + ], + "type": "Identifier", + }, + "init": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 39, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "\\\\n\\\\r\\\\b\\\\v\\\\t\\\\f\\\\ +\\\\ +", + "raw": "\\\\\\\\n\\\\\\\\r\\\\\\\\b\\\\\\\\v\\\\\\\\t\\\\\\\\f\\\\\\\\\\\\n\\\\\\\\\\\\r\\\\n", + }, + }, + ], + "range": Array [ + 9, + 39, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 39, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "Identifier", + "value": "ts", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 39, + ], + "type": "Template", + "value": "\`\\\\\\\\n\\\\\\\\r\\\\\\\\b\\\\\\\\v\\\\\\\\t\\\\\\\\f\\\\\\\\\\\\n\\\\\\\\\\\\r\\\\n\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/expressions.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "raw": "'Fred'", + "type": "Literal", + "value": "Fred", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 15, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 11, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "expressions": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "operator": "+", + "range": Array [ + 51, + 56, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "BinaryExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 28, + 37, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": "Hello ", + "raw": "Hello ", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 38, + 51, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": ". a + 5 = ", + "raw": ". a + 5 = ", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 56, + 58, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "", + "raw": "", + }, + }, + ], + "range": Array [ + 28, + 58, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 28, + 59, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "String", + "value": "'Fred'", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 28, + 37, + ], + "type": "Template", + "value": "\`Hello \${", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 38, + 51, + ], + "type": "Template", + "value": "}. a + 5 = \${", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 56, + 58, + ], + "type": "Template", + "value": "}\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/multi-line-template-string.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 110, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "The last man on Earth + sat alone in a room. + There was + a knock + on the + door...", + "raw": "The last man on Earth + sat alone in a room. + There was + a knock + on the + door...", + }, + }, + ], + "range": Array [ + 0, + 110, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 111, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 111, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 110, + ], + "type": "Template", + "value": "\`The last man on Earth + sat alone in a room. + There was + a knock + on the + door...\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/simple-template-string.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "42", + "raw": "42", + }, + }, + ], + "range": Array [ + 0, + 4, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Template", + "value": "\`42\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/single-dollar-sign.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "ts", + "range": Array [ + 4, + 6, + ], + "type": "Identifier", + }, + "init": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "$", + "raw": "$", + }, + }, + ], + "range": Array [ + 9, + 12, + ], + "type": "TemplateLiteral", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "Identifier", + "value": "ts", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Template", + "value": "\`$\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/tagged-no-placeholders.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasi": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 8, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "foo", + "raw": "foo", + }, + }, + ], + "range": Array [ + 3, + 8, + ], + "type": "TemplateLiteral", + }, + "range": Array [ + 0, + 8, + ], + "tag": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "type": "TaggedTemplateExpression", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 8, + ], + "type": "Template", + "value": "\`foo\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/templateStrings/tagged-template-string.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "arguments", + "range": Array [ + 30, + 39, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "name": "console", + "range": Array [ + 18, + 25, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "log", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "range": Array [ + 18, + 29, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 18, + 40, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 18, + 41, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 43, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "tag", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 43, + ], + "type": "FunctionDeclaration", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "quasi": Object { + "expressions": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 71, + 72, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 47, + 55, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": "a is ", + "raw": "a is ", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 56, + 71, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": " while b is ", + "raw": " while b is ", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 72, + 75, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": ".", + "raw": ".", + }, + }, + ], + "range": Array [ + 47, + 75, + ], + "type": "TemplateLiteral", + }, + "range": Array [ + 44, + 75, + ], + "tag": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "name": "tag", + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + }, + "type": "TaggedTemplateExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 44, + 76, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 76, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "tag", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 18, + 25, + ], + "type": "Identifier", + "value": "console", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "log", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 30, + 39, + ], + "type": "Identifier", + "value": "arguments", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 44, + 47, + ], + "type": "Identifier", + "value": "tag", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 47, + 55, + ], + "type": "Template", + "value": "\`a is \${", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 56, + 71, + ], + "type": "Template", + "value": "} while b is \${", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 72, + 75, + ], + "type": "Template", + "value": "}.\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 31, + "line": 4, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/basic-string-literal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "raw": "\\"\\\\u{714E}\\\\u{8336}\\"", + "type": "Literal", + "value": "煎茶", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "String", + "value": "\\"\\\\u{714E}\\\\u{8336}\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/complex-string-literal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "raw": "\\"\\\\u{20BB7}\\\\u{10FFFF}\\\\u{1}\\"", + "type": "Literal", + "value": "𠮷􏿿", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "String", + "value": "\\"\\\\u{20BB7}\\\\u{10FFFF}\\\\u{1}\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/invalid-empty-escape.src 1`] = `"Hexadecimal digit expected."`; + +exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/invalid-too-large-escape.src 1`] = `"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap new file mode 100644 index 000000000000..0be9fe0b5b7b --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap @@ -0,0 +1,10917 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`JSX useJSXTextNode: false fixtures/attributes.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 39, + ], + "raw": "test", + "type": "Literal", + "value": "test", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 41, + 44, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 39, + 45, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 5, + 8, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 5, + 14, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "raw": "\\"baz\\"", + "type": "Literal", + "value": "baz", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "qux", + "range": Array [ + 15, + 18, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 15, + 24, + ], + "type": "JSXAttribute", + "value": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "quz", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "JSXExpressionContainer", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "rest", + "range": Array [ + 29, + 33, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 34, + ], + "type": "JSXSpreadAttribute", + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 35, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 45, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "JSXIdentifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "JSXText", + "value": "\\"baz\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "JSXIdentifier", + "value": "qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "quz", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 33, + ], + "type": "Identifier", + "value": "rest", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "JSXText", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "JSXIdentifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/element-keyword-name.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "object", + "range": Array [ + 11, + 17, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 20, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 10, + 20, + ], + "type": "JSXElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 20, + 25, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "abstract", + "range": Array [ + 26, + 34, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 25, + 37, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 25, + 37, + ], + "type": "JSXElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 37, + 42, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "name": "module", + "range": Array [ + 43, + 49, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 42, + 52, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 42, + 52, + ], + "type": "JSXElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 52, + 53, + ], + "raw": " +", + "type": "Literal", + "value": " +", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "div", + "range": Array [ + 55, + 58, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 53, + 59, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 59, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 60, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "Keyword", + "value": "object", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 20, + 25, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "Keyword", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 37, + 42, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "JSXText", + "value": " +", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 55, + 58, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/embedded-comment.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 27, + ], + "type": "JSXEmptyExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 28, + ], + "type": "JSXExpressionContainer", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 30, + 31, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 28, + 32, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 3, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 32, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/embedded-conditional.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 3, + 24, + ], + "type": "JSXAttribute", + "value": Object { + "expression": Object { + "alternate": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 19, + 20, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 18, + 23, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 18, + 23, + ], + "type": "JSXElement", + }, + "consequent": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 11, + 12, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 15, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 10, + 15, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 23, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "type": "ConditionalExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 24, + ], + "type": "JSXExpressionContainer", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 27, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 27, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "JSXIdentifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "JSXIdentifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/embedded-invalid-js-identifier.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "br", + "range": Array [ + 6, + 8, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 5, + 11, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 5, + 11, + ], + "type": "JSXElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 35, + ], + "raw": "7x invalid-js-identifier", + "type": "Literal", + "value": "7x invalid-js-identifier", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 37, + 40, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 35, + 41, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 41, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "JSXIdentifier", + "value": "br", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 35, + ], + "type": "JSXText", + "value": "7x invalid-js-identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/empty-placeholder.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 4, + ], + "type": "JSXEmptyExpression", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "JSXExpressionContainer", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 5, + 9, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 3, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 9, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/escape-patterns.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 83, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 3, + 10, + ], + "type": "JSXAttribute", + "value": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "raw": "\\" \\"", + "type": "Literal", + "value": " ", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "JSXExpressionContainer", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 11, + 12, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 11, + 16, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "raw": "\\" \\"", + "type": "Literal", + "value": " ", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 17, + 18, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 17, + 26, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 26, + ], + "raw": "\\"&\\"", + "type": "Literal", + "value": "&", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 27, + 28, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 27, + 43, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 43, + ], + "raw": "\\"id=1&group=2\\"", + "type": "Literal", + "value": "id=1&group=2", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 44, + 45, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 44, + 59, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 59, + ], + "raw": "\\"�\\"", + "type": "Literal", + "value": "�", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 60, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 60, + "line": 1, + }, + }, + "name": "g", + "range": Array [ + 60, + 61, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 60, + 71, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 71, + ], + "raw": "\\"{*;\\"", + "type": "Literal", + "value": "{*;", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 72, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 73, + "line": 1, + }, + "start": Object { + "column": 72, + "line": 1, + }, + }, + "name": "h", + "range": Array [ + 72, + 73, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 72, + 80, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 74, + "line": 1, + }, + }, + "range": Array [ + 74, + 80, + ], + "raw": "\\"&#x;\\"", + "type": "Literal", + "value": "&#x;", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 83, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 83, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 83, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 84, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 84, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 84, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 84, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "String", + "value": "\\" \\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "JSXIdentifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "JSXText", + "value": "\\" \\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "JSXIdentifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 26, + ], + "type": "JSXText", + "value": "\\"&\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "JSXIdentifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 43, + ], + "type": "JSXText", + "value": "\\"id=1&group=2\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "JSXIdentifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 59, + ], + "type": "JSXText", + "value": "\\"�\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 60, + "line": 1, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "JSXIdentifier", + "value": "g", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 71, + ], + "type": "JSXText", + "value": "\\"{*;\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 73, + "line": 1, + }, + "start": Object { + "column": 72, + "line": 1, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "JSXIdentifier", + "value": "h", + }, + Object { + "loc": Object { + "end": Object { + "column": 74, + "line": 1, + }, + "start": Object { + "column": 73, + "line": 1, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 74, + "line": 1, + }, + }, + "range": Array [ + 74, + 80, + ], + "type": "JSXText", + "value": "\\"&#x;\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 82, + "line": 1, + }, + "start": Object { + "column": 81, + "line": 1, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 83, + "line": 1, + }, + "start": Object { + "column": 82, + "line": 1, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 84, + "line": 1, + }, + "start": Object { + "column": 83, + "line": 1, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-attribute.src 1`] = `"'{' expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-attribute-missing-equals.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-broken-tag.src 1`] = `"Unterminated string literal."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-computed-end-tag-name.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-computed-string-end-tag-name.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-embedded-expression.src 1`] = `"'}' expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-leading-dot-tag-name.src 1`] = `"Expression expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-matching-placeholder-in-closing-tag.src 1`] = `"'>' expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-closing-tag.src 1`] = `"Expected corresponding JSX closing tag for 'a'."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-closing-tags.src 1`] = `"JSX element 'a' has no corresponding closing tag."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-dot-tag-name.src 1`] = `"Expected corresponding JSX closing tag for 'a.b.c'."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-mismatched-namespace-tag.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-missing-closing-tag.src 1`] = `"JSX element 'a' has no corresponding closing tag."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-missing-closing-tag-attribute-placeholder.src 1`] = `"JSX element 'a' has no corresponding closing tag."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-missing-namespace-name.src 1`] = `"Expression expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-missing-namespace-value.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-missing-spread-operator.src 1`] = `"'...' expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-namespace-name-with-docts.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-no-common-parent.src 1`] = `"JSX expressions must have one parent element."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-no-common-parent-with-comment.src 1`] = `"JSX expressions must have one parent element."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-no-tag-name.src 1`] = `"Declaration or statement expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-placeholder-in-closing-tag.src 1`] = `"'>' expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-trailing-dot-tag-name.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/invalid-unexpected-comma.src 1`] = `"Identifier expected."`; + +exports[`JSX useJSXTextNode: false fixtures/japanese-characters.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "日本語", + "range": Array [ + 7, + 10, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 5, + 11, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "日本語", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 11, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "日本語", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "JSXIdentifier", + "value": "日本語", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/less-than-operator.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 2, + 5, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 1, + 8, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 1, + 8, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 0, + 13, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 5, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/member-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 5, + 11, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 11, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/member-expression-this.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "this", + "range": Array [ + 1, + 5, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "state", + "range": Array [ + 6, + 11, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 1, + 11, + ], + "type": "JSXMemberExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "Component", + "range": Array [ + 12, + 21, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 1, + 21, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 0, + 24, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 24, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "name": "this", + "range": Array [ + 27, + 31, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "Component", + "range": Array [ + 32, + 41, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 27, + 41, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 26, + 44, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 26, + 44, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 26, + 45, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "JSXIdentifier", + "value": "state", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 21, + ], + "type": "JSXIdentifier", + "value": "Component", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 32, + 41, + ], + "type": "JSXIdentifier", + "value": "Component", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/multiple-blank-spaces.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "raw": " ", + "type": "Literal", + "value": " ", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 7, + 11, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 3, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 11, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "type": "JSXText", + "value": " ", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/newslines-and-entities.src 1`] = `"Invalid character."`; + +exports[`JSX useJSXTextNode: false fixtures/self-closing-tag.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 5, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/self-closing-tag-inside-tag.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": " +", + "type": "Literal", + "value": " +", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "div", + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 18, + 24, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 24, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "JSXText", + "value": " +", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/self-closing-tag-with-newline.src 1`] = `"Invalid character."`; + +exports[`JSX useJSXTextNode: false fixtures/spread-child.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "expression": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 13, + ], + "type": "JSXSpreadChild", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 15, + 18, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 13, + 19, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 19, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/spread-operator-attribute-and-regular-attribute.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "props", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 15, + ], + "type": "JSXSpreadAttribute", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "post", + "range": Array [ + 16, + 20, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 16, + 32, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 32, + ], + "raw": "\\"attribute\\"", + "type": "Literal", + "value": "attribute", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 35, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 35, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + "value": "props", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 20, + ], + "type": "JSXIdentifier", + "value": "post", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 32, + ], + "type": "JSXText", + "value": "\\"attribute\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/spread-operator-attributes.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "props", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 15, + ], + "type": "JSXSpreadAttribute", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 18, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 18, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + "value": "props", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/tag-names-with-dots.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 5, + 11, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 11, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/tag-names-with-multi-dots.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 11, + 12, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 9, + 12, + ], + "type": "JSXMemberExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 13, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 9, + 14, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 7, + 15, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXMemberExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 5, + 6, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 1, + 6, + ], + "type": "JSXMemberExpression", + }, + "range": Array [ + 0, + 7, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 15, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "JSXIdentifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "JSXIdentifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/test-content.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 18, + ], + "raw": "@test content", + "type": "Literal", + "value": "@test content", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 18, + 24, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 24, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 18, + ], + "type": "JSXText", + "value": "@test content", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/trailing-spread-operator-attribute.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 49, + 52, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 47, + 53, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "pre", + "range": Array [ + 5, + 8, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 5, + 18, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "raw": "\\"leading\\"", + "type": "Literal", + "value": "leading", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "pre2", + "range": Array [ + 19, + 23, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 19, + 35, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 35, + ], + "raw": "\\"attribute\\"", + "type": "Literal", + "value": "attribute", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "name": "props", + "range": Array [ + 40, + 45, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 46, + ], + "type": "JSXSpreadAttribute", + }, + ], + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 47, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 53, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 54, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 54, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "JSXIdentifier", + "value": "pre", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "type": "JSXText", + "value": "\\"leading\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "JSXIdentifier", + "value": "pre2", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 35, + ], + "type": "JSXText", + "value": "\\"attribute\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 45, + ], + "type": "Identifier", + "value": "props", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/unknown-escape-pattern.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 3, + 20, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 20, + ], + "raw": "\\"¬anentity;\\"", + "type": "Literal", + "value": "¬anentity;", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 23, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 23, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "JSXIdentifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 20, + ], + "type": "JSXText", + "value": "\\"¬anentity;\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: true fixtures/self-closing-tag-inside-tag.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "raw": " + ", + "type": "JSXText", + "value": " + ", + }, + Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 10, + 17, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 10, + 17, + ], + "type": "JSXElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": " +", + "type": "JSXText", + "value": " +", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "div", + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 18, + 24, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 24, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "JSXIdentifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "JSXText", + "value": " +", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: true fixtures/test-content.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 18, + ], + "raw": "@test content", + "type": "JSXText", + "value": "@test content", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 18, + 24, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 5, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 0, + 24, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 18, + ], + "type": "JSXText", + "value": "@test content", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.js.snap new file mode 100644 index 000000000000..ae6a9a339e17 --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.js.snap @@ -0,0 +1,190 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`parse() general output tokens, comments, locs, and ranges when called with those options 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/tsx.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/tsx.js.snap new file mode 100644 index 000000000000..d78b679e7e0f --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/tsx.js.snap @@ -0,0 +1,1790 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TSX fixtures/generic-jsx-element.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "data", + "range": Array [ + 21, + 25, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 21, + 30, + ], + "type": "JSXAttribute", + "value": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "raw": "12", + "type": "Literal", + "value": 12, + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "JSXExpressionContainer", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "MyComponent", + "range": Array [ + 1, + 12, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 0, + 33, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 19, + ], + "type": "TSNumberKeyword", + }, + ], + "range": Array [ + 12, + 20, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "range": Array [ + 0, + 33, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 12, + ], + "type": "JSXIdentifier", + "value": "MyComponent", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "JSXIdentifier", + "value": "data", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "Numeric", + "value": "12", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`TSX fixtures/react-typed-props.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 30, + ], + "raw": "'react'", + "type": "Literal", + "value": "react", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "React", + "range": Array [ + 12, + 17, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 17, + ], + "type": "ImportNamespaceSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Props", + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "title", + "range": Array [ + 48, + 53, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 48, + 61, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 53, + 61, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 55, + 61, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 44, + 63, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 36, + 63, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 31, + 63, + ], + "type": "VariableDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 128, + 135, + ], + "raw": " + ", + "type": "JSXText", + "value": " + ", + }, + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 7, + "line": 9, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 7, + "line": 9, + }, + }, + "name": "props", + "range": Array [ + 136, + 141, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 9, + }, + }, + "name": "title", + "range": Array [ + 142, + 147, + ], + "type": "Identifier", + }, + "range": Array [ + 136, + 147, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 9, + }, + "start": Object { + "column": 6, + "line": 9, + }, + }, + "range": Array [ + 135, + 148, + ], + "type": "JSXExpressionContainer", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 9, + }, + }, + "range": Array [ + 148, + 153, + ], + "raw": " + ", + "type": "JSXText", + "value": " + ", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 10, + }, + "start": Object { + "column": 6, + "line": 10, + }, + }, + "name": "h1", + "range": Array [ + 155, + 157, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 153, + 158, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 5, + "line": 8, + }, + }, + "name": "h1", + "range": Array [ + 125, + 127, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 124, + 128, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 124, + 158, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 111, + 162, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 42, + "line": 6, + }, + }, + "range": Array [ + 107, + 164, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 6, + }, + "start": Object { + "column": 24, + "line": 6, + }, + }, + "name": "App", + "range": Array [ + 89, + 92, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 6, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 28, + "line": 6, + }, + }, + "name": "props", + "range": Array [ + 93, + 105, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 33, + "line": 6, + }, + }, + "range": Array [ + 98, + 105, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 35, + "line": 6, + }, + }, + "range": Array [ + 100, + 105, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 35, + "line": 6, + }, + }, + "name": "Props", + "range": Array [ + 100, + 105, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 80, + 164, + ], + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 65, + 164, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 164, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 17, + ], + "type": "Identifier", + "value": "React", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 30, + ], + "type": "String", + "value": "'react'", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 31, + 35, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + "value": "Props", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 48, + 53, + ], + "type": "Identifier", + "value": "title", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 55, + 61, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 65, + 71, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 72, + 79, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 15, + "line": 6, + }, + }, + "range": Array [ + 80, + 88, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 6, + }, + "start": Object { + "column": 24, + "line": 6, + }, + }, + "range": Array [ + 89, + 92, + ], + "type": "Identifier", + "value": "App", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 6, + }, + "start": Object { + "column": 27, + "line": 6, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 6, + }, + "start": Object { + "column": 28, + "line": 6, + }, + }, + "range": Array [ + 93, + 98, + ], + "type": "Identifier", + "value": "props", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 6, + }, + "start": Object { + "column": 33, + "line": 6, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 6, + }, + "start": Object { + "column": 35, + "line": 6, + }, + }, + "range": Array [ + 100, + 105, + ], + "type": "Identifier", + "value": "Props", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 6, + }, + "start": Object { + "column": 40, + "line": 6, + }, + }, + "range": Array [ + 105, + 106, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 6, + }, + "start": Object { + "column": 42, + "line": 6, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 111, + 117, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 118, + 119, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 5, + "line": 8, + }, + }, + "range": Array [ + 125, + 127, + ], + "type": "JSXIdentifier", + "value": "h1", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 127, + 128, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 128, + 135, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 9, + }, + "start": Object { + "column": 6, + "line": 9, + }, + }, + "range": Array [ + 135, + 136, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 7, + "line": 9, + }, + }, + "range": Array [ + 136, + 141, + ], + "type": "JSXIdentifier", + "value": "props", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "range": Array [ + 141, + 142, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 9, + }, + }, + "range": Array [ + 142, + 147, + ], + "type": "JSXIdentifier", + "value": "title", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 9, + }, + "start": Object { + "column": 18, + "line": 9, + }, + }, + "range": Array [ + 147, + 148, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 9, + }, + }, + "range": Array [ + 148, + 153, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 153, + 154, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 10, + }, + "start": Object { + "column": 5, + "line": 10, + }, + }, + "range": Array [ + 154, + 155, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 10, + }, + "start": Object { + "column": 6, + "line": 10, + }, + }, + "range": Array [ + 155, + 157, + ], + "type": "JSXIdentifier", + "value": "h1", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 157, + 158, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "range": Array [ + 161, + 162, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 12, + }, + }, + "range": Array [ + 163, + 164, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap new file mode 100644 index 000000000000..5942567f72d1 --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap @@ -0,0 +1,68838 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript fixtures/babylon-convergence/type-parameter-whitespace-loc.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 24, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/babylon-convergence/type-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 42, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 42, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "TSObjectKeyword", + }, + "default": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSObjectKeyword", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 36, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 20, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "Identifier", + "value": "object", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "Identifier", + "value": "object", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/abstract-class-with-abstract-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 43, + 51, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 66, + ], + "static": false, + "type": "TSAbstractMethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 63, + 66, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 68, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "AbstractSocket", + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 68, + ], + "superClass": null, + "type": "TSAbstractClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 68, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 68, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + "value": "AbstractSocket", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 51, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 52, + 63, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/abstract-class-with-abstract-method.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "createSocket", + "range": Array [ + 52, + 64, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 84, + ], + "static": false, + "type": "TSAbstractMethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 64, + 84, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 66, + 83, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 68, + 83, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "name": "Promise", + "range": Array [ + 68, + 75, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 75, + 83, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 86, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "AbstractSocket", + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 86, + ], + "superClass": null, + "type": "TSAbstractClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 86, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 86, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + "value": "AbstractSocket", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 51, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 52, + 64, + ], + "type": "Identifier", + "value": "createSocket", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 68, + 75, + ], + "type": "Identifier", + "value": "Promise", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/abstract-class-with-abstract-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 38, + ], + "static": false, + "type": "TSAbstractClassProperty", + "value": null, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "baz", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 60, + ], + "static": false, + "type": "TSAbstractClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 58, + 59, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 62, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 62, + ], + "superClass": null, + "type": "TSAbstractClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 63, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 51, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/abstract-class-with-abstract-readonly-property.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 63, + ], + "readonly": true, + "static": false, + "type": "TSAbstractClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 54, + 62, + ], + "raw": "'string'", + "type": "Literal", + "value": "string", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 65, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 65, + ], + "superClass": null, + "type": "TSAbstractClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 66, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 30, + 38, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 39, + 47, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 54, + 62, + ], + "type": "String", + "value": "'string'", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/abstract-class-with-optional-method.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "createSocket", + "optional": true, + "range": Array [ + 43, + 55, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 76, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 56, + 76, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 58, + 75, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 60, + 75, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "Promise", + "range": Array [ + 60, + 67, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 67, + 75, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 78, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "AbstractSocket", + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 78, + ], + "superClass": null, + "type": "TSAbstractClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 36, + ], + "type": "Identifier", + "value": "AbstractSocket", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 55, + ], + "type": "Identifier", + "value": "createSocket", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 60, + 67, + ], + "type": "Identifier", + "value": "Promise", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/abstract-interface.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "abstract": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "I", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 31, + ], + "type": "TSInterfaceDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 25, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "I", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/arrow-function-with-type-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 31, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 33, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 33, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + }, + }, + "type": "ArrowFunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 0, + 3, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/async-function-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 1, + 26, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/async-function-with-var-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 38, + 43, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 32, + 43, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 28, + 44, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 59, + 64, + ], + "raw": "'bar'", + "type": "Literal", + "value": "bar", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 53, + 64, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 65, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "name": "fooBar", + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 93, + ], + "raw": "'fooBar'", + "type": "Literal", + "value": "fooBar", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 76, + 93, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 70, + 94, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 96, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 96, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 97, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 38, + 43, + ], + "type": "String", + "value": "'foo'", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 59, + 64, + ], + "type": "String", + "value": "'bar'", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 70, + 75, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + "value": "fooBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 93, + ], + "type": "String", + "value": "'fooBar'", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 93, + 94, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 95, + 96, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 35, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "baz", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 38, + 65, + ], + "static": true, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 56, + 64, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "TSNumberKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "getBar", + "range": Array [ + 75, + 81, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 68, + 111, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 98, + 102, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "name": "bar", + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + }, + "range": Array [ + 98, + 106, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 91, + 107, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 111, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 82, + 111, + ], + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "name": "setBar", + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 114, + 171, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 156, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "name": "bar", + "range": Array [ + 157, + 160, + ], + "type": "Identifier", + }, + "range": Array [ + 152, + 160, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "operator": "=", + "range": Array [ + 152, + 166, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "name": "bar", + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 167, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 34, + "line": 7, + }, + }, + "range": Array [ + 146, + 171, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 7, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "name": "bar", + "range": Array [ + 132, + 144, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 24, + "line": 7, + }, + }, + "range": Array [ + 136, + 144, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 26, + "line": 7, + }, + }, + "range": Array [ + 138, + 144, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 131, + 171, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 173, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 173, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 174, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 45, + 51, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 75, + 81, + ], + "type": "Identifier", + "value": "getBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 91, + 97, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 98, + 102, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 103, + 106, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "range": Array [ + 114, + 123, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + "value": "setBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 7, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 132, + 135, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 7, + }, + "start": Object { + "column": 24, + "line": 7, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 26, + "line": 7, + }, + }, + "range": Array [ + 138, + 144, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 7, + }, + "start": Object { + "column": 32, + "line": 7, + }, + }, + "range": Array [ + 144, + 145, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 7, + }, + "start": Object { + "column": 34, + "line": 7, + }, + }, + "range": Array [ + 146, + 147, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 152, + 156, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 157, + 160, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 161, + 162, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 163, + 166, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 8, + }, + "start": Object { + "column": 18, + "line": 8, + }, + }, + "range": Array [ + 166, + 167, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 170, + 171, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "range": Array [ + 172, + 173, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "definite": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 23, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 25, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "!", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-export-parameter-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 16, + 27, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 54, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 54, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "export": true, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 28, + 44, + ], + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 56, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 27, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 80, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "ClassWithParentAndInterface", + "range": Array [ + 6, + 33, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "name": "MyInterface", + "range": Array [ + 66, + 77, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "range": Array [ + 66, + 77, + ], + "type": "ClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 80, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "name": "MyOtherClass", + "range": Array [ + 42, + 54, + ], + "type": "Identifier", + }, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 81, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 33, + ], + "type": "Identifier", + "value": "ClassWithParentAndInterface", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 54, + ], + "type": "Identifier", + "value": "MyOtherClass", + }, + Object { + "loc": Object { + "end": Object { + "column": 65, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 65, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "range": Array [ + 66, + 77, + ], + "type": "Identifier", + "value": "MyInterface", + }, + Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 79, + "line": 1, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "superTypeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 20, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "superTypeParameters": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "D", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 34, + 40, + ], + "type": "TSTypeParameterInstantiation", + }, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 10, + 21, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 19, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 30, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + "value": "D", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "getBar", + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 28, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 23, + 28, + ], + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 30, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + "value": "getBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "getBar", + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 34, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 32, + 34, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 29, + 34, + ], + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [ + Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 28, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 29, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 36, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + "value": "getBar", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 29, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "ClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 20, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 80, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "ClassWithParentAndInterface", + "range": Array [ + 6, + 33, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "name": "MyInterface", + "range": Array [ + 45, + 56, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 56, + ], + "type": "ClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 80, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "name": "MyOtherClass", + "range": Array [ + 65, + 77, + ], + "type": "Identifier", + }, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 81, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 33, + ], + "type": "Identifier", + "value": "ClassWithParentAndInterface", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 44, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 56, + ], + "type": "Identifier", + "value": "MyInterface", + }, + Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 64, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "range": Array [ + 65, + 77, + ], + "type": "Identifier", + "value": "MyOtherClass", + }, + Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 79, + "line": 1, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "ClassImplements", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 20, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "S", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 35, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "ClassImplements", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 30, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 20, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "S", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 79, + 82, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 60, + 82, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "Base", + "range": Array [ + 74, + 78, + ], + "type": "Identifier", + }, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 53, + 82, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 84, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "M", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "Base", + "range": Array [ + 38, + 45, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 84, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 36, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 33, + 35, + ], + "type": "TSTypeLiteral", + }, + }, + ], + "range": Array [ + 32, + 36, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 36, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 39, + "line": 5, + }, + }, + "range": Array [ + 125, + 128, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": "X", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "name": "I", + "range": Array [ + 123, + 124, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 123, + 124, + ], + "type": "ClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 86, + 128, + ], + "superClass": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 23, + "line": 5, + }, + }, + "name": "C", + "range": Array [ + 109, + 110, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "name": "M", + "range": Array [ + 102, + 103, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 102, + 111, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 104, + 107, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 103, + 108, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "type": "ClassDeclaration", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 138, + 141, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "name": "C", + "range": Array [ + 136, + 137, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 130, + 141, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 154, + 157, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 8, + }, + }, + "name": "I", + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 142, + 157, + ], + "type": "TSInterfaceDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 5, + "line": 9, + }, + }, + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 22, + "line": 9, + }, + }, + "parameters": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 30, + "line": 9, + }, + }, + "name": "args", + "range": Array [ + 188, + 199, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 34, + "line": 9, + }, + }, + "range": Array [ + 192, + 199, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 197, + ], + "type": "TSAnyKeyword", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 199, + ], + "type": "TSArrayType", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 27, + "line": 9, + }, + }, + "range": Array [ + 185, + 199, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 180, + 205, + ], + "type": "TSConstructorType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 44, + "line": 9, + }, + }, + "range": Array [ + 202, + 205, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 46, + "line": 9, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 46, + "line": 9, + }, + }, + "name": "T", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + }, + }, + "typeParameters": null, + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 9, + }, + "start": Object { + "column": 5, + "line": 9, + }, + }, + "range": Array [ + 163, + 206, + ], + "type": "VariableDeclarator", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 174, + 177, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 48, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 158, + 206, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 207, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "M", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 20, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + "value": "Constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 42, + ], + "type": "Identifier", + "value": "Base", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 60, + 65, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 66, + 73, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 74, + 78, + ], + "type": "Identifier", + "value": "Base", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 86, + 91, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 94, + 101, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Identifier", + "value": "M", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 103, + 104, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 21, + "line": 5, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 23, + "line": 5, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 26, + "line": 5, + }, + }, + "range": Array [ + 112, + 122, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 123, + 124, + ], + "type": "Identifier", + "value": "I", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 5, + }, + "start": Object { + "column": 39, + "line": 5, + }, + }, + "range": Array [ + 125, + 126, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 5, + }, + "start": Object { + "column": 41, + "line": 5, + }, + }, + "range": Array [ + 127, + 128, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 130, + 135, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 138, + 139, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 140, + 141, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 142, + 151, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 8, + }, + }, + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + "value": "I", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 154, + 155, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 14, + "line": 8, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 158, + 162, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 5, + "line": 9, + }, + }, + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + "value": "Constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 174, + 175, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "range": Array [ + 175, + 176, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 9, + }, + "start": Object { + "column": 18, + "line": 9, + }, + }, + "range": Array [ + 176, + 177, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 9, + }, + "start": Object { + "column": 20, + "line": 9, + }, + }, + "range": Array [ + 178, + 179, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 9, + }, + "start": Object { + "column": 22, + "line": 9, + }, + }, + "range": Array [ + 180, + 183, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 9, + }, + "start": Object { + "column": 26, + "line": 9, + }, + }, + "range": Array [ + 184, + 185, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 9, + }, + "start": Object { + "column": 27, + "line": 9, + }, + }, + "range": Array [ + 185, + 188, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 9, + }, + "start": Object { + "column": 30, + "line": 9, + }, + }, + "range": Array [ + 188, + 192, + ], + "type": "Identifier", + "value": "args", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 9, + }, + "start": Object { + "column": 34, + "line": 9, + }, + }, + "range": Array [ + 192, + 193, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 197, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 9, + }, + "start": Object { + "column": 39, + "line": 9, + }, + }, + "range": Array [ + 197, + 198, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 40, + "line": 9, + }, + }, + "range": Array [ + 198, + 199, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 9, + }, + "start": Object { + "column": 41, + "line": 9, + }, + }, + "range": Array [ + 199, + 200, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 9, + }, + "start": Object { + "column": 43, + "line": 9, + }, + }, + "range": Array [ + 201, + 203, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 46, + "line": 9, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 9, + }, + "start": Object { + "column": 47, + "line": 9, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 14, + 43, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "undefined", + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 45, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "String", + "value": "'foo'", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 33, + 42, + ], + "type": "Keyword", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-methods.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "foo", + "optional": true, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 18, + 21, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "bar", + "optional": true, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 24, + 39, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 28, + 39, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 30, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "name": "baz", + "optional": true, + "range": Array [ + 50, + 53, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 42, + 65, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 54, + 65, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 56, + 64, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "TSStringKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 67, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 67, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 68, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 42, + 49, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 50, + 53, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 14, + 19, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 22, + 36, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "name": "baz", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "optional": true, + "range": Array [ + 39, + 61, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 52, + 60, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 54, + 60, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 63, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 63, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 64, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 39, + 46, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 54, + 60, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-property-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 12, + 37, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "undefined", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 19, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 36, + ], + "type": "Keyword", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-private-parameter-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 201, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 57, + "line": 5, + }, + }, + "range": Array [ + 199, + 201, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "private", + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "name": "firstName", + "range": Array [ + 34, + 51, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 43, + 51, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 45, + 51, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 26, + 51, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "private", + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 84, + 100, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 92, + 100, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 94, + 100, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 67, + 100, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "accessibility": "private", + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 4, + }, + }, + "name": "age", + "range": Array [ + 124, + 135, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 127, + 135, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 129, + 135, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 116, + 140, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 4, + }, + }, + "range": Array [ + 138, + 140, + ], + "raw": "30", + "type": "Literal", + "value": 30, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 116, + 140, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "private", + "loc": Object { + "end": Object { + "column": 55, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 5, + }, + "start": Object { + "column": 31, + "line": 5, + }, + }, + "name": "student", + "range": Array [ + 173, + 189, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 5, + }, + "start": Object { + "column": 38, + "line": 5, + }, + }, + "range": Array [ + 180, + 189, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 5, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 182, + 189, + ], + "type": "TSBooleanKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 55, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 156, + 197, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 5, + }, + "start": Object { + "column": 50, + "line": 5, + }, + }, + "range": Array [ + 192, + 197, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 156, + 197, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 201, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 203, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 203, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 203, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 34, + 43, + ], + "type": "Identifier", + "value": "firstName", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 45, + 51, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 39, + "line": 2, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 67, + 74, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 75, + 83, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 84, + 92, + ], + "type": "Identifier", + "value": "lastName", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 94, + 100, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 3, + }, + "start": Object { + "column": 47, + "line": 3, + }, + }, + "range": Array [ + 100, + 101, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 116, + 123, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 4, + }, + }, + "range": Array [ + 124, + 127, + ], + "type": "Identifier", + "value": "age", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 127, + 128, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 129, + 135, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 34, + "line": 4, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 4, + }, + }, + "range": Array [ + 138, + 140, + ], + "type": "Numeric", + "value": "30", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 4, + }, + "start": Object { + "column": 38, + "line": 4, + }, + }, + "range": Array [ + 140, + 141, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 156, + 163, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 164, + 172, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 31, + "line": 5, + }, + }, + "range": Array [ + 173, + 180, + ], + "type": "Identifier", + "value": "student", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 5, + }, + "start": Object { + "column": 38, + "line": 5, + }, + }, + "range": Array [ + 180, + 181, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 5, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 182, + 189, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 48, + "line": 5, + }, + }, + "range": Array [ + 190, + 191, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 5, + }, + "start": Object { + "column": 50, + "line": 5, + }, + }, + "range": Array [ + 192, + 197, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 5, + }, + "start": Object { + "column": 55, + "line": 5, + }, + }, + "range": Array [ + 197, + 198, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 57, + "line": 5, + }, + }, + "range": Array [ + 199, + 200, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 58, + "line": 5, + }, + }, + "range": Array [ + 200, + 201, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 202, + 203, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 61, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 209, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 61, + "line": 5, + }, + "start": Object { + "column": 59, + "line": 5, + }, + }, + "range": Array [ + 207, + 209, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 61, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "firstName", + "range": Array [ + 36, + 53, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 45, + 53, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 47, + 53, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 26, + 53, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 88, + 104, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 96, + 104, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 43, + "line": 3, + }, + }, + "range": Array [ + 98, + 104, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 69, + 104, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "name": "age", + "range": Array [ + 130, + 141, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 133, + 141, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 120, + 146, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 38, + "line": 4, + }, + }, + "range": Array [ + 144, + 146, + ], + "raw": "30", + "type": "Literal", + "value": 30, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 120, + 146, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "name": "student", + "range": Array [ + 181, + 197, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 188, + 197, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 42, + "line": 5, + }, + }, + "range": Array [ + 190, + 197, + ], + "type": "TSBooleanKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 162, + 205, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 52, + "line": 5, + }, + }, + "range": Array [ + 200, + 205, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 162, + 205, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 209, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 211, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 211, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 211, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 35, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 45, + ], + "type": "Identifier", + "value": "firstName", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 47, + 53, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 69, + 78, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 79, + 87, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 88, + 96, + ], + "type": "Identifier", + "value": "lastName", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 43, + "line": 3, + }, + }, + "range": Array [ + 98, + 104, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 3, + }, + "start": Object { + "column": 49, + "line": 3, + }, + }, + "range": Array [ + 104, + 105, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 120, + 129, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 130, + 133, + ], + "type": "Identifier", + "value": "age", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 4, + }, + }, + "range": Array [ + 142, + 143, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 38, + "line": 4, + }, + }, + "range": Array [ + 144, + 146, + ], + "type": "Numeric", + "value": "30", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 4, + }, + "start": Object { + "column": 40, + "line": 4, + }, + }, + "range": Array [ + 146, + 147, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 162, + 171, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 172, + 180, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 5, + }, + "start": Object { + "column": 33, + "line": 5, + }, + }, + "range": Array [ + 181, + 188, + ], + "type": "Identifier", + "value": "student", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 5, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 188, + 189, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 42, + "line": 5, + }, + }, + "range": Array [ + 190, + 197, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 5, + }, + "start": Object { + "column": 50, + "line": 5, + }, + }, + "range": Array [ + 198, + 199, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 52, + "line": 5, + }, + }, + "range": Array [ + 200, + 205, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 57, + "line": 5, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 60, + "line": 5, + }, + "start": Object { + "column": 59, + "line": 5, + }, + }, + "range": Array [ + 207, + 208, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 5, + }, + "start": Object { + "column": 60, + "line": 5, + }, + }, + "range": Array [ + 208, + 209, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 210, + 211, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-public-parameter-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 197, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 56, + "line": 5, + }, + }, + "range": Array [ + 195, + 197, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "firstName", + "range": Array [ + 33, + 50, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 42, + 50, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 26, + 50, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 82, + 98, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "range": Array [ + 90, + 98, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 40, + "line": 3, + }, + }, + "range": Array [ + 92, + 98, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 66, + 98, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "name": "age", + "range": Array [ + 121, + 132, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 124, + 132, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 126, + 132, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 114, + 137, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "range": Array [ + 135, + 137, + ], + "raw": "30", + "type": "Literal", + "value": 30, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 114, + 137, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "name": "student", + "range": Array [ + 169, + 185, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 176, + 185, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 39, + "line": 5, + }, + }, + "range": Array [ + 178, + 185, + ], + "type": "TSBooleanKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 153, + 193, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 49, + "line": 5, + }, + }, + "range": Array [ + 188, + 193, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 153, + 193, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 199, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 199, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 199, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + "value": "firstName", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 66, + 72, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 73, + 81, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 82, + 90, + ], + "type": "Identifier", + "value": "lastName", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 40, + "line": 3, + }, + }, + "range": Array [ + 92, + 98, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 46, + "line": 3, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 114, + 120, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 121, + 124, + ], + "type": "Identifier", + "value": "age", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 126, + 132, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 33, + "line": 4, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "range": Array [ + 135, + 137, + ], + "type": "Numeric", + "value": "30", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 37, + "line": 4, + }, + }, + "range": Array [ + 137, + 138, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 153, + 159, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 5, + }, + "start": Object { + "column": 21, + "line": 5, + }, + }, + "range": Array [ + 160, + 168, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 169, + 176, + ], + "type": "Identifier", + "value": "student", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 176, + 177, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 39, + "line": 5, + }, + }, + "range": Array [ + 178, + 185, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 5, + }, + "start": Object { + "column": 47, + "line": 5, + }, + }, + "range": Array [ + 186, + 187, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 49, + "line": 5, + }, + }, + "range": Array [ + 188, + 193, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 5, + }, + "start": Object { + "column": 54, + "line": 5, + }, + }, + "range": Array [ + 193, + 194, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 56, + "line": 5, + }, + }, + "range": Array [ + 195, + 196, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 57, + "line": 5, + }, + }, + "range": Array [ + 196, + 197, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 198, + 199, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-readonly-parameter-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 107, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 51, + "line": 3, + }, + }, + "range": Array [ + 105, + 107, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "firstName", + "range": Array [ + 35, + 52, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 52, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 26, + 52, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 77, + 93, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 85, + 93, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 87, + 93, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 68, + 103, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 42, + "line": 3, + }, + }, + "range": Array [ + 96, + 103, + ], + "raw": "'Smith'", + "type": "Literal", + "value": "Smith", + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 68, + 103, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 107, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 109, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 109, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 109, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "value": "firstName", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 40, + "line": 2, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 68, + 76, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 77, + 85, + ], + "type": "Identifier", + "value": "lastName", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 87, + 93, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 40, + "line": 3, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 42, + "line": 3, + }, + }, + "range": Array [ + 96, + 103, + ], + "type": "String", + "value": "'Smith'", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 3, + }, + "start": Object { + "column": 49, + "line": 3, + }, + }, + "range": Array [ + 103, + 104, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 3, + }, + "start": Object { + "column": 51, + "line": 3, + }, + }, + "range": Array [ + 105, + 106, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 52, + "line": 3, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-readonly-property.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 47, + ], + "readonly": true, + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 46, + ], + "raw": "'string'", + "type": "Literal", + "value": "string", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 49, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 23, + 31, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 46, + ], + "type": "String", + "value": "'string'", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-static-parameter-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 16, + 27, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 54, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 54, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 28, + 44, + ], + "static": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 56, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 27, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 7, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "__P", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/const-enum.src 1`] = ` +Object { + "body": Array [ + Object { + "const": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 0, + 39, + ], + "type": "TSEnumDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/declare-class-with-optional-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "optional": true, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 24, + 36, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 28, + 36, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "TSAnyKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 38, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/declare-function.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 42, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 41, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", + }, + }, + "type": "DeclareFunction", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/destructuring-assignment.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 11, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "ArrayPattern", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 13, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 19, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-assignment.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "TSExportAssignment", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 28, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 31, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 24, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 16, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 27, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "TSTypeParameter", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 20, + 21, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 16, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 7, + 40, + ], + "type": "TSEnumDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 39, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "TSNumberKeyword", + }, + ], + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 40, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 40, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + "value": "TestAlias", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "count", + "range": Array [ + 35, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 35, + 48, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 29, + 50, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 51, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 51, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + "value": "TestClassProps", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 35, + 40, + ], + "type": "Identifier", + "value": "count", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "parameters": Array [ + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 28, + 37, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 27, + 46, + ], + "type": "TSFunctionType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 46, + ], + "type": "TSVoidKeyword", + }, + }, + "typeParameters": null, + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 47, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + "value": "TestCallback", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 41, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 46, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-await.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "future", + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 46, + ], + "type": "AwaitExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 47, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "hope", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "future", + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "value": "hope", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + "value": "future", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "type": "Identifier", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "future", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-object-type-with-optional-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 51, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 19, + 22, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 13, + 45, + ], + "type": "ObjectPattern", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "optional": true, + "range": Array [ + 26, + 39, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "optional": true, + "range": Array [ + 40, + 44, + ], + "type": "TSPropertySignature", + }, + ], + "range": Array [ + 25, + 45, + ], + "type": "TSTypeLiteral", + }, + }, + }, + ], + "range": Array [ + 0, + 51, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-object-type-without-annotation.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 19, + 22, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 13, + 43, + ], + "type": "ObjectPattern", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 43, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 38, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "TSPropertySignature", + }, + ], + "range": Array [ + 25, + 43, + ], + "type": "TSTypeLiteral", + }, + }, + }, + ], + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 29, + 38, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 40, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 40, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + }, + }, + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 13, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-type-parameters-that-have-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "compare", + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 35, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 16, + 30, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + "value": "compare", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 40, + 49, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 51, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 25, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 51, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + }, + }, + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 21, + 23, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 23, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 24, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 20, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-types.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "name", + "range": Array [ + 50, + 54, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 55, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 57, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "message", + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 57, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSStringKeyword", + }, + }, + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + "value": "message", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 50, + 54, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "name", + "range": Array [ + 89, + 93, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 82, + 94, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 96, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "message", + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "age", + "range": Array [ + 30, + 40, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 40, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 46, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 46, + ], + "raw": "100", + "type": "Literal", + "value": 100, + }, + "type": "AssignmentPattern", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "name": "args", + "range": Array [ + 51, + 69, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 69, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 56, + "line": 1, + }, + }, + "range": Array [ + 56, + 69, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 56, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 68, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 61, + 69, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 69, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 0, + 96, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 70, + "line": 1, + }, + }, + "range": Array [ + 70, + 77, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 71, + "line": 1, + }, + }, + "range": Array [ + 71, + 77, + ], + "type": "TSStringKeyword", + }, + }, + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 97, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + "value": "message", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Identifier", + "value": "age", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "Numeric", + "value": "100", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 51, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "range": Array [ + 51, + 55, + ], + "type": "Identifier", + "value": "args", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 56, + "line": 1, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 68, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 68, + "line": 1, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 70, + "line": 1, + }, + "start": Object { + "column": 69, + "line": 1, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 70, + "line": 1, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 71, + "line": 1, + }, + }, + "range": Array [ + 71, + 77, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 82, + 88, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 89, + 93, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 93, + 94, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 95, + 96, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/import-type.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "init": Object { + "isTypeOf": true, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "parameter": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "raw": "'A'", + "type": "Literal", + "value": "A", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "TSLiteralType", + }, + "qualifier": null, + "range": Array [ + 9, + 27, + ], + "type": "TSImportType", + "typeParameters": null, + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 28, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "B", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "init": Object { + "isTypeOf": false, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "parameter": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "raw": "\\"B\\"", + "type": "Literal", + "value": "B", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "type": "TSLiteralType", + }, + "qualifier": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "X", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "range": Array [ + 38, + 54, + ], + "type": "TSImportType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "Y", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 51, + 54, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 34, + 55, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 29, + 55, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "String", + "value": "'A'", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 29, + 33, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "type": "String", + "value": "\\"B\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + "value": "Y", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "isTypeOf": false, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "parameter": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "TSLiteralType", + }, + "qualifier": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "range": Array [ + 11, + 28, + ], + "type": "TSImportType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 23, + 28, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 10, + 29, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "String", + "value": "\\"\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-extends.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "TSInterfaceHeritage", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 34, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "TSInterfaceHeritage", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "Baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "TSInterfaceHeritage", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "Baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "baa", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 32, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 31, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "TSNumberKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 37, + 50, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 41, + 49, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "TSNumberKeyword", + }, + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "name": "bax", + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 55, + 69, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 60, + 68, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 62, + 68, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "name": "baz", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "optional": true, + "range": Array [ + 74, + 89, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 80, + 88, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 82, + 88, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 5, + "line": 6, + }, + }, + "name": "eee", + "range": Array [ + 95, + 106, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 98, + 106, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 94, + 116, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 107, + 115, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "range": Array [ + 109, + 115, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "name": "fff", + "optional": true, + "range": Array [ + 122, + 134, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 126, + 134, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 128, + 134, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 121, + 144, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "range": Array [ + 135, + 143, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 137, + 143, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "doo", + "range": Array [ + 149, + 152, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "optional": false, + "params": Array [], + "range": Array [ + 149, + 161, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 154, + 160, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 156, + 160, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "name": "doo", + "range": Array [ + 166, + 169, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "optional": true, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 9, + "line": 9, + }, + }, + "name": "a", + "range": Array [ + 171, + 172, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "name": "b", + "range": Array [ + 174, + 175, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, + }, + "name": "c", + "range": Array [ + 177, + 178, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 166, + 186, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "range": Array [ + 179, + 185, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 9, + }, + }, + "range": Array [ + 181, + 185, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 10, + }, + "start": Object { + "column": 5, + "line": 10, + }, + }, + "name": "loo", + "range": Array [ + 192, + 195, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "optional": true, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, + }, + "start": Object { + "column": 11, + "line": 10, + }, + }, + "name": "a", + "range": Array [ + 198, + 199, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 14, + "line": 10, + }, + }, + "name": "b", + "range": Array [ + 201, + 202, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "name": "c", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 191, + 213, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 10, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 21, + "line": 10, + }, + }, + "range": Array [ + 208, + 212, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "name": "boo", + "range": Array [ + 218, + 221, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 11, + }, + }, + "name": "a", + "range": Array [ + 225, + 226, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 11, + }, + "start": Object { + "column": 14, + "line": 11, + }, + }, + "name": "b", + "range": Array [ + 228, + 229, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 11, + }, + "start": Object { + "column": 17, + "line": 11, + }, + }, + "name": "c", + "range": Array [ + 231, + 232, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 218, + 240, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 19, + "line": 11, + }, + }, + "range": Array [ + 233, + 239, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 21, + "line": 11, + }, + }, + "range": Array [ + 235, + 239, + ], + "type": "TSVoidKeyword", + }, + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 11, + }, + "start": Object { + "column": 7, + "line": 11, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "name": "J", + "range": Array [ + 222, + 223, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 221, + 224, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 12, + }, + }, + "name": "a", + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 12, + "line": 12, + }, + }, + "name": "b", + "optional": true, + "range": Array [ + 253, + 254, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 245, + 265, + ], + "type": "TSConstructSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "range": Array [ + 256, + 264, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "range": Array [ + 258, + 264, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "name": "a", + "range": Array [ + 278, + 279, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "name": "b", + "optional": true, + "range": Array [ + 281, + 282, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 270, + 293, + ], + "type": "TSConstructSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 18, + "line": 13, + }, + }, + "range": Array [ + 284, + 292, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 20, + "line": 13, + }, + }, + "range": Array [ + 286, + 292, + ], + "type": "TSStringKeyword", + }, + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 9, + "line": 13, + }, + }, + "name": "F", + "range": Array [ + 275, + 276, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 274, + 277, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 14, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 295, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 295, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 16, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 297, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "baa", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + "value": "bax", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 62, + 68, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 82, + 88, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 5, + "line": 6, + }, + }, + "range": Array [ + 95, + 98, + ], + "type": "Identifier", + "value": "eee", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "range": Array [ + 109, + 115, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 6, + }, + "start": Object { + "column": 25, + "line": 6, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 121, + 122, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + "value": "fff", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 125, + 126, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 128, + 134, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 134, + 135, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "range": Array [ + 135, + 136, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 137, + 143, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 7, + }, + "start": Object { + "column": 26, + "line": 7, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 149, + 152, + ], + "type": "Identifier", + "value": "doo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 152, + 153, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 153, + 154, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 154, + 155, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 156, + 160, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 160, + 161, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 166, + 169, + ], + "type": "Identifier", + "value": "doo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 9, + }, + "start": Object { + "column": 7, + "line": 9, + }, + }, + "range": Array [ + 169, + 170, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 170, + 171, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 9, + "line": 9, + }, + }, + "range": Array [ + 171, + 172, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 9, + }, + "start": Object { + "column": 10, + "line": 9, + }, + }, + "range": Array [ + 172, + 173, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "range": Array [ + 174, + 175, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 9, + }, + }, + "range": Array [ + 175, + 176, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, + }, + "range": Array [ + 177, + 178, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 178, + 179, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "range": Array [ + 179, + 180, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 9, + }, + }, + "range": Array [ + 181, + 185, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 23, + "line": 9, + }, + }, + "range": Array [ + 185, + 186, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 191, + 192, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 10, + }, + "start": Object { + "column": 5, + "line": 10, + }, + }, + "range": Array [ + 192, + 195, + ], + "type": "Identifier", + "value": "loo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 195, + 196, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 10, + }, + "start": Object { + "column": 9, + "line": 10, + }, + }, + "range": Array [ + 196, + 197, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 10, + }, + "start": Object { + "column": 10, + "line": 10, + }, + }, + "range": Array [ + 197, + 198, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, + }, + "start": Object { + "column": 11, + "line": 10, + }, + }, + "range": Array [ + 198, + 199, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "range": Array [ + 199, + 200, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 14, + "line": 10, + }, + }, + "range": Array [ + 201, + 202, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 10, + }, + }, + "range": Array [ + 202, + 203, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 10, + }, + "start": Object { + "column": 18, + "line": 10, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 10, + }, + }, + "range": Array [ + 206, + 207, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 21, + "line": 10, + }, + }, + "range": Array [ + 208, + 212, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 10, + }, + "start": Object { + "column": 25, + "line": 10, + }, + }, + "range": Array [ + 212, + 213, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 218, + 221, + ], + "type": "Identifier", + "value": "boo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 11, + }, + "start": Object { + "column": 7, + "line": 11, + }, + }, + "range": Array [ + 221, + 222, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + "value": "J", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "range": Array [ + 223, + 224, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 11, + }, + "start": Object { + "column": 10, + "line": 11, + }, + }, + "range": Array [ + 224, + 225, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 11, + }, + }, + "range": Array [ + 225, + 226, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 11, + }, + "start": Object { + "column": 12, + "line": 11, + }, + }, + "range": Array [ + 226, + 227, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 11, + }, + "start": Object { + "column": 14, + "line": 11, + }, + }, + "range": Array [ + 228, + 229, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 11, + }, + "start": Object { + "column": 15, + "line": 11, + }, + }, + "range": Array [ + 229, + 230, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 11, + }, + "start": Object { + "column": 17, + "line": 11, + }, + }, + "range": Array [ + 231, + 232, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 232, + 233, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 11, + }, + "start": Object { + "column": 19, + "line": 11, + }, + }, + "range": Array [ + 233, + 234, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 21, + "line": 11, + }, + }, + "range": Array [ + 235, + 239, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 25, + "line": 11, + }, + }, + "range": Array [ + 239, + 240, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "range": Array [ + 245, + 248, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "range": Array [ + 249, + 250, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 12, + }, + }, + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 12, + }, + "start": Object { + "column": 10, + "line": 12, + }, + }, + "range": Array [ + 251, + 252, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 12, + "line": 12, + }, + }, + "range": Array [ + 253, + 254, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 12, + }, + "start": Object { + "column": 13, + "line": 12, + }, + }, + "range": Array [ + 254, + 255, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 14, + "line": 12, + }, + }, + "range": Array [ + 255, + 256, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "range": Array [ + 256, + 257, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "range": Array [ + 258, + 264, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 12, + }, + "start": Object { + "column": 23, + "line": 12, + }, + }, + "range": Array [ + 264, + 265, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 270, + 273, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 274, + 275, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 9, + "line": 13, + }, + }, + "range": Array [ + 275, + 276, + ], + "type": "Identifier", + "value": "F", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 13, + }, + "start": Object { + "column": 10, + "line": 13, + }, + }, + "range": Array [ + 276, + 277, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 13, + }, + "start": Object { + "column": 11, + "line": 13, + }, + }, + "range": Array [ + 277, + 278, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "range": Array [ + 278, + 279, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 13, + }, + "start": Object { + "column": 13, + "line": 13, + }, + }, + "range": Array [ + 279, + 280, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "range": Array [ + 281, + 282, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 13, + }, + "start": Object { + "column": 16, + "line": 13, + }, + }, + "range": Array [ + 282, + 283, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 13, + }, + "start": Object { + "column": 17, + "line": 13, + }, + }, + "range": Array [ + 283, + 284, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 13, + }, + "start": Object { + "column": 18, + "line": 13, + }, + }, + "range": Array [ + 284, + 285, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 20, + "line": 13, + }, + }, + "range": Array [ + 286, + 292, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 13, + }, + "start": Object { + "column": 26, + "line": 13, + }, + }, + "range": Array [ + 292, + 293, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 14, + }, + }, + "range": Array [ + 294, + 295, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "range": Array [ + 26, + 34, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "private", + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "range": Array [ + 36, + 45, + ], + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 21, + 47, + ], + "type": "TSConstructSignature", + "typeAnnotation": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 49, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 36, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSInterfaceHeritage", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "J", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 28, + 31, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 24, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "J", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 14, + 17, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "name": "bar", + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 76, + 85, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 87, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 87, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 88, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "Test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 21, + 26, + ], + "type": "TSPropertySignature", + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 31, + 44, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 35, + 43, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 37, + 43, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "baz", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "optional": true, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "foo", + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "name": "bar", + "optional": true, + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 63, + 71, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 65, + 71, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "name": "baz", + "optional": true, + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 49, + 79, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 81, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 81, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 37, + 43, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 59, + 62, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 65, + 71, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 31, + "line": 4, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 33, + "line": 4, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "TSPropertySignature", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 27, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "operator": "keyof", + "range": Array [ + 9, + 18, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 19, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Identifier", + "value": "keyof", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "nestedArray", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 44, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 17, + 22, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 43, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 42, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 34, + 42, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 28, + 43, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 22, + 44, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 15, + ], + "type": "Identifier", + "value": "nestedArray", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 22, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "Observable", + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "empty", + "range": Array [ + 30, + 35, + ], + "type": "Identifier", + }, + "range": Array [ + 19, + 35, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 44, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 35, + 42, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 45, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "Identifier", + "value": "never", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + "value": "Observable", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, + ], + "type": "Identifier", + "value": "empty", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + "value": "never", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "e", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "validateEntity", + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 58, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 59, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "init": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "object": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "e", + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 72, + 74, + ], + "type": "TSNonNullExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 75, + 79, + ], + "type": "Identifier", + }, + "range": Array [ + 72, + 79, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 68, + 79, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 64, + 80, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 82, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "processEntity", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "e", + "optional": true, + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "Entity", + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + "value": "processEntity", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + "value": "Entity", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + "value": "validateEntity", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 64, + 67, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + "value": "s", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": "!", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "TSNullKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 29, + ], + "type": "TSUndefinedKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 13, + 30, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 29, + ], + "type": "Identifier", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 13, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 1, + 15, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 22, + 26, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "method": true, + "range": Array [ + 22, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 26, + 31, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 20, + 33, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 19, + 35, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "method": false, + "range": Array [ + 40, + 52, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 48, + 52, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 38, + 54, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 37, + 56, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 79, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 75, + 79, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 66, + 81, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 58, + 81, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 48, + 52, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 58, + 63, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 7, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 22, + "line": 7, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 42, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "abc", + "range": Array [ + 14, + 38, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 38, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "Map", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "TSSymbolKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 22, + 38, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + ], + "range": Array [ + 0, + 42, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "abc", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "Map", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Identifier", + "value": "symbol", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 37, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 27, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 30, + 37, + ], + "type": "Identifier", + }, + }, + ], + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 37, + ], + "type": "VariableDeclarator", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 14, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + "value": "Result", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + "value": "Success", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "Identifier", + "value": "Failure", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 48, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 38, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 35, + 38, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + }, + }, + ], + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 48, + ], + "type": "VariableDeclarator", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 22, + 24, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 24, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 25, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + "value": "Result", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + "value": "Success", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + "value": "Failure", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 24, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSPropertySignature", + }, + ], + "range": Array [ + 11, + 29, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-guard.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "operator": "typeof", + "prefix": true, + "range": Array [ + 52, + 60, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "operator": "===", + "range": Array [ + 52, + 73, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 65, + 73, + ], + "raw": "'string'", + "type": "Literal", + "value": "string", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 45, + 73, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 75, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "isString", + "range": Array [ + 9, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 75, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "range": Array [ + 27, + 38, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 75, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "Identifier", + "value": "isString", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 45, + 51, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 52, + 58, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 61, + 64, + ], + "type": "Punctuator", + "value": "===", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 65, + 73, + ], + "type": "String", + "value": "'string'", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 3, + 40, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "type": "ExpressionStatement", + }, + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 40, + "line": 2, + }, + }, + "range": Array [ + 84, + 87, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 44, + 87, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "A", + "range": Array [ + 68, + 69, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 56, + 81, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 46, + "line": 3, + }, + }, + "range": Array [ + 134, + 137, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "baz", + "range": Array [ + 97, + 100, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 88, + 137, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "params": Array [ + Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "range": Array [ + 126, + 129, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "name": "A", + "range": Array [ + 112, + 129, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 100, + 131, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 138, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 44, + 52, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 40, + "line": 2, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 88, + 96, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 97, + 100, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 100, + 101, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 3, + }, + "start": Object { + "column": 42, + "line": 3, + }, + }, + "range": Array [ + 130, + 131, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 3, + }, + "start": Object { + "column": 43, + "line": 3, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 3, + }, + "start": Object { + "column": 44, + "line": 3, + }, + }, + "range": Array [ + 132, + 133, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 46, + "line": 3, + }, + }, + "range": Array [ + 134, + 135, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 48, + "line": 3, + }, + }, + "range": Array [ + 136, + 137, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "mBuffers", + "range": Array [ + 26, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 51, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 26, + 75, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 34, + 74, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 74, + ], + "type": "TSTypeReference", + "typeName": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "interop", + "range": Array [ + 36, + 43, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 53, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "name": "Reference", + "range": Array [ + 44, + 53, + ], + "type": "Identifier", + }, + "type": "TSQualifiedName", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 53, + 74, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 77, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "AudioBufferList", + "range": Array [ + 6, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 77, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 21, + ], + "type": "Identifier", + "value": "AudioBufferList", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "Identifier", + "value": "mBuffers", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "Identifier", + "value": "interop", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 44, + 53, + ], + "type": "Identifier", + "value": "Reference", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 49, + "line": 2, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 2, + }, + "start": Object { + "column": 50, + "line": 2, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-this.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "name": "addClickListener", + "range": Array [ + 23, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 65, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "onclick", + "range": Array [ + 40, + 79, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 47, + 79, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "parameters": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "name": "this", + "range": Array [ + 50, + 60, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 54, + 60, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 56, + 60, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 40, + "line": 2, + }, + }, + "name": "e", + "range": Array [ + 62, + 70, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 63, + 70, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 65, + 70, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "name": "Event", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 49, + 79, + ], + "type": "TSFunctionType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 51, + "line": 2, + }, + }, + "range": Array [ + 73, + 79, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "TSVoidKeyword", + }, + }, + "typeParameters": null, + }, + }, + }, + ], + "range": Array [ + 23, + 87, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 2, + }, + "start": Object { + "column": 58, + "line": 2, + }, + }, + "range": Array [ + 80, + 86, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 2, + }, + "start": Object { + "column": 60, + "line": 2, + }, + }, + "range": Array [ + 82, + 86, + ], + "type": "TSVoidKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 89, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "UIElement", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 89, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 90, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + "value": "UIElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 23, + 39, + ], + "type": "Identifier", + "value": "addClickListener", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 40, + 47, + ], + "type": "Identifier", + "value": "onclick", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 50, + 54, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 56, + 60, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 40, + "line": 2, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + "value": "Event", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 2, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 2, + }, + "start": Object { + "column": 50, + "line": 2, + }, + }, + "range": Array [ + 72, + 74, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 57, + "line": 2, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 2, + }, + "start": Object { + "column": 58, + "line": 2, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 2, + }, + "start": Object { + "column": 60, + "line": 2, + }, + }, + "range": Array [ + 82, + 86, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 65, + "line": 2, + }, + "start": Object { + "column": 64, + "line": 2, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "operator": "unique", + "range": Array [ + 9, + 22, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "TSSymbolKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 23, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "type", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Identifier", + "value": "unique", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Identifier", + "value": "symbol", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/var-with-definite-assignment.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "definite": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "type": "TSStringKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "definite": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 22, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 32, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 18, + 33, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "definite": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "z", + "range": Array [ + 38, + 48, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSObjectKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 38, + 48, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 34, + 49, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "!", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "!", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "!", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Identifier", + "value": "object", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 14, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "TSTypeReference", + "typeName": Object { + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "type": "TSQualifiedName", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "type": "TSQualifiedName", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/var-with-type.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 4, + 15, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 15, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "TSStringKeyword", + }, + }, + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 28, + ], + "raw": "\\"Nicholas\\"", + "type": "Literal", + "value": "Nicholas", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 34, + 45, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 37, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "TSStringKeyword", + }, + }, + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 48, + 53, + ], + "raw": "\\"Bar\\"", + "type": "Literal", + "value": "Bar", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 53, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 30, + 54, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 55, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 28, + ], + "type": "String", + "value": "\\"Nicholas\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 48, + 53, + ], + "type": "String", + "value": "\\"Bar\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 21, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "TSStringKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 32, + 37, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "configurable", + "range": Array [ + 19, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 38, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 38, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 70, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 60, + 64, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "name": "_x", + "range": Array [ + 65, + 67, + ], + "type": "Identifier", + }, + "range": Array [ + 60, + 67, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 68, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 70, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 48, + 70, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 72, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Point", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + "value": "Point", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 31, + ], + "type": "Identifier", + "value": "configurable", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 32, + 37, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 60, + 64, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 65, + 67, + ], + "type": "Identifier", + "value": "_x", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 25, + 34, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 30, + 34, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + }, + ], + "range": Array [ + 23, + 36, + ], + "type": "ObjectExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 37, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 37, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 80, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 68, + 72, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 35, + "line": 3, + }, + }, + "name": "_bar", + "range": Array [ + 73, + 77, + ], + "type": "Identifier", + }, + "range": Array [ + 68, + 77, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 61, + 78, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 59, + 80, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 56, + 80, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 82, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Other", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + "value": "Other", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 30, + 34, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 61, + 67, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 68, + 72, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 3, + }, + "start": Object { + "column": 34, + "line": 3, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 35, + "line": 3, + }, + }, + "range": Array [ + 73, + 77, + ], + "type": "Identifier", + "value": "_bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "hidden", + "range": Array [ + 15, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "z", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 53, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 43, + 47, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "name": "_z", + "range": Array [ + 48, + 50, + ], + "type": "Identifier", + }, + "range": Array [ + 43, + 50, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 36, + 51, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 34, + 53, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 31, + 53, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 55, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 55, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 55, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "P", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "Identifier", + "value": "hidden", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 43, + 47, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 48, + 50, + ], + "type": "Identifier", + "value": "_z", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "adminonly", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 27, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "y", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 76, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 58, + 62, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "name": "_y", + "range": Array [ + 63, + 65, + ], + "type": "Identifier", + }, + "range": Array [ + 58, + 65, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "operator": "=", + "range": Array [ + 58, + 69, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 58, + 70, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 48, + 76, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 44, + 76, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 78, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "User", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "User", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + "value": "adminonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 58, + 62, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 63, + 65, + ], + "type": "Identifier", + "value": "_y", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/class-decorators/class-decorator.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "sealed", + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "Qux", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + "value": "sealed", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "Qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 56, + 58, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "selector", + "range": Array [ + 17, + 25, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 17, + 32, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + }, + ], + "range": Array [ + 11, + 35, + ], + "type": "ObjectExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "Component", + "range": Array [ + 1, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 36, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "name": "FooComponent", + "range": Array [ + 43, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 10, + ], + "type": "Identifier", + "value": "Component", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "Identifier", + "value": "selector", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "String", + "value": "'foo'", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 37, + 42, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 43, + 55, + ], + "type": "Identifier", + "value": "FooComponent", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 29, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "onlyRead", + "range": Array [ + 15, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 30, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 30, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "instanceMethod", + "range": Array [ + 35, + 49, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 54, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 52, + 54, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 49, + 54, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 56, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 57, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "Identifier", + "value": "onlyRead", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 29, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 49, + ], + "type": "Identifier", + "value": "instanceMethod", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 24, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 25, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "name": "staticMethod", + "range": Array [ + 37, + 49, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 54, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 52, + 54, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 49, + 54, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 56, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 57, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 37, + 49, + ], + "type": "Identifier", + "value": "staticMethod", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/method-decorators/method-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "onlyRead", + "range": Array [ + 15, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 23, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "instanceMethod", + "range": Array [ + 28, + 42, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 47, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 45, + 47, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 42, + 47, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 49, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "Identifier", + "value": "onlyRead", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 28, + 42, + ], + "type": "Identifier", + "value": "instanceMethod", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/method-decorators/method-decorator-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "name": "staticMethod", + "range": Array [ + 30, + 42, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 47, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 45, + 47, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 42, + 47, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 49, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "D", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "D", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 30, + 42, + ], + "type": "Identifier", + "value": "staticMethod", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 3, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 20, + 31, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 113, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 81, + 85, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "title", + "range": Array [ + 86, + 91, + ], + "type": "Identifier", + }, + "range": Array [ + 81, + 91, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "operator": "=", + "range": Array [ + 81, + 106, + ], + "right": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "name": "config", + "range": Array [ + 94, + 100, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "name": "title", + "range": Array [ + 101, + 106, + ], + "type": "Identifier", + }, + "range": Array [ + 94, + 106, + ], + "type": "MemberExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 81, + 107, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 55, + "line": 2, + }, + }, + "range": Array [ + 71, + 113, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "APP_CONFIG", + "range": Array [ + 40, + 50, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "Inject", + "range": Array [ + 33, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 33, + 51, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 51, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "name": "config", + "range": Array [ + 52, + 69, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 58, + 69, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 60, + 69, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "name": "AppConfig", + "range": Array [ + 60, + 69, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 31, + 113, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 115, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Service", + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 115, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 116, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + "value": "Service", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 31, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "Identifier", + "value": "Inject", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 50, + ], + "type": "Identifier", + "value": "APP_CONFIG", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 52, + 58, + ], + "type": "Identifier", + "value": "config", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 60, + 69, + ], + "type": "Identifier", + "value": "AppConfig", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 2, + }, + "start": Object { + "column": 55, + "line": 2, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 81, + 85, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 86, + 91, + ], + "type": "Identifier", + "value": "title", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 94, + 100, + ], + "type": "Identifier", + "value": "config", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 3, + }, + }, + "range": Array [ + 100, + 101, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 101, + 106, + ], + "type": "Identifier", + "value": "title", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 114, + 115, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 50, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 48, + 50, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 29, + 33, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "special", + "range": Array [ + 21, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 21, + 34, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 20, + 34, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 35, + 46, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 46, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 19, + 50, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 52, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 53, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "Identifier", + "value": "special", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 29, + 33, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 63, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 61, + 63, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 42, + 46, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "special", + "range": Array [ + 34, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 34, + 47, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 33, + 47, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 51, + 59, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 32, + 63, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 65, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "StaticFoo", + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 65, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 66, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 15, + ], + "type": "Identifier", + "value": "StaticFoo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "Identifier", + "value": "special", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 42, + 46, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "greet", + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 95, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 67, + 75, + ], + "raw": "\\"Hello \\"", + "type": "Literal", + "value": "Hello ", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 67, + 82, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 78, + 82, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 67, + 88, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 85, + 88, + ], + "raw": "\\"!\\"", + "type": "Literal", + "value": "!", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 60, + 89, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 50, + 95, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "required", + "range": Array [ + 27, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 35, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "name": "name", + "range": Array [ + 36, + 48, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 25, + 95, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 97, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Greeter", + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 97, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 98, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + "value": "Greeter", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + "value": "greet", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "Identifier", + "value": "required", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 36, + 40, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 67, + 75, + ], + "type": "String", + "value": "\\"Hello \\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 78, + 82, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 85, + 88, + ], + "type": "String", + "value": "\\"!\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "greet", + "range": Array [ + 33, + 38, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 108, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 80, + 88, + ], + "raw": "\\"Hello \\"", + "type": "Literal", + "value": "Hello ", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 80, + 95, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 91, + 95, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 80, + 101, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 98, + 101, + ], + "raw": "\\"!\\"", + "type": "Literal", + "value": "!", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 73, + 102, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 63, + 108, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "required", + "range": Array [ + 40, + 48, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 48, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "name": "name", + "range": Array [ + 49, + 61, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 53, + 61, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 55, + 61, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 38, + 108, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 110, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "StaticGreeter", + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 110, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 111, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + "value": "StaticGreeter", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 33, + 38, + ], + "type": "Identifier", + "value": "greet", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "Identifier", + "value": "required", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 55, + 61, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 39, + "line": 2, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 73, + 79, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 80, + 88, + ], + "type": "String", + "value": "\\"Hello \\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 89, + 90, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 91, + 95, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 98, + 101, + ], + "type": "String", + "value": "\\"!\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 101, + 102, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Input", + "range": Array [ + 27, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 27, + 34, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "data", + "range": Array [ + 35, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 40, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "Output", + "range": Array [ + 46, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 46, + 54, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 45, + 54, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "click", + "range": Array [ + 59, + 64, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 45, + 86, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "EventEmitter", + "range": Array [ + 71, + 83, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 67, + 85, + ], + "type": "NewExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 88, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "SomeComponent", + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 88, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 88, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + "value": "SomeComponent", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "Identifier", + "value": "Input", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "Identifier", + "value": "data", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "Identifier", + "value": "Output", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 59, + 64, + ], + "type": "Identifier", + "value": "click", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 67, + 70, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 71, + 83, + ], + "type": "Identifier", + "value": "EventEmitter", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 87, + 88, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 32, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "configurable", + "range": Array [ + 15, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 33, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 33, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "name": "prop1", + "range": Array [ + 41, + 46, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 47, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 67, + 72, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "name": "configurable", + "range": Array [ + 54, + 66, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 54, + 73, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 73, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "name": "prop2", + "range": Array [ + 85, + 90, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 91, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 93, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 93, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 93, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 27, + ], + "type": "Identifier", + "value": "configurable", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 41, + 46, + ], + "type": "Identifier", + "value": "prop1", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 54, + 66, + ], + "type": "Identifier", + "value": "configurable", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 67, + 72, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 78, + 84, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 85, + 90, + ], + "type": "Identifier", + "value": "prop2", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "y", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 26, + 37, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 28, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "qux", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 33, + 51, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 53, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 53, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 54, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "ClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 28, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/class-extends-empty-implements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 32, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "dec", + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "E", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 0, + 14, + ], + "type": "TSEnumDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + "value": "dec", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "E", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "TSInterfaceBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "deco", + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "M", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + "value": "deco", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 17, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "M", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 14, + 16, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 68, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "members": Array [], + "modifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "TSPrivateKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "TSPublicKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 31, + ], + "type": "TSProtectedKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStaticKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 47, + ], + "type": "TSReadonlyKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "TSAbstractKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 62, + ], + "type": "TSAsyncKeyword", + }, + ], + "range": Array [ + 63, + 72, + ], + "type": "TSEnumDeclaration", + }, + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 31, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 47, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 62, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 67, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "range": Array [ + 63, + 67, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 68, + "line": 1, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 70, + "line": 1, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 71, + "line": 1, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-modifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "computed": false, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "raw": "'a'", + "type": "Literal", + "value": "a", + }, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 38, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 31, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 60, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 59, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 65, + 83, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 74, + 82, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "name": "c", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 88, + 108, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 99, + 107, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "name": "d", + "range": Array [ + 120, + 121, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 113, + 130, + ], + "static": true, + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 121, + 129, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 123, + 129, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "export": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "name": "e", + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 135, + 152, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 143, + 151, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 145, + 151, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "name": "f", + "range": Array [ + 166, + 167, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 157, + 176, + ], + "readonly": true, + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 8, + }, + "start": Object { + "column": 14, + "line": 8, + }, + }, + "range": Array [ + 167, + 175, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 8, + }, + "start": Object { + "column": 16, + "line": 8, + }, + }, + "range": Array [ + 169, + 175, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "public", + "index": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "name": "baz", + "range": Array [ + 190, + 201, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 10, + }, + }, + "range": Array [ + 193, + 201, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "range": Array [ + 195, + 201, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 182, + 211, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 10, + }, + "start": Object { + "column": 24, + "line": 10, + }, + }, + "range": Array [ + 202, + 210, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 10, + }, + "start": Object { + "column": 26, + "line": 10, + }, + }, + "range": Array [ + 204, + 210, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "private", + "index": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 13, + "line": 11, + }, + }, + "name": "baz", + "range": Array [ + 225, + 236, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 16, + "line": 11, + }, + }, + "range": Array [ + 228, + 236, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 230, + 236, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 216, + 246, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 11, + }, + "start": Object { + "column": 25, + "line": 11, + }, + }, + "range": Array [ + 237, + 245, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 11, + }, + "start": Object { + "column": 27, + "line": 11, + }, + }, + "range": Array [ + 239, + 245, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "protected", + "index": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "name": "baz", + "range": Array [ + 262, + 273, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 18, + "line": 12, + }, + }, + "range": Array [ + 265, + 273, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 20, + "line": 12, + }, + }, + "range": Array [ + 267, + 273, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "range": Array [ + 251, + 283, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 12, + }, + "start": Object { + "column": 27, + "line": 12, + }, + }, + "range": Array [ + 274, + 282, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 12, + }, + "start": Object { + "column": 29, + "line": 12, + }, + }, + "range": Array [ + 276, + 282, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "name": "baz", + "range": Array [ + 296, + 307, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "range": Array [ + 299, + 307, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 17, + "line": 13, + }, + }, + "range": Array [ + 301, + 307, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 288, + 317, + ], + "static": true, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 13, + }, + "start": Object { + "column": 24, + "line": 13, + }, + }, + "range": Array [ + 308, + 316, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 13, + }, + "start": Object { + "column": 26, + "line": 13, + }, + }, + "range": Array [ + 310, + 316, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "export": true, + "index": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 12, + "line": 14, + }, + }, + "name": "baz", + "range": Array [ + 330, + 341, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 15, + "line": 14, + }, + }, + "range": Array [ + 333, + 341, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 17, + "line": 14, + }, + }, + "range": Array [ + 335, + 341, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 322, + 351, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 14, + }, + "start": Object { + "column": 24, + "line": 14, + }, + }, + "range": Array [ + 342, + 350, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 14, + }, + "start": Object { + "column": 26, + "line": 14, + }, + }, + "range": Array [ + 344, + 350, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 14, + "line": 15, + }, + }, + "name": "baz", + "range": Array [ + 366, + 377, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 17, + "line": 15, + }, + }, + "range": Array [ + 369, + 377, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 19, + "line": 15, + }, + }, + "range": Array [ + 371, + 377, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 15, + }, + "start": Object { + "column": 4, + "line": 15, + }, + }, + "range": Array [ + 356, + 387, + ], + "readonly": true, + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 15, + }, + "start": Object { + "column": 26, + "line": 15, + }, + }, + "range": Array [ + 378, + 386, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 15, + }, + "start": Object { + "column": 28, + "line": 15, + }, + }, + "range": Array [ + 380, + 386, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 17, + }, + "start": Object { + "column": 11, + "line": 17, + }, + }, + "name": "g", + "range": Array [ + 400, + 401, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 17, + }, + "start": Object { + "column": 4, + "line": 17, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 13, + "line": 17, + }, + }, + "name": "bar", + "range": Array [ + 402, + 413, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 16, + "line": 17, + }, + }, + "range": Array [ + 405, + 413, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 18, + "line": 17, + }, + }, + "range": Array [ + 407, + 413, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 393, + 421, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 17, + }, + "start": Object { + "column": 25, + "line": 17, + }, + }, + "range": Array [ + 414, + 420, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 17, + }, + "start": Object { + "column": 27, + "line": 17, + }, + }, + "range": Array [ + 416, + 420, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 18, + }, + "start": Object { + "column": 12, + "line": 18, + }, + }, + "name": "h", + "range": Array [ + 434, + 435, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 18, + }, + "start": Object { + "column": 4, + "line": 18, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 14, + "line": 18, + }, + }, + "name": "bar", + "range": Array [ + 436, + 447, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 17, + "line": 18, + }, + }, + "range": Array [ + 439, + 447, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 19, + "line": 18, + }, + }, + "range": Array [ + 441, + 447, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 426, + 455, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 18, + }, + "start": Object { + "column": 26, + "line": 18, + }, + }, + "range": Array [ + 448, + 454, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 18, + }, + "start": Object { + "column": 28, + "line": 18, + }, + }, + "range": Array [ + 450, + 454, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 19, + }, + "start": Object { + "column": 14, + "line": 19, + }, + }, + "name": "i", + "range": Array [ + 470, + 471, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 19, + }, + "start": Object { + "column": 4, + "line": 19, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 16, + "line": 19, + }, + }, + "name": "bar", + "range": Array [ + 472, + 483, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 19, + "line": 19, + }, + }, + "range": Array [ + 475, + 483, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 21, + "line": 19, + }, + }, + "range": Array [ + 477, + 483, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 460, + 491, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 19, + }, + "start": Object { + "column": 28, + "line": 19, + }, + }, + "range": Array [ + 484, + 490, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 19, + }, + "start": Object { + "column": 30, + "line": 19, + }, + }, + "range": Array [ + 486, + 490, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 20, + }, + "start": Object { + "column": 11, + "line": 20, + }, + }, + "name": "j", + "range": Array [ + 503, + 504, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 20, + }, + "start": Object { + "column": 4, + "line": 20, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 13, + "line": 20, + }, + }, + "name": "bar", + "range": Array [ + 505, + 516, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 16, + "line": 20, + }, + }, + "range": Array [ + 508, + 516, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 18, + "line": 20, + }, + }, + "range": Array [ + 510, + 516, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 496, + 524, + ], + "static": true, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 20, + }, + "start": Object { + "column": 25, + "line": 20, + }, + }, + "range": Array [ + 517, + 523, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 20, + }, + "start": Object { + "column": 27, + "line": 20, + }, + }, + "range": Array [ + 519, + 523, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "export": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 21, + }, + "start": Object { + "column": 11, + "line": 21, + }, + }, + "name": "k", + "range": Array [ + 536, + 537, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 21, + }, + "start": Object { + "column": 4, + "line": 21, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 13, + "line": 21, + }, + }, + "name": "bar", + "range": Array [ + 538, + 549, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 16, + "line": 21, + }, + }, + "range": Array [ + 541, + 549, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 18, + "line": 21, + }, + }, + "range": Array [ + 543, + 549, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 529, + 557, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 21, + }, + "start": Object { + "column": 25, + "line": 21, + }, + }, + "range": Array [ + 550, + 556, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 21, + }, + "start": Object { + "column": 27, + "line": 21, + }, + }, + "range": Array [ + 552, + 556, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 22, + }, + "start": Object { + "column": 13, + "line": 22, + }, + }, + "name": "l", + "range": Array [ + 571, + 572, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 22, + }, + "start": Object { + "column": 4, + "line": 22, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 15, + "line": 22, + }, + }, + "name": "bar", + "range": Array [ + 573, + 584, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 18, + "line": 22, + }, + }, + "range": Array [ + 576, + 584, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 20, + "line": 22, + }, + }, + "range": Array [ + 578, + 584, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 562, + 592, + ], + "readonly": true, + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 22, + }, + "start": Object { + "column": 27, + "line": 22, + }, + }, + "range": Array [ + 585, + 591, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 22, + }, + "start": Object { + "column": 29, + "line": 22, + }, + }, + "range": Array [ + 587, + 591, + ], + "type": "TSVoidKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 23, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 594, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 23, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 594, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 25, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 596, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "String", + "value": "'a'", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 65, + 72, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 88, + 97, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 99, + 100, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 23, + "line": 5, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 113, + 119, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 120, + 121, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 121, + 122, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 123, + 129, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 20, + "line": 6, + }, + }, + "range": Array [ + 129, + 130, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 145, + 151, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 151, + 152, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 157, + 165, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 166, + 167, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 14, + "line": 8, + }, + }, + "range": Array [ + 167, + 168, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 8, + }, + "start": Object { + "column": 16, + "line": 8, + }, + }, + "range": Array [ + 169, + 175, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 8, + }, + "start": Object { + "column": 22, + "line": 8, + }, + }, + "range": Array [ + 175, + 176, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 182, + 188, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, + }, + "start": Object { + "column": 11, + "line": 10, + }, + }, + "range": Array [ + 189, + 190, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "range": Array [ + 190, + 193, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 10, + }, + }, + "range": Array [ + 193, + 194, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "range": Array [ + 195, + 201, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 10, + }, + "start": Object { + "column": 23, + "line": 10, + }, + }, + "range": Array [ + 201, + 202, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 24, + "line": 10, + }, + }, + "range": Array [ + 202, + 203, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 10, + }, + "start": Object { + "column": 26, + "line": 10, + }, + }, + "range": Array [ + 204, + 210, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 10, + }, + "start": Object { + "column": 32, + "line": 10, + }, + }, + "range": Array [ + 210, + 211, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 216, + 223, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 11, + }, + "start": Object { + "column": 12, + "line": 11, + }, + }, + "range": Array [ + 224, + 225, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 11, + }, + "start": Object { + "column": 13, + "line": 11, + }, + }, + "range": Array [ + 225, + 228, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 16, + "line": 11, + }, + }, + "range": Array [ + 228, + 229, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 230, + 236, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 24, + "line": 11, + }, + }, + "range": Array [ + 236, + 237, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 25, + "line": 11, + }, + }, + "range": Array [ + 237, + 238, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 11, + }, + "start": Object { + "column": 27, + "line": 11, + }, + }, + "range": Array [ + 239, + 245, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 11, + }, + "start": Object { + "column": 33, + "line": 11, + }, + }, + "range": Array [ + 245, + 246, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "range": Array [ + 251, + 260, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 14, + "line": 12, + }, + }, + "range": Array [ + 261, + 262, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "range": Array [ + 262, + 265, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 12, + }, + "start": Object { + "column": 18, + "line": 12, + }, + }, + "range": Array [ + 265, + 266, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 20, + "line": 12, + }, + }, + "range": Array [ + 267, + 273, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 12, + }, + "start": Object { + "column": 26, + "line": 12, + }, + }, + "range": Array [ + 273, + 274, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 12, + }, + "start": Object { + "column": 27, + "line": 12, + }, + }, + "range": Array [ + 274, + 275, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 12, + }, + "start": Object { + "column": 29, + "line": 12, + }, + }, + "range": Array [ + 276, + 282, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 12, + }, + "start": Object { + "column": 35, + "line": 12, + }, + }, + "range": Array [ + 282, + 283, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 288, + 294, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 13, + }, + "start": Object { + "column": 11, + "line": 13, + }, + }, + "range": Array [ + 295, + 296, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "range": Array [ + 296, + 299, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "range": Array [ + 299, + 300, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 17, + "line": 13, + }, + }, + "range": Array [ + 301, + 307, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 13, + }, + "start": Object { + "column": 23, + "line": 13, + }, + }, + "range": Array [ + 307, + 308, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 13, + }, + "start": Object { + "column": 24, + "line": 13, + }, + }, + "range": Array [ + 308, + 309, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 13, + }, + "start": Object { + "column": 26, + "line": 13, + }, + }, + "range": Array [ + 310, + 316, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 13, + }, + "start": Object { + "column": 32, + "line": 13, + }, + }, + "range": Array [ + 316, + 317, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 322, + 328, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 14, + }, + "start": Object { + "column": 11, + "line": 14, + }, + }, + "range": Array [ + 329, + 330, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 14, + }, + "start": Object { + "column": 12, + "line": 14, + }, + }, + "range": Array [ + 330, + 333, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 14, + }, + "start": Object { + "column": 15, + "line": 14, + }, + }, + "range": Array [ + 333, + 334, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 17, + "line": 14, + }, + }, + "range": Array [ + 335, + 341, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 14, + }, + "start": Object { + "column": 23, + "line": 14, + }, + }, + "range": Array [ + 341, + 342, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 14, + }, + "start": Object { + "column": 24, + "line": 14, + }, + }, + "range": Array [ + 342, + 343, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 14, + }, + "start": Object { + "column": 26, + "line": 14, + }, + }, + "range": Array [ + 344, + 350, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 14, + }, + "start": Object { + "column": 32, + "line": 14, + }, + }, + "range": Array [ + 350, + 351, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 15, + }, + "start": Object { + "column": 4, + "line": 15, + }, + }, + "range": Array [ + 356, + 364, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 15, + }, + "start": Object { + "column": 13, + "line": 15, + }, + }, + "range": Array [ + 365, + 366, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 15, + }, + "start": Object { + "column": 14, + "line": 15, + }, + }, + "range": Array [ + 366, + 369, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 15, + }, + "start": Object { + "column": 17, + "line": 15, + }, + }, + "range": Array [ + 369, + 370, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 19, + "line": 15, + }, + }, + "range": Array [ + 371, + 377, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 15, + }, + "start": Object { + "column": 25, + "line": 15, + }, + }, + "range": Array [ + 377, + 378, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 15, + }, + "start": Object { + "column": 26, + "line": 15, + }, + }, + "range": Array [ + 378, + 379, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 15, + }, + "start": Object { + "column": 28, + "line": 15, + }, + }, + "range": Array [ + 380, + 386, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 15, + }, + "start": Object { + "column": 34, + "line": 15, + }, + }, + "range": Array [ + 386, + 387, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 17, + }, + "start": Object { + "column": 4, + "line": 17, + }, + }, + "range": Array [ + 393, + 399, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 17, + }, + "start": Object { + "column": 11, + "line": 17, + }, + }, + "range": Array [ + 400, + 401, + ], + "type": "Identifier", + "value": "g", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 17, + }, + "start": Object { + "column": 12, + "line": 17, + }, + }, + "range": Array [ + 401, + 402, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 17, + }, + "start": Object { + "column": 13, + "line": 17, + }, + }, + "range": Array [ + 402, + 405, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 17, + }, + "start": Object { + "column": 16, + "line": 17, + }, + }, + "range": Array [ + 405, + 406, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 18, + "line": 17, + }, + }, + "range": Array [ + 407, + 413, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 17, + }, + "start": Object { + "column": 24, + "line": 17, + }, + }, + "range": Array [ + 413, + 414, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 17, + }, + "start": Object { + "column": 25, + "line": 17, + }, + }, + "range": Array [ + 414, + 415, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 17, + }, + "start": Object { + "column": 27, + "line": 17, + }, + }, + "range": Array [ + 416, + 420, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 17, + }, + "start": Object { + "column": 31, + "line": 17, + }, + }, + "range": Array [ + 420, + 421, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 18, + }, + "start": Object { + "column": 4, + "line": 18, + }, + }, + "range": Array [ + 426, + 433, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 18, + }, + "start": Object { + "column": 12, + "line": 18, + }, + }, + "range": Array [ + 434, + 435, + ], + "type": "Identifier", + "value": "h", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 18, + }, + "start": Object { + "column": 13, + "line": 18, + }, + }, + "range": Array [ + 435, + 436, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 18, + }, + "start": Object { + "column": 14, + "line": 18, + }, + }, + "range": Array [ + 436, + 439, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 18, + }, + "start": Object { + "column": 17, + "line": 18, + }, + }, + "range": Array [ + 439, + 440, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 19, + "line": 18, + }, + }, + "range": Array [ + 441, + 447, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 18, + }, + "start": Object { + "column": 25, + "line": 18, + }, + }, + "range": Array [ + 447, + 448, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 18, + }, + "start": Object { + "column": 26, + "line": 18, + }, + }, + "range": Array [ + 448, + 449, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 18, + }, + "start": Object { + "column": 28, + "line": 18, + }, + }, + "range": Array [ + 450, + 454, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 18, + }, + "start": Object { + "column": 32, + "line": 18, + }, + }, + "range": Array [ + 454, + 455, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 19, + }, + "start": Object { + "column": 4, + "line": 19, + }, + }, + "range": Array [ + 460, + 469, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 19, + }, + "start": Object { + "column": 14, + "line": 19, + }, + }, + "range": Array [ + 470, + 471, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 19, + }, + "start": Object { + "column": 15, + "line": 19, + }, + }, + "range": Array [ + 471, + 472, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 19, + }, + "start": Object { + "column": 16, + "line": 19, + }, + }, + "range": Array [ + 472, + 475, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 19, + }, + "start": Object { + "column": 19, + "line": 19, + }, + }, + "range": Array [ + 475, + 476, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 21, + "line": 19, + }, + }, + "range": Array [ + 477, + 483, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 19, + }, + "start": Object { + "column": 27, + "line": 19, + }, + }, + "range": Array [ + 483, + 484, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 19, + }, + "start": Object { + "column": 28, + "line": 19, + }, + }, + "range": Array [ + 484, + 485, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 19, + }, + "start": Object { + "column": 30, + "line": 19, + }, + }, + "range": Array [ + 486, + 490, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 19, + }, + "start": Object { + "column": 34, + "line": 19, + }, + }, + "range": Array [ + 490, + 491, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 20, + }, + "start": Object { + "column": 4, + "line": 20, + }, + }, + "range": Array [ + 496, + 502, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 20, + }, + "start": Object { + "column": 11, + "line": 20, + }, + }, + "range": Array [ + 503, + 504, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 20, + }, + "start": Object { + "column": 12, + "line": 20, + }, + }, + "range": Array [ + 504, + 505, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 20, + }, + "start": Object { + "column": 13, + "line": 20, + }, + }, + "range": Array [ + 505, + 508, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 20, + }, + "start": Object { + "column": 16, + "line": 20, + }, + }, + "range": Array [ + 508, + 509, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 18, + "line": 20, + }, + }, + "range": Array [ + 510, + 516, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 20, + }, + "start": Object { + "column": 24, + "line": 20, + }, + }, + "range": Array [ + 516, + 517, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 20, + }, + "start": Object { + "column": 25, + "line": 20, + }, + }, + "range": Array [ + 517, + 518, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 20, + }, + "start": Object { + "column": 27, + "line": 20, + }, + }, + "range": Array [ + 519, + 523, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 20, + }, + "start": Object { + "column": 31, + "line": 20, + }, + }, + "range": Array [ + 523, + 524, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 21, + }, + "start": Object { + "column": 4, + "line": 21, + }, + }, + "range": Array [ + 529, + 535, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 21, + }, + "start": Object { + "column": 11, + "line": 21, + }, + }, + "range": Array [ + 536, + 537, + ], + "type": "Identifier", + "value": "k", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 21, + }, + "start": Object { + "column": 12, + "line": 21, + }, + }, + "range": Array [ + 537, + 538, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 21, + }, + "start": Object { + "column": 13, + "line": 21, + }, + }, + "range": Array [ + 538, + 541, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 21, + }, + "start": Object { + "column": 16, + "line": 21, + }, + }, + "range": Array [ + 541, + 542, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 18, + "line": 21, + }, + }, + "range": Array [ + 543, + 549, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 21, + }, + "start": Object { + "column": 24, + "line": 21, + }, + }, + "range": Array [ + 549, + 550, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 21, + }, + "start": Object { + "column": 25, + "line": 21, + }, + }, + "range": Array [ + 550, + 551, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 21, + }, + "start": Object { + "column": 27, + "line": 21, + }, + }, + "range": Array [ + 552, + 556, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 21, + }, + "start": Object { + "column": 31, + "line": 21, + }, + }, + "range": Array [ + 556, + 557, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 22, + }, + "start": Object { + "column": 4, + "line": 22, + }, + }, + "range": Array [ + 562, + 570, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 22, + }, + "start": Object { + "column": 13, + "line": 22, + }, + }, + "range": Array [ + 571, + 572, + ], + "type": "Identifier", + "value": "l", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 22, + }, + "start": Object { + "column": 14, + "line": 22, + }, + }, + "range": Array [ + 572, + 573, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 22, + }, + "start": Object { + "column": 15, + "line": 22, + }, + }, + "range": Array [ + 573, + 576, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 22, + }, + "start": Object { + "column": 18, + "line": 22, + }, + }, + "range": Array [ + 576, + 577, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 20, + "line": 22, + }, + }, + "range": Array [ + 578, + 584, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 22, + }, + "start": Object { + "column": 26, + "line": 22, + }, + }, + "range": Array [ + 584, + 585, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 22, + }, + "start": Object { + "column": 27, + "line": 22, + }, + }, + "range": Array [ + 585, + 586, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 22, + }, + "start": Object { + "column": 29, + "line": 22, + }, + }, + "range": Array [ + 587, + 591, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 22, + }, + "start": Object { + "column": 33, + "line": 22, + }, + }, + "range": Array [ + 591, + 592, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 23, + }, + "start": Object { + "column": 0, + "line": 23, + }, + }, + "range": Array [ + 593, + 594, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/expressions/call-expression-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 3, + 6, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 23, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "TSNumberKeyword", + }, + ], + "range": Array [ + 13, + 21, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/expressions/new-expression-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 20, + ], + "type": "NewExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 20, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/expressions/tagged-template-expression-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasi": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "baz", + "raw": "baz", + }, + }, + ], + "range": Array [ + 8, + 13, + ], + "type": "TemplateLiteral", + }, + "range": Array [ + 0, + 13, + ], + "tag": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "type": "TaggedTemplateExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 3, + 8, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Template", + "value": "\`baz\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 34, + 54, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 49, + 53, + ], + "raw": "'fs'", + "type": "Literal", + "value": "fs", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "fs", + "range": Array [ + 41, + 43, + ], + "type": "Identifier", + }, + "range": Array [ + 41, + 43, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 56, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 29, + ], + "raw": "\\"i-use-things\\"", + "type": "Literal", + "value": "i-use-things", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 57, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 29, + ], + "type": "String", + "value": "\\"i-use-things\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 41, + 43, + ], + "type": "Identifier", + "value": "fs", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 49, + 53, + ], + "type": "String", + "value": "'fs'", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "select", + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 59, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "selector", + "range": Array [ + 48, + 64, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 56, + 64, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 32, + 82, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 65, + 81, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 67, + 81, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "name": "Selection", + "range": Array [ + 67, + 76, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 54, + "line": 2, + }, + }, + "range": Array [ + 77, + 80, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 76, + 81, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 59, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 25, + 82, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 84, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "d3", + "range": Array [ + 18, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 84, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 84, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 17, + ], + "type": "Identifier", + "value": "namespace", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "Identifier", + "value": "d3", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 32, + 40, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + "value": "select", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "Identifier", + "value": "selector", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 67, + 76, + ], + "type": "Identifier", + "value": "Selection", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 54, + "line": 2, + }, + }, + "range": Array [ + 77, + 80, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 57, + "line": 2, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 2, + }, + "start": Object { + "column": 58, + "line": 2, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "method", + "range": Array [ + 52, + 58, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 52, + 66, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 64, + 66, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 58, + 66, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 60, + 63, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "name": "C", + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + }, + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 42, + 73, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "C", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 34, + 73, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 73, + ], + "type": "ExportDefaultDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 34, + "line": 5, + }, + }, + "range": Array [ + 108, + 110, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "name": "bar", + "range": Array [ + 102, + 105, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "params": Array [], + "range": Array [ + 93, + 110, + ], + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 78, + 110, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 112, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 112, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 114, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 52, + 58, + ], + "type": "Identifier", + "value": "method", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 78, + 84, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 85, + 92, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 93, + 101, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "range": Array [ + 102, + 105, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 31, + "line": 5, + }, + }, + "range": Array [ + 105, + 106, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 5, + }, + "start": Object { + "column": 32, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 5, + }, + "start": Object { + "column": 34, + "line": 5, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 35, + "line": 5, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 111, + 112, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 31, + 44, + ], + "raw": "'hello world'", + "type": "Literal", + "value": "hello world", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 27, + 44, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 23, + 44, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 16, + 44, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": "constructor", + "range": Array [ + 78, + 89, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 129, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 56, + "line": 5, + }, + }, + "range": Array [ + 126, + 129, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "params": Array [ + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 27, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 97, + 106, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "range": Array [ + 98, + 106, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "range": Array [ + 90, + 106, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 38, + "line": 5, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 45, + "line": 5, + }, + }, + "name": "y", + "range": Array [ + 115, + 124, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 46, + "line": 5, + }, + }, + "range": Array [ + 116, + 124, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 48, + "line": 5, + }, + }, + "range": Array [ + 118, + 124, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "range": Array [ + 108, + 124, + ], + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 89, + 129, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 68, + 135, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "name": "Point", + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 56, + 135, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 49, + 135, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "abstract": false, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "name": "name", + "range": Array [ + 200, + 204, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "range": Array [ + 200, + 213, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 204, + 212, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 18, + "line": 9, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 28, + "line": 8, + }, + }, + "range": Array [ + 186, + 223, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 8, + }, + "start": Object { + "column": 25, + "line": 8, + }, + }, + "name": "Id", + "range": Array [ + 183, + 185, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 173, + 223, + ], + "type": "TSInterfaceDeclaration", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 166, + 223, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 156, + 229, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "name": "B", + "range": Array [ + 154, + 155, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 147, + 229, + ], + "type": "TSModuleDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 140, + 229, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 231, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 231, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 231, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 31, + 44, + ], + "type": "String", + "value": "'hello world'", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 49, + 55, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + "value": "Point", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 89, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 89, + 90, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "range": Array [ + 90, + 96, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 27, + "line": 5, + }, + }, + "range": Array [ + 97, + 98, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 5, + }, + "start": Object { + "column": 36, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 5, + }, + "start": Object { + "column": 38, + "line": 5, + }, + }, + "range": Array [ + 108, + 114, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 45, + "line": 5, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 5, + }, + "start": Object { + "column": 46, + "line": 5, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 48, + "line": 5, + }, + }, + "range": Array [ + 118, + 124, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 5, + }, + "start": Object { + "column": 54, + "line": 5, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 56, + "line": 5, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 58, + "line": 5, + }, + }, + "range": Array [ + 128, + 129, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 134, + 135, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 140, + 146, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 147, + 153, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "range": Array [ + 154, + 155, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 166, + 172, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 173, + 182, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 8, + }, + "start": Object { + "column": 25, + "line": 8, + }, + }, + "range": Array [ + 183, + 185, + ], + "type": "Identifier", + "value": "Id", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 8, + }, + "start": Object { + "column": 28, + "line": 8, + }, + }, + "range": Array [ + 186, + 187, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "range": Array [ + 200, + 204, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 18, + "line": 9, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 9, + }, + "start": Object { + "column": 24, + "line": 9, + }, + }, + "range": Array [ + 212, + 213, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 222, + 223, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 228, + 229, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 12, + }, + }, + "range": Array [ + 230, + 231, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 31, + ], + "raw": "\\"hot-new-module\\"", + "type": "Literal", + "value": "hot-new-module", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 31, + ], + "type": "String", + "value": "\\"hot-new-module\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/lib/basics.js b/packages/typescript-estree/tests/lib/basics.js new file mode 100644 index 000000000000..8a727e8e8b3b --- /dev/null +++ b/packages/typescript-estree/tests/lib/basics.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Tests for basic expressions + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"), + shelljs = require("shelljs"), + testUtils = require("../../tools/test-utils"); + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +const FIXTURES_DIR = "./tests/fixtures/basics"; + +const testFiles = shelljs.find(FIXTURES_DIR) + .filter(filename => filename.indexOf(".src.js") > -1) + // strip off ".src.js" + .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("basics", () => { + + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); + const config = { + loc: true, + range: true, + tokens: true, + ecmaFeatures: {}, + errorOnUnknownASTType: true + }; + test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); + }); + +}); diff --git a/packages/typescript-estree/tests/lib/comments.js b/packages/typescript-estree/tests/lib/comments.js new file mode 100644 index 000000000000..ec54992c2b13 --- /dev/null +++ b/packages/typescript-estree/tests/lib/comments.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Tests for parsing and attaching comments. + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"), + shelljs = require("shelljs"), + testUtils = require("../../tools/test-utils"); + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +const FIXTURES_DIR = "./tests/fixtures/comments"; + +const testFiles = shelljs.find(FIXTURES_DIR) + .filter(filename => filename.indexOf(".src.js") > -1) + // strip off ".src.js" + .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("Comments", () => { + + testFiles.forEach(filename => { + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); + const config = { + loc: true, + range: true, + tokens: true, + comment: true, + ecmaFeatures: { + jsx: true + } + }; + test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); + }); + +}); diff --git a/packages/typescript-estree/tests/lib/ecma-features.js b/packages/typescript-estree/tests/lib/ecma-features.js new file mode 100644 index 000000000000..40b619f2e1f9 --- /dev/null +++ b/packages/typescript-estree/tests/lib/ecma-features.js @@ -0,0 +1,55 @@ +/** + * @fileoverview Tests for ECMA feature flags + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"), + shelljs = require("shelljs"), + testUtils = require("../../tools/test-utils"); + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +const FIXTURES_DIR = "./tests/fixtures/ecma-features"; + +const testFiles = shelljs.find(FIXTURES_DIR) + .filter(filename => filename.indexOf(".src.js") > -1) + // strip off ".src.js" + .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("ecmaFeatures", () => { + + testFiles.forEach(filename => { + + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const feature = path.dirname(filename), + code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`), + config = { + loc: true, + range: true, + tokens: true, + ecmaFeatures: {}, + errorOnUnknownASTType: true + }; + + test(`fixtures/${filename}.src`, () => { + config.ecmaFeatures[feature] = true; + testUtils.createSnapshotTestBlock(code, config)(); + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/jsx.js b/packages/typescript-estree/tests/lib/jsx.js new file mode 100644 index 000000000000..ba1dce33917a --- /dev/null +++ b/packages/typescript-estree/tests/lib/jsx.js @@ -0,0 +1,79 @@ +/** + * @fileoverview Tests for JSX + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"), + shelljs = require("shelljs"), + testUtils = require("../../tools/test-utils"), + filesWithKnownIssues = require("../jsx-known-issues"); + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +const JSX_FIXTURES_DIR = "./tests/fixtures/jsx"; + +const jsxTestFiles = shelljs.find(JSX_FIXTURES_DIR) + .filter(filename => filename.indexOf(".src.js") > -1) + .filter(filename => filesWithKnownIssues.every(fileName => filename.indexOf(fileName) === -1)) + // strip off ".src.js" + .map(filename => filename.substring(JSX_FIXTURES_DIR.length - 1, filename.length - 7)); + +const JSX_JSXTEXT_FIXTURES_DIR = "./tests/fixtures/jsx-useJSXTextNode"; + +const jsxTextTestFiles = shelljs.find(JSX_JSXTEXT_FIXTURES_DIR) + .filter(filename => filename.indexOf(".src.js") > -1) + // strip off ".src.js" + .map(filename => filename.substring(JSX_JSXTEXT_FIXTURES_DIR.length - 1, filename.length - 7)); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("JSX", () => { + + /** + * Test each fixture file + * @param {string} fixturesDir Fixtures Directory + * @param {boolean} useJSXTextNode Use JSX Text Node + * @returns {void} + */ + function testFixture(fixturesDir, useJSXTextNode) { + + return filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat(`${path.resolve(fixturesDir, filename)}.src.js`); + + const config = { + loc: true, + range: true, + tokens: true, + errorOnUnknownASTType: true, + useJSXTextNode, + ecmaFeatures: { + jsx: true + } + }; + + test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); + }; + } + + describe("useJSXTextNode: false", () => { + jsxTestFiles.forEach(testFixture(JSX_FIXTURES_DIR, false)); + }); + describe("useJSXTextNode: true", () => { + jsxTextTestFiles.forEach(testFixture(JSX_JSXTEXT_FIXTURES_DIR, true)); + }); +}); diff --git a/packages/typescript-estree/tests/lib/parse.js b/packages/typescript-estree/tests/lib/parse.js new file mode 100644 index 000000000000..c84499233819 --- /dev/null +++ b/packages/typescript-estree/tests/lib/parse.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Tests for tokenize(). + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const parser = require("../../parser"), + testUtils = require("../../tools/test-utils"); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("parse()", () => { + + + describe("basic functionality", () => { + + it("should parse an empty string", () => { + expect(parser.parse("").body).toEqual([]); + expect(parser.parse("", {}).body).toEqual([]); + }); + + }); + + describe("modules", () => { + + it("should have correct column number when strict mode error occurs", () => { + try { + parser.parse("function fn(a, a) {\n}", { sourceType: "module" }); + } catch (err) { + expect(err.column).toEqual(16); + } + }); + + }); + + describe("general", () => { + + const code = "let foo = bar;"; + const config = { + ecmaFeatures: { + blockBindings: true + }, + comment: true, + tokens: true, + range: true, + loc: true + }; + + test("output tokens, comments, locs, and ranges when called with those options", testUtils.createSnapshotTestBlock(code, config)); + + }); + + +}); diff --git a/packages/typescript-estree/tests/lib/tsx.js b/packages/typescript-estree/tests/lib/tsx.js new file mode 100644 index 000000000000..a29b57fdb073 --- /dev/null +++ b/packages/typescript-estree/tests/lib/tsx.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Tests for TSX-specific constructs + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"), + shelljs = require("shelljs"), + testUtils = require("../../tools/test-utils"); + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +const TSX_FIXTURES_DIR = "./tests/fixtures/tsx"; + +const testFiles = shelljs.find(TSX_FIXTURES_DIR) + .filter(filename => filename.indexOf(".src.tsx") > -1) + // strip off ".src.tsx" + .map(filename => filename.substring(TSX_FIXTURES_DIR.length - 1, filename.length - 8)); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("TSX", () => { + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat(`${path.resolve(TSX_FIXTURES_DIR, filename)}.src.tsx`); + const config = { + loc: true, + range: true, + tokens: true, + errorOnUnknownASTType: true, + useJSXTextNode: true, + ecmaFeatures: { + jsx: true + } + }; + test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); + }); +}); diff --git a/packages/typescript-estree/tests/lib/typescript.js b/packages/typescript-estree/tests/lib/typescript.js new file mode 100644 index 000000000000..8032dac66263 --- /dev/null +++ b/packages/typescript-estree/tests/lib/typescript.js @@ -0,0 +1,50 @@ +/** + * @fileoverview Tests for TypeScript-specific constructs + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"), + shelljs = require("shelljs"), + testUtils = require("../../tools/test-utils"); + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +const FIXTURES_DIR = "./tests/fixtures/typescript"; + +const testFiles = shelljs.find(FIXTURES_DIR) + .filter(filename => filename.indexOf(".src.ts") > -1) + // strip off ".src.ts" + .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe("typescript", () => { + + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.ts`); + const config = { + loc: true, + range: true, + tokens: true, + ecmaFeatures: {}, + errorOnUnknownASTType: true + }; + test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); + }); + +}); diff --git a/packages/typescript-estree/tools/test-utils.js b/packages/typescript-estree/tools/test-utils.js new file mode 100644 index 000000000000..76a7c9ed100b --- /dev/null +++ b/packages/typescript-estree/tools/test-utils.js @@ -0,0 +1,73 @@ +/** + * @fileoverview Tools for running test cases + * @author Nicholas C. Zakas + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const parser = require("../parser"); + +//------------------------------------------------------------------------------ +// Private +//-------------------------------------------------------------------------------- + +/** + * Returns a raw copy of the given AST + * @param {Object} ast the AST object + * @returns {Object} copy of the AST object + */ +function getRaw(ast) { + return JSON.parse(JSON.stringify(ast, (key, value) => { + if ((key === "start" || key === "end") && typeof value === "number") { + return undefined; + } + return value; + })); +} + +/** + * Returns a function which can be used as the callback of a Jest test() block, + * and which performs an assertion on the snapshot for the given code and config. + * @param {string} code The source code to parse + * @param {*} config the parser configuration + * @returns {Function} callback for Jest test() block + */ +function createSnapshotTestBlock(code, config) { + + /** + * @returns {Object} the AST object + */ + function parse() { + const ast = parser.parse(code, config); + return getRaw(ast); + } + + return () => { + try { + const result = parse(); + expect(result).toMatchSnapshot(); + } catch (e) { + /** + * If we are deliberately throwing because of encountering an unknown + * AST_NODE_TYPE, we rethrow to cause the test to fail + */ + if (e.message.match("Unknown AST_NODE_TYPE")) { + throw new Error(e); + } + expect(parse).toThrowErrorMatchingSnapshot(); + } + }; + +} + +module.exports = { + getRaw, + createSnapshotTestBlock +}; diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock new file mode 100644 index 000000000000..6255bab7b248 --- /dev/null +++ b/packages/typescript-estree/yarn.lock @@ -0,0 +1,6781 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/code-frame@^7.0.0-beta.35": + version "7.0.0-beta.56" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.56.tgz#09f76300673ac085d3b90e02aafa0ffc2c96846a" + dependencies: + "@babel/highlight" "7.0.0-beta.56" + +"@babel/core@^7.0.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.0.tgz#08958f1371179f62df6966d8a614003d11faeb04" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.0.0" + "@babel/helpers" "^7.1.0" + "@babel/parser" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + convert-source-map "^1.1.0" + debug "^3.1.0" + json5 "^0.5.0" + lodash "^4.17.10" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0.tgz#1efd58bffa951dc846449e58ce3a1d7f02d393aa" + dependencies: + "@babel/types" "^7.0.0" + jsesc "^2.5.1" + lodash "^4.17.10" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" + dependencies: + "@babel/helper-explode-assignable-expression" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-call-delegate@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz#6a957f105f37755e8645343d3038a22e1449cc4a" + dependencies: + "@babel/helper-hoist-variables" "^7.0.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-define-map@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz#3b74caec329b3c80c116290887c0dd9ae468c20c" + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/types" "^7.0.0" + lodash "^4.17.10" + +"@babel/helper-explode-assignable-expression@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" + dependencies: + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-hoist-variables@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz#46adc4c5e758645ae7a45deb92bab0918c23bb88" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-member-expression-to-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-imports@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-transforms@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.1.0.tgz#470d4f9676d9fad50b324cdcce5fbabbc3da5787" + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + lodash "^4.17.10" + +"@babel/helper-optimise-call-expression@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + +"@babel/helper-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0.tgz#2c1718923b57f9bbe64705ffe5640ac64d9bdb27" + dependencies: + lodash "^4.17.10" + +"@babel/helper-remap-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-wrap-function" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-replace-supers@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.1.0.tgz#5fc31de522ec0ef0899dc9b3e7cf6a5dd655f362" + dependencies: + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-simple-access@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" + dependencies: + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-wrap-function@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz#8cf54e9190706067f016af8f75cb3df829cc8c66" + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helpers@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.1.0.tgz#429bf0f0020be56a4242883432084e3d70a8a141" + dependencies: + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/highlight@7.0.0-beta.56": + version "7.0.0-beta.56" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.56.tgz#f8b0fc8c5c2de53bb2c12f9001ad3d99e573696d" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.0.tgz#a7cd42cb3c12aec52e24375189a47b39759b783e" + +"@babel/plugin-proposal-async-generator-functions@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.1.0.tgz#41c1a702e10081456e23a7b74d891922dd1bb6ce" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/plugin-syntax-async-generators" "^7.0.0" + +"@babel/plugin-proposal-json-strings@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.0.0.tgz#3b4d7b5cf51e1f2e70f52351d28d44fc2970d01e" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-json-strings" "^7.0.0" + +"@babel/plugin-proposal-object-rest-spread@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0.tgz#9a17b547f64d0676b6c9cecd4edf74a82ab85e7e" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + +"@babel/plugin-proposal-optional-catch-binding@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0.tgz#b610d928fe551ff7117d42c8bb410eec312a6425" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" + +"@babel/plugin-proposal-unicode-property-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz#498b39cd72536cd7c4b26177d030226eba08cd33" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + regexpu-core "^4.2.0" + +"@babel/plugin-syntax-async-generators@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0.tgz#bf0891dcdbf59558359d0c626fdc9490e20bc13c" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-json-strings@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.0.0.tgz#0d259a68090e15b383ce3710e01d5b23f3770cbd" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz#37d8fbcaf216bd658ea1aebbeb8b75e88ebc549b" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0.tgz#886f72008b3a8b185977f7cb70713b45e51ee475" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-arrow-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz#a6c14875848c68a3b4b3163a486535ef25c7e749" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.1.0.tgz#109e036496c51dd65857e16acab3bafdf3c57811" + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + +"@babel/plugin-transform-block-scoped-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0.tgz#482b3f75103927e37288b3b67b65f848e2aa0d07" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-block-scoping@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0.tgz#1745075edffd7cdaf69fab2fb6f9694424b7e9bc" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + lodash "^4.17.10" + +"@babel/plugin-transform-classes@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.1.0.tgz#ab3f8a564361800cbc8ab1ca6f21108038432249" + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-define-map" "^7.1.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0.tgz#2fbb8900cd3e8258f2a2ede909b90e7556185e31" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-destructuring@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0.tgz#68e911e1935dda2f06b6ccbbf184ffb024e9d43a" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-dotall-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0.tgz#73a24da69bc3c370251f43a3d048198546115e58" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + regexpu-core "^4.1.3" + +"@babel/plugin-transform-duplicate-keys@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0.tgz#a0601e580991e7cace080e4cf919cfd58da74e86" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-exponentiation-operator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.1.0.tgz#9c34c2ee7fd77e02779cfa37e403a2e1003ccc73" + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-for-of@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz#f2ba4eadb83bd17dc3c7e9b30f4707365e1c3e39" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.1.0.tgz#29c5550d5c46208e7f730516d41eeddd4affadbb" + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-literals@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0.tgz#2aec1d29cdd24c407359c930cdd89e914ee8ff86" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-amd@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.1.0.tgz#f9e0a7072c12e296079b5a59f408ff5b97bf86a8" + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-commonjs@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.1.0.tgz#0a9d86451cbbfb29bd15186306897c67f6f9a05c" + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + +"@babel/plugin-transform-modules-systemjs@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0.tgz#8873d876d4fee23209decc4d1feab8f198cf2df4" + dependencies: + "@babel/helper-hoist-variables" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-umd@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.1.0.tgz#a29a7d85d6f28c3561c33964442257cc6a21f2a8" + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-new-target@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz#ae8fbd89517fa7892d20e6564e641e8770c3aa4a" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-object-super@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.1.0.tgz#b1ae194a054b826d8d4ba7ca91486d4ada0f91bb" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + +"@babel/plugin-transform-parameters@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.1.0.tgz#44f492f9d618c9124026e62301c296bf606a7aed" + dependencies: + "@babel/helper-call-delegate" "^7.1.0" + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-regenerator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz#5b41686b4ed40bef874d7ed6a84bdd849c13e0c1" + dependencies: + regenerator-transform "^0.13.3" + +"@babel/plugin-transform-shorthand-properties@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0.tgz#85f8af592dcc07647541a0350e8c95c7bf419d15" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-spread@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0.tgz#93583ce48dd8c85e53f3a46056c856e4af30b49b" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-sticky-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0.tgz#30a9d64ac2ab46eec087b8530535becd90e73366" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + +"@babel/plugin-transform-template-literals@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0.tgz#084f1952efe5b153ddae69eb8945f882c7a97c65" + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-typeof-symbol@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0.tgz#4dcf1e52e943e5267b7313bff347fdbe0f81cec9" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-unicode-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz#c6780e5b1863a76fe792d90eded9fcd5b51d68fc" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + regexpu-core "^4.1.3" + +"@babel/polyfill@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.0.0.tgz#c8ff65c9ec3be6a1ba10113ebd40e8750fb90bff" + dependencies: + core-js "^2.5.7" + regenerator-runtime "^0.11.1" + +"@babel/preset-env@^7.0.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.0.tgz#e67ea5b0441cfeab1d6f41e9b5c79798800e8d11" + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-async-generator-functions" "^7.1.0" + "@babel/plugin-proposal-json-strings" "^7.0.0" + "@babel/plugin-proposal-object-rest-spread" "^7.0.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.0.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.0.0" + "@babel/plugin-syntax-async-generators" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" + "@babel/plugin-transform-arrow-functions" "^7.0.0" + "@babel/plugin-transform-async-to-generator" "^7.1.0" + "@babel/plugin-transform-block-scoped-functions" "^7.0.0" + "@babel/plugin-transform-block-scoping" "^7.0.0" + "@babel/plugin-transform-classes" "^7.1.0" + "@babel/plugin-transform-computed-properties" "^7.0.0" + "@babel/plugin-transform-destructuring" "^7.0.0" + "@babel/plugin-transform-dotall-regex" "^7.0.0" + "@babel/plugin-transform-duplicate-keys" "^7.0.0" + "@babel/plugin-transform-exponentiation-operator" "^7.1.0" + "@babel/plugin-transform-for-of" "^7.0.0" + "@babel/plugin-transform-function-name" "^7.1.0" + "@babel/plugin-transform-literals" "^7.0.0" + "@babel/plugin-transform-modules-amd" "^7.1.0" + "@babel/plugin-transform-modules-commonjs" "^7.1.0" + "@babel/plugin-transform-modules-systemjs" "^7.0.0" + "@babel/plugin-transform-modules-umd" "^7.1.0" + "@babel/plugin-transform-new-target" "^7.0.0" + "@babel/plugin-transform-object-super" "^7.1.0" + "@babel/plugin-transform-parameters" "^7.1.0" + "@babel/plugin-transform-regenerator" "^7.0.0" + "@babel/plugin-transform-shorthand-properties" "^7.0.0" + "@babel/plugin-transform-spread" "^7.0.0" + "@babel/plugin-transform-sticky-regex" "^7.0.0" + "@babel/plugin-transform-template-literals" "^7.0.0" + "@babel/plugin-transform-typeof-symbol" "^7.0.0" + "@babel/plugin-transform-unicode-regex" "^7.0.0" + browserslist "^4.1.0" + invariant "^2.2.2" + js-levenshtein "^1.1.3" + semver "^5.3.0" + +"@babel/register@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0.tgz#fa634bae1bfa429f60615b754fc1f1d745edd827" + dependencies: + core-js "^2.5.7" + find-cache-dir "^1.0.0" + home-or-tmp "^3.0.0" + lodash "^4.17.10" + mkdirp "^0.5.1" + pirates "^4.0.0" + source-map-support "^0.5.9" + +"@babel/template@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.0.tgz#58cc9572e1bfe24fe1537fdf99d839d53e517e22" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/traverse@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.0.tgz#503ec6669387efd182c3888c4eec07bcc45d91b2" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.0.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + debug "^3.1.0" + globals "^11.1.0" + lodash "^4.17.10" + +"@babel/types@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0.tgz#6e191793d3c854d19c6749989e3bc55f0e962118" + dependencies: + esutils "^2.0.2" + lodash "^4.17.10" + to-fast-properties "^2.0.0" + +"@mrmlnc/readdir-enhanced@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + dependencies: + call-me-maybe "^1.0.1" + glob-to-regexp "^0.3.0" + +"@nodelib/fs.stat@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz#54c5a964462be3d4d78af631363c18d6fa91ac26" + +"@octokit/rest@^15.2.0": + version "15.12.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-15.12.0.tgz#458efa0466ce3b257726bffff869a06da026e954" + dependencies: + before-after-hook "^1.1.0" + btoa-lite "^1.0.0" + debug "^3.1.0" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.0" + lodash "^4.17.4" + node-fetch "^2.1.1" + universal-user-agent "^2.0.0" + url-template "^2.0.8" + +"@samverschueren/stream-to-observable@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" + dependencies: + any-observable "^0.3.0" + +"@semantic-release/commit-analyzer@^6.0.0": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@semantic-release/commit-analyzer/-/commit-analyzer-6.0.1.tgz#5acd015130d60e279b6ed2de56b8e0d06169cd3f" + dependencies: + conventional-changelog-angular "^5.0.0" + conventional-commits-filter "^2.0.0" + conventional-commits-parser "^3.0.0" + debug "^4.0.0" + import-from "^2.1.0" + lodash "^4.17.4" + +"@semantic-release/error@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-2.2.0.tgz#ee9d5a09c9969eade1ec864776aeda5c5cddbbf0" + +"@semantic-release/github@^5.0.0": + version "5.0.5" + resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-5.0.5.tgz#9149b4fd9232f63ee38039c540a800a00a4d9e55" + dependencies: + "@octokit/rest" "^15.2.0" + "@semantic-release/error" "^2.2.0" + aggregate-error "^1.0.0" + bottleneck "^2.0.1" + debug "^4.0.0" + dir-glob "^2.0.0" + fs-extra "^7.0.0" + globby "^8.0.0" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + issue-parser "^3.0.0" + lodash "^4.17.4" + mime "^2.0.3" + p-filter "^1.0.0" + p-retry "^2.0.0" + parse-github-url "^1.0.1" + url-join "^4.0.0" + +"@semantic-release/npm@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@semantic-release/npm/-/npm-5.0.4.tgz#bef4ff31c9a70cc6db7583e08d2d29741b32d2f8" + dependencies: + "@semantic-release/error" "^2.2.0" + aggregate-error "^1.0.0" + detect-indent "^5.0.0" + detect-newline "^2.1.0" + execa "^1.0.0" + fs-extra "^7.0.0" + lodash "^4.17.4" + nerf-dart "^1.0.0" + normalize-url "^3.0.0" + npm "^6.3.0" + parse-json "^4.0.0" + rc "^1.2.8" + read-pkg "^4.0.0" + registry-auth-token "^3.3.1" + +"@semantic-release/release-notes-generator@^7.0.0": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@semantic-release/release-notes-generator/-/release-notes-generator-7.0.2.tgz#67f15c53c4f8e68106a74f0364bfb1326ade3e63" + dependencies: + conventional-changelog-angular "^5.0.0" + conventional-changelog-writer "^4.0.0" + conventional-commits-filter "^2.0.0" + conventional-commits-parser "^3.0.0" + debug "^4.0.0" + get-stream "^4.0.0" + git-url-parse "^10.0.1" + import-from "^2.1.0" + into-stream "^3.1.0" + lodash "^4.17.4" + +"@sindresorhus/is@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.11.0.tgz#a65970040a5b55c4713452666703b92a6c331fdb" + dependencies: + symbol-observable "^1.2.0" + +"@szmarczak/http-timer@^1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.1.tgz#6402258dfe467532b26649ef076b4d11f74fb612" + dependencies: + defer-to-connect "^1.0.1" + +JSONStream@^1.0.4, JSONStream@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.4.tgz#615bb2adb0cd34c8f4c447b5f6512fa1d8f16a2e" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +abab@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + +abbrev@1, abbrev@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +acorn-globals@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + dependencies: + acorn "^5.0.0" + +acorn@^5.0.0, acorn@^5.5.3: + version "5.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" + +agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + dependencies: + es6-promisify "^5.0.0" + +agentkeepalive@^3.4.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.1.tgz#4eba75cf2ad258fc09efd506cdb8d8c2971d35a4" + dependencies: + humanize-ms "^1.2.1" + +aggregate-error@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-1.0.0.tgz#888344dad0220a72e3af50906117f48771925fac" + dependencies: + clean-stack "^1.0.0" + indent-string "^3.0.0" + +ajv@^5.1.0, ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-align@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + dependencies: + string-width "^2.0.0" + +ansi-escapes@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-escapes@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +ansicolors@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" + +ansistyles@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ansistyles/-/ansistyles-0.1.3.tgz#5de60415bda071bb37127854c864f41b23254539" + +any-observable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +append-transform@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" + dependencies: + default-require-extensions "^2.0.0" + +aproba@^1.0.3, aproba@^1.1.1, aproba@^1.1.2, aproba@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +"aproba@^1.1.2 || 2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + +archy@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + dependencies: + sprintf-js "~1.0.2" + +argv-formatter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/argv-formatter/-/argv-formatter-1.0.0.tgz#a0ca0cbc29a5b73e836eebe1cbf6c5e0e4eb82f9" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-ify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.0, array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asap@^2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.1.4, async@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + dependencies: + lodash "^4.17.10" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +atob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.6.0, aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + +babel-code-frame@6.26.0, babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.0.0, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.4.2.tgz#f276de67798a5d68f2d6e87ff518c2f6e1609877" + dependencies: + babel-plugin-istanbul "^4.1.6" + babel-preset-jest "^23.2.0" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.1.6: + version "4.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" + +babel-plugin-jest-hoist@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" + +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-preset-jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" + dependencies: + babel-plugin-jest-hoist "^23.2.0" + babel-plugin-syntax-object-rest-spread "^6.13.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@7.0.0-beta.39: + version "7.0.0-beta.39" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.39.tgz#512833ea788f6570c6db026d743a7565e58d3aeb" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + dependencies: + tweetnacl "^0.14.3" + +before-after-hook@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.1.0.tgz#83165e15a59460d13702cb8febd6a1807896db5a" + +bin-links@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-1.1.2.tgz#fb74bd54bae6b7befc6c6221f25322ac830d9757" + dependencies: + bluebird "^3.5.0" + cmd-shim "^2.0.2" + gentle-fs "^2.0.0" + graceful-fs "^4.1.11" + write-file-atomic "^2.3.0" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +bluebird@^3.5.0, bluebird@^3.5.1, bluebird@~3.5.1: + version "3.5.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" + +bottleneck@^2.0.1: + version "2.11.0" + resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.11.0.tgz#d91e194ef071ddb88312f13454405e52067ea9cc" + +boxen@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^2.0.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^1.2.0" + widest-line "^2.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +browser-process-hrtime@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + dependencies: + resolve "1.1.7" + +browserslist@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.1.1.tgz#328eb4ff1215b12df6589e9ab82f8adaa4fc8cd6" + dependencies: + caniuse-lite "^1.0.30000884" + electron-to-chromium "^1.3.62" + node-releases "^1.0.0-alpha.11" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + +btoa-lite@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +builtins@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + +byline@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" + +byte-size@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.3.tgz#b7c095efc68eadf82985fccd9a2df43a74fa2ccd" + +cacache@^10.0.4: + version "10.0.4" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460" + dependencies: + bluebird "^3.5.1" + chownr "^1.0.1" + glob "^7.1.2" + graceful-fs "^4.1.11" + lru-cache "^4.1.1" + mississippi "^2.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^5.2.4" + unique-filename "^1.1.0" + y18n "^4.0.0" + +cacache@^11.0.1, cacache@^11.0.2, cacache@^11.2.0: + version "11.2.0" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.2.0.tgz#617bdc0b02844af56310e411c0878941d5739965" + dependencies: + bluebird "^3.5.1" + chownr "^1.0.1" + figgy-pudding "^3.1.0" + glob "^7.1.2" + graceful-fs "^4.1.11" + lru-cache "^4.1.3" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^6.0.0" + unique-filename "^1.1.0" + y18n "^4.0.0" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +cacheable-request@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-5.0.0.tgz#7ce347741c48d85c76bc41b78f6bf13e2907056d" + dependencies: + clone-response "^1.0.2" + get-stream "^4.0.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^1.0.1" + normalize-url "^3.1.0" + responselike "^1.0.2" + +call-limit@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/call-limit/-/call-limit-1.1.0.tgz#6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea" + +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + +camelcase-keys@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" + dependencies: + camelcase "^4.1.0" + map-obj "^2.0.0" + quick-lru "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^4.0.0, camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +caniuse-lite@^1.0.30000884: + version "1.0.30000886" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000886.tgz#2127186c4f57da10d3ba26fc3e87dce4a5ddd3ae" + +capture-exit@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" + dependencies: + rsvp "^3.3.3" + +capture-stack-trace@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" + +cardinal@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-2.1.1.tgz#7cc1055d822d212954d07b085dea251cc7bc5505" + dependencies: + ansicolors "~0.3.2" + redeyed "~2.1.0" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.0.0, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chownr@^1.0.1, chownr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + +ci-info@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" + +ci-info@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" + +cidr-regex@^2.0.10: + version "2.0.10" + resolved "https://registry.yarnpkg.com/cidr-regex/-/cidr-regex-2.0.10.tgz#af13878bd4ad704de77d6dc800799358b3afa70d" + dependencies: + ip-regex "^2.1.0" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +clean-stack@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" + +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + +cli-columns@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cli-columns/-/cli-columns-3.1.2.tgz#6732d972979efc2ae444a1f08e08fa139c96a18e" + dependencies: + string-width "^2.0.0" + strip-ansi "^3.0.1" + +cli-cursor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-table3@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" + dependencies: + object-assign "^4.1.0" + string-width "^2.1.1" + optionalDependencies: + colors "^1.1.2" + +cli-table@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" + dependencies: + colors "1.0.3" + +cli-truncate@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + dependencies: + slice-ansi "0.0.4" + string-width "^1.0.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + dependencies: + mimic-response "^1.0.0" + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + +cmd-shim@^2.0.2, cmd-shim@~2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" + dependencies: + graceful-fs "^4.1.2" + mkdirp "~0.5.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + dependencies: + color-name "1.1.1" + +color-name@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + +colors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + +colors@^1.1.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" + +columnify@~1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" + dependencies: + strip-ansi "^3.0.0" + wcwidth "^1.0.0" + +combined-stream@1.0.6, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + dependencies: + delayed-stream "~1.0.0" + +commander@^2.14.1, commander@^2.9.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" + +commander@~2.17.1: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +compare-func@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" + dependencies: + array-ify "^1.0.0" + dot-prop "^3.0.0" + +compare-versions@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.3.0.tgz#af93ea705a96943f622ab309578b9b90586f39c3" + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.5.0, concat-stream@^1.5.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +config-chain@~1.1.11: + version "1.1.12" + resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" + dependencies: + ini "^1.3.4" + proto-list "~1.2.1" + +configstore@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" + dependencies: + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" + +console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +conventional-changelog-angular@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.1.tgz#f96431b76de453333a909decd02b15cb5bd2d364" + dependencies: + compare-func "^1.3.1" + q "^1.5.1" + +conventional-changelog-writer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.0.tgz#3ed983c8ef6a3aa51fe44e82c9c75e86f1b5aa42" + dependencies: + compare-func "^1.3.1" + conventional-commits-filter "^2.0.0" + dateformat "^3.0.0" + handlebars "^4.0.2" + json-stringify-safe "^5.0.1" + lodash "^4.2.1" + meow "^4.0.0" + semver "^5.5.0" + split "^1.0.0" + through2 "^2.0.0" + +conventional-commit-types@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz#5db95739d6c212acbe7b6f656a11b940baa68946" + +conventional-commits-filter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.0.tgz#a0ce1d1ff7a1dd7fab36bee8e8256d348d135651" + dependencies: + is-subset "^0.1.1" + modify-values "^1.0.0" + +conventional-commits-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.0.tgz#7f604549a50bd8f60443fbe515484b1c2f06a5c4" + dependencies: + JSONStream "^1.0.4" + is-text-path "^1.0.0" + lodash "^4.2.1" + meow "^4.0.0" + split2 "^2.0.0" + through2 "^2.0.0" + trim-off-newlines "^1.0.0" + +convert-source-map@^1.1.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + dependencies: + safe-buffer "~5.1.1" + +convert-source-map@^1.4.0, convert-source-map@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + +core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.7: + version "2.5.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cosmiconfig@^5.0.1, cosmiconfig@^5.0.2: + version "5.0.6" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" + dependencies: + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^4.0.0" + +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + dependencies: + capture-stack-trace "^1.0.0" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" + +cssstyle@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.0.0.tgz#79b16d51ec5591faec60e688891f15d2a5705129" + dependencies: + cssom "0.3.x" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +cyclist@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + +cz-conventional-changelog@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-2.1.0.tgz#2f4bc7390e3244e4df293e6ba351e4c740a7c764" + dependencies: + conventional-commit-types "^2.0.0" + lodash.map "^4.5.1" + longest "^1.0.1" + right-pad "^1.0.1" + word-wrap "^1.0.3" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.0.0.tgz#24802de4e81c298ea8a9388bb0d8e461c774684f" + dependencies: + abab "^1.0.4" + whatwg-mimetype "^2.0.0" + whatwg-url "^6.4.0" + +date-fns@^1.27.2: + version "1.29.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" + +dateformat@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" + +debug@3.1.0, debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +debug@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.0.1.tgz#f9bb36d439b8d1f0dd52d8fb6b46e4ebb8c1cd5b" + dependencies: + ms "^2.1.1" + +debuglog@*, debuglog@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" + +decamelize-keys@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" + dependencies: + decamelize "^1.1.0" + map-obj "^1.0.0" + +decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decamelize@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" + dependencies: + xregexp "4.0.0" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + dependencies: + mimic-response "^1.0.0" + +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +default-require-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" + dependencies: + strip-bom "^3.0.0" + +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + +defer-to-connect@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.0.1.tgz#41ec1dd670dc4c6dcbe7e54c9e44d784d025fe63" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detect-indent@^5.0.0, detect-indent@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + +dezalgo@^1.0.0, dezalgo@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" + dependencies: + asap "^2.0.0" + wrappy "1" + +diff@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + +dir-glob@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" + dependencies: + arrify "^1.0.1" + path-type "^3.0.0" + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + dependencies: + webidl-conversions "^4.0.2" + +dot-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" + dependencies: + is-obj "^1.0.0" + +dot-prop@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + dependencies: + is-obj "^1.0.0" + +dotenv@^5.0.1: + version "5.0.1" + resolved "http://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" + +duplexer2@~0.1.0: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + +duplexify@^3.4.2, duplexify@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.6.0.tgz#592903f5d80b38d037220541264d69a198fb3410" + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +editor@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742" + +electron-to-chromium@^1.3.62: + version "1.3.70" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.70.tgz#ded377256d92d81b4257d36c65aa890274afcfd2" + +elegant-spinner@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + dependencies: + iconv-lite "~0.4.13" + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + dependencies: + once "^1.4.0" + +env-ci@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/env-ci/-/env-ci-3.0.0.tgz#16f022753562dee387e0bdca3dd629a497ed67b5" + dependencies: + execa "^1.0.0" + java-properties "^0.2.9" + +err-code@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" + +errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + dependencies: + prr "~1.0.1" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.5.1: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +es6-promise@^4.0.3: + version "4.2.5" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + dependencies: + es6-promise "^4.0.3" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@^1.9.1: + version "1.11.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esprima@^4.0.0, esprima@~4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + +estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +exec-sh@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" + dependencies: + merge "^1.2.0" + +execa@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" + dependencies: + cross-spawn "^6.0.0" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +expect@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.4.0.tgz#6da4ecc99c1471253e7288338983ad1ebadb60c3" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^23.2.0" + jest-get-type "^22.1.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.1, extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + +fast-glob@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.2.tgz#71723338ac9b4e0e2fff1d6748a2a13d5ed352bf" + dependencies: + "@mrmlnc/readdir-enhanced" "^2.2.1" + "@nodelib/fs.stat" "^1.0.1" + glob-parent "^3.1.0" + is-glob "^4.0.0" + merge2 "^1.2.1" + micromatch "^3.1.10" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +figgy-pudding@^3.0.0, figgy-pudding@^3.1.0, figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + +figures@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-cache-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" + dependencies: + commondir "^1.0.1" + make-dir "^1.0.0" + pkg-dir "^2.0.0" + +find-npm-prefix@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz#8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf" + +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + dependencies: + locate-path "^3.0.0" + +find-versions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-2.0.0.tgz#2ad90d490f6828c1aa40292cf709ac3318210c3c" + dependencies: + array-uniq "^1.0.0" + semver-regex "^1.0.0" + +flush-write-stream@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.4" + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.3.1, form-data@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" + dependencies: + asynckit "^0.4.0" + combined-stream "1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + +from2@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-1.3.0.tgz#88413baaa5f9a597cfde9221d86986cd3c061dfd" + dependencies: + inherits "~2.0.1" + readable-stream "~1.1.10" + +from2@^2.1.0, from2@^2.1.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-extra@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.0.tgz#8cc3f47ce07ef7b3593a11b9fb245f7e34c041d6" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + +fs-vacuum@^1.2.10, fs-vacuum@~1.2.10: + version "1.2.10" + resolved "https://registry.yarnpkg.com/fs-vacuum/-/fs-vacuum-1.2.10.tgz#b7629bec07a4031a2548fdf99f5ecf1cc8b31e36" + dependencies: + graceful-fs "^4.1.2" + path-is-inside "^1.0.1" + rimraf "^2.5.2" + +fs-write-stream-atomic@^1.0.8, fs-write-stream-atomic@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +fstream@^1.0.0, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +genfun@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/genfun/-/genfun-4.0.1.tgz#ed10041f2e4a7f1b0a38466d17a5c3e27df1dfc1" + +gentle-fs@^2.0.0, gentle-fs@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/gentle-fs/-/gentle-fs-2.0.1.tgz#585cfd612bfc5cd52471fdb42537f016a5ce3687" + dependencies: + aproba "^1.1.2" + fs-vacuum "^1.2.10" + graceful-fs "^4.1.11" + iferr "^0.1.5" + mkdirp "^0.5.1" + path-is-inside "^1.0.2" + read-cmd-shim "^1.0.1" + slide "^1.1.6" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + +get-own-enumerable-property-symbols@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +get-stream@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.0.0.tgz#9e074cb898bd2b9ebabb445a1766d7f43576d977" + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +git-log-parser@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/git-log-parser/-/git-log-parser-1.2.0.tgz#2e6a4c1b13fc00028207ba795a7ac31667b9fd4a" + dependencies: + argv-formatter "~1.0.0" + spawn-error-forwarder "~1.0.0" + split2 "~1.0.0" + stream-combiner2 "~1.1.1" + through2 "~2.0.0" + traverse "~0.6.6" + +git-up@^2.0.0: + version "2.0.10" + resolved "https://registry.yarnpkg.com/git-up/-/git-up-2.0.10.tgz#20fe6bafbef4384cae253dc4f463c49a0c3bd2ec" + dependencies: + is-ssh "^1.3.0" + parse-url "^1.3.0" + +git-url-parse@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-10.0.1.tgz#75f153b24ac7297447fc583cf9fac23a5ae687c1" + dependencies: + git-up "^2.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-to-regexp@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + +glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@~7.1.2: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-dirs@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + dependencies: + ini "^1.3.4" + +globals@^11.1.0: + version "11.7.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +globby@^8.0.0: + version "8.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50" + dependencies: + array-union "^1.0.1" + dir-glob "^2.0.0" + fast-glob "^2.0.2" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" + +got@^6.7.1: + version "6.7.1" + resolved "http://registry.npmjs.org/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + +got@^9.1.0: + version "9.2.2" + resolved "https://registry.yarnpkg.com/got/-/got-9.2.2.tgz#d6cb73f40d4cb512864c2f66f275f258ab43aa25" + dependencies: + "@sindresorhus/is" "^0.11.0" + "@szmarczak/http-timer" "^1.1.0" + cacheable-request "^5.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.0.0" + mimic-response "^1.0.1" + p-cancelable "^0.5.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@~4.1.11: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + +handlebars@^4.0.2: + version "4.0.12" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" + dependencies: + async "^2.5.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +handlebars@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + +har-validator@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" + dependencies: + ajv "^5.3.0" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-unicode@^2.0.0, has-unicode@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +home-or-tmp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" + +hook-std@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/hook-std/-/hook-std-1.1.0.tgz#7f76b74b6f96d3cd4106afb50a66bdb0af2d2a2d" + +hosted-git-info@^2.1.4, hosted-git-info@^2.6.0, hosted-git-info@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + +http-cache-semantics@^3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + +http-cache-semantics@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#2d0069a73c36c80e3297bc3a0cadd669b78a69ce" + +http-proxy-agent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + dependencies: + agent-base "4" + debug "3.1.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-proxy-agent@^2.2.0, https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + dependencies: + ms "^2.0.0" + +husky@0.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" + dependencies: + is-ci "^1.0.10" + normalize-path "^1.0.0" + strip-indent "^2.0.0" + +iconv-lite@0.4.19: + version "0.4.19" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" + +iconv-lite@^0.4.4: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@~0.4.13: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + +iferr@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-1.0.2.tgz#e9fde49a9da06dc4a4194c6c9ed6d08305037a6d" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + +ignore@^3.3.5: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + +import-from@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" + dependencies: + resolve-from "^3.0.0" + +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + +import-local@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@*, imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +indent-string@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + +inflight@^1.0.4, inflight@~1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +init-package-json@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-1.10.3.tgz#45ffe2f610a8ca134f2bd1db5637b235070f6cbe" + dependencies: + glob "^7.1.1" + npm-package-arg "^4.0.0 || ^5.0.0 || ^6.0.0" + promzard "^0.3.0" + read "~1.0.1" + read-package-json "1 || 2" + semver "2.x || 3.x || 4 || 5" + validate-npm-package-license "^3.0.1" + validate-npm-package-name "^3.0.0" + +interpret@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + +into-stream@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" + dependencies: + from2 "^2.1.1" + p-is-promise "^1.1.0" + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + +ip@^1.1.4, ip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + +is-ci@^1.0.10: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" + dependencies: + ci-info "^1.0.0" + +is-cidr@^2.0.6: + version "2.0.7" + resolved "https://registry.yarnpkg.com/is-cidr/-/is-cidr-2.0.7.tgz#0fd4b863c26b2eb2d157ed21060c4f3f8dd356ce" + dependencies: + cidr-regex "^2.0.10" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-generator-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + dependencies: + is-extglob "^2.1.1" + +is-installed-globally@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" + dependencies: + global-dirs "^0.1.0" + is-path-inside "^1.0.0" + +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-obj@^1.0.0, is-obj@^1.0.1: + version "1.0.1" + resolved "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + +is-observable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" + dependencies: + symbol-observable "^1.1.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + +is-retry-allowed@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + +is-ssh@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.0.tgz#ebea1169a2614da392a63740366c3ce049d8dff6" + dependencies: + protocols "^1.1.0" + +is-stream@^1.0.0, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +is-text-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + dependencies: + text-extensions "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +issue-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/issue-parser/-/issue-parser-3.0.0.tgz#729d3fd5d6b86379cb0f513acc33b62f47ebd681" + dependencies: + lodash.capitalize "^4.2.1" + lodash.escaperegexp "^4.1.2" + lodash.isplainobject "^4.0.6" + lodash.isstring "^4.0.1" + lodash.uniqby "^4.7.0" + +istanbul-api@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" + dependencies: + async "^2.1.4" + compare-versions "^3.1.0" + fileset "^2.0.2" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-hook "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-report "^1.1.4" + istanbul-lib-source-maps "^1.2.4" + istanbul-reports "^1.3.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" + +istanbul-lib-hook@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz#f614ec45287b2a8fc4f07f5660af787575601805" + dependencies: + append-transform "^1.0.0" + +istanbul-lib-instrument@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.0" + semver "^5.3.0" + +istanbul-lib-report@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" + dependencies: + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz#ffe6be4e7ab86d3603e4290d54990b14506fc9b1" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" + dependencies: + handlebars "^4.0.3" + +java-properties@^0.2.9: + version "0.2.10" + resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-0.2.10.tgz#2551560c25fa1ad94d998218178f233ad9b18f60" + +jest-changed-files@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" + dependencies: + throat "^4.0.0" + +jest-cli@^23.1.0: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.4.2.tgz#49d56bcfe6cf01871bfcc4a0494e08edaf2b61d0" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.1.11" + import-local "^1.0.0" + is-ci "^1.0.10" + istanbul-api "^1.3.1" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-source-maps "^1.2.4" + jest-changed-files "^23.4.2" + jest-config "^23.4.2" + jest-environment-jsdom "^23.4.0" + jest-get-type "^22.1.0" + jest-haste-map "^23.4.1" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve-dependencies "^23.4.2" + jest-runner "^23.4.2" + jest-runtime "^23.4.2" + jest-snapshot "^23.4.2" + jest-util "^23.4.0" + jest-validate "^23.4.0" + jest-watcher "^23.4.0" + jest-worker "^23.2.0" + micromatch "^2.3.11" + node-notifier "^5.2.1" + prompts "^0.1.9" + realpath-native "^1.0.0" + rimraf "^2.5.4" + slash "^1.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" + which "^1.2.12" + yargs "^11.0.0" + +jest-config@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.4.2.tgz#62a105e14b8266458f2bf4d32403b2c44418fa77" + dependencies: + babel-core "^6.0.0" + babel-jest "^23.4.2" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^23.4.0" + jest-environment-node "^23.4.0" + jest-get-type "^22.1.0" + jest-jasmine2 "^23.4.2" + jest-regex-util "^23.3.0" + jest-resolve "^23.4.1" + jest-util "^23.4.0" + jest-validate "^23.4.0" + pretty-format "^23.2.0" + +jest-diff@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.2.0.tgz#9f2cf4b51e12c791550200abc16b47130af1062a" + dependencies: + chalk "^2.0.1" + diff "^3.2.0" + jest-get-type "^22.1.0" + pretty-format "^23.2.0" + +jest-docblock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" + dependencies: + detect-newline "^2.1.0" + +jest-each@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.4.0.tgz#2fa9edd89daa1a4edc9ff9bf6062a36b71345143" + dependencies: + chalk "^2.0.1" + pretty-format "^23.2.0" + +jest-environment-jsdom@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + jsdom "^11.5.1" + +jest-environment-node@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + +jest-haste-map@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.4.1.tgz#43a174ba7ac079ae1dd74eaf5a5fe78989474dd2" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + jest-docblock "^23.2.0" + jest-serializer "^23.0.1" + jest-worker "^23.2.0" + micromatch "^2.3.11" + sane "^2.0.0" + +jest-jasmine2@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.4.2.tgz#2fbf52f93e43ed4c5e7326a90bb1d785be4321ac" + dependencies: + babel-traverse "^6.0.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^23.4.0" + is-generator-fn "^1.0.0" + jest-diff "^23.2.0" + jest-each "^23.4.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.4.0" + jest-snapshot "^23.4.2" + jest-util "^23.4.0" + pretty-format "^23.2.0" + +jest-leak-detector@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.2.0.tgz#c289d961dc638f14357d4ef96e0431ecc1aa377d" + dependencies: + pretty-format "^23.2.0" + +jest-matcher-utils@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.2.0.tgz#4d4981f23213e939e3cedf23dc34c747b5ae1913" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + pretty-format "^23.2.0" + +jest-message-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-mock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" + +jest-regex-util@^23.3.0: + version "23.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" + +jest-resolve-dependencies@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.4.2.tgz#0675ba876a5b819deffc449ad72e9985c2592048" + dependencies: + jest-regex-util "^23.3.0" + jest-snapshot "^23.4.2" + +jest-resolve@^23.4.1: + version "23.4.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.4.1.tgz#7f3c17104732a2c0c940a01256025ed745814982" + dependencies: + browser-resolve "^1.11.3" + chalk "^2.0.1" + realpath-native "^1.0.0" + +jest-runner@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.4.2.tgz#579a88524ac52c846075b0129a21c7b483e75a7e" + dependencies: + exit "^0.1.2" + graceful-fs "^4.1.11" + jest-config "^23.4.2" + jest-docblock "^23.2.0" + jest-haste-map "^23.4.1" + jest-jasmine2 "^23.4.2" + jest-leak-detector "^23.2.0" + jest-message-util "^23.4.0" + jest-runtime "^23.4.2" + jest-util "^23.4.0" + jest-worker "^23.2.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.4.2.tgz#00c3bb8385253d401a394a27d1112d3615e5a65c" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.1.6" + chalk "^2.0.1" + convert-source-map "^1.4.0" + exit "^0.1.2" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.11" + jest-config "^23.4.2" + jest-haste-map "^23.4.1" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.4.1" + jest-snapshot "^23.4.2" + jest-util "^23.4.0" + jest-validate "^23.4.0" + micromatch "^2.3.11" + realpath-native "^1.0.0" + slash "^1.0.0" + strip-bom "3.0.0" + write-file-atomic "^2.1.0" + yargs "^11.0.0" + +jest-serializer@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" + +jest-snapshot@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.4.2.tgz#8fa6130feb5a527dac73e5fa80d86f29f7c42ab6" + dependencies: + babel-types "^6.0.0" + chalk "^2.0.1" + jest-diff "^23.2.0" + jest-matcher-utils "^23.2.0" + jest-message-util "^23.4.0" + jest-resolve "^23.4.1" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^23.2.0" + semver "^5.5.0" + +jest-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^23.4.0" + mkdirp "^0.5.1" + slash "^1.0.0" + source-map "^0.6.0" + +jest-validate@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.4.0.tgz#d96eede01ef03ac909c009e9c8e455197d48c201" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.2.0" + +jest-validate@^23.5.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.6.0" + +jest-watcher@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + string-length "^2.0.0" + +jest-worker@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" + dependencies: + merge-stream "^1.0.1" + +jest@23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.1.0.tgz#bbb7f893100a11a742dd8bd0d047a54b0968ad1a" + dependencies: + import-local "^1.0.0" + jest-cli "^23.1.0" + +js-levenshtein@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.3.tgz#3ef627df48ec8cf24bacf05c0f184ff30ef413c5" + +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + +js-yaml@^3.7.0, js-yaml@^3.9.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + +json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json5@^0.5.0, json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + dependencies: + json-buffer "3.0.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +kleur@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.1.tgz#7cc64b0d188d0dcbc98bdcdfdda2cc10619ddce8" + +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + dependencies: + package-json "^4.0.0" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lazy-property@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lazy-property/-/lazy-property-1.0.0.tgz#84ddc4b370679ba8bd4cdcfa4c06b43d57111147" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + dependencies: + invert-kv "^2.0.0" + +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +libcipm@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/libcipm/-/libcipm-2.0.2.tgz#4f38c2b37acf2ec156936cef1cbf74636568fc7b" + dependencies: + bin-links "^1.1.2" + bluebird "^3.5.1" + find-npm-prefix "^1.0.2" + graceful-fs "^4.1.11" + lock-verify "^2.0.2" + mkdirp "^0.5.1" + npm-lifecycle "^2.0.3" + npm-logical-tree "^1.2.1" + npm-package-arg "^6.1.0" + pacote "^8.1.6" + protoduck "^5.0.0" + read-package-json "^2.0.13" + rimraf "^2.6.2" + worker-farm "^1.6.0" + +libnpmhook@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/libnpmhook/-/libnpmhook-4.0.1.tgz#63641654de772cbeb96a88527a7fd5456ec3c2d7" + dependencies: + figgy-pudding "^3.1.0" + npm-registry-fetch "^3.0.0" + +libnpx@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/libnpx/-/libnpx-10.2.0.tgz#1bf4a1c9f36081f64935eb014041da10855e3102" + dependencies: + dotenv "^5.0.1" + npm-package-arg "^6.0.0" + rimraf "^2.6.2" + safe-buffer "^5.1.0" + update-notifier "^2.3.0" + which "^1.3.0" + y18n "^4.0.0" + yargs "^11.0.0" + +lint-staged@7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.3.0.tgz#90ff33e5ca61ed3dbac35b6f6502dbefdc0db58d" + dependencies: + chalk "^2.3.1" + commander "^2.14.1" + cosmiconfig "^5.0.2" + debug "^3.1.0" + dedent "^0.7.0" + execa "^0.9.0" + find-parent-dir "^0.3.0" + is-glob "^4.0.0" + is-windows "^1.0.2" + jest-validate "^23.5.0" + listr "^0.14.1" + lodash "^4.17.5" + log-symbols "^2.2.0" + micromatch "^3.1.8" + npm-which "^3.0.1" + p-map "^1.1.1" + path-is-inside "^1.0.2" + pify "^3.0.0" + please-upgrade-node "^3.0.2" + staged-git-files "1.1.1" + string-argv "^0.0.2" + stringify-object "^3.2.2" + +listr-silent-renderer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + +listr-update-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + elegant-spinner "^1.0.1" + figures "^1.7.0" + indent-string "^3.0.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + strip-ansi "^3.0.1" + +listr-verbose-renderer@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35" + dependencies: + chalk "^1.1.3" + cli-cursor "^1.0.2" + date-fns "^1.27.2" + figures "^1.7.0" + +listr@^0.14.1: + version "0.14.2" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.2.tgz#cbe44b021100a15376addfc2d79349ee430bfe14" + dependencies: + "@samverschueren/stream-to-observable" "^0.3.0" + is-observable "^1.1.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.4.0" + listr-verbose-renderer "^0.4.0" + p-map "^1.1.1" + rxjs "^6.1.0" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lock-verify@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lock-verify/-/lock-verify-2.0.2.tgz#148e4f85974915c9e3c34d694b7de9ecb18ee7a8" + dependencies: + npm-package-arg "^5.1.2 || 6" + semver "^5.4.1" + +lockfile@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.4.tgz#07f819d25ae48f87e538e6578b6964a4981a5609" + dependencies: + signal-exit "^3.0.2" + +lodash._baseindexof@*: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" + +lodash._baseuniq@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" + dependencies: + lodash._createset "~4.0.0" + lodash._root "~3.0.0" + +lodash._bindcallback@*: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" + +lodash._cacheindexof@*: + version "3.0.2" + resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" + +lodash._createcache@*: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" + dependencies: + lodash._getnative "^3.0.0" + +lodash._createset@~4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" + +lodash._getnative@*, lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._root@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + +lodash.assign@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + +lodash.capitalize@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9" + +lodash.clonedeep@~4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + +lodash.escaperegexp@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" + +lodash.isplainobject@4.0.6, lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + +lodash.map@^4.5.1: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" + +lodash.restparam@*: + version "3.6.1" + resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + +lodash.toarray@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561" + +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + +lodash.union@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" + +lodash.uniq@~4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + +lodash.uniqby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" + +lodash.without@~4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" + +lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + +lodash@^4.17.5, lodash@^4.2.1: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +log-symbols@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + dependencies: + chalk "^2.0.1" + +log-update@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + dependencies: + ansi-escapes "^1.0.0" + cli-cursor "^1.0.2" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + +lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +macos-release@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-1.1.0.tgz#831945e29365b470aa8724b0ab36c8f8959d10fb" + +make-dir@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + dependencies: + pify "^3.0.0" + +"make-fetch-happen@^2.5.0 || 3 || 4", make-fetch-happen@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" + dependencies: + agentkeepalive "^3.4.1" + cacache "^11.0.1" + http-cache-semantics "^3.8.1" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + lru-cache "^4.1.2" + mississippi "^3.0.0" + node-fetch-npm "^2.0.2" + promise-retry "^1.1.1" + socks-proxy-agent "^4.0.0" + ssri "^6.0.0" + +make-fetch-happen@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-3.0.0.tgz#7b661d2372fc4710ab5cc8e1fa3c290eea69a961" + dependencies: + agentkeepalive "^3.4.1" + cacache "^10.0.4" + http-cache-semantics "^3.8.1" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.0" + lru-cache "^4.1.2" + mississippi "^3.0.0" + node-fetch-npm "^2.0.2" + promise-retry "^1.1.1" + socks-proxy-agent "^3.0.1" + ssri "^5.2.4" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +map-age-cleaner@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz#098fb15538fd3dbe461f12745b0ca8568d4e3f74" + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +map-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + +marked-terminal@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-3.1.1.tgz#1e726816ddc4552a83393228ff0952b6cd4e5e04" + dependencies: + cardinal "^2.1.1" + chalk "^2.4.1" + cli-table "^0.3.1" + lodash.assign "^4.2.0" + node-emoji "^1.4.1" + +marked@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.5.0.tgz#9e590bad31584a48ff405b33ab1c0dd25172288e" + +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + +meant@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/meant/-/meant-1.0.1.tgz#66044fea2f23230ec806fb515efea29c44d2115d" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + +mem@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.0.0.tgz#6437690d9471678f6cc83659c00cbafcd6b0cdaf" + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^1.0.0" + p-is-promise "^1.1.0" + +meow@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.1.tgz#d48598f6f4b1472f35bf6317a95945ace347f975" + dependencies: + camelcase-keys "^4.0.0" + decamelize-keys "^1.0.0" + loud-rejection "^1.0.0" + minimist "^1.1.3" + minimist-options "^3.0.1" + normalize-package-data "^2.3.4" + read-pkg-up "^3.0.0" + redent "^2.0.0" + trim-newlines "^2.0.0" + +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + dependencies: + readable-stream "^2.0.1" + +merge2@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.2.tgz#03212e3da8d86c4d8523cebd6318193414f94e34" + +merge@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.35.0: + version "1.35.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" + +mime-db@~1.36.0: + version "1.36.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" + +mime-types@^2.1.12, mime-types@~2.1.17: + version "2.1.19" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" + dependencies: + mime-db "~1.35.0" + +mime-types@~2.1.19: + version "2.1.20" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" + dependencies: + mime-db "~1.36.0" + +mime@^2.0.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + +minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist-options@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" + dependencies: + arrify "^1.0.1" + is-plain-obj "^1.1.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +minipass@^2.2.1, minipass@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + +mississippi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^2.0.1" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +modify-values@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" + +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + dependencies: + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +ms@^2.0.0, ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + +mute-stream@~0.0.4: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + +nan@^2.9.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +needle@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +nerf-dart@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/nerf-dart/-/nerf-dart-1.0.0.tgz#e6dab7febf5ad816ea81cf5c629c5a0ebde72c1a" + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + +node-emoji@^1.4.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.8.1.tgz#6eec6bfb07421e2148c75c6bba72421f8530a826" + dependencies: + lodash.toarray "^4.4.0" + +node-fetch-npm@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7" + dependencies: + encoding "^0.1.11" + json-parse-better-errors "^1.0.0" + safe-buffer "^5.1.1" + +node-fetch@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.0.tgz#4ee79bde909262f9775f731e3656d0db55ced5b5" + +node-gyp@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" + dependencies: + fstream "^1.0.0" + glob "^7.0.3" + graceful-fs "^4.1.2" + mkdirp "^0.5.0" + nopt "2 || 3" + npmlog "0 || 1 || 2 || 3 || 4" + osenv "0" + request "^2.87.0" + rimraf "2" + semver "~5.3.0" + tar "^2.0.0" + which "1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + +node-notifier@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +node-releases@^1.0.0-alpha.11: + version "1.0.0-alpha.11" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.0-alpha.11.tgz#73c810acc2e5b741a17ddfbb39dfca9ab9359d8a" + dependencies: + semver "^5.3.0" + +"nopt@2 || 3": + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +nopt@^4.0.1, nopt@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.4.0, "normalize-package-data@~1.0.1 || ^2.0.0", normalize-package-data@~2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + +normalize-path@^2.0.1, normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-url@^3.0.0, normalize-url@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" + +npm-audit-report@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/npm-audit-report/-/npm-audit-report-1.3.1.tgz#e79ea1fcb5ffaf3031102b389d5222c2b0459632" + dependencies: + cli-table3 "^0.5.0" + console-control-strings "^1.1.0" + +npm-bundled@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + +npm-cache-filename@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz#ded306c5b0bfc870a9e9faf823bc5f283e05ae11" + +npm-install-checks@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-3.0.0.tgz#d4aecdfd51a53e3723b7b2f93b2ee28e307bc0d7" + dependencies: + semver "^2.3.0 || 3.x || 4 || 5" + +npm-lifecycle@^2.0.3, npm-lifecycle@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.1.0.tgz#1eda2eedb82db929e3a0c50341ab0aad140ed569" + dependencies: + byline "^5.0.0" + graceful-fs "^4.1.11" + node-gyp "^3.8.0" + resolve-from "^4.0.0" + slide "^1.1.6" + uid-number "0.0.6" + umask "^1.1.0" + which "^1.3.1" + +npm-logical-tree@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/npm-logical-tree/-/npm-logical-tree-1.2.1.tgz#44610141ca24664cad35d1e607176193fd8f5b88" + +"npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^5.1.2 || 6", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" + dependencies: + hosted-git-info "^2.6.0" + osenv "^0.1.5" + semver "^5.5.0" + validate-npm-package-name "^3.0.0" + +npm-packlist@^1.1.10, npm-packlist@^1.1.11, npm-packlist@^1.1.6: + version "1.1.11" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-path@^2.0.2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" + dependencies: + which "^1.2.10" + +npm-pick-manifest@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.1.0.tgz#dc381bdd670c35d81655e1d5a94aa3dd4d87fce5" + dependencies: + npm-package-arg "^6.0.0" + semver "^5.4.1" + +npm-profile@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-3.0.2.tgz#58d568f1b56ef769602fd0aed8c43fa0e0de0f57" + dependencies: + aproba "^1.1.2 || 2" + make-fetch-happen "^2.5.0 || 3 || 4" + +npm-registry-client@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-8.6.0.tgz#7f1529f91450732e89f8518e0f21459deea3e4c4" + dependencies: + concat-stream "^1.5.2" + graceful-fs "^4.1.6" + normalize-package-data "~1.0.1 || ^2.0.0" + npm-package-arg "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" + once "^1.3.3" + request "^2.74.0" + retry "^0.10.0" + safe-buffer "^5.1.1" + semver "2 >=2.2.1 || 3.x || 4 || 5" + slide "^1.1.3" + ssri "^5.2.4" + optionalDependencies: + npmlog "2 || ^3.1.0 || ^4.0.0" + +npm-registry-fetch@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-1.1.1.tgz#710bc5947d9ee2c549375072dab6d5d17baf2eb2" + dependencies: + bluebird "^3.5.1" + figgy-pudding "^3.0.0" + lru-cache "^4.1.2" + make-fetch-happen "^3.0.0" + npm-package-arg "^6.0.0" + safe-buffer "^5.1.1" + +npm-registry-fetch@^3.0.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.8.0.tgz#aa7d9a7c92aff94f48dba0984bdef4bd131c88cc" + dependencies: + JSONStream "^1.3.4" + bluebird "^3.5.1" + figgy-pudding "^3.4.1" + lru-cache "^4.1.3" + make-fetch-happen "^4.0.1" + npm-package-arg "^6.1.0" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npm-user-validate@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-1.0.0.tgz#8ceca0f5cea04d4e93519ef72d0557a75122e951" + +npm-which@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + dependencies: + commander "^2.9.0" + npm-path "^2.0.2" + which "^1.2.10" + +npm@^6.3.0: + version "6.4.1" + resolved "https://registry.yarnpkg.com/npm/-/npm-6.4.1.tgz#4f39f9337b557a28faed4a771d5c8802d6b4288b" + dependencies: + JSONStream "^1.3.4" + abbrev "~1.1.1" + ansicolors "~0.3.2" + ansistyles "~0.1.3" + aproba "~1.2.0" + archy "~1.0.0" + bin-links "^1.1.2" + bluebird "~3.5.1" + byte-size "^4.0.3" + cacache "^11.2.0" + call-limit "~1.1.0" + chownr "~1.0.1" + ci-info "^1.4.0" + cli-columns "^3.1.2" + cli-table3 "^0.5.0" + cmd-shim "~2.0.2" + columnify "~1.5.4" + config-chain "~1.1.11" + detect-indent "~5.0.0" + detect-newline "^2.1.0" + dezalgo "~1.0.3" + editor "~1.0.0" + figgy-pudding "^3.4.1" + find-npm-prefix "^1.0.2" + fs-vacuum "~1.2.10" + fs-write-stream-atomic "~1.0.10" + gentle-fs "^2.0.1" + glob "~7.1.2" + graceful-fs "~4.1.11" + has-unicode "~2.0.1" + hosted-git-info "^2.7.1" + iferr "^1.0.2" + inflight "~1.0.6" + inherits "~2.0.3" + ini "^1.3.5" + init-package-json "^1.10.3" + is-cidr "^2.0.6" + json-parse-better-errors "^1.0.2" + lazy-property "~1.0.0" + libcipm "^2.0.2" + libnpmhook "^4.0.1" + libnpx "^10.2.0" + lock-verify "^2.0.2" + lockfile "^1.0.4" + lodash._baseuniq "~4.6.0" + lodash.clonedeep "~4.5.0" + lodash.union "~4.6.0" + lodash.uniq "~4.5.0" + lodash.without "~4.4.0" + lru-cache "^4.1.3" + meant "~1.0.1" + mississippi "^3.0.0" + mkdirp "~0.5.1" + move-concurrently "^1.0.1" + node-gyp "^3.8.0" + nopt "~4.0.1" + normalize-package-data "~2.4.0" + npm-audit-report "^1.3.1" + npm-cache-filename "~1.0.2" + npm-install-checks "~3.0.0" + npm-lifecycle "^2.1.0" + npm-package-arg "^6.1.0" + npm-packlist "^1.1.11" + npm-pick-manifest "^2.1.0" + npm-profile "^3.0.2" + npm-registry-client "^8.6.0" + npm-registry-fetch "^1.1.0" + npm-user-validate "~1.0.0" + npmlog "~4.1.2" + once "~1.4.0" + opener "^1.5.0" + osenv "^0.1.5" + pacote "^8.1.6" + path-is-inside "~1.0.2" + promise-inflight "~1.0.1" + qrcode-terminal "^0.12.0" + query-string "^6.1.0" + qw "~1.0.1" + read "~1.0.7" + read-cmd-shim "~1.0.1" + read-installed "~4.0.3" + read-package-json "^2.0.13" + read-package-tree "^5.2.1" + readable-stream "^2.3.6" + request "^2.88.0" + retry "^0.12.0" + rimraf "~2.6.2" + safe-buffer "^5.1.2" + semver "^5.5.0" + sha "~2.0.1" + slide "~1.1.6" + sorted-object "~2.0.1" + sorted-union-stream "~2.1.3" + ssri "^6.0.0" + stringify-package "^1.0.0" + tar "^4.4.6" + text-table "~0.2.0" + tiny-relative-date "^1.3.0" + uid-number "0.0.6" + umask "~1.1.0" + unique-filename "~1.1.0" + unpipe "~1.0.0" + update-notifier "^2.5.0" + uuid "^3.3.2" + validate-npm-package-license "^3.0.4" + validate-npm-package-name "~3.0.0" + which "^1.3.1" + worker-farm "^1.6.0" + write-file-atomic "^2.3.0" + +"npmlog@0 || 1 || 2 || 3 || 4", "npmlog@2 || ^3.1.0 || ^4.0.0", npmlog@^4.0.2, npmlog@~4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +nwsapi@^2.0.7: + version "2.0.8" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.8.tgz#e3603579b7e162b3dbedae4fb24e46f771d8fa24" + +oauth-sign@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-keys@^1.0.8: + version "1.0.12" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + +once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0, once@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +onetime@^1.0.0: + version "1.1.0" + resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + +opener@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-locale@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.0.1.tgz#3b014fbf01d87f60a1e5348d80fe870dc82c4620" + dependencies: + execa "^0.10.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-name@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/os-name/-/os-name-2.0.1.tgz#b9a386361c17ae3a21736ef0599405c9a8c5dc5e" + dependencies: + macos-release "^1.0.0" + win-release "^1.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@0, osenv@^0.1.4, osenv@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-cancelable@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.5.1.tgz#b797a33c43c645cd70d5a838b1d25352b9e29e75" + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + +p-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-filter/-/p-filter-1.0.0.tgz#629d317150209c8fd508ba137713ef4bb920e9db" + dependencies: + p-map "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-is-promise@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" + dependencies: + p-try "^2.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + dependencies: + p-limit "^2.0.0" + +p-map@^1.0.0, p-map@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + +p-retry@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-2.0.0.tgz#b97f1f4d6d81a3c065b2b40107b811e995c1bfba" + dependencies: + retry "^0.12.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + +p-try@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + +package-json@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + dependencies: + got "^6.7.1" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + +pacote@^8.1.6: + version "8.1.6" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-8.1.6.tgz#8e647564d38156367e7a9dc47a79ca1ab278d46e" + dependencies: + bluebird "^3.5.1" + cacache "^11.0.2" + get-stream "^3.0.0" + glob "^7.1.2" + lru-cache "^4.1.3" + make-fetch-happen "^4.0.1" + minimatch "^3.0.4" + minipass "^2.3.3" + mississippi "^3.0.0" + mkdirp "^0.5.1" + normalize-package-data "^2.4.0" + npm-package-arg "^6.1.0" + npm-packlist "^1.1.10" + npm-pick-manifest "^2.1.0" + osenv "^0.1.5" + promise-inflight "^1.0.1" + promise-retry "^1.1.1" + protoduck "^5.0.0" + rimraf "^2.6.2" + safe-buffer "^5.1.2" + semver "^5.5.0" + ssri "^6.0.0" + tar "^4.4.3" + unique-filename "^1.1.0" + which "^1.3.0" + +parallel-transform@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + dependencies: + cyclist "~0.2.2" + inherits "^2.0.3" + readable-stream "^2.1.5" + +parse-github-url@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-url@^1.3.0: + version "1.3.11" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-1.3.11.tgz#57c15428ab8a892b1f43869645c711d0e144b554" + dependencies: + is-ssh "^1.3.0" + protocols "^1.4.0" + +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1, path-is-inside@^1.0.2, path-is-inside@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pirates@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.0.tgz#850b18781b4ac6ec58a43c9ed9ec5fe6796addbd" + dependencies: + node-modules-regexp "^1.0.0" + +pkg-conf@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.1.0.tgz#2126514ca6f2abfebd168596df18ba57867f0058" + dependencies: + find-up "^2.0.0" + load-json-file "^4.0.0" + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + dependencies: + find-up "^2.1.0" + +please-upgrade-node@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" + dependencies: + semver-compare "^1.0.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +pretty-format@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +pretty-format@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +private@^0.1.6, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +promise-inflight@^1.0.1, promise-inflight@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + +promise-retry@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-1.1.1.tgz#6739e968e3051da20ce6497fb2b50f6911df3d6d" + dependencies: + err-code "^1.0.0" + retry "^0.10.0" + +prompts@^0.1.9: + version "0.1.14" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2" + dependencies: + kleur "^2.0.1" + sisteransi "^0.1.1" + +promzard@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" + dependencies: + read "1" + +proto-list@~1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + +protocols@^1.1.0, protocols@^1.4.0: + version "1.4.6" + resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.6.tgz#f8bb263ea1b5fd7a7604d26b8be39bd77678bf8a" + +protoduck@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.0.tgz#752145e6be0ad834cb25716f670a713c860dce70" + dependencies: + genfun "^4.0.1" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +psl@^1.1.24: + version "1.1.29" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + +pump@^2.0.0, pump@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.3: + version "1.5.1" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + +q@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + +qrcode-terminal@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" + +qs@~6.5.1, qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + +query-string@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.1.0.tgz#01e7d69f6a0940dac67a937d6c6325647aa4532a" + dependencies: + decode-uri-component "^0.2.0" + strict-uri-encode "^2.0.0" + +quick-lru@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" + +qw@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/qw/-/qw-1.0.1.tgz#efbfdc740f9ad054304426acb183412cc8b996d4" + +randomatic@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +read-cmd-shim@^1.0.1, read-cmd-shim@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" + dependencies: + graceful-fs "^4.1.2" + +read-installed@~4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" + dependencies: + debuglog "^1.0.1" + read-package-json "^2.0.0" + readdir-scoped-modules "^1.0.0" + semver "2 || 3 || 4 || 5" + slide "~1.1.3" + util-extend "^1.0.1" + optionalDependencies: + graceful-fs "^4.1.2" + +"read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: + version "2.0.13" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.0.13.tgz#2e82ebd9f613baa6d2ebe3aa72cefe3f68e41f4a" + dependencies: + glob "^7.1.1" + json-parse-better-errors "^1.0.1" + normalize-package-data "^2.0.0" + slash "^1.0.0" + optionalDependencies: + graceful-fs "^4.1.2" + +read-package-tree@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.2.1.tgz#6218b187d6fac82289ce4387bbbaf8eef536ad63" + dependencies: + debuglog "^1.0.1" + dezalgo "^1.0.0" + once "^1.3.0" + read-package-json "^2.0.0" + readdir-scoped-modules "^1.0.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +read-pkg@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" + dependencies: + normalize-package-data "^2.3.2" + parse-json "^4.0.0" + pify "^3.0.0" + +read@1, read@~1.0.1, read@~1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + dependencies: + mute-stream "~0.0.4" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@~1.1.10: + version "1.1.14" + resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" + dependencies: + debuglog "^1.0.1" + dezalgo "^1.0.0" + graceful-fs "^4.1.2" + once "^1.3.0" + +realpath-native@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.1.tgz#07f40a0cce8f8261e2e8b7ebebf5c95965d7b633" + dependencies: + util.promisify "^1.0.0" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +redent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" + dependencies: + indent-string "^3.0.0" + strip-indent "^2.0.0" + +redeyed@~2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-2.1.1.tgz#8984b5815d99cb220469c99eeeffe38913e6cc0b" + dependencies: + esprima "~4.0.0" + +regenerate-unicode-properties@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" + dependencies: + regenerate "^1.4.0" + +regenerate@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + +regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.13.3: + version "0.13.3" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" + dependencies: + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpu-core@^4.1.3, regexpu-core@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^7.0.0" + regjsgen "^0.4.0" + regjsparser "^0.3.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.0.2" + +registry-auth-token@^3.0.1, registry-auth-token@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" + dependencies: + rc "^1.1.6" + safe-buffer "^5.0.1" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + dependencies: + rc "^1.0.1" + +regjsgen@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" + +regjsparser@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.3.0.tgz#3c326da7fcfd69fa0d332575a41c8c0cdf588c96" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + +request@^2.74.0, request@^2.88.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +request@^2.87.0: + version "2.87.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.6, resolve@^1.3.2: + version "1.8.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + dependencies: + path-parse "^1.0.5" + +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + dependencies: + lowercase-keys "^1.0.0" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + +retry@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +right-pad@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" + +rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +rsvp@^3.3.3: + version "3.6.2" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" + +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + dependencies: + aproba "^1.1.1" + +rxjs@^6.1.0: + version "6.3.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.2.tgz#6a688b16c4e6e980e62ea805ec30648e1c60907f" + dependencies: + tslib "^1.9.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sane@^2.0.0: + version "2.5.2" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" + dependencies: + anymatch "^2.0.0" + capture-exit "^1.2.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.2.3" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +semantic-release@^15.9.16: + version "15.9.16" + resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.9.16.tgz#70391ef6a9246253f54061ecd06634994e305b1e" + dependencies: + "@semantic-release/commit-analyzer" "^6.0.0" + "@semantic-release/error" "^2.2.0" + "@semantic-release/github" "^5.0.0" + "@semantic-release/npm" "^5.0.1" + "@semantic-release/release-notes-generator" "^7.0.0" + aggregate-error "^1.0.0" + cosmiconfig "^5.0.1" + debug "^4.0.0" + env-ci "^3.0.0" + execa "^1.0.0" + figures "^2.0.0" + find-versions "^2.0.0" + get-stream "^4.0.0" + git-log-parser "^1.2.0" + git-url-parse "^10.0.1" + hook-std "^1.1.0" + hosted-git-info "^2.7.1" + lodash "^4.17.4" + marked "^0.5.0" + marked-terminal "^3.0.0" + p-locate "^3.0.0" + p-reduce "^1.0.0" + read-pkg-up "^4.0.0" + resolve-from "^4.0.0" + semver "^5.4.1" + signale "^1.2.1" + yargs "^12.0.0" + +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + +semver-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-1.0.0.tgz#92a4969065f9c70c694753d55248fc68f8f652c9" + +"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.1, semver@^5.0.3, semver@^5.1.0: + version "5.5.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" + +"semver@2 || 3 || 4 || 5", semver@5.5.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +semver@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +sha@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/sha/-/sha-2.0.1.tgz#6030822fbd2c9823949f8f72ed6411ee5cf25aae" + dependencies: + graceful-fs "^4.1.2" + readable-stream "^2.0.2" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +shelljs@0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +signale@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/signale/-/signale-1.3.0.tgz#1b4917c2c7a8691550adca0ad1da750a662b4497" + dependencies: + chalk "^2.3.2" + figures "^2.0.0" + pkg-conf "^2.1.0" + +sisteransi@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +slide@^1.1.3, slide@^1.1.6, slide@~1.1.3, slide@~1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +smart-buffer@^1.0.13: + version "1.1.15" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" + +smart-buffer@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +socks-proxy-agent@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz#2eae7cf8e2a82d34565761539a7f9718c5617659" + dependencies: + agent-base "^4.1.0" + socks "^1.1.10" + +socks-proxy-agent@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" + dependencies: + agent-base "~4.2.0" + socks "~2.2.0" + +socks@^1.1.10: + version "1.1.10" + resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a" + dependencies: + ip "^1.1.4" + smart-buffer "^1.0.13" + +socks@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" + dependencies: + ip "^1.1.5" + smart-buffer "^4.0.1" + +sorted-object@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/sorted-object/-/sorted-object-2.0.1.tgz#7d631f4bd3a798a24af1dffcfbfe83337a5df5fc" + +sorted-union-stream@~2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/sorted-union-stream/-/sorted-union-stream-2.1.3.tgz#c7794c7e077880052ff71a8d4a2dbb4a9a638ac7" + dependencies: + from2 "^1.3.0" + stream-iterate "^1.1.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-support@^0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spawn-error-forwarder@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz#1afd94738e999b0346d7b9fc373be55e07577029" + +spdx-correct@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + +split2@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" + dependencies: + through2 "^2.0.2" + +split2@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-1.0.0.tgz#52e2e221d88c75f9a73f90556e263ff96772b314" + dependencies: + through2 "~2.0.0" + +split@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" + dependencies: + through "2" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.14.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + safer-buffer "^2.0.2" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +ssri@^5.2.4: + version "5.3.0" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.3.0.tgz#ba3872c9c6d33a0704a7d71ff045e5ec48999d06" + dependencies: + safe-buffer "^5.1.1" + +ssri@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + dependencies: + figgy-pudding "^3.5.1" + +stack-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" + +staged-git-files@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + +stream-combiner2@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + +stream-each@^1.1.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + +stream-iterate@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/stream-iterate/-/stream-iterate-1.2.0.tgz#2bd7c77296c1702a46488b8ad41f79865eecd4e1" + dependencies: + readable-stream "^2.1.5" + stream-shift "^1.0.0" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + +string-argv@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" + +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +stringify-object@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" + dependencies: + get-own-enumerable-property-symbols "^2.0.1" + is-obj "^1.0.1" + is-regexp "^1.0.0" + +stringify-package@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.0.tgz#e02828089333d7d45cd8c287c30aa9a13375081b" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-indent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +supports-color@^5.3.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" + +symbol-observable@^1.1.0, symbol-observable@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + +tar@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +tar@^4, tar@^4.4.3, tar@^4.4.6: + version "4.4.6" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +term-size@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + dependencies: + execa "^0.7.0" + +test-exclude@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" + dependencies: + arrify "^1.0.1" + micromatch "^3.1.8" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +text-extensions@^1.0.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.8.0.tgz#6f343c62268843019b21a616a003557bdb952d2b" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + +through2@^2.0.0, through2@^2.0.2, through2@~2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +through@2, "through@>=2.2.7 <3": + version "2.3.8" + resolved "http://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + +tiny-relative-date@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@>=2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tough-cookie@~2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" + dependencies: + punycode "^1.4.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + dependencies: + punycode "^2.1.0" + +traverse@~0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + +travis-deploy-once@^5.0.8: + version "5.0.8" + resolved "https://registry.yarnpkg.com/travis-deploy-once/-/travis-deploy-once-5.0.8.tgz#ba5aee81a20e4c56898f8a3dd9ae07ba8e3bf378" + dependencies: + "@babel/core" "^7.0.0" + "@babel/polyfill" "^7.0.0" + "@babel/preset-env" "^7.0.0" + "@babel/register" "^7.0.0" + chalk "^2.1.0" + execa "^1.0.0" + got "^9.1.0" + p-retry "^2.0.0" + semver "^5.4.1" + update-notifier "^2.3.0" + url-join "^4.0.0" + yargs "^12.0.1" + +trim-newlines@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" + +trim-off-newlines@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +typescript@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb" + +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-js@^3.1.4: + version "3.4.9" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" + dependencies: + commander "~2.17.1" + source-map "~0.6.1" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uid-number@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +umask@^1.1.0, umask@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" + +unicode-canonical-property-names-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + +unicode-match-property-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + dependencies: + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" + +unicode-match-property-value-ecmascript@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" + +unicode-property-aliases-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unique-filename@^1.1.0, unique-filename@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" + dependencies: + imurmurhash "^0.1.4" + +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" + +universal-user-agent@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.0.1.tgz#18e591ca52b1cb804f6b9cbc4c336cf8191f80e1" + dependencies: + os-name "^2.0.1" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + +unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + +update-notifier@^2.3.0, update-notifier@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" + dependencies: + boxen "^1.2.1" + chalk "^2.0.1" + configstore "^3.0.0" + import-lazy "^2.1.0" + is-ci "^1.0.10" + is-installed-globally "^0.1.0" + is-npm "^1.0.0" + latest-version "^3.0.0" + semver-diff "^2.0.0" + xdg-basedir "^3.0.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +url-join@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.0.tgz#4d3340e807d3773bda9991f8305acdcc2a665d2a" + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + dependencies: + prepend-http "^2.0.0" + +url-template@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util-extend@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f" + +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +uuid@^3.1.0, uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + +validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + dependencies: + builtins "^1.0.3" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + dependencies: + browser-process-hrtime "^0.1.2" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + +wcwidth@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + dependencies: + defaults "^1.0.3" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" + dependencies: + iconv-lite "0.4.19" + +whatwg-mimetype@^2.0.0, whatwg-mimetype@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz#f0f21d76cbba72362eb609dbed2a30cd17fcc7d4" + +whatwg-url@^6.4.0, whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@1, which@^1.2.10, which@^1.2.12, which@^1.2.9, which@^1.3.0, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +widest-line@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.0.tgz#0142a4e8a243f8882c0233aa0e0281aa76152273" + dependencies: + string-width "^2.1.1" + +win-release@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/win-release/-/win-release-1.1.1.tgz#5fa55e02be7ca934edfc12665632e849b72e5209" + dependencies: + semver "^5.0.1" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +word-wrap@^1.0.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +worker-farm@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" + dependencies: + errno "~0.1.7" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^2.0.0, write-file-atomic@^2.1.0, write-file-atomic@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + dependencies: + async-limiter "~1.0.0" + +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + +xregexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" + +xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + +yargs-parser@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + dependencies: + camelcase "^4.1.0" + +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + dependencies: + camelcase "^4.1.0" + +yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + +yargs@^12.0.0, yargs@^12.0.1: + version "12.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc" + dependencies: + cliui "^4.0.0" + decamelize "^2.0.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^10.1.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From ffb4663b296956abdeb96f3c8c3af1e85cab9500 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sat, 22 Sep 2018 15:45:03 -0400 Subject: [PATCH 02/84] docs(README): Updated docs --- packages/typescript-estree/README.md | 45 ++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index b3825c5eab9b..a1868843461e 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -1,7 +1,46 @@ -

DO NOT USE - POC ONLY

- # TypeScript ESTree A parser that converts TypeScript source code into an [ESTree](https://github.com/estree/estree)-compatible form. -More docs to follow here soon... (PRs welcome!) +## Usage + +This parser is somewhat generic and robust, it could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatiable AST. + +In fact, it is already used within these hyper-popular open-source projects to power their TypeScript support: + +- [ESLint](https://eslint.org), the pluggable linting utility for JavaScript and JSX + - See [typescript-eslint-parser](https://github.com/eslint/typescript-eslint-parser) for more details +- [Prettier](https://prettier.io), an opinionated code formatter + +## Supported TypeScript Version + +We will always endeavor to support the latest stable version of TypeScript. + +The version of TypeScript currently supported by this parser is `~3.0.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. + +If you use a non-supported version of TypeScript, the parser will log a warning to the console. + +**Please ensure that you are using a supported version before submitting any issues/bug reports.** + +## Reporting Issues + +Please check the current list of open and known issues and ensure the issue has not been reported before. When creating a new issue provide as much information about your environment as possible. This includes: + +- TypeScript version +- The `typescript-estree` version + +## AST Alignment Tests + +A couple of years after work on this parser began, the TypeScript Team at Microsoft began [officially supporting TypeScript parsing via Babel](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/). + +I work closely with TypeScript Team and we are gradually aliging the AST of this project with the one produced by Babel's parser. To that end, I have created a full test harness to compare the ASTs of the two projects which runs on every PR, please see the code for more details. + +## Build/Test Commands + +- `npm test` - run all tests +- `npm run unit-tests` - run only unit tests +- `npm run ast-alignment-tests` - run only Babylon AST alignment tests + +## License + +TypeScript ESTree inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. From d1d39bf26bdc63668cd017cf7b09830fab1f7f59 Mon Sep 17 00:00:00 2001 From: Benjamin Lichtman Date: Wed, 26 Sep 2018 16:37:44 -0700 Subject: [PATCH 03/84] chore: force LF for tsx files (#11) --- packages/typescript-estree/.gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/typescript-estree/.gitattributes b/packages/typescript-estree/.gitattributes index b9aad4d12c4d..8db1f2632df7 100644 --- a/packages/typescript-estree/.gitattributes +++ b/packages/typescript-estree/.gitattributes @@ -1,4 +1,5 @@ * text=auto *.js eol=lf *.ts eol=lf +*.tsx eol=lf *.yml eol=lf From 678dc60dd9df6e0a854d0e5e0281978ccbafe969 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Thu, 27 Sep 2018 07:47:59 +0800 Subject: [PATCH 04/84] feat: Support `unknown` keyword (#3) --- .../typescript-estree/lib/ast-node-types.js | 1 + packages/typescript-estree/lib/node-utils.js | 1 + .../tests/ast-alignment/fixtures-to-test.js | 5 + .../basics/unknown-type-annotation.src.ts | 1 + .../lib/__snapshots__/typescript.js.snap | 205 ++++++++++++++++++ 5 files changed, 213 insertions(+) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/unknown-type-annotation.src.ts diff --git a/packages/typescript-estree/lib/ast-node-types.js b/packages/typescript-estree/lib/ast-node-types.js index 155abac19973..3e0530ce7ab9 100644 --- a/packages/typescript-estree/lib/ast-node-types.js +++ b/packages/typescript-estree/lib/ast-node-types.js @@ -150,6 +150,7 @@ module.exports = { TSTypeReference: "TSTypeReference", TSUnionType: "TSUnionType", TSUndefinedKeyword: "TSUndefinedKeyword", + TSUnknownKeyword: "TSUnknownKeyword", TSVoidKeyword: "TSVoidKeyword", UnaryExpression: "UnaryExpression", UpdateExpression: "UpdateExpression", diff --git a/packages/typescript-estree/lib/node-utils.js b/packages/typescript-estree/lib/node-utils.js index c4da3d32b99a..09b8e77e0a60 100644 --- a/packages/typescript-estree/lib/node-utils.js +++ b/packages/typescript-estree/lib/node-utils.js @@ -326,6 +326,7 @@ function isTypeKeyword(kind) { case SyntaxKind.ObjectKeyword: case SyntaxKind.StringKeyword: case SyntaxKind.SymbolKeyword: + case SyntaxKind.UnknownKeyword: case SyntaxKind.VoidKeyword: return true; default: diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js index 6461434f0235..233adc022a10 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js @@ -381,6 +381,11 @@ let fixturePatternConfigsToTest = [ * tsep: DeclareFunction */ "declare-function", + /** + * Babylon: TSTypeReference + identifier + * tsep: TSUnknownKeyword + */ + "unknown-type-annotation", /** * Other major AST differences (e.g. fundamentally different node types) */ diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/unknown-type-annotation.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/unknown-type-annotation.src.ts new file mode 100644 index 000000000000..5f4c1a3ac1d4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/unknown-type-annotation.src.ts @@ -0,0 +1 @@ +let foo: unknown; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap index 5942567f72d1..927477cfaa87 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap @@ -44884,6 +44884,211 @@ Object { } `; +exports[`typescript fixtures/basics/unknown-type-annotation.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 16, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 16, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "TSUnknownKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + "value": "unknown", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/var-with-definite-assignment.src 1`] = ` Object { "body": Array [ From de37f3771cfa5382cf2f23866a601b0e1aa2061d Mon Sep 17 00:00:00 2001 From: James Henry Date: Wed, 26 Sep 2018 22:26:34 -0400 Subject: [PATCH 05/84] chore: lint commit messages (#12) --- packages/typescript-estree/.travis.yml | 1 + packages/typescript-estree/README.md | 15 +- packages/typescript-estree/package.json | 11 +- packages/typescript-estree/yarn.lock | 376 +++++++++++++++++++++--- 4 files changed, 355 insertions(+), 48 deletions(-) diff --git a/packages/typescript-estree/.travis.yml b/packages/typescript-estree/.travis.yml index b5eca5e7d567..95a5b03f8861 100644 --- a/packages/typescript-estree/.travis.yml +++ b/packages/typescript-estree/.travis.yml @@ -13,6 +13,7 @@ node_js: install: - yarn --ignore-engines script: + - commitlint-travis - yarn test after_success: - npm run travis-deploy-once "npm run semantic-release" diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index a1868843461e..978b7b28291e 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -1,6 +1,17 @@ -# TypeScript ESTree +

TypeScript ESTree

-A parser that converts TypeScript source code into an [ESTree](https://github.com/estree/estree)-compatible form. +

A parser that converts TypeScript source code into an ESTree-compatible form: https://github.com/estree/estree

+ +
+ +
## Usage diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 2f0895cdd49d..0e6b4ac22a90 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -17,6 +17,9 @@ }, "license": "BSD-2-Clause", "devDependencies": { + "@commitlint/cli": "^7.1.2", + "@commitlint/config-conventional": "^7.1.2", + "@commitlint/travis-cli": "^7.1.2", "babel-code-frame": "6.26.0", "babylon": "7.0.0-beta.39", "cz-conventional-changelog": "2.1.0", @@ -27,8 +30,8 @@ "lodash.isplainobject": "4.0.6", "semantic-release": "^15.9.16", "shelljs": "0.8.2", - "typescript": "~3.0.1", - "travis-deploy-once": "^5.0.8" + "travis-deploy-once": "^5.0.8", + "typescript": "~3.0.1" }, "keywords": [ "ast", @@ -45,6 +48,7 @@ "ast-alignment-tests": "jest --config=./tests/ast-alignment/jest.config.js", "precommit": "npm test && lint-staged", "cz": "git-cz", + "commitmsg": "commitlint -E GIT_PARAMS", "semantic-release": "semantic-release", "travis-deploy-once": "travis-deploy-once" }, @@ -61,6 +65,9 @@ "path": "./node_modules/cz-conventional-changelog" } }, + "commitlint": { + "extends": ["@commitlint/config-conventional"] + }, "jest": { "testEnvironment": "node", "testRegex": "tests/lib/.+\\.js$", diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 6255bab7b248..f10a7ad2ee45 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -551,6 +551,144 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@commitlint/cli@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-7.1.2.tgz#9ad1b4703679e18e3b1972c4abf0441255219e78" + dependencies: + "@commitlint/format" "^7.1.2" + "@commitlint/lint" "^7.1.2" + "@commitlint/load" "^7.1.2" + "@commitlint/read" "^7.1.2" + babel-polyfill "6.26.0" + chalk "2.3.1" + get-stdin "5.0.1" + lodash.merge "4.6.1" + lodash.pick "4.4.0" + meow "5.0.0" + +"@commitlint/config-conventional@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-7.1.2.tgz#5b5e45924c9abd8f9a8d83eb1f66e24e5f66916f" + +"@commitlint/ensure@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-7.1.2.tgz#30d74bf0062ac6d917037f20dbf27bb63a4ae7c1" + dependencies: + lodash.camelcase "4.3.0" + lodash.kebabcase "4.1.1" + lodash.snakecase "4.1.1" + lodash.startcase "4.4.0" + lodash.upperfirst "4.3.1" + +"@commitlint/execute-rule@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-7.1.2.tgz#b504e800c5f7c0fbfa24a261b04c549aa2726254" + dependencies: + babel-runtime "6.26.0" + +"@commitlint/format@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-7.1.2.tgz#0f601d572d97d7cca59ef6f3da0cde0d10de3de2" + dependencies: + babel-runtime "^6.23.0" + chalk "^2.0.1" + +"@commitlint/is-ignored@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-7.1.2.tgz#1168ef48883e86446dd2930f23300ec0e038dddc" + dependencies: + semver "5.5.0" + +"@commitlint/lint@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-7.1.2.tgz#7166a9ba71e75c2f981f531a2386739ef28b21a3" + dependencies: + "@commitlint/is-ignored" "^7.1.2" + "@commitlint/parse" "^7.1.2" + "@commitlint/rules" "^7.1.2" + babel-runtime "^6.23.0" + lodash.topairs "4.3.0" + +"@commitlint/load@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-7.1.2.tgz#91fc756f63477d19299cd1ed79be2d36aaa8c33d" + dependencies: + "@commitlint/execute-rule" "^7.1.2" + "@commitlint/resolve-extends" "^7.1.2" + babel-runtime "^6.23.0" + cosmiconfig "^4.0.0" + lodash.merge "4.6.1" + lodash.mergewith "4.6.1" + lodash.pick "4.4.0" + lodash.topairs "4.3.0" + resolve-from "4.0.0" + +"@commitlint/message@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-7.1.2.tgz#b8e7ed3914896f8490b5897c4f6b8923105b55fd" + +"@commitlint/parse@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-7.1.2.tgz#d63b246cebd5a2cf326b0356421f9ec5f227a2d4" + dependencies: + conventional-changelog-angular "^1.3.3" + conventional-commits-parser "^2.1.0" + +"@commitlint/read@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-7.1.2.tgz#6a1fcb192e54e311eee280e5070627981d8d7bf3" + dependencies: + "@commitlint/top-level" "^7.1.2" + "@marionebl/sander" "^0.6.0" + babel-runtime "^6.23.0" + git-raw-commits "^1.3.0" + +"@commitlint/resolve-extends@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-7.1.2.tgz#886f589f1c2ce87c42f2786696b68fac7e356978" + dependencies: + babel-runtime "6.26.0" + lodash.merge "4.6.1" + lodash.omit "4.5.0" + require-uncached "^1.0.3" + resolve-from "^4.0.0" + resolve-global "^0.1.0" + +"@commitlint/rules@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-7.1.2.tgz#ba241dc3dbb6c05ce4a186a7cdf85c170345778c" + dependencies: + "@commitlint/ensure" "^7.1.2" + "@commitlint/message" "^7.1.2" + "@commitlint/to-lines" "^7.1.2" + babel-runtime "^6.23.0" + +"@commitlint/to-lines@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-7.1.2.tgz#2277347e50eac2a8d38ab6ab2c70f01b84c5f115" + +"@commitlint/top-level@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-7.1.2.tgz#58f78043546bce0c1bfba36291bc4a812b6426b3" + dependencies: + find-up "^2.1.0" + +"@commitlint/travis-cli@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-7.1.2.tgz#7de0ed9cc420e0f231119e3ba8fcf73fb7d2a7e9" + dependencies: + "@commitlint/cli" "^7.1.2" + babel-runtime "6.26.0" + execa "0.9.0" + +"@marionebl/sander@^0.6.0": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@marionebl/sander/-/sander-0.6.1.tgz#1958965874f24bc51be48875feb50d642fc41f7b" + dependencies: + graceful-fs "^4.1.3" + mkdirp "^0.5.1" + rimraf "^2.5.2" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -1006,6 +1144,14 @@ babel-plugin-syntax-object-rest-spread@^6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" +babel-polyfill@6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + babel-preset-jest@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" @@ -1025,7 +1171,7 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" -babel-runtime@^6.22.0, babel-runtime@^6.26.0: +babel-runtime@6.26.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: @@ -1284,6 +1430,16 @@ call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" @@ -1336,6 +1492,14 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" +chalk@2.3.1: + version "2.3.1" + resolved "http://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + dependencies: + ansi-styles "^3.2.0" + escape-string-regexp "^1.0.5" + supports-color "^5.2.0" + chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -1571,6 +1735,13 @@ console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control- version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" +conventional-changelog-angular@^1.3.3: + version "1.6.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz#b27f2b315c16d0a1f23eb181309d0e6a4698ea0f" + dependencies: + compare-func "^1.3.1" + q "^1.5.1" + conventional-changelog-angular@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.1.tgz#f96431b76de453333a909decd02b15cb5bd2d364" @@ -1604,6 +1775,18 @@ conventional-commits-filter@^2.0.0: is-subset "^0.1.1" modify-values "^1.0.0" +conventional-commits-parser@^2.1.0: + version "2.1.7" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz#eca45ed6140d72ba9722ee4132674d639e644e8e" + dependencies: + JSONStream "^1.0.4" + is-text-path "^1.0.0" + lodash "^4.2.1" + meow "^4.0.0" + split2 "^2.0.0" + through2 "^2.0.0" + trim-off-newlines "^1.0.0" + conventional-commits-parser@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.0.tgz#7f604549a50bd8f60443fbe515484b1c2f06a5c4" @@ -1649,6 +1832,15 @@ core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +cosmiconfig@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" + dependencies: + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^4.0.0" + require-from-string "^2.0.1" + cosmiconfig@^5.0.1, cosmiconfig@^5.0.2: version "5.0.6" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" @@ -1715,6 +1907,12 @@ cz-conventional-changelog@2.1.0: right-pad "^1.0.1" word-wrap "^1.0.3" +dargs@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" + dependencies: + number-is-nan "^1.0.0" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1755,7 +1953,7 @@ debug@^4.0.0: dependencies: ms "^2.1.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -2044,11 +2242,11 @@ exec-sh@^0.2.0: dependencies: merge "^1.2.0" -execa@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" +execa@0.9.0, execa@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" dependencies: - cross-spawn "^6.0.0" + cross-spawn "^5.0.1" get-stream "^3.0.0" is-stream "^1.1.0" npm-run-path "^2.0.0" @@ -2056,11 +2254,11 @@ execa@^0.10.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" +execa@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" dependencies: - cross-spawn "^5.0.1" + cross-spawn "^6.0.0" get-stream "^3.0.0" is-stream "^1.1.0" npm-run-path "^2.0.0" @@ -2068,9 +2266,9 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -2443,6 +2641,10 @@ get-own-enumerable-property-symbols@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" +get-stdin@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -2474,6 +2676,16 @@ git-log-parser@^1.2.0: through2 "~2.0.0" traverse "~0.6.6" +git-raw-commits@^1.3.0: + version "1.3.6" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.6.tgz#27c35a32a67777c1ecd412a239a6c19d71b95aff" + dependencies: + dargs "^4.0.1" + lodash.template "^4.0.2" + meow "^4.0.0" + split2 "^2.0.0" + through2 "^2.0.0" + git-up@^2.0.0: version "2.0.10" resolved "https://registry.yarnpkg.com/git-up/-/git-up-2.0.10.tgz#20fe6bafbef4384cae253dc4f463c49a0c3bd2ec" @@ -2590,7 +2802,7 @@ got@^9.1.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@~4.1.11: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@~4.1.11: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -2807,7 +3019,7 @@ import-local@^1.0.0: pkg-dir "^2.0.0" resolve-cwd "^2.0.0" -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -3872,10 +4084,6 @@ lockfile@^1.0.4: dependencies: signal-exit "^3.0.2" -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -3883,27 +4091,13 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" lodash._root@~3.0.0: version "3.0.1" @@ -3913,6 +4107,10 @@ lodash.assign@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" +lodash.camelcase@4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + lodash.capitalize@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9" @@ -3933,22 +4131,63 @@ lodash.isstring@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" +lodash.kebabcase@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" + lodash.map@^4.5.1: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" +lodash.merge@4.6.1: + version "4.6.1" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" + +lodash.mergewith@4.6.1: + version "4.6.1" + resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" + +lodash.omit@4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60" + +lodash.pick@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + +lodash.snakecase@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" +lodash.startcase@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" + +lodash.template@^4.0.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.toarray@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561" +lodash.topairs@4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.topairs/-/lodash.topairs-4.3.0.tgz#3b6deaa37d60fb116713c46c5f17ea190ec48d64" + lodash.unescape@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" @@ -3965,6 +4204,10 @@ lodash.uniqby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" +lodash.upperfirst@4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" + lodash.without@~4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" @@ -4132,6 +4375,20 @@ mem@^4.0.0: mimic-fn "^1.0.0" p-is-promise "^1.1.0" +meow@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" + dependencies: + camelcase-keys "^4.0.0" + decamelize-keys "^1.0.0" + loud-rejection "^1.0.0" + minimist-options "^3.0.1" + normalize-package-data "^2.3.4" + read-pkg-up "^3.0.0" + redent "^2.0.0" + trim-newlines "^2.0.0" + yargs-parser "^10.0.0" + meow@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.1.tgz#d48598f6f4b1472f35bf6317a95945ace347f975" @@ -5397,7 +5654,7 @@ readable-stream@~1.1.10: isarray "0.0.1" string_decoder "~0.10.x" -readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0: +readdir-scoped-modules@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" dependencies: @@ -5441,6 +5698,10 @@ regenerate@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -5584,23 +5845,44 @@ require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" +require-from-string@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" dependencies: resolve-from "^3.0.0" +resolve-from@4.0.0, resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" +resolve-global@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-0.1.0.tgz#8fb02cfd5b7db20118e886311f15af95bd15fbd9" + dependencies: + global-dirs "^0.1.0" resolve-url@^0.2.1: version "0.2.1" @@ -6186,6 +6468,12 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" +supports-color@^5.2.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + dependencies: + has-flag "^3.0.0" + supports-color@^5.3.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" @@ -6725,7 +7013,7 @@ yallist@^3.0.0, yallist@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" -yargs-parser@^10.1.0: +yargs-parser@^10.0.0, yargs-parser@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" dependencies: From 027b17b16696c0d2daaf413bbf13b5715efbcc55 Mon Sep 17 00:00:00 2001 From: James Henry Date: Wed, 26 Sep 2018 23:02:51 -0400 Subject: [PATCH 06/84] style: format code and markdown using prettier (#13) --- .../.github/ISSUE_TEMPLATE.md | 3 - packages/typescript-estree/.prettierignore | 1 + packages/typescript-estree/.prettierrc | 3 + packages/typescript-estree/.travis.yml | 1 + packages/typescript-estree/README.md | 2 +- .../typescript-estree/lib/ast-converter.js | 78 +- .../typescript-estree/lib/ast-node-types.js | 282 +- .../typescript-estree/lib/convert-comments.js | 181 +- packages/typescript-estree/lib/convert.js | 4226 +++++++++-------- packages/typescript-estree/lib/node-utils.js | 832 ++-- packages/typescript-estree/package.json | 13 +- packages/typescript-estree/parser.js | 268 +- .../tests/ast-alignment/.eslintrc.yml | 2 - .../tests/ast-alignment/fixtures-to-test.js | 948 ++-- .../tests/ast-alignment/jest.config.js | 6 +- .../tests/ast-alignment/parse.js | 162 +- .../tests/ast-alignment/spec.js | 138 +- .../tests/ast-alignment/utils.js | 192 +- .../tests/jsx-known-issues.js | 10 +- .../typescript-estree/tests/lib/.eslintrc.yml | 2 - .../typescript-estree/tests/lib/basics.js | 54 +- .../typescript-estree/tests/lib/comments.js | 54 +- .../tests/lib/ecma-features.js | 59 +- packages/typescript-estree/tests/lib/jsx.js | 107 +- packages/typescript-estree/tests/lib/parse.js | 79 +- packages/typescript-estree/tests/lib/tsx.js | 60 +- .../typescript-estree/tests/lib/typescript.js | 54 +- .../typescript-estree/tools/test-utils.js | 66 +- packages/typescript-estree/yarn.lock | 4 + 29 files changed, 4114 insertions(+), 3773 deletions(-) create mode 100644 packages/typescript-estree/.prettierignore create mode 100644 packages/typescript-estree/.prettierrc delete mode 100644 packages/typescript-estree/tests/ast-alignment/.eslintrc.yml delete mode 100644 packages/typescript-estree/tests/lib/.eslintrc.yml diff --git a/packages/typescript-estree/.github/ISSUE_TEMPLATE.md b/packages/typescript-estree/.github/ISSUE_TEMPLATE.md index 293115d2a1e8..7da63fb42d43 100644 --- a/packages/typescript-estree/.github/ISSUE_TEMPLATE.md +++ b/packages/typescript-estree/.github/ISSUE_TEMPLATE.md @@ -1,9 +1,7 @@ **What version of TypeScript are you using?** - **What version of `typescript-estree` are you using?** - **What code were you trying to parse?** ```ts @@ -12,5 +10,4 @@ **What did you expect to happen?** - **What actually happened?** diff --git a/packages/typescript-estree/.prettierignore b/packages/typescript-estree/.prettierignore new file mode 100644 index 000000000000..9da7aa648acc --- /dev/null +++ b/packages/typescript-estree/.prettierignore @@ -0,0 +1 @@ +tests/fixtures/**/* \ No newline at end of file diff --git a/packages/typescript-estree/.prettierrc b/packages/typescript-estree/.prettierrc new file mode 100644 index 000000000000..dc2fb828f039 --- /dev/null +++ b/packages/typescript-estree/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} \ No newline at end of file diff --git a/packages/typescript-estree/.travis.yml b/packages/typescript-estree/.travis.yml index 95a5b03f8861..8a20fa68067c 100644 --- a/packages/typescript-estree/.travis.yml +++ b/packages/typescript-estree/.travis.yml @@ -14,6 +14,7 @@ install: - yarn --ignore-engines script: - commitlint-travis + - yarn check-format - yarn test after_success: - npm run travis-deploy-once "npm run semantic-release" diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index 978b7b28291e..b6babb7f40c6 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -20,7 +20,7 @@ This parser is somewhat generic and robust, it could be used to power any use-ca In fact, it is already used within these hyper-popular open-source projects to power their TypeScript support: - [ESLint](https://eslint.org), the pluggable linting utility for JavaScript and JSX - - See [typescript-eslint-parser](https://github.com/eslint/typescript-eslint-parser) for more details + - See [typescript-eslint-parser](https://github.com/eslint/typescript-eslint-parser) for more details - [Prettier](https://prettier.io), an opinionated code formatter ## Supported TypeScript Version diff --git a/packages/typescript-estree/lib/ast-converter.js b/packages/typescript-estree/lib/ast-converter.js index 2e8cf359a245..924a98e7d69e 100644 --- a/packages/typescript-estree/lib/ast-converter.js +++ b/packages/typescript-estree/lib/ast-converter.js @@ -6,15 +6,15 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const convert = require("./convert"), - convertComments = require("./convert-comments").convertComments, - nodeUtils = require("./node-utils"); +const convert = require('./convert'), + convertComments = require('./convert-comments').convertComments, + nodeUtils = require('./node-utils'); //------------------------------------------------------------------------------ // Private @@ -26,7 +26,11 @@ const convert = require("./convert"), * @returns {Object} converted error object */ function convertError(error) { - return nodeUtils.createError(error.file, error.start, error.message || error.messageText); + return nodeUtils.createError( + error.file, + error.start, + error.message || error.messageText + ); } //------------------------------------------------------------------------------ @@ -34,42 +38,40 @@ function convertError(error) { //------------------------------------------------------------------------------ module.exports = (ast, extra) => { + /** + * The TypeScript compiler produced fundamental parse errors when parsing the + * source. + */ + if (ast.parseDiagnostics.length) { + throw convertError(ast.parseDiagnostics[0]); + } - /** - * The TypeScript compiler produced fundamental parse errors when parsing the - * source. - */ - if (ast.parseDiagnostics.length) { - throw convertError(ast.parseDiagnostics[0]); + /** + * Recursively convert the TypeScript AST into an ESTree-compatible AST + */ + const estree = convert({ + node: ast, + parent: null, + ast, + additionalOptions: { + errorOnUnknownASTType: extra.errorOnUnknownASTType || false, + useJSXTextNode: extra.useJSXTextNode || false } + }); - /** - * Recursively convert the TypeScript AST into an ESTree-compatible AST - */ - const estree = convert({ - node: ast, - parent: null, - ast, - additionalOptions: { - errorOnUnknownASTType: extra.errorOnUnknownASTType || false, - useJSXTextNode: extra.useJSXTextNode || false - } - }); + /** + * Optionally convert and include all tokens in the AST + */ + if (extra.tokens) { + estree.tokens = nodeUtils.convertTokens(ast); + } - /** - * Optionally convert and include all tokens in the AST - */ - if (extra.tokens) { - estree.tokens = nodeUtils.convertTokens(ast); - } - - /** - * Optionally convert and include all comments in the AST - */ - if (extra.comment) { - estree.comments = convertComments(ast, extra.code); - } - - return estree; + /** + * Optionally convert and include all comments in the AST + */ + if (extra.comment) { + estree.comments = convertComments(ast, extra.code); + } + return estree; }; diff --git a/packages/typescript-estree/lib/ast-node-types.js b/packages/typescript-estree/lib/ast-node-types.js index 3e0530ce7ab9..496a31be2b28 100644 --- a/packages/typescript-estree/lib/ast-node-types.js +++ b/packages/typescript-estree/lib/ast-node-types.js @@ -6,7 +6,7 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements @@ -19,144 +19,144 @@ //------------------------------------------------------------------------------ module.exports = { - ArrayExpression: "ArrayExpression", - ArrayPattern: "ArrayPattern", - ArrowFunctionExpression: "ArrowFunctionExpression", - AssignmentExpression: "AssignmentExpression", - AssignmentPattern: "AssignmentPattern", - AwaitExpression: "AwaitExpression", - BinaryExpression: "BinaryExpression", - BlockStatement: "BlockStatement", - BreakStatement: "BreakStatement", - CallExpression: "CallExpression", - CatchClause: "CatchClause", - ClassBody: "ClassBody", - ClassDeclaration: "ClassDeclaration", - ClassExpression: "ClassExpression", - ClassImplements: "ClassImplements", - ClassProperty: "ClassProperty", - ConditionalExpression: "ConditionalExpression", - ContinueStatement: "ContinueStatement", - DebuggerStatement: "DebuggerStatement", - DeclareFunction: "DeclareFunction", - Decorator: "Decorator", - DoWhileStatement: "DoWhileStatement", - EmptyStatement: "EmptyStatement", - ExportAllDeclaration: "ExportAllDeclaration", - ExportDefaultDeclaration: "ExportDefaultDeclaration", - ExportNamedDeclaration: "ExportNamedDeclaration", - ExportSpecifier: "ExportSpecifier", - ExpressionStatement: "ExpressionStatement", - ForInStatement: "ForInStatement", - ForOfStatement: "ForOfStatement", - ForStatement: "ForStatement", - FunctionDeclaration: "FunctionDeclaration", - FunctionExpression: "FunctionExpression", - GenericTypeAnnotation: "GenericTypeAnnotation", - Identifier: "Identifier", - IfStatement: "IfStatement", - Import: "Import", - ImportDeclaration: "ImportDeclaration", - ImportDefaultSpecifier: "ImportDefaultSpecifier", - ImportNamespaceSpecifier: "ImportNamespaceSpecifier", - ImportSpecifier: "ImportSpecifier", - JSXAttribute: "JSXAttribute", - JSXClosingElement: "JSXClosingElement", - JSXElement: "JSXElement", - JSXEmptyExpression: "JSXEmptyExpression", - JSXExpressionContainer: "JSXExpressionContainer", - JSXIdentifier: "JSXIdentifier", - JSXMemberExpression: "JSXMemberExpression", - JSXNamespacedName: "JSXNamespacedName", - JSXOpeningElement: "JSXOpeningElement", - JSXSpreadAttribute: "JSXSpreadAttribute", - JSXSpreadChild: "JSXSpreadChild", - JSXText: "JSXText", - LabeledStatement: "LabeledStatement", - Literal: "Literal", - LogicalExpression: "LogicalExpression", - MemberExpression: "MemberExpression", - MetaProperty: "MetaProperty", - MethodDefinition: "MethodDefinition", - NewExpression: "NewExpression", - ObjectExpression: "ObjectExpression", - ObjectPattern: "ObjectPattern", - Program: "Program", - Property: "Property", - RestElement: "RestElement", - ReturnStatement: "ReturnStatement", - SequenceExpression: "SequenceExpression", - SpreadElement: "SpreadElement", - Super: "Super", - SwitchCase: "SwitchCase", - SwitchStatement: "SwitchStatement", - TaggedTemplateExpression: "TaggedTemplateExpression", - TemplateElement: "TemplateElement", - TemplateLiteral: "TemplateLiteral", - ThisExpression: "ThisExpression", - ThrowStatement: "ThrowStatement", - TryStatement: "TryStatement", - /** - * TS-prefixed nodes - */ - TSAbstractClassProperty: "TSAbstractClassProperty", - TSAbstractKeyword: "TSAbstractKeyword", - TSAbstractMethodDefinition: "TSAbstractMethodDefinition", - TSAnyKeyword: "TSAnyKeyword", - TSArrayType: "TSArrayType", - TSAsyncKeyword: "TSAsyncKeyword", - TSBooleanKeyword: "TSBooleanKeyword", - TSConstructorType: "TSConstructorType", - TSConstructSignature: "TSConstructSignature", - TSDeclareKeyword: "TSDeclareKeyword", - TSEnumDeclaration: "TSEnumDeclaration", - TSEnumMember: "TSEnumMember", - TSExportAssignment: "TSExportAssignment", - TSExportKeyword: "TSExportKeyword", - TSImportType: "TSImportType", - TSLiteralType: "TSLiteralType", - TSIndexSignature: "TSIndexSignature", - TSInterfaceBody: "TSInterfaceBody", - TSInterfaceDeclaration: "TSInterfaceDeclaration", - TSInterfaceHeritage: "TSInterfaceHeritage", - TSFunctionType: "TSFunctionType", - TSMethodSignature: "TSMethodSignature", - TSModuleBlock: "TSModuleBlock", - TSModuleDeclaration: "TSModuleDeclaration", - TSNamespaceFunctionDeclaration: "TSNamespaceFunctionDeclaration", - TSNonNullExpression: "TSNonNullExpression", - TSNeverKeyword: "TSNeverKeyword", - TSNullKeyword: "TSNullKeyword", - TSNumberKeyword: "TSNumberKeyword", - TSObjectKeyword: "TSObjectKeyword", - TSParameterProperty: "TSParameterProperty", - TSPrivateKeyword: "TSPrivateKeyword", - TSPropertySignature: "TSPropertySignature", - TSProtectedKeyword: "TSProtectedKeyword", - TSPublicKeyword: "TSPublicKeyword", - TSQualifiedName: "TSQualifiedName", - TSQuestionToken: "TSQuestionToken", - TSReadonlyKeyword: "TSReadonlyKeyword", - TSStaticKeyword: "TSStaticKeyword", - TSStringKeyword: "TSStringKeyword", - TSSymbolKeyword: "TSSymbolKeyword", - TSTypeAnnotation: "TSTypeAnnotation", - TSTypeLiteral: "TSTypeLiteral", - TSTypeOperator: "TSTypeOperator", - TSTypeParameter: "TSTypeParameter", - TSTypeParameterDeclaration: "TSTypeParameterDeclaration", - TSTypeParameterInstantiation: "TSTypeParameterInstantiation", - TSTypePredicate: "TSTypePredicate", - TSTypeReference: "TSTypeReference", - TSUnionType: "TSUnionType", - TSUndefinedKeyword: "TSUndefinedKeyword", - TSUnknownKeyword: "TSUnknownKeyword", - TSVoidKeyword: "TSVoidKeyword", - UnaryExpression: "UnaryExpression", - UpdateExpression: "UpdateExpression", - VariableDeclaration: "VariableDeclaration", - VariableDeclarator: "VariableDeclarator", - WhileStatement: "WhileStatement", - WithStatement: "WithStatement", - YieldExpression: "YieldExpression" + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + AwaitExpression: 'AwaitExpression', + BinaryExpression: 'BinaryExpression', + BlockStatement: 'BlockStatement', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ClassImplements: 'ClassImplements', + ClassProperty: 'ClassProperty', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DebuggerStatement: 'DebuggerStatement', + DeclareFunction: 'DeclareFunction', + Decorator: 'Decorator', + DoWhileStatement: 'DoWhileStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForInStatement: 'ForInStatement', + ForOfStatement: 'ForOfStatement', + ForStatement: 'ForStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + GenericTypeAnnotation: 'GenericTypeAnnotation', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + Import: 'Import', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + JSXAttribute: 'JSXAttribute', + JSXClosingElement: 'JSXClosingElement', + JSXElement: 'JSXElement', + JSXEmptyExpression: 'JSXEmptyExpression', + JSXExpressionContainer: 'JSXExpressionContainer', + JSXIdentifier: 'JSXIdentifier', + JSXMemberExpression: 'JSXMemberExpression', + JSXNamespacedName: 'JSXNamespacedName', + JSXOpeningElement: 'JSXOpeningElement', + JSXSpreadAttribute: 'JSXSpreadAttribute', + JSXSpreadChild: 'JSXSpreadChild', + JSXText: 'JSXText', + LabeledStatement: 'LabeledStatement', + Literal: 'Literal', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchCase: 'SwitchCase', + SwitchStatement: 'SwitchStatement', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + /** + * TS-prefixed nodes + */ + TSAbstractClassProperty: 'TSAbstractClassProperty', + TSAbstractKeyword: 'TSAbstractKeyword', + TSAbstractMethodDefinition: 'TSAbstractMethodDefinition', + TSAnyKeyword: 'TSAnyKeyword', + TSArrayType: 'TSArrayType', + TSAsyncKeyword: 'TSAsyncKeyword', + TSBooleanKeyword: 'TSBooleanKeyword', + TSConstructorType: 'TSConstructorType', + TSConstructSignature: 'TSConstructSignature', + TSDeclareKeyword: 'TSDeclareKeyword', + TSEnumDeclaration: 'TSEnumDeclaration', + TSEnumMember: 'TSEnumMember', + TSExportAssignment: 'TSExportAssignment', + TSExportKeyword: 'TSExportKeyword', + TSImportType: 'TSImportType', + TSLiteralType: 'TSLiteralType', + TSIndexSignature: 'TSIndexSignature', + TSInterfaceBody: 'TSInterfaceBody', + TSInterfaceDeclaration: 'TSInterfaceDeclaration', + TSInterfaceHeritage: 'TSInterfaceHeritage', + TSFunctionType: 'TSFunctionType', + TSMethodSignature: 'TSMethodSignature', + TSModuleBlock: 'TSModuleBlock', + TSModuleDeclaration: 'TSModuleDeclaration', + TSNamespaceFunctionDeclaration: 'TSNamespaceFunctionDeclaration', + TSNonNullExpression: 'TSNonNullExpression', + TSNeverKeyword: 'TSNeverKeyword', + TSNullKeyword: 'TSNullKeyword', + TSNumberKeyword: 'TSNumberKeyword', + TSObjectKeyword: 'TSObjectKeyword', + TSParameterProperty: 'TSParameterProperty', + TSPrivateKeyword: 'TSPrivateKeyword', + TSPropertySignature: 'TSPropertySignature', + TSProtectedKeyword: 'TSProtectedKeyword', + TSPublicKeyword: 'TSPublicKeyword', + TSQualifiedName: 'TSQualifiedName', + TSQuestionToken: 'TSQuestionToken', + TSReadonlyKeyword: 'TSReadonlyKeyword', + TSStaticKeyword: 'TSStaticKeyword', + TSStringKeyword: 'TSStringKeyword', + TSSymbolKeyword: 'TSSymbolKeyword', + TSTypeAnnotation: 'TSTypeAnnotation', + TSTypeLiteral: 'TSTypeLiteral', + TSTypeOperator: 'TSTypeOperator', + TSTypeParameter: 'TSTypeParameter', + TSTypeParameterDeclaration: 'TSTypeParameterDeclaration', + TSTypeParameterInstantiation: 'TSTypeParameterInstantiation', + TSTypePredicate: 'TSTypePredicate', + TSTypeReference: 'TSTypeReference', + TSUnionType: 'TSUnionType', + TSUndefinedKeyword: 'TSUndefinedKeyword', + TSUnknownKeyword: 'TSUnknownKeyword', + TSVoidKeyword: 'TSVoidKeyword', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' }; diff --git a/packages/typescript-estree/lib/convert-comments.js b/packages/typescript-estree/lib/convert-comments.js index c31e99d8282b..728ca2cf312c 100644 --- a/packages/typescript-estree/lib/convert-comments.js +++ b/packages/typescript-estree/lib/convert-comments.js @@ -5,14 +5,14 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const ts = require("typescript"), - nodeUtils = require("./node-utils"); +const ts = require('typescript'), + nodeUtils = require('./node-utils'); //------------------------------------------------------------------------------ // Private @@ -29,24 +29,31 @@ const ts = require("typescript"), * @returns {Object} The comment object. * @private */ -function convertTypeScriptCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) { - const comment = { - type: block ? "Block" : "Line", - value: text +function convertTypeScriptCommentToEsprimaComment( + block, + text, + start, + end, + startLoc, + endLoc +) { + const comment = { + type: block ? 'Block' : 'Line', + value: text + }; + + if (typeof start === 'number') { + comment.range = [start, end]; + } + + if (typeof startLoc === 'object') { + comment.loc = { + start: startLoc, + end: endLoc }; + } - if (typeof start === "number") { - comment.range = [start, end]; - } - - if (typeof startLoc === "object") { - comment.loc = { - start: startLoc, - end: endLoc - }; - } - - return comment; + return comment; } /** @@ -58,21 +65,30 @@ function convertTypeScriptCommentToEsprimaComment(block, text, start, end, start * @private */ function getCommentFromTriviaScanner(triviaScanner, ast, code) { - const kind = triviaScanner.getToken(); - const isBlock = (kind === ts.SyntaxKind.MultiLineCommentTrivia); - const range = { - pos: triviaScanner.getTokenPos(), - end: triviaScanner.getTextPos(), - kind: triviaScanner.getToken() - }; - - const comment = code.substring(range.pos, range.end); - const text = (isBlock) ? comment.replace(/^\/\*/, "").replace(/\*\/$/, "") : comment.replace(/^\/\//, ""); - const loc = nodeUtils.getLocFor(range.pos, range.end, ast); - - const esprimaComment = convertTypeScriptCommentToEsprimaComment(isBlock, text, range.pos, range.end, loc.start, loc.end); - - return esprimaComment; + const kind = triviaScanner.getToken(); + const isBlock = kind === ts.SyntaxKind.MultiLineCommentTrivia; + const range = { + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + kind: triviaScanner.getToken() + }; + + const comment = code.substring(range.pos, range.end); + const text = isBlock + ? comment.replace(/^\/\*/, '').replace(/\*\/$/, '') + : comment.replace(/^\/\//, ''); + const loc = nodeUtils.getLocFor(range.pos, range.end, ast); + + const esprimaComment = convertTypeScriptCommentToEsprimaComment( + isBlock, + text, + range.pos, + range.end, + loc.start, + loc.end + ); + + return esprimaComment; } //------------------------------------------------------------------------------ @@ -80,10 +96,9 @@ function getCommentFromTriviaScanner(triviaScanner, ast, code) { //------------------------------------------------------------------------------ module.exports = { - convertComments + convertComments }; - /** * Convert all comments for the given AST. * @param {Object} ast the AST object @@ -92,55 +107,53 @@ module.exports = { * @private */ function convertComments(ast, code) { - const comments = []; - - /** - * Create a TypeScript Scanner, with skipTrivia set to false so that - * we can parse the comments - */ - const triviaScanner = ts.createScanner(ast.languageVersion, false, 0, code); - - let kind = triviaScanner.scan(); - while (kind !== ts.SyntaxKind.EndOfFileToken) { - const start = triviaScanner.getTokenPos(); - const end = triviaScanner.getTextPos(); - - let container = null; - switch (kind) { - case ts.SyntaxKind.SingleLineCommentTrivia: - case ts.SyntaxKind.MultiLineCommentTrivia: { - const comment = getCommentFromTriviaScanner(triviaScanner, ast, code); - - comments.push(comment); - break; - } - case ts.SyntaxKind.CloseBraceToken: - container = nodeUtils.getNodeContainer(ast, start, end); - - if ( - container.kind === ts.SyntaxKind.TemplateMiddle || - container.kind === ts.SyntaxKind.TemplateTail - ) { - kind = triviaScanner.reScanTemplateToken(); - continue; - } - break; - case ts.SyntaxKind.SlashToken: - case ts.SyntaxKind.SlashEqualsToken: - container = nodeUtils.getNodeContainer(ast, start, end); - - if ( - container.kind === ts.SyntaxKind.RegularExpressionLiteral - ) { - kind = triviaScanner.reScanSlashToken(); - continue; - } - break; - default: - break; + const comments = []; + + /** + * Create a TypeScript Scanner, with skipTrivia set to false so that + * we can parse the comments + */ + const triviaScanner = ts.createScanner(ast.languageVersion, false, 0, code); + + let kind = triviaScanner.scan(); + while (kind !== ts.SyntaxKind.EndOfFileToken) { + const start = triviaScanner.getTokenPos(); + const end = triviaScanner.getTextPos(); + + let container = null; + switch (kind) { + case ts.SyntaxKind.SingleLineCommentTrivia: + case ts.SyntaxKind.MultiLineCommentTrivia: { + const comment = getCommentFromTriviaScanner(triviaScanner, ast, code); + + comments.push(comment); + break; + } + case ts.SyntaxKind.CloseBraceToken: + container = nodeUtils.getNodeContainer(ast, start, end); + + if ( + container.kind === ts.SyntaxKind.TemplateMiddle || + container.kind === ts.SyntaxKind.TemplateTail + ) { + kind = triviaScanner.reScanTemplateToken(); + continue; + } + break; + case ts.SyntaxKind.SlashToken: + case ts.SyntaxKind.SlashEqualsToken: + container = nodeUtils.getNodeContainer(ast, start, end); + + if (container.kind === ts.SyntaxKind.RegularExpressionLiteral) { + kind = triviaScanner.reScanSlashToken(); + continue; } - kind = triviaScanner.scan(); + break; + default: + break; } + kind = triviaScanner.scan(); + } - return comments; + return comments; } diff --git a/packages/typescript-estree/lib/convert.js b/packages/typescript-estree/lib/convert.js index fd93e601df4f..f764d9081eda 100644 --- a/packages/typescript-estree/lib/convert.js +++ b/packages/typescript-estree/lib/convert.js @@ -6,14 +6,14 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const nodeUtils = require("./node-utils"), - AST_NODE_TYPES = require("./ast-node-types"); +const nodeUtils = require('./node-utils'), + AST_NODE_TYPES = require('./ast-node-types'); //------------------------------------------------------------------------------ // Private @@ -36,2161 +36,2355 @@ const SyntaxKind = nodeUtils.SyntaxKind; * @returns {ESTreeNode} the converted ESTreeNode */ module.exports = function convert(config) { - - const node = config.node; - const parent = config.parent; - const ast = config.ast; - const additionalOptions = config.additionalOptions || {}; - - /** - * Exit early for null and undefined - */ - if (!node) { - return null; - } - - /** - * Create a new ESTree node - */ - let result = { - type: "", - range: [node.getStart(), node.end], - loc: nodeUtils.getLoc(node, ast) + const node = config.node; + const parent = config.parent; + const ast = config.ast; + const additionalOptions = config.additionalOptions || {}; + + /** + * Exit early for null and undefined + */ + if (!node) { + return null; + } + + /** + * Create a new ESTree node + */ + let result = { + type: '', + range: [node.getStart(), node.end], + loc: nodeUtils.getLoc(node, ast) + }; + + /** + * Copies the result object into an ESTree node with just a type property. + * This is used only for leaf nodes that have no other properties. + * @returns {void} + */ + function simplyCopy() { + Object.assign(result, { + type: SyntaxKind[node.kind] + }); + } + + /** + * Converts a TypeScript node into an ESTree node. + * @param {TSNode} child the child TSNode + * @returns {ESTreeNode} the converted ESTree node + */ + function convertChild(child) { + return convert({ node: child, parent: node, ast, additionalOptions }); + } + + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param {TSNode} child The TypeScript AST node to convert. + * @returns {ESTreeNode} The type annotation node. + */ + function convertTypeAnnotation(child) { + const annotation = convertChild(child); + const annotationStartCol = child.getFullStart() - 1; + const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); + return { + type: AST_NODE_TYPES.TSTypeAnnotation, + loc, + range: [annotationStartCol, child.end], + typeAnnotation: annotation }; - - /** - * Copies the result object into an ESTree node with just a type property. - * This is used only for leaf nodes that have no other properties. - * @returns {void} - */ - function simplyCopy() { - Object.assign(result, { - type: SyntaxKind[node.kind] - }); - } - + } + + /** + * Converts a TSNode's typeArguments array to a flow-like typeParameters node + * @param {TSNode[]} typeArguments TSNode typeArguments + * @returns {TypeParameterInstantiation} TypeParameterInstantiation node + */ + function convertTypeArgumentsToTypeParameters(typeArguments) { /** - * Converts a TypeScript node into an ESTree node. - * @param {TSNode} child the child TSNode - * @returns {ESTreeNode} the converted ESTree node + * Even if typeArguments is an empty array, TypeScript sets a `pos` and `end` + * property on the array object so we can safely read the values here */ - function convertChild(child) { - return convert({ node: child, parent: node, ast, additionalOptions }); + const start = typeArguments.pos - 1; + let end = typeArguments.end + 1; + if (typeArguments && typeArguments.length) { + const firstTypeArgument = typeArguments[0]; + const typeArgumentsParent = firstTypeArgument.parent; + /** + * In the case of the parent being a CallExpression or a TypeReference we have to use + * slightly different logic to calculate the correct end position + */ + if ( + typeArgumentsParent && + (typeArgumentsParent.kind === SyntaxKind.CallExpression || + typeArgumentsParent.kind === SyntaxKind.TypeReference) + ) { + const lastTypeArgument = typeArguments[typeArguments.length - 1]; + const greaterThanToken = nodeUtils.findNextToken(lastTypeArgument, ast); + end = greaterThanToken.end; + } } - - /** - * Converts a child into a type annotation. This creates an intermediary - * TypeAnnotation node to match what Flow does. - * @param {TSNode} child The TypeScript AST node to convert. - * @returns {ESTreeNode} The type annotation node. - */ - function convertTypeAnnotation(child) { - const annotation = convertChild(child); - const annotationStartCol = child.getFullStart() - 1; - const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); - return { - type: AST_NODE_TYPES.TSTypeAnnotation, - loc, - range: [annotationStartCol, child.end], - typeAnnotation: annotation - }; - } - - /** - * Converts a TSNode's typeArguments array to a flow-like typeParameters node - * @param {TSNode[]} typeArguments TSNode typeArguments - * @returns {TypeParameterInstantiation} TypeParameterInstantiation node - */ - function convertTypeArgumentsToTypeParameters(typeArguments) { - /** - * Even if typeArguments is an empty array, TypeScript sets a `pos` and `end` - * property on the array object so we can safely read the values here - */ - const start = typeArguments.pos - 1; - let end = typeArguments.end + 1; - if (typeArguments && typeArguments.length) { - const firstTypeArgument = typeArguments[0]; - const typeArgumentsParent = firstTypeArgument.parent; - /** - * In the case of the parent being a CallExpression or a TypeReference we have to use - * slightly different logic to calculate the correct end position - */ - if (typeArgumentsParent && (typeArgumentsParent.kind === SyntaxKind.CallExpression || typeArgumentsParent.kind === SyntaxKind.TypeReference)) { - const lastTypeArgument = typeArguments[typeArguments.length - 1]; - const greaterThanToken = nodeUtils.findNextToken(lastTypeArgument, ast); - end = greaterThanToken.end; - } + return { + type: AST_NODE_TYPES.TSTypeParameterInstantiation, + range: [start, end], + loc: nodeUtils.getLocFor(start, end, ast), + params: typeArguments.map(typeArgument => { + if (nodeUtils.isTypeKeyword(typeArgument.kind)) { + return { + type: AST_NODE_TYPES[`TS${SyntaxKind[typeArgument.kind]}`], + range: [typeArgument.getStart(), typeArgument.getEnd()], + loc: nodeUtils.getLoc(typeArgument, ast) + }; + } + if (typeArgument.kind === SyntaxKind.ImportType) { + return convert({ + node: typeArgument, + parent: null, + ast, + additionalOptions + }); } return { - type: AST_NODE_TYPES.TSTypeParameterInstantiation, - range: [ - start, - end - ], - loc: nodeUtils.getLocFor(start, end, ast), - params: typeArguments.map(typeArgument => { - if (nodeUtils.isTypeKeyword(typeArgument.kind)) { - return { - type: AST_NODE_TYPES[`TS${SyntaxKind[typeArgument.kind]}`], - range: [ - typeArgument.getStart(), - typeArgument.getEnd() - ], - loc: nodeUtils.getLoc(typeArgument, ast) - }; - } - if (typeArgument.kind === SyntaxKind.ImportType) { - return convert({ node: typeArgument, parent: null, ast, additionalOptions }); - } - return { - type: AST_NODE_TYPES.TSTypeReference, - range: [ - typeArgument.getStart(), - typeArgument.getEnd() - ], - loc: nodeUtils.getLoc(typeArgument, ast), - typeName: convertChild(typeArgument.typeName || typeArgument), - typeParameters: (typeArgument.typeArguments) - ? convertTypeArgumentsToTypeParameters(typeArgument.typeArguments) - : undefined - }; - }) + type: AST_NODE_TYPES.TSTypeReference, + range: [typeArgument.getStart(), typeArgument.getEnd()], + loc: nodeUtils.getLoc(typeArgument, ast), + typeName: convertChild(typeArgument.typeName || typeArgument), + typeParameters: typeArgument.typeArguments + ? convertTypeArgumentsToTypeParameters(typeArgument.typeArguments) + : undefined }; - } - - /** - * Converts a TSNode's typeParameters array to a flow-like TypeParameterDeclaration node - * @param {TSNode[]} typeParameters TSNode typeParameters - * @returns {TypeParameterDeclaration} TypeParameterDeclaration node - */ - function convertTSTypeParametersToTypeParametersDeclaration(typeParameters) { - const firstTypeParameter = typeParameters[0]; - const lastTypeParameter = typeParameters[typeParameters.length - 1]; - - const greaterThanToken = nodeUtils.findNextToken(lastTypeParameter, ast); + }) + }; + } + + /** + * Converts a TSNode's typeParameters array to a flow-like TypeParameterDeclaration node + * @param {TSNode[]} typeParameters TSNode typeParameters + * @returns {TypeParameterDeclaration} TypeParameterDeclaration node + */ + function convertTSTypeParametersToTypeParametersDeclaration(typeParameters) { + const firstTypeParameter = typeParameters[0]; + const lastTypeParameter = typeParameters[typeParameters.length - 1]; + + const greaterThanToken = nodeUtils.findNextToken(lastTypeParameter, ast); + + return { + type: AST_NODE_TYPES.TSTypeParameterDeclaration, + range: [firstTypeParameter.pos - 1, greaterThanToken.end], + loc: nodeUtils.getLocFor( + firstTypeParameter.pos - 1, + greaterThanToken.end, + ast + ), + params: typeParameters.map(typeParameter => { + const name = typeParameter.name.text; + + const constraint = typeParameter.constraint + ? convert({ + node: typeParameter.constraint, + parent: typeParameter, + ast, + additionalOptions + }) + : undefined; + + const defaultParameter = typeParameter.default + ? convert({ + node: typeParameter.default, + parent: typeParameter, + ast, + additionalOptions + }) + : typeParameter.default; return { - type: AST_NODE_TYPES.TSTypeParameterDeclaration, - range: [ - firstTypeParameter.pos - 1, - greaterThanToken.end - ], - loc: nodeUtils.getLocFor(firstTypeParameter.pos - 1, greaterThanToken.end, ast), - params: typeParameters.map(typeParameter => { - const name = typeParameter.name.text; - - const constraint = typeParameter.constraint - ? convert({ node: typeParameter.constraint, parent: typeParameter, ast, additionalOptions }) - : undefined; - - const defaultParameter = typeParameter.default - ? convert({ node: typeParameter.default, parent: typeParameter, ast, additionalOptions }) - : typeParameter.default; - - return { - type: AST_NODE_TYPES.TSTypeParameter, - range: [ - typeParameter.getStart(), - typeParameter.getEnd() - ], - loc: nodeUtils.getLoc(typeParameter, ast), - name, - constraint, - default: defaultParameter - }; - }) + type: AST_NODE_TYPES.TSTypeParameter, + range: [typeParameter.getStart(), typeParameter.getEnd()], + loc: nodeUtils.getLoc(typeParameter, ast), + name, + constraint, + default: defaultParameter }; + }) + }; + } + + /** + * Converts a child into a class implements node. This creates an intermediary + * ClassImplements node to match what Flow does. + * @param {TSNode} child The TypeScript AST node to convert. + * @returns {ESTreeNode} The type annotation node. + */ + function convertClassImplements(child) { + const id = convertChild(child.expression); + const classImplementsNode = { + type: AST_NODE_TYPES.ClassImplements, + loc: id.loc, + range: id.range, + id + }; + if (child.typeArguments && child.typeArguments.length) { + classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters( + child.typeArguments + ); } + return classImplementsNode; + } + + /** + * Converts a child into a interface heritage node. + * @param {TSNode} child The TypeScript AST node to convert. + * @returns {ESTreeNode} The type annotation node. + */ + function convertInterfaceHeritageClause(child) { + const id = convertChild(child.expression); + const classImplementsNode = { + type: AST_NODE_TYPES.TSInterfaceHeritage, + loc: id.loc, + range: id.range, + id + }; - /** - * Converts a child into a class implements node. This creates an intermediary - * ClassImplements node to match what Flow does. - * @param {TSNode} child The TypeScript AST node to convert. - * @returns {ESTreeNode} The type annotation node. - */ - function convertClassImplements(child) { - const id = convertChild(child.expression); - const classImplementsNode = { - type: AST_NODE_TYPES.ClassImplements, - loc: id.loc, - range: id.range, - id - }; - if (child.typeArguments && child.typeArguments.length) { - classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters(child.typeArguments); - } - return classImplementsNode; + if (child.typeArguments && child.typeArguments.length) { + classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters( + child.typeArguments + ); } - - /** - * Converts a child into a interface heritage node. - * @param {TSNode} child The TypeScript AST node to convert. - * @returns {ESTreeNode} The type annotation node. - */ - function convertInterfaceHeritageClause(child) { - const id = convertChild(child.expression); - const classImplementsNode = { - type: AST_NODE_TYPES.TSInterfaceHeritage, - loc: id.loc, - range: id.range, - id - }; - - if (child.typeArguments && child.typeArguments.length) { - classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters(child.typeArguments); - } - return classImplementsNode; + return classImplementsNode; + } + + /** + * Converts an array of TSNode decorators into an array of ESTreeNode decorators + * @param {TSNode[]} decorators An array of TSNode decorators to be converted + * @returns {ESTreeNode[]} an array of converted ESTreeNode decorators + */ + function convertDecorators(decorators) { + if (!decorators || !decorators.length) { + return []; } - - /** - * Converts an array of TSNode decorators into an array of ESTreeNode decorators - * @param {TSNode[]} decorators An array of TSNode decorators to be converted - * @returns {ESTreeNode[]} an array of converted ESTreeNode decorators - */ - function convertDecorators(decorators) { - if (!decorators || !decorators.length) { - return []; - } - return decorators.map(decorator => { - const expression = convertChild(decorator.expression); - return { - type: AST_NODE_TYPES.Decorator, - range: [decorator.getStart(), decorator.end], - loc: nodeUtils.getLoc(decorator, ast), - expression - }; - }); + return decorators.map(decorator => { + const expression = convertChild(decorator.expression); + return { + type: AST_NODE_TYPES.Decorator, + range: [decorator.getStart(), decorator.end], + loc: nodeUtils.getLoc(decorator, ast), + expression + }; + }); + } + + /** + * Converts an array of TSNode parameters into an array of ESTreeNode params + * @param {TSNode[]} parameters An array of TSNode params to be converted + * @returns {ESTreeNode[]} an array of converted ESTreeNode params + */ + function convertParameters(parameters) { + if (!parameters || !parameters.length) { + return []; } - + return parameters.map(param => { + const convertedParam = convertChild(param); + if (!param.decorators || !param.decorators.length) { + return convertedParam; + } + return Object.assign(convertedParam, { + decorators: convertDecorators(param.decorators) + }); + }); + } + + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + * @returns {void} + */ + function deeplyCopy() { + const customType = `TS${SyntaxKind[node.kind]}`; /** - * Converts an array of TSNode parameters into an array of ESTreeNode params - * @param {TSNode[]} parameters An array of TSNode params to be converted - * @returns {ESTreeNode[]} an array of converted ESTreeNode params + * If the "errorOnUnknownASTType" option is set to true, throw an error, + * otherwise fallback to just inlcuding the unknown type as-is. */ - function convertParameters(parameters) { - if (!parameters || !parameters.length) { - return []; - } - return parameters.map(param => { - const convertedParam = convertChild(param); - if (!param.decorators || !param.decorators.length) { - return convertedParam; - } - return Object.assign(convertedParam, { - decorators: convertDecorators(param.decorators) - }); - }); + if ( + additionalOptions.errorOnUnknownASTType && + !AST_NODE_TYPES[customType] + ) { + throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`); } - - /** - * For nodes that are copied directly from the TypeScript AST into - * ESTree mostly as-is. The only difference is the addition of a type - * property instead of a kind property. Recursively copies all children. - * @returns {void} - */ - function deeplyCopy() { - const customType = `TS${SyntaxKind[node.kind]}`; - /** - * If the "errorOnUnknownASTType" option is set to true, throw an error, - * otherwise fallback to just inlcuding the unknown type as-is. - */ - if (additionalOptions.errorOnUnknownASTType && !AST_NODE_TYPES[customType]) { - throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`); + result.type = customType; + Object.keys(node) + .filter( + key => + !/^(?:_children|kind|parent|pos|end|flags|modifierFlagsCache|jsDoc)$/.test( + key + ) + ) + .forEach(key => { + if (key === 'type') { + result.typeAnnotation = node.type + ? convertTypeAnnotation(node.type) + : null; + } else if (key === 'typeArguments') { + result.typeParameters = node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : null; + } else if (key === 'typeParameters') { + result.typeParameters = node.typeParameters + ? convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ) + : null; + } else if (key === 'decorators') { + const decorators = convertDecorators(node.decorators); + if (decorators && decorators.length) { + result.decorators = decorators; + } + } else { + if (Array.isArray(node[key])) { + result[key] = node[key].map(convertChild); + } else if (node[key] && typeof node[key] === 'object') { + result[key] = convertChild(node[key]); + } else { + result[key] = node[key]; + } } - result.type = customType; - Object - .keys(node) - .filter(key => !(/^(?:_children|kind|parent|pos|end|flags|modifierFlagsCache|jsDoc)$/.test(key))) - .forEach(key => { - if (key === "type") { - result.typeAnnotation = (node.type) ? convertTypeAnnotation(node.type) : null; - } else if (key === "typeArguments") { - result.typeParameters = (node.typeArguments) - ? convertTypeArgumentsToTypeParameters(node.typeArguments) - : null; - } else if (key === "typeParameters") { - result.typeParameters = (node.typeParameters) - ? convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters) - : null; - } else if (key === "decorators") { - const decorators = convertDecorators(node.decorators); - if (decorators && decorators.length) { - result.decorators = decorators; - } - } else { - if (Array.isArray(node[key])) { - result[key] = node[key].map(convertChild); - } else if (node[key] && typeof node[key] === "object") { - result[key] = convertChild(node[key]); - } else { - result[key] = node[key]; - } - } - }); + }); + } + + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param {Object} tagName the tagName object from a JSX TSNode + * @param {Object} ast the AST object + * @returns {Object} the converted ESTree name object + */ + function convertTypeScriptJSXTagNameToESTreeName(tagName) { + const tagNameToken = nodeUtils.convertToken(tagName, ast); + + if (tagNameToken.type === AST_NODE_TYPES.JSXMemberExpression) { + const isNestedMemberExpression = + node.tagName.expression.kind === SyntaxKind.PropertyAccessExpression; + + // Convert TSNode left and right objects into ESTreeNode object + // and property objects + tagNameToken.object = convertChild(node.tagName.expression); + tagNameToken.property = convertChild(node.tagName.name); + + // Assign the appropriate types + tagNameToken.object.type = isNestedMemberExpression + ? AST_NODE_TYPES.JSXMemberExpression + : AST_NODE_TYPES.JSXIdentifier; + tagNameToken.property.type = AST_NODE_TYPES.JSXIdentifier; + if (tagName.expression.kind === SyntaxKind.ThisKeyword) { + tagNameToken.object.name = 'this'; + } + } else { + tagNameToken.type = AST_NODE_TYPES.JSXIdentifier; + tagNameToken.name = tagNameToken.value; } - /** - * Converts a TypeScript JSX node.tagName into an ESTree node.name - * @param {Object} tagName the tagName object from a JSX TSNode - * @param {Object} ast the AST object - * @returns {Object} the converted ESTree name object - */ - function convertTypeScriptJSXTagNameToESTreeName(tagName) { - const tagNameToken = nodeUtils.convertToken(tagName, ast); - - if (tagNameToken.type === AST_NODE_TYPES.JSXMemberExpression) { - - const isNestedMemberExpression = (node.tagName.expression.kind === SyntaxKind.PropertyAccessExpression); - - // Convert TSNode left and right objects into ESTreeNode object - // and property objects - tagNameToken.object = convertChild(node.tagName.expression); - tagNameToken.property = convertChild(node.tagName.name); - - // Assign the appropriate types - tagNameToken.object.type = (isNestedMemberExpression) ? AST_NODE_TYPES.JSXMemberExpression : AST_NODE_TYPES.JSXIdentifier; - tagNameToken.property.type = AST_NODE_TYPES.JSXIdentifier; - if (tagName.expression.kind === SyntaxKind.ThisKeyword) { - tagNameToken.object.name = "this"; - } - } else { - tagNameToken.type = AST_NODE_TYPES.JSXIdentifier; - tagNameToken.name = tagNameToken.value; - } + delete tagNameToken.value; - delete tagNameToken.value; + return tagNameToken; + } - return tagNameToken; + /** + * Applies the given TS modifiers to the given result object. + * @param {TSNode[]} modifiers original TSNodes from the node.modifiers array + * @returns {void} (the current result object will be mutated) + */ + function applyModifiersToResult(modifiers) { + if (!modifiers || !modifiers.length) { + return; } - /** - * Applies the given TS modifiers to the given result object. - * @param {TSNode[]} modifiers original TSNodes from the node.modifiers array - * @returns {void} (the current result object will be mutated) + * Some modifiers are explicitly handled by applying them as + * boolean values on the result node. As well as adding them + * to the result, we remove them from the array, so that they + * are not handled twice. */ - function applyModifiersToResult(modifiers) { - if (!modifiers || !modifiers.length) { - return; - } - /** - * Some modifiers are explicitly handled by applying them as - * boolean values on the result node. As well as adding them - * to the result, we remove them from the array, so that they - * are not handled twice. - */ - const handledModifierIndices = {}; - for (let i = 0; i < modifiers.length; i++) { - const modifier = modifiers[i]; - switch (modifier.kind) { - /** - * Ignore ExportKeyword and DefaultKeyword, they are handled - * via the fixExports utility function - */ - case SyntaxKind.ExportKeyword: - case SyntaxKind.DefaultKeyword: - handledModifierIndices[i] = true; - break; - case SyntaxKind.ConstKeyword: - result.const = true; - handledModifierIndices[i] = true; - break; - case SyntaxKind.DeclareKeyword: - result.declare = true; - handledModifierIndices[i] = true; - break; - default: - } - } + const handledModifierIndices = {}; + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i]; + switch (modifier.kind) { /** - * If there are still valid modifiers available which have - * not been explicitly handled above, we just convert and - * add the modifiers array to the result node. + * Ignore ExportKeyword and DefaultKeyword, they are handled + * via the fixExports utility function */ - const remainingModifiers = modifiers.filter((_, i) => !handledModifierIndices[i]); - if (!remainingModifiers || !remainingModifiers.length) { - return; - } - result.modifiers = remainingModifiers.map(convertChild); + case SyntaxKind.ExportKeyword: + case SyntaxKind.DefaultKeyword: + handledModifierIndices[i] = true; + break; + case SyntaxKind.ConstKeyword: + result.const = true; + handledModifierIndices[i] = true; + break; + case SyntaxKind.DeclareKeyword: + result.declare = true; + handledModifierIndices[i] = true; + break; + default: + } } - /** - * Uses the current TSNode's end location for its `type` to adjust the location data of the given - * ESTreeNode, which should be the parent of the final typeAnnotation node - * @param {ESTreeNode} typeAnnotationParent The node that will have its location data mutated - * @returns {void} + * If there are still valid modifiers available which have + * not been explicitly handled above, we just convert and + * add the modifiers array to the result node. */ - function fixTypeAnnotationParentLocation(typeAnnotationParent) { - const end = node.type.getEnd(); - typeAnnotationParent.range[1] = end; - const loc = nodeUtils.getLocFor(typeAnnotationParent.range[0], typeAnnotationParent.range[1], ast); - typeAnnotationParent.loc = loc; + const remainingModifiers = modifiers.filter( + (_, i) => !handledModifierIndices[i] + ); + if (!remainingModifiers || !remainingModifiers.length) { + return; } + result.modifiers = remainingModifiers.map(convertChild); + } + + /** + * Uses the current TSNode's end location for its `type` to adjust the location data of the given + * ESTreeNode, which should be the parent of the final typeAnnotation node + * @param {ESTreeNode} typeAnnotationParent The node that will have its location data mutated + * @returns {void} + */ + function fixTypeAnnotationParentLocation(typeAnnotationParent) { + const end = node.type.getEnd(); + typeAnnotationParent.range[1] = end; + const loc = nodeUtils.getLocFor( + typeAnnotationParent.range[0], + typeAnnotationParent.range[1], + ast + ); + typeAnnotationParent.loc = loc; + } + + /** + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + */ + switch (node.kind) { + case SyntaxKind.SourceFile: + Object.assign(result, { + type: AST_NODE_TYPES.Program, + body: [], + sourceType: node.externalModuleIndicator ? 'module' : 'script' + }); + + // filter out unknown nodes for now + node.statements.forEach(statement => { + const convertedStatement = convertChild(statement); + if (convertedStatement) { + result.body.push(convertedStatement); + } + }); + + result.range[1] = node.endOfFileToken.end; + result.loc = nodeUtils.getLocFor(node.getStart(), result.range[1], ast); + break; + + case SyntaxKind.Block: + Object.assign(result, { + type: AST_NODE_TYPES.BlockStatement, + body: node.statements.map(convertChild) + }); + break; + + case SyntaxKind.Identifier: + Object.assign(result, { + type: AST_NODE_TYPES.Identifier, + name: node.text + }); + break; + + case SyntaxKind.WithStatement: + Object.assign(result, { + type: AST_NODE_TYPES.WithStatement, + object: convertChild(node.expression), + body: convertChild(node.statement) + }); + break; + + // Control Flow + + case SyntaxKind.ReturnStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ReturnStatement, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.LabeledStatement: + Object.assign(result, { + type: AST_NODE_TYPES.LabeledStatement, + label: convertChild(node.label), + body: convertChild(node.statement) + }); + break; + + case SyntaxKind.BreakStatement: + case SyntaxKind.ContinueStatement: + Object.assign(result, { + type: SyntaxKind[node.kind], + label: convertChild(node.label) + }); + break; + + // Choice + + case SyntaxKind.IfStatement: + Object.assign(result, { + type: AST_NODE_TYPES.IfStatement, + test: convertChild(node.expression), + consequent: convertChild(node.thenStatement), + alternate: convertChild(node.elseStatement) + }); + break; + + case SyntaxKind.SwitchStatement: + Object.assign(result, { + type: AST_NODE_TYPES.SwitchStatement, + discriminant: convertChild(node.expression), + cases: node.caseBlock.clauses.map(convertChild) + }); + break; + + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + Object.assign(result, { + type: AST_NODE_TYPES.SwitchCase, + test: convertChild(node.expression), + consequent: node.statements.map(convertChild) + }); + break; + + // Exceptions + + case SyntaxKind.ThrowStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ThrowStatement, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.TryStatement: + Object.assign(result, { + type: AST_NODE_TYPES.TryStatement, + block: convert({ + node: node.tryBlock, + parent: null, + ast, + additionalOptions + }), + handler: convertChild(node.catchClause), + finalizer: convertChild(node.finallyBlock) + }); + break; + + case SyntaxKind.CatchClause: + Object.assign(result, { + type: AST_NODE_TYPES.CatchClause, + param: node.variableDeclaration + ? convertChild(node.variableDeclaration.name) + : null, + body: convertChild(node.block) + }); + break; + + // Loops + + case SyntaxKind.WhileStatement: + Object.assign(result, { + type: AST_NODE_TYPES.WhileStatement, + test: convertChild(node.expression), + body: convertChild(node.statement) + }); + break; /** - * The core of the conversion logic: - * Identify and convert each relevant TypeScript SyntaxKind + * Unlike other parsers, TypeScript calls a "DoWhileStatement" + * a "DoStatement" */ - switch (node.kind) { - - case SyntaxKind.SourceFile: - Object.assign(result, { - type: AST_NODE_TYPES.Program, - body: [], - sourceType: node.externalModuleIndicator ? "module" : "script" - }); - - // filter out unknown nodes for now - node.statements.forEach(statement => { - const convertedStatement = convertChild(statement); - if (convertedStatement) { - result.body.push(convertedStatement); - } - }); - - result.range[1] = node.endOfFileToken.end; - result.loc = nodeUtils.getLocFor(node.getStart(), result.range[1], ast); - break; - - case SyntaxKind.Block: - Object.assign(result, { - type: AST_NODE_TYPES.BlockStatement, - body: node.statements.map(convertChild) - }); - break; - - case SyntaxKind.Identifier: - Object.assign(result, { - type: AST_NODE_TYPES.Identifier, - name: node.text - }); - break; - - case SyntaxKind.WithStatement: - Object.assign(result, { - type: AST_NODE_TYPES.WithStatement, - object: convertChild(node.expression), - body: convertChild(node.statement) - }); - break; - - // Control Flow - - case SyntaxKind.ReturnStatement: - Object.assign(result, { - type: AST_NODE_TYPES.ReturnStatement, - argument: convertChild(node.expression) - }); - break; - - case SyntaxKind.LabeledStatement: - Object.assign(result, { - type: AST_NODE_TYPES.LabeledStatement, - label: convertChild(node.label), - body: convertChild(node.statement) - }); - break; - - case SyntaxKind.BreakStatement: - case SyntaxKind.ContinueStatement: - Object.assign(result, { - type: SyntaxKind[node.kind], - label: convertChild(node.label) - }); - break; - - // Choice - - case SyntaxKind.IfStatement: - Object.assign(result, { - type: AST_NODE_TYPES.IfStatement, - test: convertChild(node.expression), - consequent: convertChild(node.thenStatement), - alternate: convertChild(node.elseStatement) - }); - break; - - case SyntaxKind.SwitchStatement: - Object.assign(result, { - type: AST_NODE_TYPES.SwitchStatement, - discriminant: convertChild(node.expression), - cases: node.caseBlock.clauses.map(convertChild) - }); - break; - - case SyntaxKind.CaseClause: - case SyntaxKind.DefaultClause: - Object.assign(result, { - type: AST_NODE_TYPES.SwitchCase, - test: convertChild(node.expression), - consequent: node.statements.map(convertChild) - }); - break; - - // Exceptions - - case SyntaxKind.ThrowStatement: - Object.assign(result, { - type: AST_NODE_TYPES.ThrowStatement, - argument: convertChild(node.expression) - }); - break; - - case SyntaxKind.TryStatement: - Object.assign(result, { - type: AST_NODE_TYPES.TryStatement, - block: convert({ node: node.tryBlock, parent: null, ast, additionalOptions }), - handler: convertChild(node.catchClause), - finalizer: convertChild(node.finallyBlock) - }); - break; - - case SyntaxKind.CatchClause: - Object.assign(result, { - type: AST_NODE_TYPES.CatchClause, - param: node.variableDeclaration ? convertChild(node.variableDeclaration.name) : null, - body: convertChild(node.block) - }); - break; - - // Loops - - case SyntaxKind.WhileStatement: - Object.assign(result, { - type: AST_NODE_TYPES.WhileStatement, - test: convertChild(node.expression), - body: convertChild(node.statement) - }); - break; - - /** - * Unlike other parsers, TypeScript calls a "DoWhileStatement" - * a "DoStatement" - */ - case SyntaxKind.DoStatement: - Object.assign(result, { - type: AST_NODE_TYPES.DoWhileStatement, - test: convertChild(node.expression), - body: convertChild(node.statement) - }); - break; - - case SyntaxKind.ForStatement: - Object.assign(result, { - type: AST_NODE_TYPES.ForStatement, - init: convertChild(node.initializer), - test: convertChild(node.condition), - update: convertChild(node.incrementor), - body: convertChild(node.statement) - }); - break; - - case SyntaxKind.ForInStatement: - case SyntaxKind.ForOfStatement: { - const isAwait = !!(node.awaitModifier && node.awaitModifier.kind === SyntaxKind.AwaitKeyword); - Object.assign(result, { - type: SyntaxKind[node.kind], - left: convertChild(node.initializer), - right: convertChild(node.expression), - body: convertChild(node.statement), - await: isAwait - }); - break; - } - - // Declarations - - case SyntaxKind.FunctionDeclaration: { - - let functionDeclarationType = AST_NODE_TYPES.FunctionDeclaration; - - if (node.modifiers && node.modifiers.length) { - const isDeclareFunction = nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node); - if (isDeclareFunction) { - functionDeclarationType = AST_NODE_TYPES.DeclareFunction; - } - } - - Object.assign(result, { - type: functionDeclarationType, - id: convertChild(node.name), - generator: !!node.asteriskToken, - expression: false, - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - params: convertParameters(node.parameters), - body: convertChild(node.body) - }); - - // Process returnType - if (node.type) { - result.returnType = convertTypeAnnotation(node.type); - } - - // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } + case SyntaxKind.DoStatement: + Object.assign(result, { + type: AST_NODE_TYPES.DoWhileStatement, + test: convertChild(node.expression), + body: convertChild(node.statement) + }); + break; + + case SyntaxKind.ForStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ForStatement, + init: convertChild(node.initializer), + test: convertChild(node.condition), + update: convertChild(node.incrementor), + body: convertChild(node.statement) + }); + break; + + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: { + const isAwait = !!( + node.awaitModifier && + node.awaitModifier.kind === SyntaxKind.AwaitKeyword + ); + Object.assign(result, { + type: SyntaxKind[node.kind], + left: convertChild(node.initializer), + right: convertChild(node.expression), + body: convertChild(node.statement), + await: isAwait + }); + break; + } - // check for exports - result = nodeUtils.fixExports(node, result, ast); + // Declarations - break; + case SyntaxKind.FunctionDeclaration: { + let functionDeclarationType = AST_NODE_TYPES.FunctionDeclaration; + if (node.modifiers && node.modifiers.length) { + const isDeclareFunction = nodeUtils.hasModifier( + SyntaxKind.DeclareKeyword, + node + ); + if (isDeclareFunction) { + functionDeclarationType = AST_NODE_TYPES.DeclareFunction; } + } + + Object.assign(result, { + type: functionDeclarationType, + id: convertChild(node.name), + generator: !!node.asteriskToken, + expression: false, + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + params: convertParameters(node.parameters), + body: convertChild(node.body) + }); + + // Process returnType + if (node.type) { + result.returnType = convertTypeAnnotation(node.type); + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + } - case SyntaxKind.VariableDeclaration: { - Object.assign(result, { - type: AST_NODE_TYPES.VariableDeclarator, - id: convertChild(node.name), - init: convertChild(node.initializer) - }); - - if (node.exclamationToken) { - result.definite = true; - } + case SyntaxKind.VariableDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclarator, + id: convertChild(node.name), + init: convertChild(node.initializer) + }); + + if (node.exclamationToken) { + result.definite = true; + } + + if (node.type) { + result.id.typeAnnotation = convertTypeAnnotation(node.type); + fixTypeAnnotationParentLocation(result.id); + } + break; + } - if (node.type) { - result.id.typeAnnotation = convertTypeAnnotation(node.type); - fixTypeAnnotationParentLocation(result.id); - } - break; + case SyntaxKind.VariableStatement: + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarationList.declarations.map(convertChild), + kind: nodeUtils.getDeclarationKind(node.declarationList) + }); + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + break; + + // mostly for for-of, for-in + case SyntaxKind.VariableDeclarationList: + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclaration, + declarations: node.declarations.map(convertChild), + kind: nodeUtils.getDeclarationKind(node) + }); + break; + + // Expressions + + case SyntaxKind.ExpressionStatement: + Object.assign(result, { + type: AST_NODE_TYPES.ExpressionStatement, + expression: convertChild(node.expression) + }); + break; + + case SyntaxKind.ThisKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.ThisExpression + }); + break; + + case SyntaxKind.ArrayLiteralExpression: { + const arrayAssignNode = nodeUtils.findAncestorOfKind( + node, + SyntaxKind.BinaryExpression + ); + const arrayIsInForOf = + node.parent && node.parent.kind === SyntaxKind.ForOfStatement; + const arrayIsInForIn = + node.parent && node.parent.kind === SyntaxKind.ForInStatement; + let arrayIsInAssignment; + + if (arrayAssignNode) { + if (arrayAssignNode.left === node) { + arrayIsInAssignment = true; + } else { + arrayIsInAssignment = + nodeUtils.findChildOfKind( + arrayAssignNode.left, + SyntaxKind.ArrayLiteralExpression, + ast + ) === node; } + } - case SyntaxKind.VariableStatement: - Object.assign(result, { - type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarationList.declarations.map(convertChild), - kind: nodeUtils.getDeclarationKind(node.declarationList) - }); - - // check for exports - result = nodeUtils.fixExports(node, result, ast); - break; - - // mostly for for-of, for-in - case SyntaxKind.VariableDeclarationList: - Object.assign(result, { - type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarations.map(convertChild), - kind: nodeUtils.getDeclarationKind(node) - }); - break; - - // Expressions - - case SyntaxKind.ExpressionStatement: - Object.assign(result, { - type: AST_NODE_TYPES.ExpressionStatement, - expression: convertChild(node.expression) - }); - break; - - case SyntaxKind.ThisKeyword: - Object.assign(result, { - type: AST_NODE_TYPES.ThisExpression - }); - break; - - case SyntaxKind.ArrayLiteralExpression: { - - const arrayAssignNode = nodeUtils.findAncestorOfKind(node, SyntaxKind.BinaryExpression); - const arrayIsInForOf = node.parent && node.parent.kind === SyntaxKind.ForOfStatement; - const arrayIsInForIn = node.parent && node.parent.kind === SyntaxKind.ForInStatement; - let arrayIsInAssignment; - - if (arrayAssignNode) { - if (arrayAssignNode.left === node) { - arrayIsInAssignment = true; - } else { - arrayIsInAssignment = (nodeUtils.findChildOfKind(arrayAssignNode.left, SyntaxKind.ArrayLiteralExpression, ast) === node); - } - } - - // TypeScript uses ArrayLiteralExpression in destructuring assignment, too - if (arrayIsInAssignment || arrayIsInForOf || arrayIsInForIn) { - Object.assign(result, { - type: AST_NODE_TYPES.ArrayPattern, - elements: node.elements.map(convertChild) - }); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.ArrayExpression, - elements: node.elements.map(convertChild) - }); - } - break; + // TypeScript uses ArrayLiteralExpression in destructuring assignment, too + if (arrayIsInAssignment || arrayIsInForOf || arrayIsInForIn) { + Object.assign(result, { + type: AST_NODE_TYPES.ArrayPattern, + elements: node.elements.map(convertChild) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ArrayExpression, + elements: node.elements.map(convertChild) + }); + } + break; + } + case SyntaxKind.ObjectLiteralExpression: { + const ancestorNode = nodeUtils.findFirstMatchingAncestor( + node, + parentNode => + parentNode.kind === SyntaxKind.BinaryExpression || + parentNode.kind === SyntaxKind.ArrowFunction + ); + const objectAssignNode = + ancestorNode && + ancestorNode.kind === SyntaxKind.BinaryExpression && + ancestorNode.operatorToken.kind === SyntaxKind.FirstAssignment + ? ancestorNode + : null; + + let objectIsInAssignment = false; + + if (objectAssignNode) { + if (objectAssignNode.left === node) { + objectIsInAssignment = true; + } else { + objectIsInAssignment = + nodeUtils.findChildOfKind( + objectAssignNode.left, + SyntaxKind.ObjectLiteralExpression, + ast + ) === node; } + } - case SyntaxKind.ObjectLiteralExpression: { + // TypeScript uses ObjectLiteralExpression in destructuring assignment, too + if (objectIsInAssignment) { + Object.assign(result, { + type: AST_NODE_TYPES.ObjectPattern, + properties: node.properties.map(convertChild) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ObjectExpression, + properties: node.properties.map(convertChild) + }); + } - const ancestorNode = nodeUtils.findFirstMatchingAncestor( - node, - parentNode => - (parentNode.kind === SyntaxKind.BinaryExpression || parentNode.kind === SyntaxKind.ArrowFunction) - ); - const objectAssignNode = ( - ancestorNode && - ancestorNode.kind === SyntaxKind.BinaryExpression && - ancestorNode.operatorToken.kind === SyntaxKind.FirstAssignment - ) ? ancestorNode : null; - - let objectIsInAssignment = false; - - if (objectAssignNode) { - if (objectAssignNode.left === node) { - objectIsInAssignment = true; - } else { - objectIsInAssignment = (nodeUtils.findChildOfKind(objectAssignNode.left, SyntaxKind.ObjectLiteralExpression, ast) === node); - } - } + break; + } - // TypeScript uses ObjectLiteralExpression in destructuring assignment, too - if (objectIsInAssignment) { - Object.assign(result, { - type: AST_NODE_TYPES.ObjectPattern, - properties: node.properties.map(convertChild) - }); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.ObjectExpression, - properties: node.properties.map(convertChild) - }); - } + case SyntaxKind.PropertyAssignment: + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: convertChild(node.initializer), + computed: nodeUtils.isComputedProperty(node.name), + method: false, + shorthand: false, + kind: 'init' + }); + break; + + case SyntaxKind.ShorthandPropertyAssignment: { + if (node.objectAssignmentInitializer) { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: { + type: AST_NODE_TYPES.AssignmentPattern, + left: convertChild(node.name), + right: convertChild(node.objectAssignmentInitializer), + loc: result.loc, + range: result.range + }, + computed: false, + method: false, + shorthand: true, + kind: 'init' + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: convertChild(node.initializer || node.name), + computed: false, + method: false, + shorthand: true, + kind: 'init' + }); + } + break; + } - break; + case SyntaxKind.ComputedPropertyName: + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: convertChild(node.name), + computed: false, + method: false, + shorthand: true, + kind: 'init' + }); + } else { + return convertChild(node.expression); + } + break; + + case SyntaxKind.PropertyDeclaration: { + const isAbstract = nodeUtils.hasModifier( + SyntaxKind.AbstractKeyword, + node + ); + Object.assign(result, { + type: isAbstract + ? AST_NODE_TYPES.TSAbstractClassProperty + : AST_NODE_TYPES.ClassProperty, + key: convertChild(node.name), + value: convertChild(node.initializer), + computed: nodeUtils.isComputedProperty(node.name), + static: nodeUtils.hasStaticModifierFlag(node), + readonly: + nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined + }); + + if (node.type) { + result.typeAnnotation = convertTypeAnnotation(node.type); + } + + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + if (node.name.kind === SyntaxKind.Identifier && node.questionToken) { + result.optional = true; + } + + if (node.exclamationToken) { + result.definite = true; + } + + if (result.key.type === AST_NODE_TYPES.Literal && node.questionToken) { + result.optional = true; + } + break; + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.MethodDeclaration: { + const openingParen = nodeUtils.findFirstMatchingToken( + node.name, + ast, + token => { + if (!token || !token.kind) { + return false; + } + return nodeUtils.getTextForTokenKind(token.kind) === '('; } + ); + + const methodLoc = ast.getLineAndCharacterOfPosition( + openingParen.getStart() + ), + nodeIsMethod = node.kind === SyntaxKind.MethodDeclaration, + method = { + type: AST_NODE_TYPES.FunctionExpression, + id: null, + generator: !!node.asteriskToken, + expression: false, + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + body: convertChild(node.body), + range: [node.parameters.pos - 1, result.range[1]], + loc: { + start: { + line: methodLoc.line + 1, + column: methodLoc.character + }, + end: result.loc.end + } + }; - case SyntaxKind.PropertyAssignment: - Object.assign(result, { - type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: convertChild(node.initializer), - computed: nodeUtils.isComputedProperty(node.name), - method: false, - shorthand: false, - kind: "init" - }); - break; - - case SyntaxKind.ShorthandPropertyAssignment: { - if (node.objectAssignmentInitializer) { - Object.assign(result, { - type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: { - type: AST_NODE_TYPES.AssignmentPattern, - left: convertChild(node.name), - right: convertChild(node.objectAssignmentInitializer), - loc: result.loc, - range: result.range - }, - computed: false, - method: false, - shorthand: true, - kind: "init" - }); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: convertChild(node.initializer || node.name), - computed: false, - method: false, - shorthand: true, - kind: "init" - }); - } - break; - } + if (node.type) { + method.returnType = convertTypeAnnotation(node.type); + } - case SyntaxKind.ComputedPropertyName: - - if (parent.kind === SyntaxKind.ObjectLiteralExpression) { - Object.assign(result, { - type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: convertChild(node.name), - computed: false, - method: false, - shorthand: true, - kind: "init" - }); - } else { - return convertChild(node.expression); - } - break; - - case SyntaxKind.PropertyDeclaration: { - const isAbstract = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node); - Object.assign(result, { - type: (isAbstract) ? AST_NODE_TYPES.TSAbstractClassProperty : AST_NODE_TYPES.ClassProperty, - key: convertChild(node.name), - value: convertChild(node.initializer), - computed: nodeUtils.isComputedProperty(node.name), - static: nodeUtils.hasStaticModifierFlag(node), - readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined - }); - - if (node.type) { - result.typeAnnotation = convertTypeAnnotation(node.type); - } + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + method.params = node.parameters.map(convertChild); - if (node.decorators) { - result.decorators = convertDecorators(node.decorators); - } + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.name), + value: method, + computed: nodeUtils.isComputedProperty(node.name), + method: nodeIsMethod, + shorthand: false, + kind: 'init' + }); + } else { + // class - const accessibility = nodeUtils.getTSNodeAccessibility(node); - if (accessibility) { - result.accessibility = accessibility; - } + /** + * Unlike in object literal methods, class method params can have decorators + */ + method.params = convertParameters(node.parameters); - if (node.name.kind === SyntaxKind.Identifier && node.questionToken) { - result.optional = true; - } + /** + * TypeScript class methods can be defined as "abstract" + */ + const methodDefinitionType = nodeUtils.hasModifier( + SyntaxKind.AbstractKeyword, + node + ) + ? AST_NODE_TYPES.TSAbstractMethodDefinition + : AST_NODE_TYPES.MethodDefinition; - if (node.exclamationToken) { - result.definite = true; - } + Object.assign(result, { + type: methodDefinitionType, + key: convertChild(node.name), + value: method, + computed: nodeUtils.isComputedProperty(node.name), + static: nodeUtils.hasStaticModifierFlag(node), + kind: 'method' + }); - if (result.key.type === AST_NODE_TYPES.Literal && node.questionToken) { - result.optional = true; - } - break; + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); } - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.MethodDeclaration: { - - const openingParen = nodeUtils.findFirstMatchingToken(node.name, ast, token => { - if (!token || !token.kind) { - return false; - } - return nodeUtils.getTextForTokenKind(token.kind) === "("; - }); - - const methodLoc = ast.getLineAndCharacterOfPosition(openingParen.getStart()), - nodeIsMethod = (node.kind === SyntaxKind.MethodDeclaration), - method = { - type: AST_NODE_TYPES.FunctionExpression, - id: null, - generator: !!node.asteriskToken, - expression: false, - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - body: convertChild(node.body), - range: [node.parameters.pos - 1, result.range[1]], - loc: { - start: { - line: methodLoc.line + 1, - column: methodLoc.character - }, - end: result.loc.end - } - }; - - if (node.type) { - method.returnType = convertTypeAnnotation(node.type); - } - - if (parent.kind === SyntaxKind.ObjectLiteralExpression) { - - method.params = node.parameters.map(convertChild); - - Object.assign(result, { - type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: method, - computed: nodeUtils.isComputedProperty(node.name), - method: nodeIsMethod, - shorthand: false, - kind: "init" - }); - - } else { // class - - /** - * Unlike in object literal methods, class method params can have decorators - */ - method.params = convertParameters(node.parameters); - - /** - * TypeScript class methods can be defined as "abstract" - */ - const methodDefinitionType = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node) - ? AST_NODE_TYPES.TSAbstractMethodDefinition - : AST_NODE_TYPES.MethodDefinition; - - Object.assign(result, { - type: methodDefinitionType, - key: convertChild(node.name), - value: method, - computed: nodeUtils.isComputedProperty(node.name), - static: nodeUtils.hasStaticModifierFlag(node), - kind: "method" - }); - - if (node.decorators) { - result.decorators = convertDecorators(node.decorators); - } - - const accessibility = nodeUtils.getTSNodeAccessibility(node); - if (accessibility) { - result.accessibility = accessibility; - } - - } - - if (result.key.type === AST_NODE_TYPES.Identifier && node.questionToken) { - result.key.optional = true; - } - - if (node.kind === SyntaxKind.GetAccessor) { - result.kind = "get"; - } else if (node.kind === SyntaxKind.SetAccessor) { - result.kind = "set"; - } else if (!result.static && node.name.kind === SyntaxKind.StringLiteral && node.name.text === "constructor") { - result.kind = "constructor"; - } - - // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { - method.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } - - break; - + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; } + } + + if (result.key.type === AST_NODE_TYPES.Identifier && node.questionToken) { + result.key.optional = true; + } + + if (node.kind === SyntaxKind.GetAccessor) { + result.kind = 'get'; + } else if (node.kind === SyntaxKind.SetAccessor) { + result.kind = 'set'; + } else if ( + !result.static && + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' + ) { + result.kind = 'constructor'; + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + method.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } + + break; + } - // TypeScript uses this even for static methods named "constructor" - case SyntaxKind.Constructor: { - - const constructorIsStatic = nodeUtils.hasStaticModifierFlag(node), - constructorIsAbstract = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node), - firstConstructorToken = constructorIsStatic ? nodeUtils.findNextToken(node.getFirstToken(), ast) : node.getFirstToken(), - constructorLoc = ast.getLineAndCharacterOfPosition(node.parameters.pos - 1), - constructor = { - type: AST_NODE_TYPES.FunctionExpression, - id: null, - params: convertParameters(node.parameters), - generator: false, - expression: false, - async: false, - body: convertChild(node.body), - range: [node.parameters.pos - 1, result.range[1]], - loc: { - start: { - line: constructorLoc.line + 1, - column: constructorLoc.character - }, - end: result.loc.end - } - }; - - const constructorIdentifierLocStart = ast.getLineAndCharacterOfPosition(firstConstructorToken.getStart()), - constructorIdentifierLocEnd = ast.getLineAndCharacterOfPosition(firstConstructorToken.getEnd()), - constructorIsComputed = !!node.name && nodeUtils.isComputedProperty(node.name); - - let constructorKey; - - if (constructorIsComputed) { - constructorKey = { - type: AST_NODE_TYPES.Literal, - value: "constructor", - raw: node.name.getText(), - range: [firstConstructorToken.getStart(), firstConstructorToken.end], - loc: { - start: { - line: constructorIdentifierLocStart.line + 1, - column: constructorIdentifierLocStart.character - }, - end: { - line: constructorIdentifierLocEnd.line + 1, - column: constructorIdentifierLocEnd.character - } - } - }; - } else { - constructorKey = { - type: AST_NODE_TYPES.Identifier, - name: "constructor", - range: [firstConstructorToken.getStart(), firstConstructorToken.end], - loc: { - start: { - line: constructorIdentifierLocStart.line + 1, - column: constructorIdentifierLocStart.character - }, - end: { - line: constructorIdentifierLocEnd.line + 1, - column: constructorIdentifierLocEnd.character - } - } - }; - } - - Object.assign(result, { - type: constructorIsAbstract ? AST_NODE_TYPES.TSAbstractMethodDefinition : AST_NODE_TYPES.MethodDefinition, - key: constructorKey, - value: constructor, - computed: constructorIsComputed, - static: constructorIsStatic, - kind: (constructorIsStatic || constructorIsComputed) ? "method" : "constructor" - }); - - const accessibility = nodeUtils.getTSNodeAccessibility(node); - if (accessibility) { - result.accessibility = accessibility; - } - - break; - - } + // TypeScript uses this even for static methods named "constructor" + case SyntaxKind.Constructor: { + const constructorIsStatic = nodeUtils.hasStaticModifierFlag(node), + constructorIsAbstract = nodeUtils.hasModifier( + SyntaxKind.AbstractKeyword, + node + ), + firstConstructorToken = constructorIsStatic + ? nodeUtils.findNextToken(node.getFirstToken(), ast) + : node.getFirstToken(), + constructorLoc = ast.getLineAndCharacterOfPosition( + node.parameters.pos - 1 + ), + constructor = { + type: AST_NODE_TYPES.FunctionExpression, + id: null, + params: convertParameters(node.parameters), + generator: false, + expression: false, + async: false, + body: convertChild(node.body), + range: [node.parameters.pos - 1, result.range[1]], + loc: { + start: { + line: constructorLoc.line + 1, + column: constructorLoc.character + }, + end: result.loc.end + } + }; - case SyntaxKind.FunctionExpression: - Object.assign(result, { - type: AST_NODE_TYPES.FunctionExpression, - id: convertChild(node.name), - generator: !!node.asteriskToken, - params: convertParameters(node.parameters), - body: convertChild(node.body), - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - expression: false - }); - - // Process returnType - if (node.type) { - result.returnType = convertTypeAnnotation(node.type); - } + const constructorIdentifierLocStart = ast.getLineAndCharacterOfPosition( + firstConstructorToken.getStart() + ), + constructorIdentifierLocEnd = ast.getLineAndCharacterOfPosition( + firstConstructorToken.getEnd() + ), + constructorIsComputed = + !!node.name && nodeUtils.isComputedProperty(node.name); + + let constructorKey; + + if (constructorIsComputed) { + constructorKey = { + type: AST_NODE_TYPES.Literal, + value: 'constructor', + raw: node.name.getText(), + range: [firstConstructorToken.getStart(), firstConstructorToken.end], + loc: { + start: { + line: constructorIdentifierLocStart.line + 1, + column: constructorIdentifierLocStart.character + }, + end: { + line: constructorIdentifierLocEnd.line + 1, + column: constructorIdentifierLocEnd.character + } + } + }; + } else { + constructorKey = { + type: AST_NODE_TYPES.Identifier, + name: 'constructor', + range: [firstConstructorToken.getStart(), firstConstructorToken.end], + loc: { + start: { + line: constructorIdentifierLocStart.line + 1, + column: constructorIdentifierLocStart.character + }, + end: { + line: constructorIdentifierLocEnd.line + 1, + column: constructorIdentifierLocEnd.character + } + } + }; + } + + Object.assign(result, { + type: constructorIsAbstract + ? AST_NODE_TYPES.TSAbstractMethodDefinition + : AST_NODE_TYPES.MethodDefinition, + key: constructorKey, + value: constructor, + computed: constructorIsComputed, + static: constructorIsStatic, + kind: + constructorIsStatic || constructorIsComputed + ? 'method' + : 'constructor' + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + break; + } - // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } - break; - - case SyntaxKind.SuperKeyword: - Object.assign(result, { - type: AST_NODE_TYPES.Super - }); - break; - - case SyntaxKind.ArrayBindingPattern: - Object.assign(result, { - type: AST_NODE_TYPES.ArrayPattern, - elements: node.elements.map(convertChild) - }); - break; - - // occurs with missing array elements like [,] - case SyntaxKind.OmittedExpression: - return null; - - case SyntaxKind.ObjectBindingPattern: - Object.assign(result, { - type: AST_NODE_TYPES.ObjectPattern, - properties: node.elements.map(convertChild) - }); - break; - - case SyntaxKind.BindingElement: - - if (parent.kind === SyntaxKind.ArrayBindingPattern) { - const arrayItem = convert({ node: node.name, parent, ast, additionalOptions }); - - if (node.initializer) { - Object.assign(result, { - type: AST_NODE_TYPES.AssignmentPattern, - left: arrayItem, - right: convertChild(node.initializer) - }); - } else if (node.dotDotDotToken) { - Object.assign(result, { - type: AST_NODE_TYPES.RestElement, - argument: arrayItem - }); - } else { - return arrayItem; - } - } else if (parent.kind === SyntaxKind.ObjectBindingPattern) { - - if (node.dotDotDotToken) { - Object.assign(result, { - type: AST_NODE_TYPES.RestElement, - argument: convertChild(node.propertyName || node.name) - }); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.Property, - key: convertChild(node.propertyName || node.name), - value: convertChild(node.name), - computed: Boolean(node.propertyName && node.propertyName.kind === SyntaxKind.ComputedPropertyName), - method: false, - shorthand: !node.propertyName, - kind: "init" - }); - } - - if (node.initializer) { - result.value = { - type: AST_NODE_TYPES.AssignmentPattern, - left: convertChild(node.name), - right: convertChild(node.initializer), - range: [node.name.getStart(), node.initializer.end], - loc: nodeUtils.getLocFor(node.name.getStart(), node.initializer.end, ast) - }; - } - } - break; - - - case SyntaxKind.ArrowFunction: - Object.assign(result, { - type: AST_NODE_TYPES.ArrowFunctionExpression, - generator: false, - id: null, - params: convertParameters(node.parameters), - body: convertChild(node.body), - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - expression: node.body.kind !== SyntaxKind.Block - }); - - // Process returnType - if (node.type) { - result.returnType = convertTypeAnnotation(node.type); - } + case SyntaxKind.FunctionExpression: + Object.assign(result, { + type: AST_NODE_TYPES.FunctionExpression, + id: convertChild(node.name), + generator: !!node.asteriskToken, + params: convertParameters(node.parameters), + body: convertChild(node.body), + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + expression: false + }); + + // Process returnType + if (node.type) { + result.returnType = convertTypeAnnotation(node.type); + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } + break; + + case SyntaxKind.SuperKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Super + }); + break; + + case SyntaxKind.ArrayBindingPattern: + Object.assign(result, { + type: AST_NODE_TYPES.ArrayPattern, + elements: node.elements.map(convertChild) + }); + break; + + // occurs with missing array elements like [,] + case SyntaxKind.OmittedExpression: + return null; + + case SyntaxKind.ObjectBindingPattern: + Object.assign(result, { + type: AST_NODE_TYPES.ObjectPattern, + properties: node.elements.map(convertChild) + }); + break; + + case SyntaxKind.BindingElement: + if (parent.kind === SyntaxKind.ArrayBindingPattern) { + const arrayItem = convert({ + node: node.name, + parent, + ast, + additionalOptions + }); - // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } - break; - - case SyntaxKind.YieldExpression: - Object.assign(result, { - type: AST_NODE_TYPES.YieldExpression, - delegate: !!node.asteriskToken, - argument: convertChild(node.expression) - }); - break; - - case SyntaxKind.AwaitExpression: - Object.assign(result, { - type: AST_NODE_TYPES.AwaitExpression, - argument: convertChild(node.expression) - }); - break; - - // Template Literals - - case SyntaxKind.NoSubstitutionTemplateLiteral: - Object.assign(result, { - type: AST_NODE_TYPES.TemplateLiteral, - quasis: [ - { - type: AST_NODE_TYPES.TemplateElement, - value: { - raw: ast.text.slice(node.getStart() + 1, node.end - 1), - cooked: node.text - }, - tail: true, - range: result.range, - loc: result.loc - } - ], - expressions: [] - }); - break; - - case SyntaxKind.TemplateExpression: - Object.assign(result, { - type: AST_NODE_TYPES.TemplateLiteral, - quasis: [convertChild(node.head)], - expressions: [] - }); - - node.templateSpans.forEach(templateSpan => { - result.expressions.push(convertChild(templateSpan.expression)); - result.quasis.push(convertChild(templateSpan.literal)); - }); - break; - - case SyntaxKind.TaggedTemplateExpression: - Object.assign(result, { - type: AST_NODE_TYPES.TaggedTemplateExpression, - typeParameters: (node.typeArguments) - ? convertTypeArgumentsToTypeParameters(node.typeArguments) - : undefined, - tag: convertChild(node.tag), - quasi: convertChild(node.template) - }); - break; - - case SyntaxKind.TemplateHead: - case SyntaxKind.TemplateMiddle: - case SyntaxKind.TemplateTail: { - const tail = (node.kind === SyntaxKind.TemplateTail); - Object.assign(result, { - type: AST_NODE_TYPES.TemplateElement, - value: { - raw: ast.text.slice(node.getStart() + 1, node.end - (tail ? 1 : 2)), - cooked: node.text - }, - tail - }); - break; + if (node.initializer) { + Object.assign(result, { + type: AST_NODE_TYPES.AssignmentPattern, + left: arrayItem, + right: convertChild(node.initializer) + }); + } else if (node.dotDotDotToken) { + Object.assign(result, { + type: AST_NODE_TYPES.RestElement, + argument: arrayItem + }); + } else { + return arrayItem; } - - // Patterns - - case SyntaxKind.SpreadElement: { - let type = AST_NODE_TYPES.SpreadElement; - - if (node.parent && - node.parent.parent && - node.parent.parent.kind === SyntaxKind.BinaryExpression - ) { - if (node.parent.parent.left === node.parent) { - type = AST_NODE_TYPES.RestElement; - } else if (node.parent.parent.right === node.parent) { - type = AST_NODE_TYPES.SpreadElement; - } - } - - Object.assign(result, { - type, - argument: convertChild(node.expression) - }); - break; + } else if (parent.kind === SyntaxKind.ObjectBindingPattern) { + if (node.dotDotDotToken) { + Object.assign(result, { + type: AST_NODE_TYPES.RestElement, + argument: convertChild(node.propertyName || node.name) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.Property, + key: convertChild(node.propertyName || node.name), + value: convertChild(node.name), + computed: Boolean( + node.propertyName && + node.propertyName.kind === SyntaxKind.ComputedPropertyName + ), + method: false, + shorthand: !node.propertyName, + kind: 'init' + }); } - case SyntaxKind.SpreadAssignment: { - let type = AST_NODE_TYPES.SpreadElement; - - if (node.parent && - node.parent.parent && - node.parent.parent.kind === SyntaxKind.BinaryExpression - ) { - if (node.parent.parent.right === node.parent) { - type = AST_NODE_TYPES.SpreadElement; - } else if (node.parent.parent.left === node.parent) { - type = AST_NODE_TYPES.RestElement; - } - } - Object.assign(result, { - type, - argument: convertChild(node.expression) - }); - break; + if (node.initializer) { + result.value = { + type: AST_NODE_TYPES.AssignmentPattern, + left: convertChild(node.name), + right: convertChild(node.initializer), + range: [node.name.getStart(), node.initializer.end], + loc: nodeUtils.getLocFor( + node.name.getStart(), + node.initializer.end, + ast + ) + }; } + } + break; + + case SyntaxKind.ArrowFunction: + Object.assign(result, { + type: AST_NODE_TYPES.ArrowFunctionExpression, + generator: false, + id: null, + params: convertParameters(node.parameters), + body: convertChild(node.body), + async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + expression: node.body.kind !== SyntaxKind.Block + }); + + // Process returnType + if (node.type) { + result.returnType = convertTypeAnnotation(node.type); + } + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } + break; + + case SyntaxKind.YieldExpression: + Object.assign(result, { + type: AST_NODE_TYPES.YieldExpression, + delegate: !!node.asteriskToken, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.AwaitExpression: + Object.assign(result, { + type: AST_NODE_TYPES.AwaitExpression, + argument: convertChild(node.expression) + }); + break; + + // Template Literals + + case SyntaxKind.NoSubstitutionTemplateLiteral: + Object.assign(result, { + type: AST_NODE_TYPES.TemplateLiteral, + quasis: [ + { + type: AST_NODE_TYPES.TemplateElement, + value: { + raw: ast.text.slice(node.getStart() + 1, node.end - 1), + cooked: node.text + }, + tail: true, + range: result.range, + loc: result.loc + } + ], + expressions: [] + }); + break; + + case SyntaxKind.TemplateExpression: + Object.assign(result, { + type: AST_NODE_TYPES.TemplateLiteral, + quasis: [convertChild(node.head)], + expressions: [] + }); + + node.templateSpans.forEach(templateSpan => { + result.expressions.push(convertChild(templateSpan.expression)); + result.quasis.push(convertChild(templateSpan.literal)); + }); + break; + + case SyntaxKind.TaggedTemplateExpression: + Object.assign(result, { + type: AST_NODE_TYPES.TaggedTemplateExpression, + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : undefined, + tag: convertChild(node.tag), + quasi: convertChild(node.template) + }); + break; + + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: { + const tail = node.kind === SyntaxKind.TemplateTail; + Object.assign(result, { + type: AST_NODE_TYPES.TemplateElement, + value: { + raw: ast.text.slice(node.getStart() + 1, node.end - (tail ? 1 : 2)), + cooked: node.text + }, + tail + }); + break; + } - case SyntaxKind.Parameter: { - let parameter; - - if (node.dotDotDotToken) { - parameter = convertChild(node.name); - Object.assign(result, { - type: AST_NODE_TYPES.RestElement, - argument: parameter - }); - } else if (node.initializer) { - parameter = convertChild(node.name); - Object.assign(result, { - type: AST_NODE_TYPES.AssignmentPattern, - left: parameter, - right: convertChild(node.initializer) - }); - } else { - parameter = convert({ node: node.name, parent, ast, additionalOptions }); - result = parameter; - } - - if (node.type) { - parameter.typeAnnotation = convertTypeAnnotation(node.type); - fixTypeAnnotationParentLocation(parameter); - } - - if (node.questionToken) { - parameter.optional = true; - } - - if (node.modifiers) { - return { - type: AST_NODE_TYPES.TSParameterProperty, - range: [node.getStart(), node.end], - loc: nodeUtils.getLoc(node, ast), - accessibility: nodeUtils.getTSNodeAccessibility(node) || undefined, - readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, - export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined, - parameter: result - }; - } + // Patterns - break; + case SyntaxKind.SpreadElement: { + let type = AST_NODE_TYPES.SpreadElement; + if ( + node.parent && + node.parent.parent && + node.parent.parent.kind === SyntaxKind.BinaryExpression + ) { + if (node.parent.parent.left === node.parent) { + type = AST_NODE_TYPES.RestElement; + } else if (node.parent.parent.right === node.parent) { + type = AST_NODE_TYPES.SpreadElement; } + } - // Classes - - case SyntaxKind.ClassDeclaration: - case SyntaxKind.ClassExpression: { - - const heritageClauses = node.heritageClauses || []; - - let classNodeType = SyntaxKind[node.kind]; - let lastClassToken = heritageClauses.length ? heritageClauses[heritageClauses.length - 1] : node.name; - - if (node.typeParameters && node.typeParameters.length) { - const lastTypeParameter = node.typeParameters[node.typeParameters.length - 1]; - - if (!lastClassToken || lastTypeParameter.pos > lastClassToken.pos) { - lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast); - } - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } - - if (node.modifiers && node.modifiers.length) { - - /** - * TypeScript class declarations can be defined as "abstract" - */ - if (node.kind === SyntaxKind.ClassDeclaration) { - if (nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)) { - classNodeType = `TSAbstract${classNodeType}`; - } - } - - /** - * We need check for modifiers, and use the last one, as there - * could be multiple before the open brace - */ - const lastModifier = node.modifiers[node.modifiers.length - 1]; - - if (!lastClassToken || lastModifier.pos > lastClassToken.pos) { - lastClassToken = nodeUtils.findNextToken(lastModifier, ast); - } - - } else if (!lastClassToken) { // no name - lastClassToken = node.getFirstToken(); - } - - const openBrace = nodeUtils.findNextToken(lastClassToken, ast); - const superClass = heritageClauses.find(clause => clause.token === SyntaxKind.ExtendsKeyword); - - if (superClass) { - if (superClass.types.length > 1) { - throw nodeUtils.createError(ast, superClass.types[1].pos, "Classes can only extend a single class."); - } - - if (superClass.types[0] && superClass.types[0].typeArguments) { - result.superTypeParameters = convertTypeArgumentsToTypeParameters(superClass.types[0].typeArguments); - } - } + Object.assign(result, { + type, + argument: convertChild(node.expression) + }); + break; + } + case SyntaxKind.SpreadAssignment: { + let type = AST_NODE_TYPES.SpreadElement; + + if ( + node.parent && + node.parent.parent && + node.parent.parent.kind === SyntaxKind.BinaryExpression + ) { + if (node.parent.parent.right === node.parent) { + type = AST_NODE_TYPES.SpreadElement; + } else if (node.parent.parent.left === node.parent) { + type = AST_NODE_TYPES.RestElement; + } + } - const implementsClause = heritageClauses.find(clause => clause.token === SyntaxKind.ImplementsKeyword); + Object.assign(result, { + type, + argument: convertChild(node.expression) + }); + break; + } - Object.assign(result, { - type: classNodeType, - id: convertChild(node.name), - body: { - type: AST_NODE_TYPES.ClassBody, - body: [], + case SyntaxKind.Parameter: { + let parameter; - // TODO: Fix location info - range: [openBrace.getStart(), result.range[1]], - loc: nodeUtils.getLocFor(openBrace.getStart(), node.end, ast) - }, - superClass: (superClass && superClass.types[0] ? convertChild(superClass.types[0].expression) : null) - }); + if (node.dotDotDotToken) { + parameter = convertChild(node.name); + Object.assign(result, { + type: AST_NODE_TYPES.RestElement, + argument: parameter + }); + } else if (node.initializer) { + parameter = convertChild(node.name); + Object.assign(result, { + type: AST_NODE_TYPES.AssignmentPattern, + left: parameter, + right: convertChild(node.initializer) + }); + } else { + parameter = convert({ + node: node.name, + parent, + ast, + additionalOptions + }); + result = parameter; + } - if (implementsClause) { - result.implements = implementsClause.types.map(convertClassImplements); - } + if (node.type) { + parameter.typeAnnotation = convertTypeAnnotation(node.type); + fixTypeAnnotationParentLocation(parameter); + } - if (node.decorators) { - result.decorators = convertDecorators(node.decorators); - } + if (node.questionToken) { + parameter.optional = true; + } - const filteredMembers = node.members.filter(nodeUtils.isESTreeClassMember); + if (node.modifiers) { + return { + type: AST_NODE_TYPES.TSParameterProperty, + range: [node.getStart(), node.end], + loc: nodeUtils.getLoc(node, ast), + accessibility: nodeUtils.getTSNodeAccessibility(node) || undefined, + readonly: + nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || + undefined, + static: + nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: + nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined, + parameter: result + }; + } - if (filteredMembers.length) { - result.body.body = filteredMembers.map(convertChild); - } + break; + } - // check for exports - result = nodeUtils.fixExports(node, result, ast); + // Classes - break; + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: { + const heritageClauses = node.heritageClauses || []; - } + let classNodeType = SyntaxKind[node.kind]; + let lastClassToken = heritageClauses.length + ? heritageClauses[heritageClauses.length - 1] + : node.name; - // Modules - case SyntaxKind.ModuleBlock: - Object.assign(result, { - type: AST_NODE_TYPES.TSModuleBlock, - body: node.statements.map(convertChild) - }); - break; - - case SyntaxKind.ImportDeclaration: - Object.assign(result, { - type: AST_NODE_TYPES.ImportDeclaration, - source: convertChild(node.moduleSpecifier), - specifiers: [] - }); - - if (node.importClause) { - if (node.importClause.name) { - result.specifiers.push(convertChild(node.importClause)); - } - - if (node.importClause.namedBindings) { - if (node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { - result.specifiers.push(convertChild(node.importClause.namedBindings)); - } else { - result.specifiers = result.specifiers.concat(node.importClause.namedBindings.elements.map(convertChild)); - } - } - } + if (node.typeParameters && node.typeParameters.length) { + const lastTypeParameter = + node.typeParameters[node.typeParameters.length - 1]; - break; - - case SyntaxKind.NamespaceImport: - Object.assign(result, { - type: AST_NODE_TYPES.ImportNamespaceSpecifier, - local: convertChild(node.name) - }); - break; - - case SyntaxKind.ImportSpecifier: - Object.assign(result, { - type: AST_NODE_TYPES.ImportSpecifier, - local: convertChild(node.name), - imported: convertChild(node.propertyName || node.name) - }); - break; - - case SyntaxKind.ImportClause: - Object.assign(result, { - type: AST_NODE_TYPES.ImportDefaultSpecifier, - local: convertChild(node.name) - }); - - // have to adjust location information due to tree differences - result.range[1] = node.name.end; - result.loc = nodeUtils.getLocFor(result.range[0], result.range[1], ast); - break; - - case SyntaxKind.NamedImports: - Object.assign(result, { - type: AST_NODE_TYPES.ImportDefaultSpecifier, - local: convertChild(node.name) - }); - break; - - case SyntaxKind.ExportDeclaration: - if (node.exportClause) { - Object.assign(result, { - type: AST_NODE_TYPES.ExportNamedDeclaration, - source: convertChild(node.moduleSpecifier), - specifiers: node.exportClause.elements.map(convertChild), - declaration: null - }); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.ExportAllDeclaration, - source: convertChild(node.moduleSpecifier) - }); - } - break; - - case SyntaxKind.ExportSpecifier: - Object.assign(result, { - type: AST_NODE_TYPES.ExportSpecifier, - local: convertChild(node.propertyName || node.name), - exported: convertChild(node.name) - }); - break; - - case SyntaxKind.ExportAssignment: - if (node.isExportEquals) { - Object.assign(result, { - type: AST_NODE_TYPES.TSExportAssignment, - expression: convertChild(node.expression) - }); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.ExportDefaultDeclaration, - declaration: convertChild(node.expression) - }); - } - break; - - // Unary Operations - - case SyntaxKind.PrefixUnaryExpression: - case SyntaxKind.PostfixUnaryExpression: { - const operator = nodeUtils.getTextForTokenKind(node.operator); - Object.assign(result, { - /** - * ESTree uses UpdateExpression for ++/-- - */ - type: /^(?:\+\+|--)$/.test(operator) ? AST_NODE_TYPES.UpdateExpression : AST_NODE_TYPES.UnaryExpression, - operator, - prefix: node.kind === SyntaxKind.PrefixUnaryExpression, - argument: convertChild(node.operand) - }); - break; + if (!lastClassToken || lastTypeParameter.pos > lastClassToken.pos) { + lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast); } + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } - case SyntaxKind.DeleteExpression: - Object.assign(result, { - type: AST_NODE_TYPES.UnaryExpression, - operator: "delete", - prefix: true, - argument: convertChild(node.expression) - }); - break; - - case SyntaxKind.VoidExpression: - Object.assign(result, { - type: AST_NODE_TYPES.UnaryExpression, - operator: "void", - prefix: true, - argument: convertChild(node.expression) - }); - break; - - case SyntaxKind.TypeOfExpression: - Object.assign(result, { - type: AST_NODE_TYPES.UnaryExpression, - operator: "typeof", - prefix: true, - argument: convertChild(node.expression) - }); - break; - - case SyntaxKind.TypeOperator: - Object.assign(result, { - type: AST_NODE_TYPES.TSTypeOperator, - operator: nodeUtils.getTextForTokenKind(node.operator), - typeAnnotation: convertChild(node.type) - }); - break; - - // Binary Operations - - case SyntaxKind.BinaryExpression: - - // TypeScript uses BinaryExpression for sequences as well - if (nodeUtils.isComma(node.operatorToken)) { - Object.assign(result, { - type: AST_NODE_TYPES.SequenceExpression, - expressions: [] - }); - - const left = convertChild(node.left), - right = convertChild(node.right); - - if (left.type === AST_NODE_TYPES.SequenceExpression) { - result.expressions = result.expressions.concat(left.expressions); - } else { - result.expressions.push(left); - } - - if (right.type === AST_NODE_TYPES.SequenceExpression) { - result.expressions = result.expressions.concat(right.expressions); - } else { - result.expressions.push(right); - } - - } else if (node.operatorToken && node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken) { - Object.assign(result, { - type: AST_NODE_TYPES.AssignmentExpression, - operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), - left: convertChild(node.left), - right: convertChild(node.right) - }); - } else { - Object.assign(result, { - type: nodeUtils.getBinaryExpressionType(node.operatorToken), - operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), - left: convertChild(node.left), - right: convertChild(node.right) - }); - - // if the binary expression is in a destructured array, switch it - if (result.type === AST_NODE_TYPES.AssignmentExpression) { - const upperArrayNode = nodeUtils.findAncestorOfKind(node, SyntaxKind.ArrayLiteralExpression), - upperArrayAssignNode = upperArrayNode && nodeUtils.findAncestorOfKind(upperArrayNode, SyntaxKind.BinaryExpression); - - let upperArrayIsInAssignment; - - if (upperArrayAssignNode) { - if (upperArrayAssignNode.left === upperArrayNode) { - upperArrayIsInAssignment = true; - } else { - upperArrayIsInAssignment = (nodeUtils.findChildOfKind(upperArrayAssignNode.left, SyntaxKind.ArrayLiteralExpression, ast) === upperArrayNode); - } - } - - if (upperArrayIsInAssignment) { - delete result.operator; - result.type = AST_NODE_TYPES.AssignmentPattern; - } - } - } - break; - - case SyntaxKind.PropertyAccessExpression: - if (nodeUtils.isJSXToken(parent)) { - const jsxMemberExpression = { - type: AST_NODE_TYPES.MemberExpression, - object: convertChild(node.expression), - property: convertChild(node.name) - }; - const isNestedMemberExpression = (node.expression.kind === SyntaxKind.PropertyAccessExpression); - if (node.expression.kind === SyntaxKind.ThisKeyword) { - jsxMemberExpression.object.name = "this"; - } - - jsxMemberExpression.object.type = (isNestedMemberExpression) ? AST_NODE_TYPES.MemberExpression : AST_NODE_TYPES.JSXIdentifier; - jsxMemberExpression.property.type = AST_NODE_TYPES.JSXIdentifier; - Object.assign(result, jsxMemberExpression); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.MemberExpression, - object: convertChild(node.expression), - property: convertChild(node.name), - computed: false - }); - } - break; - - case SyntaxKind.ElementAccessExpression: - Object.assign(result, { - type: AST_NODE_TYPES.MemberExpression, - object: convertChild(node.expression), - property: convertChild(node.argumentExpression), - computed: true - }); - break; - - case SyntaxKind.ConditionalExpression: - Object.assign(result, { - type: AST_NODE_TYPES.ConditionalExpression, - test: convertChild(node.condition), - consequent: convertChild(node.whenTrue), - alternate: convertChild(node.whenFalse) - }); - break; - - case SyntaxKind.CallExpression: - Object.assign(result, { - type: AST_NODE_TYPES.CallExpression, - callee: convertChild(node.expression), - arguments: node.arguments.map(convertChild) - }); - if (node.typeArguments && node.typeArguments.length) { - result.typeParameters = convertTypeArgumentsToTypeParameters(node.typeArguments); - } - break; - - case SyntaxKind.NewExpression: - Object.assign(result, { - type: AST_NODE_TYPES.NewExpression, - callee: convertChild(node.expression), - arguments: (node.arguments) ? node.arguments.map(convertChild) : [] - }); - if (node.typeArguments && node.typeArguments.length) { - result.typeParameters = convertTypeArgumentsToTypeParameters(node.typeArguments); - } - break; - - case SyntaxKind.MetaProperty: { - const newToken = nodeUtils.convertToken(node.getFirstToken(), ast); - Object.assign(result, { - type: AST_NODE_TYPES.MetaProperty, - meta: { - type: AST_NODE_TYPES.Identifier, - range: newToken.range, - loc: newToken.loc, - name: nodeUtils.getTextForTokenKind(node.keywordToken) - }, - property: convertChild(node.name) - }); - break; + if (node.modifiers && node.modifiers.length) { + /** + * TypeScript class declarations can be defined as "abstract" + */ + if (node.kind === SyntaxKind.ClassDeclaration) { + if (nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)) { + classNodeType = `TSAbstract${classNodeType}`; + } } - // Literals - - case SyntaxKind.StringLiteral: - Object.assign(result, { - type: AST_NODE_TYPES.Literal, - raw: ast.text.slice(result.range[0], result.range[1]) - }); - if (parent.name && parent.name === node) { - result.value = node.text; - } else { - result.value = nodeUtils.unescapeStringLiteralText(node.text); - } - break; - - case SyntaxKind.NumericLiteral: - Object.assign(result, { - type: AST_NODE_TYPES.Literal, - value: Number(node.text), - raw: ast.text.slice(result.range[0], result.range[1]) - }); - break; - - case SyntaxKind.RegularExpressionLiteral: { - const pattern = node.text.slice(1, node.text.lastIndexOf("/")); - const flags = node.text.slice(node.text.lastIndexOf("/") + 1); - - let regex = null; - try { - regex = new RegExp(pattern, flags); - } catch (exception) { - regex = null; - } + /** + * We need check for modifiers, and use the last one, as there + * could be multiple before the open brace + */ + const lastModifier = node.modifiers[node.modifiers.length - 1]; - Object.assign(result, { - type: AST_NODE_TYPES.Literal, - value: regex, - raw: node.text, - regex: { - pattern, - flags - } - }); - break; + if (!lastClassToken || lastModifier.pos > lastClassToken.pos) { + lastClassToken = nodeUtils.findNextToken(lastModifier, ast); } - - case SyntaxKind.TrueKeyword: - Object.assign(result, { - type: AST_NODE_TYPES.Literal, - value: true, - raw: "true" - }); - break; - - case SyntaxKind.FalseKeyword: - Object.assign(result, { - type: AST_NODE_TYPES.Literal, - value: false, - raw: "false" - }); - break; - - case SyntaxKind.NullKeyword: { - if (nodeUtils.isWithinTypeAnnotation(node)) { - Object.assign(result, { - type: AST_NODE_TYPES.TSNullKeyword - }); - } else { - Object.assign(result, { - type: AST_NODE_TYPES.Literal, - value: null, - raw: "null" - }); - } - break; + } else if (!lastClassToken) { + // no name + lastClassToken = node.getFirstToken(); + } + + const openBrace = nodeUtils.findNextToken(lastClassToken, ast); + const superClass = heritageClauses.find( + clause => clause.token === SyntaxKind.ExtendsKeyword + ); + + if (superClass) { + if (superClass.types.length > 1) { + throw nodeUtils.createError( + ast, + superClass.types[1].pos, + 'Classes can only extend a single class.' + ); } - case SyntaxKind.ImportKeyword: - Object.assign(result, { - type: AST_NODE_TYPES.Import - }); - break; - - case SyntaxKind.EmptyStatement: - case SyntaxKind.DebuggerStatement: - simplyCopy(); - break; - - // JSX - - case SyntaxKind.JsxElement: - Object.assign(result, { - type: AST_NODE_TYPES.JSXElement, - openingElement: convertChild(node.openingElement), - closingElement: convertChild(node.closingElement), - children: node.children.map(convertChild) - }); - - break; - - case SyntaxKind.JsxSelfClosingElement: { - /** - * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, - * TypeScript does not seem to have the idea of openingElement when tag is self-closing - */ - node.kind = SyntaxKind.JsxOpeningElement; - - const openingElement = convertChild(node); - openingElement.selfClosing = true; - - Object.assign(result, { - type: AST_NODE_TYPES.JSXElement, - openingElement, - closingElement: null, - children: [] - }); - - break; - + if (superClass.types[0] && superClass.types[0].typeArguments) { + result.superTypeParameters = convertTypeArgumentsToTypeParameters( + superClass.types[0].typeArguments + ); } + } + + const implementsClause = heritageClauses.find( + clause => clause.token === SyntaxKind.ImplementsKeyword + ); + + Object.assign(result, { + type: classNodeType, + id: convertChild(node.name), + body: { + type: AST_NODE_TYPES.ClassBody, + body: [], + + // TODO: Fix location info + range: [openBrace.getStart(), result.range[1]], + loc: nodeUtils.getLocFor(openBrace.getStart(), node.end, ast) + }, + superClass: + superClass && superClass.types[0] + ? convertChild(superClass.types[0].expression) + : null + }); + + if (implementsClause) { + result.implements = implementsClause.types.map(convertClassImplements); + } + + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + + const filteredMembers = node.members.filter( + nodeUtils.isESTreeClassMember + ); + + if (filteredMembers.length) { + result.body.body = filteredMembers.map(convertChild); + } + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + } - case SyntaxKind.JsxOpeningElement: - Object.assign(result, { - type: AST_NODE_TYPES.JSXOpeningElement, - typeParameters: (node.typeArguments) - ? convertTypeArgumentsToTypeParameters(node.typeArguments) - : undefined, - selfClosing: false, - name: convertTypeScriptJSXTagNameToESTreeName(node.tagName), - attributes: node.attributes.properties.map(convertChild) - }); - break; - - case SyntaxKind.JsxClosingElement: - Object.assign(result, { - type: AST_NODE_TYPES.JSXClosingElement, - name: convertTypeScriptJSXTagNameToESTreeName(node.tagName) - }); - break; - - case SyntaxKind.JsxExpression: { - const eloc = ast.getLineAndCharacterOfPosition(result.range[0] + 1); - const expression = (node.expression) ? convertChild(node.expression) : { - type: AST_NODE_TYPES.JSXEmptyExpression, - loc: { - start: { - line: eloc.line + 1, - column: eloc.character - }, - end: { - line: result.loc.end.line, - column: result.loc.end.column - 1 - } - }, - range: [result.range[0] + 1, result.range[1] - 1] - }; - - Object.assign(result, { - type: node.dotDotDotToken - ? AST_NODE_TYPES.JSXSpreadChild - : AST_NODE_TYPES.JSXExpressionContainer, - expression - }); - - break; - + // Modules + case SyntaxKind.ModuleBlock: + Object.assign(result, { + type: AST_NODE_TYPES.TSModuleBlock, + body: node.statements.map(convertChild) + }); + break; + + case SyntaxKind.ImportDeclaration: + Object.assign(result, { + type: AST_NODE_TYPES.ImportDeclaration, + source: convertChild(node.moduleSpecifier), + specifiers: [] + }); + + if (node.importClause) { + if (node.importClause.name) { + result.specifiers.push(convertChild(node.importClause)); } - case SyntaxKind.JsxAttribute: { - const attributeName = nodeUtils.convertToken(node.name, ast); - attributeName.type = AST_NODE_TYPES.JSXIdentifier; - attributeName.name = attributeName.value; - delete attributeName.value; - - Object.assign(result, { - type: AST_NODE_TYPES.JSXAttribute, - name: attributeName, - value: convertChild(node.initializer) - }); - - break; - + if (node.importClause.namedBindings) { + if ( + node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport + ) { + result.specifiers.push( + convertChild(node.importClause.namedBindings) + ); + } else { + result.specifiers = result.specifiers.concat( + node.importClause.namedBindings.elements.map(convertChild) + ); + } } + } + + break; + + case SyntaxKind.NamespaceImport: + Object.assign(result, { + type: AST_NODE_TYPES.ImportNamespaceSpecifier, + local: convertChild(node.name) + }); + break; + + case SyntaxKind.ImportSpecifier: + Object.assign(result, { + type: AST_NODE_TYPES.ImportSpecifier, + local: convertChild(node.name), + imported: convertChild(node.propertyName || node.name) + }); + break; + + case SyntaxKind.ImportClause: + Object.assign(result, { + type: AST_NODE_TYPES.ImportDefaultSpecifier, + local: convertChild(node.name) + }); + + // have to adjust location information due to tree differences + result.range[1] = node.name.end; + result.loc = nodeUtils.getLocFor(result.range[0], result.range[1], ast); + break; + + case SyntaxKind.NamedImports: + Object.assign(result, { + type: AST_NODE_TYPES.ImportDefaultSpecifier, + local: convertChild(node.name) + }); + break; + + case SyntaxKind.ExportDeclaration: + if (node.exportClause) { + Object.assign(result, { + type: AST_NODE_TYPES.ExportNamedDeclaration, + source: convertChild(node.moduleSpecifier), + specifiers: node.exportClause.elements.map(convertChild), + declaration: null + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ExportAllDeclaration, + source: convertChild(node.moduleSpecifier) + }); + } + break; + + case SyntaxKind.ExportSpecifier: + Object.assign(result, { + type: AST_NODE_TYPES.ExportSpecifier, + local: convertChild(node.propertyName || node.name), + exported: convertChild(node.name) + }); + break; + + case SyntaxKind.ExportAssignment: + if (node.isExportEquals) { + Object.assign(result, { + type: AST_NODE_TYPES.TSExportAssignment, + expression: convertChild(node.expression) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: convertChild(node.expression) + }); + } + break; + + // Unary Operations + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: { + const operator = nodeUtils.getTextForTokenKind(node.operator); + Object.assign(result, { /** - * The JSX AST changed the node type for string literals - * inside a JSX Element from `Literal` to `JSXText`. We - * provide a flag to support both types until `Literal` - * node type is deprecated in ESLint v5. + * ESTree uses UpdateExpression for ++/-- */ - case SyntaxKind.JsxText: { - const start = node.getFullStart(); - const end = node.getEnd(); - - const type = (additionalOptions.useJSXTextNode) - ? AST_NODE_TYPES.JSXText : AST_NODE_TYPES.Literal; + type: /^(?:\+\+|--)$/.test(operator) + ? AST_NODE_TYPES.UpdateExpression + : AST_NODE_TYPES.UnaryExpression, + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + argument: convertChild(node.operand) + }); + break; + } - Object.assign(result, { - type, - value: ast.text.slice(start, end), - raw: ast.text.slice(start, end) - }); + case SyntaxKind.DeleteExpression: + Object.assign(result, { + type: AST_NODE_TYPES.UnaryExpression, + operator: 'delete', + prefix: true, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.VoidExpression: + Object.assign(result, { + type: AST_NODE_TYPES.UnaryExpression, + operator: 'void', + prefix: true, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.TypeOfExpression: + Object.assign(result, { + type: AST_NODE_TYPES.UnaryExpression, + operator: 'typeof', + prefix: true, + argument: convertChild(node.expression) + }); + break; + + case SyntaxKind.TypeOperator: + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeOperator, + operator: nodeUtils.getTextForTokenKind(node.operator), + typeAnnotation: convertChild(node.type) + }); + break; + + // Binary Operations + + case SyntaxKind.BinaryExpression: + // TypeScript uses BinaryExpression for sequences as well + if (nodeUtils.isComma(node.operatorToken)) { + Object.assign(result, { + type: AST_NODE_TYPES.SequenceExpression, + expressions: [] + }); - result.loc = nodeUtils.getLocFor(start, end, ast); - result.range = [start, end]; + const left = convertChild(node.left), + right = convertChild(node.right); - break; + if (left.type === AST_NODE_TYPES.SequenceExpression) { + result.expressions = result.expressions.concat(left.expressions); + } else { + result.expressions.push(left); } - case SyntaxKind.JsxSpreadAttribute: - Object.assign(result, { - type: AST_NODE_TYPES.JSXSpreadAttribute, - argument: convertChild(node.expression) - }); + if (right.type === AST_NODE_TYPES.SequenceExpression) { + result.expressions = result.expressions.concat(right.expressions); + } else { + result.expressions.push(right); + } + } else if ( + node.operatorToken && + node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken + ) { + Object.assign(result, { + type: AST_NODE_TYPES.AssignmentExpression, + operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), + left: convertChild(node.left), + right: convertChild(node.right) + }); + } else { + Object.assign(result, { + type: nodeUtils.getBinaryExpressionType(node.operatorToken), + operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), + left: convertChild(node.left), + right: convertChild(node.right) + }); - break; + // if the binary expression is in a destructured array, switch it + if (result.type === AST_NODE_TYPES.AssignmentExpression) { + const upperArrayNode = nodeUtils.findAncestorOfKind( + node, + SyntaxKind.ArrayLiteralExpression + ), + upperArrayAssignNode = + upperArrayNode && + nodeUtils.findAncestorOfKind( + upperArrayNode, + SyntaxKind.BinaryExpression + ); + + let upperArrayIsInAssignment; + + if (upperArrayAssignNode) { + if (upperArrayAssignNode.left === upperArrayNode) { + upperArrayIsInAssignment = true; + } else { + upperArrayIsInAssignment = + nodeUtils.findChildOfKind( + upperArrayAssignNode.left, + SyntaxKind.ArrayLiteralExpression, + ast + ) === upperArrayNode; + } + } + + if (upperArrayIsInAssignment) { + delete result.operator; + result.type = AST_NODE_TYPES.AssignmentPattern; + } + } + } + break; + + case SyntaxKind.PropertyAccessExpression: + if (nodeUtils.isJSXToken(parent)) { + const jsxMemberExpression = { + type: AST_NODE_TYPES.MemberExpression, + object: convertChild(node.expression), + property: convertChild(node.name) + }; + const isNestedMemberExpression = + node.expression.kind === SyntaxKind.PropertyAccessExpression; + if (node.expression.kind === SyntaxKind.ThisKeyword) { + jsxMemberExpression.object.name = 'this'; + } - case SyntaxKind.FirstNode: { - Object.assign(result, { - type: AST_NODE_TYPES.TSQualifiedName, - left: convertChild(node.left), - right: convertChild(node.right) - }); + jsxMemberExpression.object.type = isNestedMemberExpression + ? AST_NODE_TYPES.MemberExpression + : AST_NODE_TYPES.JSXIdentifier; + jsxMemberExpression.property.type = AST_NODE_TYPES.JSXIdentifier; + Object.assign(result, jsxMemberExpression); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.MemberExpression, + object: convertChild(node.expression), + property: convertChild(node.name), + computed: false + }); + } + break; + + case SyntaxKind.ElementAccessExpression: + Object.assign(result, { + type: AST_NODE_TYPES.MemberExpression, + object: convertChild(node.expression), + property: convertChild(node.argumentExpression), + computed: true + }); + break; + + case SyntaxKind.ConditionalExpression: + Object.assign(result, { + type: AST_NODE_TYPES.ConditionalExpression, + test: convertChild(node.condition), + consequent: convertChild(node.whenTrue), + alternate: convertChild(node.whenFalse) + }); + break; + + case SyntaxKind.CallExpression: + Object.assign(result, { + type: AST_NODE_TYPES.CallExpression, + callee: convertChild(node.expression), + arguments: node.arguments.map(convertChild) + }); + if (node.typeArguments && node.typeArguments.length) { + result.typeParameters = convertTypeArgumentsToTypeParameters( + node.typeArguments + ); + } + break; + + case SyntaxKind.NewExpression: + Object.assign(result, { + type: AST_NODE_TYPES.NewExpression, + callee: convertChild(node.expression), + arguments: node.arguments ? node.arguments.map(convertChild) : [] + }); + if (node.typeArguments && node.typeArguments.length) { + result.typeParameters = convertTypeArgumentsToTypeParameters( + node.typeArguments + ); + } + break; + + case SyntaxKind.MetaProperty: { + const newToken = nodeUtils.convertToken(node.getFirstToken(), ast); + Object.assign(result, { + type: AST_NODE_TYPES.MetaProperty, + meta: { + type: AST_NODE_TYPES.Identifier, + range: newToken.range, + loc: newToken.loc, + name: nodeUtils.getTextForTokenKind(node.keywordToken) + }, + property: convertChild(node.name) + }); + break; + } - break; + // Literals + + case SyntaxKind.StringLiteral: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + raw: ast.text.slice(result.range[0], result.range[1]) + }); + if (parent.name && parent.name === node) { + result.value = node.text; + } else { + result.value = nodeUtils.unescapeStringLiteralText(node.text); + } + break; + + case SyntaxKind.NumericLiteral: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: Number(node.text), + raw: ast.text.slice(result.range[0], result.range[1]) + }); + break; + + case SyntaxKind.RegularExpressionLiteral: { + const pattern = node.text.slice(1, node.text.lastIndexOf('/')); + const flags = node.text.slice(node.text.lastIndexOf('/') + 1); + + let regex = null; + try { + regex = new RegExp(pattern, flags); + } catch (exception) { + regex = null; + } + + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: regex, + raw: node.text, + regex: { + pattern, + flags } + }); + break; + } - // TypeScript specific + case SyntaxKind.TrueKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: true, + raw: 'true' + }); + break; + + case SyntaxKind.FalseKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: false, + raw: 'false' + }); + break; + + case SyntaxKind.NullKeyword: { + if (nodeUtils.isWithinTypeAnnotation(node)) { + Object.assign(result, { + type: AST_NODE_TYPES.TSNullKeyword + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.Literal, + value: null, + raw: 'null' + }); + } + break; + } - case SyntaxKind.ParenthesizedExpression: - return convert({ node: node.expression, parent, ast, additionalOptions }); + case SyntaxKind.ImportKeyword: + Object.assign(result, { + type: AST_NODE_TYPES.Import + }); + break; + + case SyntaxKind.EmptyStatement: + case SyntaxKind.DebuggerStatement: + simplyCopy(); + break; + + // JSX + + case SyntaxKind.JsxElement: + Object.assign(result, { + type: AST_NODE_TYPES.JSXElement, + openingElement: convertChild(node.openingElement), + closingElement: convertChild(node.closingElement), + children: node.children.map(convertChild) + }); + + break; + + case SyntaxKind.JsxSelfClosingElement: { + /** + * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, + * TypeScript does not seem to have the idea of openingElement when tag is self-closing + */ + node.kind = SyntaxKind.JsxOpeningElement; + + const openingElement = convertChild(node); + openingElement.selfClosing = true; + + Object.assign(result, { + type: AST_NODE_TYPES.JSXElement, + openingElement, + closingElement: null, + children: [] + }); + + break; + } - /** - * Convert TypeAliasDeclaration node into VariableDeclaration - * to allow core rules such as "semi" to work automatically - */ - case SyntaxKind.TypeAliasDeclaration: { - const typeAliasDeclarator = { - type: AST_NODE_TYPES.VariableDeclarator, - id: convertChild(node.name), - init: convertChild(node.type), - range: [node.name.getStart(), node.end] - }; - - typeAliasDeclarator.loc = nodeUtils.getLocFor(typeAliasDeclarator.range[0], typeAliasDeclarator.range[1], ast); - - // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { - typeAliasDeclarator.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } + case SyntaxKind.JsxOpeningElement: + Object.assign(result, { + type: AST_NODE_TYPES.JSXOpeningElement, + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : undefined, + selfClosing: false, + name: convertTypeScriptJSXTagNameToESTreeName(node.tagName), + attributes: node.attributes.properties.map(convertChild) + }); + break; + + case SyntaxKind.JsxClosingElement: + Object.assign(result, { + type: AST_NODE_TYPES.JSXClosingElement, + name: convertTypeScriptJSXTagNameToESTreeName(node.tagName) + }); + break; + + case SyntaxKind.JsxExpression: { + const eloc = ast.getLineAndCharacterOfPosition(result.range[0] + 1); + const expression = node.expression + ? convertChild(node.expression) + : { + type: AST_NODE_TYPES.JSXEmptyExpression, + loc: { + start: { + line: eloc.line + 1, + column: eloc.character + }, + end: { + line: result.loc.end.line, + column: result.loc.end.column - 1 + } + }, + range: [result.range[0] + 1, result.range[1] - 1] + }; + + Object.assign(result, { + type: node.dotDotDotToken + ? AST_NODE_TYPES.JSXSpreadChild + : AST_NODE_TYPES.JSXExpressionContainer, + expression + }); + + break; + } - Object.assign(result, { - type: AST_NODE_TYPES.VariableDeclaration, - kind: nodeUtils.getDeclarationKind(node), - declarations: [typeAliasDeclarator] - }); + case SyntaxKind.JsxAttribute: { + const attributeName = nodeUtils.convertToken(node.name, ast); + attributeName.type = AST_NODE_TYPES.JSXIdentifier; + attributeName.name = attributeName.value; + delete attributeName.value; - // check for exports - result = nodeUtils.fixExports(node, result, ast); + Object.assign(result, { + type: AST_NODE_TYPES.JSXAttribute, + name: attributeName, + value: convertChild(node.initializer) + }); - break; + break; + } - } + /** + * The JSX AST changed the node type for string literals + * inside a JSX Element from `Literal` to `JSXText`. We + * provide a flag to support both types until `Literal` + * node type is deprecated in ESLint v5. + */ + case SyntaxKind.JsxText: { + const start = node.getFullStart(); + const end = node.getEnd(); - case SyntaxKind.MethodSignature: { - Object.assign(result, { - type: AST_NODE_TYPES.TSMethodSignature, - optional: nodeUtils.isOptional(node), - computed: nodeUtils.isComputedProperty(node.name), - key: convertChild(node.name), - params: convertParameters(node.parameters), - typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null, - readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), - export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined - }); - - const accessibility = nodeUtils.getTSNodeAccessibility(node); - if (accessibility) { - result.accessibility = accessibility; - } + const type = additionalOptions.useJSXTextNode + ? AST_NODE_TYPES.JSXText + : AST_NODE_TYPES.Literal; - if (node.typeParameters) { - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } + Object.assign(result, { + type, + value: ast.text.slice(start, end), + raw: ast.text.slice(start, end) + }); - break; - } + result.loc = nodeUtils.getLocFor(start, end, ast); + result.range = [start, end]; - case SyntaxKind.PropertySignature: { - Object.assign(result, { - type: AST_NODE_TYPES.TSPropertySignature, - optional: nodeUtils.isOptional(node) || undefined, - computed: nodeUtils.isComputedProperty(node.name), - key: convertChild(node.name), - typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : undefined, - initializer: convertChild(node.initializer) || undefined, - readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, - export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined - }); - - const accessibility = nodeUtils.getTSNodeAccessibility(node); - if (accessibility) { - result.accessibility = accessibility; - } + break; + } - break; - } + case SyntaxKind.JsxSpreadAttribute: + Object.assign(result, { + type: AST_NODE_TYPES.JSXSpreadAttribute, + argument: convertChild(node.expression) + }); - case SyntaxKind.IndexSignature: { - Object.assign(result, { - type: AST_NODE_TYPES.TSIndexSignature, - index: convertChild(node.parameters[0]), - typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null, - readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), - export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined - }); - - const accessibility = nodeUtils.getTSNodeAccessibility(node); - if (accessibility) { - result.accessibility = accessibility; - } + break; - break; - } + case SyntaxKind.FirstNode: { + Object.assign(result, { + type: AST_NODE_TYPES.TSQualifiedName, + left: convertChild(node.left), + right: convertChild(node.right) + }); - case SyntaxKind.ConstructSignature: { - Object.assign(result, { - type: AST_NODE_TYPES.TSConstructSignature, - params: convertParameters(node.parameters), - typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null - }); + break; + } - if (node.typeParameters) { - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } + // TypeScript specific - break; - } + case SyntaxKind.ParenthesizedExpression: + return convert({ node: node.expression, parent, ast, additionalOptions }); - case SyntaxKind.InterfaceDeclaration: { - const interfaceHeritageClauses = node.heritageClauses || []; + /** + * Convert TypeAliasDeclaration node into VariableDeclaration + * to allow core rules such as "semi" to work automatically + */ + case SyntaxKind.TypeAliasDeclaration: { + const typeAliasDeclarator = { + type: AST_NODE_TYPES.VariableDeclarator, + id: convertChild(node.name), + init: convertChild(node.type), + range: [node.name.getStart(), node.end] + }; + + typeAliasDeclarator.loc = nodeUtils.getLocFor( + typeAliasDeclarator.range[0], + typeAliasDeclarator.range[1], + ast + ); + + // Process typeParameters + if (node.typeParameters && node.typeParameters.length) { + typeAliasDeclarator.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } + + Object.assign(result, { + type: AST_NODE_TYPES.VariableDeclaration, + kind: nodeUtils.getDeclarationKind(node), + declarations: [typeAliasDeclarator] + }); + + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + } - let interfaceLastClassToken = interfaceHeritageClauses.length ? interfaceHeritageClauses[interfaceHeritageClauses.length - 1] : node.name; + case SyntaxKind.MethodSignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSMethodSignature, + optional: nodeUtils.isOptional(node), + computed: nodeUtils.isComputedProperty(node.name), + key: convertChild(node.name), + params: convertParameters(node.parameters), + typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, + readonly: + nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), + export: + nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + if (node.typeParameters) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } + + break; + } - if (node.typeParameters && node.typeParameters.length) { - const interfaceLastTypeParameter = node.typeParameters[node.typeParameters.length - 1]; + case SyntaxKind.PropertySignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSPropertySignature, + optional: nodeUtils.isOptional(node) || undefined, + computed: nodeUtils.isComputedProperty(node.name), + key: convertChild(node.name), + typeAnnotation: node.type + ? convertTypeAnnotation(node.type) + : undefined, + initializer: convertChild(node.initializer) || undefined, + readonly: + nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: + nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: + nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + break; + } - if (!interfaceLastClassToken || interfaceLastTypeParameter.pos > interfaceLastClassToken.pos) { - interfaceLastClassToken = nodeUtils.findNextToken(interfaceLastTypeParameter, ast); - } - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters); - } + case SyntaxKind.IndexSignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSIndexSignature, + index: convertChild(node.parameters[0]), + typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, + readonly: + nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), + export: + nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + }); + + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + break; + } - const hasImplementsClause = interfaceHeritageClauses.length > 0; - const hasAbstractKeyword = nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node); - const interfaceOpenBrace = nodeUtils.findNextToken(interfaceLastClassToken, ast); - - const interfaceBody = { - type: AST_NODE_TYPES.TSInterfaceBody, - body: node.members.map(member => convertChild(member)), - range: [interfaceOpenBrace.getStart(), result.range[1]], - loc: nodeUtils.getLocFor(interfaceOpenBrace.getStart(), node.end, ast) - }; - - Object.assign(result, { - abstract: hasAbstractKeyword, - type: AST_NODE_TYPES.TSInterfaceDeclaration, - body: interfaceBody, - id: convertChild(node.name), - heritage: hasImplementsClause ? interfaceHeritageClauses[0].types.map(convertInterfaceHeritageClause) : [] - }); - /** - * Semantically, decorators are not allowed on interface declarations, - * but the TypeScript compiler will parse them and produce a valid AST, - * so we handle them here too. - */ - if (node.decorators) { - result.decorators = convertDecorators(node.decorators); - } - // check for exports - result = nodeUtils.fixExports(node, result, ast); + case SyntaxKind.ConstructSignature: { + Object.assign(result, { + type: AST_NODE_TYPES.TSConstructSignature, + params: convertParameters(node.parameters), + typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null + }); - break; + if (node.typeParameters) { + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } - } + break; + } - case SyntaxKind.FirstTypeNode: - Object.assign(result, { - type: AST_NODE_TYPES.TSTypePredicate, - parameterName: convertChild(node.parameterName), - typeAnnotation: convertTypeAnnotation(node.type) - }); - /** - * Specific fix for type-guard location data - */ - result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; - result.typeAnnotation.range = result.typeAnnotation.typeAnnotation.range; - break; - - case SyntaxKind.ImportType: - Object.assign(result, { - type: AST_NODE_TYPES.TSImportType, - isTypeOf: !!node.isTypeOf, - parameter: convertChild(node.argument), - qualifier: convertChild(node.qualifier), - typeParameters: node.typeArguments ? convertTypeArgumentsToTypeParameters(node.typeArguments) : null - }); - break; - - case SyntaxKind.EnumDeclaration: { - Object.assign(result, { - type: AST_NODE_TYPES.TSEnumDeclaration, - id: convertChild(node.name), - members: node.members.map(convertChild) - }); - // apply modifiers first... - applyModifiersToResult(node.modifiers); - // ...then check for exports - result = nodeUtils.fixExports(node, result, ast); - /** - * Semantically, decorators are not allowed on enum declarations, - * but the TypeScript compiler will parse them and produce a valid AST, - * so we handle them here too. - */ - if (node.decorators) { - result.decorators = convertDecorators(node.decorators); - } - break; + case SyntaxKind.InterfaceDeclaration: { + const interfaceHeritageClauses = node.heritageClauses || []; + + let interfaceLastClassToken = interfaceHeritageClauses.length + ? interfaceHeritageClauses[interfaceHeritageClauses.length - 1] + : node.name; + + if (node.typeParameters && node.typeParameters.length) { + const interfaceLastTypeParameter = + node.typeParameters[node.typeParameters.length - 1]; + + if ( + !interfaceLastClassToken || + interfaceLastTypeParameter.pos > interfaceLastClassToken.pos + ) { + interfaceLastClassToken = nodeUtils.findNextToken( + interfaceLastTypeParameter, + ast + ); } + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters + ); + } + + const hasImplementsClause = interfaceHeritageClauses.length > 0; + const hasAbstractKeyword = nodeUtils.hasModifier( + SyntaxKind.AbstractKeyword, + node + ); + const interfaceOpenBrace = nodeUtils.findNextToken( + interfaceLastClassToken, + ast + ); + + const interfaceBody = { + type: AST_NODE_TYPES.TSInterfaceBody, + body: node.members.map(member => convertChild(member)), + range: [interfaceOpenBrace.getStart(), result.range[1]], + loc: nodeUtils.getLocFor(interfaceOpenBrace.getStart(), node.end, ast) + }; + + Object.assign(result, { + abstract: hasAbstractKeyword, + type: AST_NODE_TYPES.TSInterfaceDeclaration, + body: interfaceBody, + id: convertChild(node.name), + heritage: hasImplementsClause + ? interfaceHeritageClauses[0].types.map( + convertInterfaceHeritageClause + ) + : [] + }); + /** + * Semantically, decorators are not allowed on interface declarations, + * but the TypeScript compiler will parse them and produce a valid AST, + * so we handle them here too. + */ + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + // check for exports + result = nodeUtils.fixExports(node, result, ast); + + break; + } - case SyntaxKind.EnumMember: { - Object.assign(result, { - type: AST_NODE_TYPES.TSEnumMember, - id: convertChild(node.name) - }); - if (node.initializer) { - result.initializer = convertChild(node.initializer); - } - break; - } + case SyntaxKind.FirstTypeNode: + Object.assign(result, { + type: AST_NODE_TYPES.TSTypePredicate, + parameterName: convertChild(node.parameterName), + typeAnnotation: convertTypeAnnotation(node.type) + }); + /** + * Specific fix for type-guard location data + */ + result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; + result.typeAnnotation.range = result.typeAnnotation.typeAnnotation.range; + break; + + case SyntaxKind.ImportType: + Object.assign(result, { + type: AST_NODE_TYPES.TSImportType, + isTypeOf: !!node.isTypeOf, + parameter: convertChild(node.argument), + qualifier: convertChild(node.qualifier), + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : null + }); + break; + + case SyntaxKind.EnumDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.TSEnumDeclaration, + id: convertChild(node.name), + members: node.members.map(convertChild) + }); + // apply modifiers first... + applyModifiersToResult(node.modifiers); + // ...then check for exports + result = nodeUtils.fixExports(node, result, ast); + /** + * Semantically, decorators are not allowed on enum declarations, + * but the TypeScript compiler will parse them and produce a valid AST, + * so we handle them here too. + */ + if (node.decorators) { + result.decorators = convertDecorators(node.decorators); + } + break; + } - case SyntaxKind.AbstractKeyword: { - Object.assign(result, { - type: AST_NODE_TYPES.TSAbstractKeyword - }); - break; - } + case SyntaxKind.EnumMember: { + Object.assign(result, { + type: AST_NODE_TYPES.TSEnumMember, + id: convertChild(node.name) + }); + if (node.initializer) { + result.initializer = convertChild(node.initializer); + } + break; + } - case SyntaxKind.ModuleDeclaration: { - Object.assign(result, { - type: AST_NODE_TYPES.TSModuleDeclaration, - id: convertChild(node.name) - }); - if (node.body) { - result.body = convertChild(node.body); - } - // apply modifiers first... - applyModifiersToResult(node.modifiers); - // ...then check for exports - result = nodeUtils.fixExports(node, result, ast); - break; - } + case SyntaxKind.AbstractKeyword: { + Object.assign(result, { + type: AST_NODE_TYPES.TSAbstractKeyword + }); + break; + } - default: - deeplyCopy(); + case SyntaxKind.ModuleDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.TSModuleDeclaration, + id: convertChild(node.name) + }); + if (node.body) { + result.body = convertChild(node.body); + } + // apply modifiers first... + applyModifiersToResult(node.modifiers); + // ...then check for exports + result = nodeUtils.fixExports(node, result, ast); + break; } - return result; + default: + deeplyCopy(); + } + return result; }; diff --git a/packages/typescript-estree/lib/node-utils.js b/packages/typescript-estree/lib/node-utils.js index 09b8e77e0a60..5f83a67067a2 100644 --- a/packages/typescript-estree/lib/node-utils.js +++ b/packages/typescript-estree/lib/node-utils.js @@ -5,14 +5,14 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const ts = require("typescript"), - unescape = require("lodash.unescape"); +const ts = require('typescript'), + unescape = require('lodash.unescape'); //------------------------------------------------------------------------------ // Private @@ -21,86 +21,86 @@ const ts = require("typescript"), const SyntaxKind = ts.SyntaxKind; const ASSIGNMENT_OPERATORS = [ - SyntaxKind.EqualsToken, - SyntaxKind.PlusEqualsToken, - SyntaxKind.MinusEqualsToken, - SyntaxKind.AsteriskEqualsToken, - SyntaxKind.SlashEqualsToken, - SyntaxKind.PercentEqualsToken, - SyntaxKind.LessThanLessThanEqualsToken, - SyntaxKind.GreaterThanGreaterThanEqualsToken, - SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, - SyntaxKind.AmpersandEqualsToken, - SyntaxKind.BarEqualsToken, - SyntaxKind.CaretEqualsToken + SyntaxKind.EqualsToken, + SyntaxKind.PlusEqualsToken, + SyntaxKind.MinusEqualsToken, + SyntaxKind.AsteriskEqualsToken, + SyntaxKind.SlashEqualsToken, + SyntaxKind.PercentEqualsToken, + SyntaxKind.LessThanLessThanEqualsToken, + SyntaxKind.GreaterThanGreaterThanEqualsToken, + SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, + SyntaxKind.AmpersandEqualsToken, + SyntaxKind.BarEqualsToken, + SyntaxKind.CaretEqualsToken ]; const LOGICAL_OPERATORS = [ - SyntaxKind.BarBarToken, - SyntaxKind.AmpersandAmpersandToken + SyntaxKind.BarBarToken, + SyntaxKind.AmpersandAmpersandToken ]; const TOKEN_TO_TEXT = {}; -TOKEN_TO_TEXT[SyntaxKind.OpenBraceToken] = "{"; -TOKEN_TO_TEXT[SyntaxKind.CloseBraceToken] = "}"; -TOKEN_TO_TEXT[SyntaxKind.OpenParenToken] = "("; -TOKEN_TO_TEXT[SyntaxKind.CloseParenToken] = ")"; -TOKEN_TO_TEXT[SyntaxKind.OpenBracketToken] = "["; -TOKEN_TO_TEXT[SyntaxKind.CloseBracketToken] = "]"; -TOKEN_TO_TEXT[SyntaxKind.DotToken] = "."; -TOKEN_TO_TEXT[SyntaxKind.DotDotDotToken] = "..."; -TOKEN_TO_TEXT[SyntaxKind.SemicolonToken] = ";"; -TOKEN_TO_TEXT[SyntaxKind.CommaToken] = ","; -TOKEN_TO_TEXT[SyntaxKind.LessThanToken] = "<"; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanToken] = ">"; -TOKEN_TO_TEXT[SyntaxKind.LessThanEqualsToken] = "<="; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanEqualsToken] = ">="; -TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsToken] = "=="; -TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsToken] = "!="; -TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsEqualsToken] = "==="; -TOKEN_TO_TEXT[SyntaxKind.InstanceOfKeyword] = "instanceof"; -TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsEqualsToken] = "!=="; -TOKEN_TO_TEXT[SyntaxKind.EqualsGreaterThanToken] = "=>"; -TOKEN_TO_TEXT[SyntaxKind.PlusToken] = "+"; -TOKEN_TO_TEXT[SyntaxKind.MinusToken] = "-"; -TOKEN_TO_TEXT[SyntaxKind.AsteriskToken] = "*"; -TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskToken] = "**"; -TOKEN_TO_TEXT[SyntaxKind.SlashToken] = "/"; -TOKEN_TO_TEXT[SyntaxKind.PercentToken] = "%"; -TOKEN_TO_TEXT[SyntaxKind.PlusPlusToken] = "++"; -TOKEN_TO_TEXT[SyntaxKind.MinusMinusToken] = "--"; -TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanToken] = "<<"; -TOKEN_TO_TEXT[SyntaxKind.LessThanSlashToken] = ">"; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanToken] = ">>>"; -TOKEN_TO_TEXT[SyntaxKind.AmpersandToken] = "&"; -TOKEN_TO_TEXT[SyntaxKind.BarToken] = "|"; -TOKEN_TO_TEXT[SyntaxKind.CaretToken] = "^"; -TOKEN_TO_TEXT[SyntaxKind.ExclamationToken] = "!"; -TOKEN_TO_TEXT[SyntaxKind.TildeToken] = "~"; -TOKEN_TO_TEXT[SyntaxKind.AmpersandAmpersandToken] = "&&"; -TOKEN_TO_TEXT[SyntaxKind.BarBarToken] = "||"; -TOKEN_TO_TEXT[SyntaxKind.QuestionToken] = "?"; -TOKEN_TO_TEXT[SyntaxKind.ColonToken] = ":"; -TOKEN_TO_TEXT[SyntaxKind.EqualsToken] = "="; -TOKEN_TO_TEXT[SyntaxKind.PlusEqualsToken] = "+="; -TOKEN_TO_TEXT[SyntaxKind.MinusEqualsToken] = "-="; -TOKEN_TO_TEXT[SyntaxKind.AsteriskEqualsToken] = "*="; -TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskEqualsToken] = "**="; -TOKEN_TO_TEXT[SyntaxKind.SlashEqualsToken] = "/="; -TOKEN_TO_TEXT[SyntaxKind.PercentEqualsToken] = "%="; -TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanEqualsToken] = "<<="; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanEqualsToken] = ">>="; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken] = ">>>="; -TOKEN_TO_TEXT[SyntaxKind.AmpersandEqualsToken] = "&="; -TOKEN_TO_TEXT[SyntaxKind.BarEqualsToken] = "|="; -TOKEN_TO_TEXT[SyntaxKind.CaretEqualsToken] = "^="; -TOKEN_TO_TEXT[SyntaxKind.AtToken] = "@"; -TOKEN_TO_TEXT[SyntaxKind.InKeyword] = "in"; -TOKEN_TO_TEXT[SyntaxKind.UniqueKeyword] = "unique"; -TOKEN_TO_TEXT[SyntaxKind.KeyOfKeyword] = "keyof"; -TOKEN_TO_TEXT[SyntaxKind.NewKeyword] = "new"; -TOKEN_TO_TEXT[SyntaxKind.ImportKeyword] = "import"; +TOKEN_TO_TEXT[SyntaxKind.OpenBraceToken] = '{'; +TOKEN_TO_TEXT[SyntaxKind.CloseBraceToken] = '}'; +TOKEN_TO_TEXT[SyntaxKind.OpenParenToken] = '('; +TOKEN_TO_TEXT[SyntaxKind.CloseParenToken] = ')'; +TOKEN_TO_TEXT[SyntaxKind.OpenBracketToken] = '['; +TOKEN_TO_TEXT[SyntaxKind.CloseBracketToken] = ']'; +TOKEN_TO_TEXT[SyntaxKind.DotToken] = '.'; +TOKEN_TO_TEXT[SyntaxKind.DotDotDotToken] = '...'; +TOKEN_TO_TEXT[SyntaxKind.SemicolonToken] = ';'; +TOKEN_TO_TEXT[SyntaxKind.CommaToken] = ','; +TOKEN_TO_TEXT[SyntaxKind.LessThanToken] = '<'; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanToken] = '>'; +TOKEN_TO_TEXT[SyntaxKind.LessThanEqualsToken] = '<='; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanEqualsToken] = '>='; +TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsToken] = '=='; +TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsToken] = '!='; +TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsEqualsToken] = '==='; +TOKEN_TO_TEXT[SyntaxKind.InstanceOfKeyword] = 'instanceof'; +TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsEqualsToken] = '!=='; +TOKEN_TO_TEXT[SyntaxKind.EqualsGreaterThanToken] = '=>'; +TOKEN_TO_TEXT[SyntaxKind.PlusToken] = '+'; +TOKEN_TO_TEXT[SyntaxKind.MinusToken] = '-'; +TOKEN_TO_TEXT[SyntaxKind.AsteriskToken] = '*'; +TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskToken] = '**'; +TOKEN_TO_TEXT[SyntaxKind.SlashToken] = '/'; +TOKEN_TO_TEXT[SyntaxKind.PercentToken] = '%'; +TOKEN_TO_TEXT[SyntaxKind.PlusPlusToken] = '++'; +TOKEN_TO_TEXT[SyntaxKind.MinusMinusToken] = '--'; +TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanToken] = '<<'; +TOKEN_TO_TEXT[SyntaxKind.LessThanSlashToken] = '>'; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanToken] = '>>>'; +TOKEN_TO_TEXT[SyntaxKind.AmpersandToken] = '&'; +TOKEN_TO_TEXT[SyntaxKind.BarToken] = '|'; +TOKEN_TO_TEXT[SyntaxKind.CaretToken] = '^'; +TOKEN_TO_TEXT[SyntaxKind.ExclamationToken] = '!'; +TOKEN_TO_TEXT[SyntaxKind.TildeToken] = '~'; +TOKEN_TO_TEXT[SyntaxKind.AmpersandAmpersandToken] = '&&'; +TOKEN_TO_TEXT[SyntaxKind.BarBarToken] = '||'; +TOKEN_TO_TEXT[SyntaxKind.QuestionToken] = '?'; +TOKEN_TO_TEXT[SyntaxKind.ColonToken] = ':'; +TOKEN_TO_TEXT[SyntaxKind.EqualsToken] = '='; +TOKEN_TO_TEXT[SyntaxKind.PlusEqualsToken] = '+='; +TOKEN_TO_TEXT[SyntaxKind.MinusEqualsToken] = '-='; +TOKEN_TO_TEXT[SyntaxKind.AsteriskEqualsToken] = '*='; +TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskEqualsToken] = '**='; +TOKEN_TO_TEXT[SyntaxKind.SlashEqualsToken] = '/='; +TOKEN_TO_TEXT[SyntaxKind.PercentEqualsToken] = '%='; +TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanEqualsToken] = '<<='; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanEqualsToken] = '>>='; +TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken] = '>>>='; +TOKEN_TO_TEXT[SyntaxKind.AmpersandEqualsToken] = '&='; +TOKEN_TO_TEXT[SyntaxKind.BarEqualsToken] = '|='; +TOKEN_TO_TEXT[SyntaxKind.CaretEqualsToken] = '^='; +TOKEN_TO_TEXT[SyntaxKind.AtToken] = '@'; +TOKEN_TO_TEXT[SyntaxKind.InKeyword] = 'in'; +TOKEN_TO_TEXT[SyntaxKind.UniqueKeyword] = 'unique'; +TOKEN_TO_TEXT[SyntaxKind.KeyOfKeyword] = 'keyof'; +TOKEN_TO_TEXT[SyntaxKind.NewKeyword] = 'new'; +TOKEN_TO_TEXT[SyntaxKind.ImportKeyword] = 'import'; /** * Find the first matching child based on the given sourceFile and predicate function. @@ -110,19 +110,19 @@ TOKEN_TO_TEXT[SyntaxKind.ImportKeyword] = "import"; * @returns {TSNode|undefined} a matching child TSNode */ function findFirstMatchingChild(node, sourceFile, predicate) { - const children = node.getChildren(sourceFile); - for (let i = 0; i < children.length; i++) { - const child = children[i]; - if (child && predicate(child)) { - return child; - } - - const grandChild = findFirstMatchingChild(child, sourceFile, predicate); - if (grandChild) { - return grandChild; - } + const children = node.getChildren(sourceFile); + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (child && predicate(child)) { + return child; } - return undefined; + + const grandChild = findFirstMatchingChild(child, sourceFile, predicate); + if (grandChild) { + return grandChild; + } + } + return undefined; } //------------------------------------------------------------------------------ @@ -130,43 +130,43 @@ function findFirstMatchingChild(node, sourceFile, predicate) { //------------------------------------------------------------------------------ module.exports = { - /** - * Expose the enum of possible TSNode `kind`s. - */ - SyntaxKind, - isAssignmentOperator, - isLogicalOperator, - getTextForTokenKind, - isESTreeClassMember, - hasModifier, - isComma, - getBinaryExpressionType, - getLocFor, - getLoc, - isToken, - isJSXToken, - getDeclarationKind, - getTSNodeAccessibility, - hasStaticModifierFlag, - findNextToken, - findFirstMatchingToken, - findChildOfKind, - findFirstMatchingAncestor, - findAncestorOfKind, - hasJSXAncestor, - unescapeStringLiteralText, - isComputedProperty, - isOptional, - fixExports, - getTokenType, - convertToken, - convertTokens, - getNodeContainer, - isWithinTypeAnnotation, - isTypeKeyword, - isComment, - isJSDocComment, - createError + /** + * Expose the enum of possible TSNode `kind`s. + */ + SyntaxKind, + isAssignmentOperator, + isLogicalOperator, + getTextForTokenKind, + isESTreeClassMember, + hasModifier, + isComma, + getBinaryExpressionType, + getLocFor, + getLoc, + isToken, + isJSXToken, + getDeclarationKind, + getTSNodeAccessibility, + hasStaticModifierFlag, + findNextToken, + findFirstMatchingToken, + findChildOfKind, + findFirstMatchingAncestor, + findAncestorOfKind, + hasJSXAncestor, + unescapeStringLiteralText, + isComputedProperty, + isOptional, + fixExports, + getTokenType, + convertToken, + convertTokens, + getNodeContainer, + isWithinTypeAnnotation, + isTypeKeyword, + isComment, + isJSDocComment, + createError }; /** @@ -175,7 +175,7 @@ module.exports = { * @returns {boolean} is assignment */ function isAssignmentOperator(operator) { - return ASSIGNMENT_OPERATORS.indexOf(operator.kind) > -1; + return ASSIGNMENT_OPERATORS.indexOf(operator.kind) > -1; } /** @@ -184,7 +184,7 @@ function isAssignmentOperator(operator) { * @returns {boolean} is a logical operator */ function isLogicalOperator(operator) { - return LOGICAL_OPERATORS.indexOf(operator.kind) > -1; + return LOGICAL_OPERATORS.indexOf(operator.kind) > -1; } /** @@ -193,7 +193,7 @@ function isLogicalOperator(operator) { * @returns {string} the token applicable token as a string */ function getTextForTokenKind(kind) { - return TOKEN_TO_TEXT[kind]; + return TOKEN_TO_TEXT[kind]; } /** @@ -202,7 +202,7 @@ function getTextForTokenKind(kind) { * @returns {boolean} is valid ESTree class member */ function isESTreeClassMember(node) { - return node.kind !== SyntaxKind.SemicolonClassElement; + return node.kind !== SyntaxKind.SemicolonClassElement; } /** @@ -212,7 +212,11 @@ function isESTreeClassMember(node) { * @returns {boolean} has the modifier specified */ function hasModifier(modifierKind, node) { - return !!node.modifiers && !!node.modifiers.length && node.modifiers.some(modifier => modifier.kind === modifierKind); + return ( + !!node.modifiers && + !!node.modifiers.length && + node.modifiers.some(modifier => modifier.kind === modifierKind) + ); } /** @@ -221,7 +225,7 @@ function hasModifier(modifierKind, node) { * @returns {boolean} is comma */ function isComma(token) { - return token.kind === SyntaxKind.CommaToken; + return token.kind === SyntaxKind.CommaToken; } /** @@ -230,7 +234,10 @@ function isComma(token) { * @returns {boolean} is commment */ function isComment(node) { - return node.kind === SyntaxKind.SingleLineCommentTrivia || node.kind === SyntaxKind.MultiLineCommentTrivia; + return ( + node.kind === SyntaxKind.SingleLineCommentTrivia || + node.kind === SyntaxKind.MultiLineCommentTrivia + ); } /** @@ -239,7 +246,7 @@ function isComment(node) { * @returns {boolean} is JSDoc comment */ function isJSDocComment(node) { - return node.kind === SyntaxKind.JSDocComment; + return node.kind === SyntaxKind.JSDocComment; } /** @@ -248,12 +255,12 @@ function isJSDocComment(node) { * @returns {string} the binary expression type */ function getBinaryExpressionType(operator) { - if (isAssignmentOperator(operator)) { - return "AssignmentExpression"; - } else if (isLogicalOperator(operator)) { - return "LogicalExpression"; - } - return "BinaryExpression"; + if (isAssignmentOperator(operator)) { + return 'AssignmentExpression'; + } else if (isLogicalOperator(operator)) { + return 'LogicalExpression'; + } + return 'BinaryExpression'; } /** @@ -265,19 +272,19 @@ function getBinaryExpressionType(operator) { * @returns {Object} the loc data */ function getLocFor(start, end, ast) { - const startLoc = ast.getLineAndCharacterOfPosition(start), - endLoc = ast.getLineAndCharacterOfPosition(end); - - return { - start: { - line: startLoc.line + 1, - column: startLoc.character - }, - end: { - line: endLoc.line + 1, - column: endLoc.character - } - }; + const startLoc = ast.getLineAndCharacterOfPosition(start), + endLoc = ast.getLineAndCharacterOfPosition(end); + + return { + start: { + line: startLoc.line + 1, + column: startLoc.character + }, + end: { + line: endLoc.line + 1, + column: endLoc.character + } + }; } /** @@ -288,7 +295,7 @@ function getLocFor(start, end, ast) { * @returns {Object} the loc data */ function getLoc(nodeOrToken, ast) { - return getLocFor(nodeOrToken.getStart(), nodeOrToken.end, ast); + return getLocFor(nodeOrToken.getStart(), nodeOrToken.end, ast); } /** @@ -297,7 +304,9 @@ function getLoc(nodeOrToken, ast) { * @returns {boolean} is a token */ function isToken(node) { - return node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken; + return ( + node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken + ); } /** @@ -306,10 +315,9 @@ function isToken(node) { * @returns {boolean} is a JSX token */ function isJSXToken(node) { - return ( - node.kind >= SyntaxKind.JsxElement && - node.kind <= SyntaxKind.JsxAttribute - ); + return ( + node.kind >= SyntaxKind.JsxElement && node.kind <= SyntaxKind.JsxAttribute + ); } /** @@ -318,20 +326,20 @@ function isJSXToken(node) { * @returns {boolean} is a type keyword */ function isTypeKeyword(kind) { - switch (kind) { - case SyntaxKind.AnyKeyword: - case SyntaxKind.BooleanKeyword: - case SyntaxKind.NeverKeyword: - case SyntaxKind.NumberKeyword: - case SyntaxKind.ObjectKeyword: - case SyntaxKind.StringKeyword: - case SyntaxKind.SymbolKeyword: - case SyntaxKind.UnknownKeyword: - case SyntaxKind.VoidKeyword: - return true; - default: - return false; - } + switch (kind) { + case SyntaxKind.AnyKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.UnknownKeyword: + case SyntaxKind.VoidKeyword: + return true; + default: + return false; + } } /** @@ -340,20 +348,20 @@ function isTypeKeyword(kind) { * @returns {string} declaration kind */ function getDeclarationKind(node) { - switch (node.kind) { - case SyntaxKind.TypeAliasDeclaration: - return "type"; - case SyntaxKind.VariableDeclarationList: - if (node.flags & ts.NodeFlags.Let) { - return "let"; - } - if (node.flags & ts.NodeFlags.Const) { - return "const"; - } - return "var"; - default: - throw "Unable to determine declaration kind."; - } + switch (node.kind) { + case SyntaxKind.TypeAliasDeclaration: + return 'type'; + case SyntaxKind.VariableDeclarationList: + if (node.flags & ts.NodeFlags.Let) { + return 'let'; + } + if (node.flags & ts.NodeFlags.Const) { + return 'const'; + } + return 'var'; + default: + throw 'Unable to determine declaration kind.'; + } } /** @@ -362,24 +370,24 @@ function getDeclarationKind(node) { * @returns {string | null} accessibility "public", "protected", "private", or null */ function getTSNodeAccessibility(node) { - const modifiers = node.modifiers; - if (!modifiers) { - return null; - } - for (let i = 0; i < modifiers.length; i++) { - const modifier = modifiers[i]; - switch (modifier.kind) { - case SyntaxKind.PublicKeyword: - return "public"; - case SyntaxKind.ProtectedKeyword: - return "protected"; - case SyntaxKind.PrivateKeyword: - return "private"; - default: - continue; - } - } + const modifiers = node.modifiers; + if (!modifiers) { return null; + } + for (let i = 0; i < modifiers.length; i++) { + const modifier = modifiers[i]; + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + return 'public'; + case SyntaxKind.ProtectedKeyword: + return 'protected'; + case SyntaxKind.PrivateKeyword: + return 'private'; + default: + continue; + } + } + return null; } /** @@ -389,10 +397,10 @@ function getTSNodeAccessibility(node) { * @returns {boolean} whether or not the static modifier flag is set */ function hasStaticModifierFlag(node) { - /** - * TODO: Remove dependency on private TypeScript method - */ - return Boolean(ts.getModifierFlags(node) & ts.ModifierFlags.Static); + /** + * TODO: Remove dependency on private TypeScript method + */ + return Boolean(ts.getModifierFlags(node) & ts.ModifierFlags.Static); } /** @@ -402,10 +410,10 @@ function hasStaticModifierFlag(node) { * @returns {TSToken} the next TSToken */ function findNextToken(previousToken, parent) { - /** - * TODO: Remove dependency on private TypeScript method - */ - return ts.findNextToken(previousToken, parent); + /** + * TODO: Remove dependency on private TypeScript method + */ + return ts.findNextToken(previousToken, parent); } /** @@ -416,13 +424,13 @@ function findNextToken(previousToken, parent) { * @returns {TSToken|undefined} a matching TSToken */ function findFirstMatchingToken(previousToken, parent, predicate) { - while (previousToken) { - if (predicate(previousToken)) { - return previousToken; - } - previousToken = findNextToken(previousToken, parent); + while (previousToken) { + if (predicate(previousToken)) { + return previousToken; } - return undefined; + previousToken = findNextToken(previousToken, parent); + } + return undefined; } /** @@ -433,7 +441,7 @@ function findFirstMatchingToken(previousToken, parent, predicate) { * @returns {TSNode|undefined} a matching TSNode */ function findChildOfKind(node, kind, sourceFile) { - return findFirstMatchingChild(node, sourceFile, child => child.kind === kind); + return findFirstMatchingChild(node, sourceFile, child => child.kind === kind); } /** @@ -443,13 +451,13 @@ function findChildOfKind(node, kind, sourceFile) { * @returns {TSNode|undefined} a matching parent TSNode */ function findFirstMatchingAncestor(node, predicate) { - while (node) { - if (predicate(node)) { - return node; - } - node = node.parent; + while (node) { + if (predicate(node)) { + return node; } - return undefined; + node = node.parent; + } + return undefined; } /** @@ -459,17 +467,16 @@ function findFirstMatchingAncestor(node, predicate) { * @returns {TSNode|undefined} a matching parent TSNode */ function findAncestorOfKind(node, kind) { - return findFirstMatchingAncestor(node, parent => parent.kind === kind); + return findFirstMatchingAncestor(node, parent => parent.kind === kind); } - /** * Returns true if a given TSNode has a JSX token within its hierarchy * @param {TSNode} node TSNode to be checked * @returns {boolean} has JSX ancestor */ function hasJSXAncestor(node) { - return !!findFirstMatchingAncestor(node, isJSXToken); + return !!findFirstMatchingAncestor(node, isJSXToken); } /** @@ -478,7 +485,7 @@ function hasJSXAncestor(node) { * @returns {string} The unescaped string literal text. */ function unescapeStringLiteralText(text) { - return unescape(text); + return unescape(text); } /** @@ -487,7 +494,7 @@ function unescapeStringLiteralText(text) { * @returns {boolean} is Computed Property */ function isComputedProperty(node) { - return node.kind === SyntaxKind.ComputedPropertyName; + return node.kind === SyntaxKind.ComputedPropertyName; } /** @@ -496,8 +503,9 @@ function isComputedProperty(node) { * @returns {boolean} is Optional */ function isOptional(node) { - return (node.questionToken) - ? (node.questionToken.kind === SyntaxKind.QuestionToken) : false; + return node.questionToken + ? node.questionToken.kind === SyntaxKind.QuestionToken + : false; } /** @@ -507,7 +515,10 @@ function isOptional(node) { * @returns {boolean} is within "typeAnnotation context" */ function isWithinTypeAnnotation(node) { - return node.parent.type === node || (node.parent.types && node.parent.types.indexOf(node) > -1); + return ( + node.parent.type === node || + (node.parent.types && node.parent.types.indexOf(node) > -1) + ); } /** @@ -518,36 +529,38 @@ function isWithinTypeAnnotation(node) { * @returns {TSNode} the TSNode with fixed exports */ function fixExports(node, result, ast) { - // check for exports - if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) { - const exportKeyword = node.modifiers[0], - nextModifier = node.modifiers[1], - lastModifier = node.modifiers[node.modifiers.length - 1], - declarationIsDefault = nextModifier && (nextModifier.kind === SyntaxKind.DefaultKeyword), - varToken = findNextToken(lastModifier, ast); - - result.range[0] = varToken.getStart(); - result.loc = getLocFor(result.range[0], result.range[1], ast); - - const declarationType = declarationIsDefault ? "ExportDefaultDeclaration" : "ExportNamedDeclaration"; - - const newResult = { - type: declarationType, - declaration: result, - range: [exportKeyword.getStart(), result.range[1]], - loc: getLocFor(exportKeyword.getStart(), result.range[1], ast) - }; - - if (!declarationIsDefault) { - newResult.specifiers = []; - newResult.source = null; - } - - return newResult; + // check for exports + if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) { + const exportKeyword = node.modifiers[0], + nextModifier = node.modifiers[1], + lastModifier = node.modifiers[node.modifiers.length - 1], + declarationIsDefault = + nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword, + varToken = findNextToken(lastModifier, ast); + + result.range[0] = varToken.getStart(); + result.loc = getLocFor(result.range[0], result.range[1], ast); + + const declarationType = declarationIsDefault + ? 'ExportDefaultDeclaration' + : 'ExportNamedDeclaration'; + + const newResult = { + type: declarationType, + declaration: result, + range: [exportKeyword.getStart(), result.range[1]], + loc: getLocFor(exportKeyword.getStart(), result.range[1], ast) + }; + if (!declarationIsDefault) { + newResult.specifiers = []; + newResult.source = null; } - return result; + return newResult; + } + + return result; } /** @@ -556,87 +569,105 @@ function fixExports(node, result, ast) { * @returns {string} the token type */ function getTokenType(token) { - // Need two checks for keywords since some are also identifiers - if (token.originalKeywordKind) { - - switch (token.originalKeywordKind) { - case SyntaxKind.NullKeyword: - return "Null"; - - case SyntaxKind.GetKeyword: - case SyntaxKind.SetKeyword: - case SyntaxKind.TypeKeyword: - case SyntaxKind.ModuleKeyword: - return "Identifier"; - - default: - return "Keyword"; - } - } - - if (token.kind >= SyntaxKind.FirstKeyword && token.kind <= SyntaxKind.LastFutureReservedWord) { - if (token.kind === SyntaxKind.FalseKeyword || token.kind === SyntaxKind.TrueKeyword) { - return "Boolean"; - } - - return "Keyword"; + // Need two checks for keywords since some are also identifiers + if (token.originalKeywordKind) { + switch (token.originalKeywordKind) { + case SyntaxKind.NullKeyword: + return 'Null'; + + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + case SyntaxKind.TypeKeyword: + case SyntaxKind.ModuleKeyword: + return 'Identifier'; + + default: + return 'Keyword'; } - - if (token.kind >= SyntaxKind.FirstPunctuation && token.kind <= SyntaxKind.LastBinaryOperator) { - return "Punctuator"; + } + + if ( + token.kind >= SyntaxKind.FirstKeyword && + token.kind <= SyntaxKind.LastFutureReservedWord + ) { + if ( + token.kind === SyntaxKind.FalseKeyword || + token.kind === SyntaxKind.TrueKeyword + ) { + return 'Boolean'; } - if (token.kind >= SyntaxKind.NoSubstitutionTemplateLiteral && token.kind <= SyntaxKind.TemplateTail) { - return "Template"; + return 'Keyword'; + } + + if ( + token.kind >= SyntaxKind.FirstPunctuation && + token.kind <= SyntaxKind.LastBinaryOperator + ) { + return 'Punctuator'; + } + + if ( + token.kind >= SyntaxKind.NoSubstitutionTemplateLiteral && + token.kind <= SyntaxKind.TemplateTail + ) { + return 'Template'; + } + + switch (token.kind) { + case SyntaxKind.NumericLiteral: + return 'Numeric'; + + case SyntaxKind.JsxText: + return 'JSXText'; + + case SyntaxKind.StringLiteral: + // A TypeScript-StringLiteral token with a TypeScript-JsxAttribute or TypeScript-JsxElement parent, + // must actually be an ESTree-JSXText token + if ( + token.parent && + (token.parent.kind === SyntaxKind.JsxAttribute || + token.parent.kind === SyntaxKind.JsxElement) + ) { + return 'JSXText'; + } + + return 'String'; + + case SyntaxKind.RegularExpressionLiteral: + return 'RegularExpression'; + + case SyntaxKind.Identifier: + case SyntaxKind.ConstructorKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + + // falls through + default: + } + + // Some JSX tokens have to be determined based on their parent + if (token.parent) { + if ( + token.kind === SyntaxKind.Identifier && + token.parent.kind === SyntaxKind.PropertyAccessExpression && + hasJSXAncestor(token) + ) { + return 'JSXIdentifier'; } - switch (token.kind) { - case SyntaxKind.NumericLiteral: - return "Numeric"; - - case SyntaxKind.JsxText: - return "JSXText"; - - case SyntaxKind.StringLiteral: + if (isJSXToken(token.parent)) { + if (token.kind === SyntaxKind.PropertyAccessExpression) { + return 'JSXMemberExpression'; + } - // A TypeScript-StringLiteral token with a TypeScript-JsxAttribute or TypeScript-JsxElement parent, - // must actually be an ESTree-JSXText token - if (token.parent && (token.parent.kind === SyntaxKind.JsxAttribute || token.parent.kind === SyntaxKind.JsxElement)) { - return "JSXText"; - } - - return "String"; - - case SyntaxKind.RegularExpressionLiteral: - return "RegularExpression"; - - case SyntaxKind.Identifier: - case SyntaxKind.ConstructorKeyword: - case SyntaxKind.GetKeyword: - case SyntaxKind.SetKeyword: - - // falls through - default: + if (token.kind === SyntaxKind.Identifier) { + return 'JSXIdentifier'; + } } + } - // Some JSX tokens have to be determined based on their parent - if (token.parent) { - if (token.kind === SyntaxKind.Identifier && token.parent.kind === SyntaxKind.PropertyAccessExpression && hasJSXAncestor(token)) { - return "JSXIdentifier"; - } - - if (isJSXToken(token.parent)) { - if (token.kind === SyntaxKind.PropertyAccessExpression) { - return "JSXMemberExpression"; - } - - if (token.kind === SyntaxKind.Identifier) { - return "JSXIdentifier"; - } - } - } - - return "Identifier"; + return 'Identifier'; } /** @@ -646,24 +677,27 @@ function getTokenType(token) { * @returns {ESTreeToken} the converted ESTreeToken */ function convertToken(token, ast) { - const start = (token.kind === SyntaxKind.JsxText) ? token.getFullStart() : token.getStart(), - end = token.getEnd(), - value = ast.text.slice(start, end), - newToken = { - type: getTokenType(token), - value, - range: [start, end], - loc: getLocFor(start, end, ast) - }; - - if (newToken.type === "RegularExpression") { - newToken.regex = { - pattern: value.slice(1, value.lastIndexOf("/")), - flags: value.slice(value.lastIndexOf("/") + 1) - }; - } + const start = + token.kind === SyntaxKind.JsxText + ? token.getFullStart() + : token.getStart(), + end = token.getEnd(), + value = ast.text.slice(start, end), + newToken = { + type: getTokenType(token), + value, + range: [start, end], + loc: getLocFor(start, end, ast) + }; + + if (newToken.type === 'RegularExpression') { + newToken.regex = { + pattern: value.slice(1, value.lastIndexOf('/')), + flags: value.slice(value.lastIndexOf('/') + 1) + }; + } - return newToken; + return newToken; } /** @@ -672,30 +706,30 @@ function convertToken(token, ast) { * @returns {ESTreeToken[]} the converted ESTreeTokens */ function convertTokens(ast) { - const result = []; - /** - * @param {TSNode} node the TSNode - * @returns {undefined} - */ - function walk(node) { - // TypeScript generates tokens for types in JSDoc blocks. Comment tokens - // and their children should not be walked or added to the resulting tokens list. - if (isComment(node) || isJSDocComment(node)) { - return; - } - - if (isToken(node) && node.kind !== SyntaxKind.EndOfFileToken) { - const converted = convertToken(node, ast); - - if (converted) { - result.push(converted); - } - } else { - node.getChildren().forEach(walk); - } + const result = []; + /** + * @param {TSNode} node the TSNode + * @returns {undefined} + */ + function walk(node) { + // TypeScript generates tokens for types in JSDoc blocks. Comment tokens + // and their children should not be walked or added to the resulting tokens list. + if (isComment(node) || isJSDocComment(node)) { + return; } - walk(ast); - return result; + + if (isToken(node) && node.kind !== SyntaxKind.EndOfFileToken) { + const converted = convertToken(node, ast); + + if (converted) { + result.push(converted); + } + } else { + node.getChildren().forEach(walk); + } + } + walk(ast); + return result; } /** @@ -707,27 +741,27 @@ function convertTokens(ast) { * @private */ function getNodeContainer(ast, start, end) { - let container = null; - - /** - * @param {TSNode} node the TSNode - * @returns {undefined} - */ - function walk(node) { - const nodeStart = node.pos; - const nodeEnd = node.end; - - if (start >= nodeStart && end <= nodeEnd) { - if (isToken(node)) { - container = node; - } else { - node.getChildren().forEach(walk); - } - } + let container = null; + + /** + * @param {TSNode} node the TSNode + * @returns {undefined} + */ + function walk(node) { + const nodeStart = node.pos; + const nodeEnd = node.end; + + if (start >= nodeStart && end <= nodeEnd) { + if (isToken(node)) { + container = node; + } else { + node.getChildren().forEach(walk); + } } - walk(ast); + } + walk(ast); - return container; + return container; } /** @@ -737,11 +771,11 @@ function getNodeContainer(ast, start, end) { * @returns {Object} converted error object */ function createError(ast, start, message) { - const loc = ast.getLineAndCharacterOfPosition(start); - return { - index: start, - lineNumber: loc.line + 1, - column: loc.character, - message - }; + const loc = ast.getLineAndCharacterOfPosition(start); + return { + index: start, + lineNumber: loc.line + 1, + column: loc.character, + message + }; } diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 0e6b4ac22a90..8205fb5662d7 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -28,6 +28,7 @@ "jest": "23.1.0", "lint-staged": "7.3.0", "lodash.isplainobject": "4.0.6", + "prettier": "^1.14.3", "semantic-release": "^15.9.16", "shelljs": "0.8.2", "travis-deploy-once": "^5.0.8", @@ -49,6 +50,7 @@ "precommit": "npm test && lint-staged", "cz": "git-cz", "commitmsg": "commitlint -E GIT_PARAMS", + "check-format": "prettier --list-different \"./**/*.{ts,js,json,md}\"", "semantic-release": "semantic-release", "travis-deploy-once": "travis-deploy-once" }, @@ -59,14 +61,21 @@ "peerDependencies": { "typescript": "*" }, - "lint-staged": {}, + "lint-staged": { + "*.{ts,js,json,md}": [ + "prettier --write", + "git add" + ] + }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } }, "commitlint": { - "extends": ["@commitlint/config-conventional"] + "extends": [ + "@commitlint/config-conventional" + ] }, "jest": { "testEnvironment": "node", diff --git a/packages/typescript-estree/parser.js b/packages/typescript-estree/parser.js index cbab9a789326..033bec8aa30b 100644 --- a/packages/typescript-estree/parser.js +++ b/packages/typescript-estree/parser.js @@ -6,16 +6,20 @@ * MIT License */ -"use strict"; +'use strict'; -const astNodeTypes = require("./lib/ast-node-types"), - ts = require("typescript"), - convert = require("./lib/ast-converter"), - semver = require("semver"); +const astNodeTypes = require('./lib/ast-node-types'), + ts = require('typescript'), + convert = require('./lib/ast-converter'), + semver = require('semver'); -const SUPPORTED_TYPESCRIPT_VERSIONS = require("./package.json").devDependencies.typescript; +const SUPPORTED_TYPESCRIPT_VERSIONS = require('./package.json').devDependencies + .typescript; const ACTIVE_TYPESCRIPT_VERSION = ts.version; -const isRunningSupportedTypeScriptVersion = semver.satisfies(ACTIVE_TYPESCRIPT_VERSION, SUPPORTED_TYPESCRIPT_VERSIONS); +const isRunningSupportedTypeScriptVersion = semver.satisfies( + ACTIVE_TYPESCRIPT_VERSION, + SUPPORTED_TYPESCRIPT_VERSIONS +); let extra; let warnedAboutTSVersion = false; @@ -25,19 +29,19 @@ let warnedAboutTSVersion = false; * @returns {void} */ function resetExtra() { - extra = { - tokens: null, - range: false, - loc: false, - comment: false, - comments: [], - tolerant: false, - errors: [], - strict: false, - ecmaFeatures: {}, - useJSXTextNode: false, - log: console.log - }; + extra = { + tokens: null, + range: false, + loc: false, + comment: false, + comments: [], + tolerant: false, + errors: [], + strict: false, + ecmaFeatures: {}, + useJSXTextNode: false, + log: console.log + }; } //------------------------------------------------------------------------------ @@ -51,131 +55,135 @@ function resetExtra() { * @returns {Object} the AST */ function generateAST(code, options) { - const toString = String; + const toString = String; - if (typeof code !== "string" && !(code instanceof String)) { - code = toString(code); + if (typeof code !== 'string' && !(code instanceof String)) { + code = toString(code); + } + + resetExtra(); + + if (typeof options !== 'undefined') { + extra.range = typeof options.range === 'boolean' && options.range; + extra.loc = typeof options.loc === 'boolean' && options.loc; + + if (extra.loc && options.source !== null && options.source !== undefined) { + extra.source = toString(options.source); } - resetExtra(); - - if (typeof options !== "undefined") { - extra.range = (typeof options.range === "boolean") && options.range; - extra.loc = (typeof options.loc === "boolean") && options.loc; - - if (extra.loc && options.source !== null && options.source !== undefined) { - extra.source = toString(options.source); - } - - if (typeof options.tokens === "boolean" && options.tokens) { - extra.tokens = []; - } - if (typeof options.comment === "boolean" && options.comment) { - extra.comment = true; - extra.comments = []; - } - if (typeof options.tolerant === "boolean" && options.tolerant) { - extra.errors = []; - } - - if (options.ecmaFeatures && typeof options.ecmaFeatures === "object") { - // pass through jsx option - extra.ecmaFeatures.jsx = options.ecmaFeatures.jsx; - } - - /** - * Allow the user to cause the parser to error if it encounters an unknown AST Node Type - * (used in testing). - */ - if (options.errorOnUnknownASTType) { - extra.errorOnUnknownASTType = true; - } - - if (typeof options.useJSXTextNode === "boolean" && options.useJSXTextNode) { - extra.useJSXTextNode = true; - } - - /** - * Allow the user to override the function used for logging - */ - if (typeof options.loggerFn === "function") { - extra.log = options.loggerFn; - } else if (options.loggerFn === false) { - extra.log = Function.prototype; - } + if (typeof options.tokens === 'boolean' && options.tokens) { + extra.tokens = []; + } + if (typeof options.comment === 'boolean' && options.comment) { + extra.comment = true; + extra.comments = []; + } + if (typeof options.tolerant === 'boolean' && options.tolerant) { + extra.errors = []; } - if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { - const border = "============="; - const versionWarning = [ - border, - "WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.", - "You may find that it works just fine, or you may not.", - `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, - `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, - "Please only submit bug reports when using the officially supported version.", - border - ]; - extra.log(versionWarning.join("\n\n")); - warnedAboutTSVersion = true; + if (options.ecmaFeatures && typeof options.ecmaFeatures === 'object') { + // pass through jsx option + extra.ecmaFeatures.jsx = options.ecmaFeatures.jsx; } - // Even if jsx option is set in typescript compiler, filename still has to - // contain .tsx file extension - const FILENAME = (extra.ecmaFeatures.jsx) ? "estree.tsx" : "estree.ts"; - - const compilerHost = { - fileExists() { - return true; - }, - getCanonicalFileName() { - return FILENAME; - }, - getCurrentDirectory() { - return ""; - }, - getDefaultLibFileName() { - return "lib.d.ts"; - }, - - // TODO: Support Windows CRLF - getNewLine() { - return "\n"; - }, - getSourceFile(filename) { - return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true); - }, - readFile() { - return null; - }, - useCaseSensitiveFileNames() { - return true; - }, - writeFile() { - return null; - } - }; - - const program = ts.createProgram([FILENAME], { - noResolve: true, - target: ts.ScriptTarget.Latest, - jsx: extra.ecmaFeatures.jsx ? "preserve" : undefined - }, compilerHost); - - const ast = program.getSourceFile(FILENAME); - - extra.code = code; - return convert(ast, extra); + /** + * Allow the user to cause the parser to error if it encounters an unknown AST Node Type + * (used in testing). + */ + if (options.errorOnUnknownASTType) { + extra.errorOnUnknownASTType = true; + } + + if (typeof options.useJSXTextNode === 'boolean' && options.useJSXTextNode) { + extra.useJSXTextNode = true; + } + + /** + * Allow the user to override the function used for logging + */ + if (typeof options.loggerFn === 'function') { + extra.log = options.loggerFn; + } else if (options.loggerFn === false) { + extra.log = Function.prototype; + } + } + + if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { + const border = '============='; + const versionWarning = [ + border, + 'WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.', + 'You may find that it works just fine, or you may not.', + `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, + `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, + 'Please only submit bug reports when using the officially supported version.', + border + ]; + extra.log(versionWarning.join('\n\n')); + warnedAboutTSVersion = true; + } + + // Even if jsx option is set in typescript compiler, filename still has to + // contain .tsx file extension + const FILENAME = extra.ecmaFeatures.jsx ? 'estree.tsx' : 'estree.ts'; + + const compilerHost = { + fileExists() { + return true; + }, + getCanonicalFileName() { + return FILENAME; + }, + getCurrentDirectory() { + return ''; + }, + getDefaultLibFileName() { + return 'lib.d.ts'; + }, + + // TODO: Support Windows CRLF + getNewLine() { + return '\n'; + }, + getSourceFile(filename) { + return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true); + }, + readFile() { + return null; + }, + useCaseSensitiveFileNames() { + return true; + }, + writeFile() { + return null; + } + }; + + const program = ts.createProgram( + [FILENAME], + { + noResolve: true, + target: ts.ScriptTarget.Latest, + jsx: extra.ecmaFeatures.jsx ? 'preserve' : undefined + }, + compilerHost + ); + + const ast = program.getSourceFile(FILENAME); + + extra.code = code; + return convert(ast, extra); } //------------------------------------------------------------------------------ // Public //------------------------------------------------------------------------------ -exports.version = require("./package.json").version; +exports.version = require('./package.json').version; exports.parse = function parse(code, options) { - return generateAST(code, options); + return generateAST(code, options); }; exports.AST_NODE_TYPES = astNodeTypes; diff --git a/packages/typescript-estree/tests/ast-alignment/.eslintrc.yml b/packages/typescript-estree/tests/ast-alignment/.eslintrc.yml deleted file mode 100644 index e19b2cfa824a..000000000000 --- a/packages/typescript-estree/tests/ast-alignment/.eslintrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -env: - jest: true diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js index 233adc022a10..872a4430ce5a 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js @@ -1,12 +1,14 @@ -"use strict"; +'use strict'; -const path = require("path"); -const glob = require("glob"); +const path = require('path'); +const glob = require('glob'); /** * JSX fixtures which have known issues for typescript-estree */ -const jsxFilesWithKnownIssues = require("../jsx-known-issues").map(f => f.replace("jsx/", "")); +const jsxFilesWithKnownIssues = require('../jsx-known-issues').map(f => + f.replace('jsx/', '') +); /** * Current random error difference on jsx/invalid-no-tag-name.src.js @@ -15,7 +17,7 @@ const jsxFilesWithKnownIssues = require("../jsx-known-issues").map(f => f.replac * * Reported here: https://github.com/babel/babylon/issues/674 */ -jsxFilesWithKnownIssues.push("invalid-no-tag-name"); +jsxFilesWithKnownIssues.push('invalid-no-tag-name'); /** * Custom constructs/concepts used in this file: @@ -46,459 +48,488 @@ let fixturesRequiringSourceTypeModule = []; * @returns {FixturePatternConfig} an object containing the glob pattern and optional additional config */ function createFixturePatternConfigFor(fixturesSubPath, config) { - if (!fixturesSubPath) { - return ""; - } - config = config || {}; - config.ignore = config.ignore || []; - config.fileType = config.fileType || "js"; - config.parseWithSourceTypeModule = config.parseWithSourceTypeModule || []; - /** - * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". - * Babylon does not have an equivalent feature (although perhaps it might come in the future https://github.com/babel/babylon/issues/440), - * so we have to specify the "sourceType" we want to use. - * - * By default we have configured babylon to use "script", but for any fixtures specified in the parseWithSourceTypeModule array we need "module". - * - * First merge the fixtures which need to be parsed with sourceType: "module" into the - * ignore list, and then add their full config into the global array. - */ - if (config.parseWithSourceTypeModule.length) { - config.ignore = [].concat(config.ignore, config.parseWithSourceTypeModule); - fixturesRequiringSourceTypeModule = [].concat(fixturesRequiringSourceTypeModule, config.parseWithSourceTypeModule.map( - fixture => ({ - // It needs to be the full path from within fixtures/ for the pattern - pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, - config: { babylonParserOptions: { sourceType: "module" } } - }) - )); - } - return { - pattern: `${fixturesSubPath}/!(${config.ignore.join("|")}).src.${config.fileType}` - }; + if (!fixturesSubPath) { + return ''; + } + config = config || {}; + config.ignore = config.ignore || []; + config.fileType = config.fileType || 'js'; + config.parseWithSourceTypeModule = config.parseWithSourceTypeModule || []; + /** + * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". + * Babylon does not have an equivalent feature (although perhaps it might come in the future https://github.com/babel/babylon/issues/440), + * so we have to specify the "sourceType" we want to use. + * + * By default we have configured babylon to use "script", but for any fixtures specified in the parseWithSourceTypeModule array we need "module". + * + * First merge the fixtures which need to be parsed with sourceType: "module" into the + * ignore list, and then add their full config into the global array. + */ + if (config.parseWithSourceTypeModule.length) { + config.ignore = [].concat(config.ignore, config.parseWithSourceTypeModule); + fixturesRequiringSourceTypeModule = [].concat( + fixturesRequiringSourceTypeModule, + config.parseWithSourceTypeModule.map(fixture => ({ + // It needs to be the full path from within fixtures/ for the pattern + pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, + config: { babylonParserOptions: { sourceType: 'module' } } + })) + ); + } + return { + pattern: `${fixturesSubPath}/!(${config.ignore.join('|')}).src.${ + config.fileType + }` + }; } /** * An array of FixturePatternConfigs */ let fixturePatternConfigsToTest = [ - createFixturePatternConfigFor("basics"), - - createFixturePatternConfigFor("comments", { - ignore: [ - "export-default-anonymous-class", // needs to be parsed with `sourceType: "module"` - /** - * Template strings seem to also be affected by the difference in opinion between different parsers in: - * https://github.com/babel/babylon/issues/673 - */ - "no-comment-template", // Purely AST diffs - "template-string-block" // Purely AST diffs - ] - }), - - createFixturePatternConfigFor("ecma-features/templateStrings", { - ignore: [ - "**/*" - ] - }), - - createFixturePatternConfigFor("ecma-features/experimentalObjectRestSpread", { - ignore: [ - /** - * Trailing comma is not permitted after a "RestElement" in Babylon - */ - "invalid-rest-trailing-comma" - ] - }), - - createFixturePatternConfigFor("ecma-features/arrowFunctions", { - ignore: [ - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "error-dup-params", // babylon parse errors - "error-dup-params", // babylon parse errors - "error-strict-dup-params", // babylon parse errors - "error-strict-octal", // babylon parse errors - "error-two-lines" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/binaryLiterals"), - createFixturePatternConfigFor("ecma-features/blockBindings"), - - createFixturePatternConfigFor("ecma-features/classes", { - ignore: [ - /** - * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. - */ - "class-one-method-super", // babylon parse errors - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "invalid-class-declaration", // babylon parse errors - "invalid-class-setter-declaration" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/defaultParams"), - - createFixturePatternConfigFor("ecma-features/destructuring", { - ignore: [ - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "invalid-defaults-object-assign" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/destructuring-and-arrowFunctions"), - createFixturePatternConfigFor("ecma-features/destructuring-and-blockBindings"), - createFixturePatternConfigFor("ecma-features/destructuring-and-defaultParams"), - createFixturePatternConfigFor("ecma-features/destructuring-and-forOf"), - - createFixturePatternConfigFor("ecma-features/destructuring-and-spread", { - ignore: [ - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "error-complex-destructured-spread-first" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/experimentalAsyncIteration"), - createFixturePatternConfigFor("ecma-features/experimentalDynamicImport"), - createFixturePatternConfigFor("ecma-features/exponentiationOperators"), - - createFixturePatternConfigFor("ecma-features/forOf", { - ignore: [ - /** - * TypeScript, espree and acorn parse this fine - esprima, flow and babylon do not... - */ - "for-of-with-function-initializer" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/generators"), - createFixturePatternConfigFor("ecma-features/globalReturn"), - - createFixturePatternConfigFor("ecma-features/modules", { - ignore: [ - /** - * TypeScript, flow and babylon parse this fine - esprima, espree and acorn do not... - */ - "invalid-export-default", // typescript-estree parse errors - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "invalid-export-named-default", // babylon parse errors - "invalid-import-default-module-specifier", // babylon parse errors - "invalid-import-module-specifier", // babylon parse errors - /** - * Deleting local variable in strict mode - */ - "error-delete", // babylon parse errors - /** - * 'with' in strict mode - */ - "error-strict" // babylon parse errors - ], - parseWithSourceTypeModule: [ - "export-default-array", - "export-default-class", - "export-default-expression", - "export-default-function", - "export-default-named-class", - "export-default-named-function", - "export-default-number", - "export-default-object", - "export-default-value", - "export-from-batch", - "export-from-default", - "export-from-named-as-default", - "export-from-named-as-specifier", - "export-from-named-as-specifiers", - "export-from-specifier", - "export-from-specifiers", - "export-function", - "export-named-as-default", - "export-named-as-specifier", - "export-named-as-specifiers", - "export-named-class", - "export-named-empty", - "export-named-specifier", - "export-named-specifiers-comma", - "export-named-specifiers", - "export-var-anonymous-function", - "export-var-number", - "export-var", - "import-default-and-named-specifiers", - "import-default-and-namespace-specifiers", - "import-default-as", - "import-default", - "import-jquery", - "import-module", - "import-named-as-specifier", - "import-named-as-specifiers", - "import-named-empty", - "import-named-specifier", - "import-named-specifiers-comma", - "import-named-specifiers", - "import-namespace-specifier", - "import-null-as-nil", - "invalid-await", - "invalid-class" - ] - }), - - createFixturePatternConfigFor("ecma-features/newTarget", { - ignore: [ - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "invalid-new-target", // babylon parse errors - "invalid-unknown-property" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/objectLiteralComputedProperties"), - - createFixturePatternConfigFor("ecma-features/objectLiteralDuplicateProperties", { - ignore: [ - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "error-proto-property", // babylon parse errors - "error-proto-string-property" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/objectLiteralShorthandMethods"), - createFixturePatternConfigFor("ecma-features/objectLiteralShorthandProperties"), - createFixturePatternConfigFor("ecma-features/octalLiterals"), - createFixturePatternConfigFor("ecma-features/regex"), - createFixturePatternConfigFor("ecma-features/regexUFlag"), - createFixturePatternConfigFor("ecma-features/regexYFlag"), - - createFixturePatternConfigFor("ecma-features/restParams", { - ignore: [ - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - "error-no-default", // babylon parse errors - "error-not-last" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("ecma-features/spread"), - createFixturePatternConfigFor("ecma-features/unicodeCodePointEscapes"), - createFixturePatternConfigFor("jsx", { ignore: jsxFilesWithKnownIssues }), - createFixturePatternConfigFor("jsx-useJSXTextNode"), - - /* ================================================== */ - - /** - * TSX-SPECIFIC FILES - */ - - createFixturePatternConfigFor("tsx", { - fileType: "tsx", - ignore: [ - /** - * AST difference - */ - "react-typed-props", - /** - * currently babylon not supported - */ - "generic-jsx-element" - ] - }), - - /* ================================================== */ - - /** - * TYPESCRIPT-SPECIFIC FILES - */ - - createFixturePatternConfigFor("typescript/babylon-convergence", { fileType: "ts" }), - - createFixturePatternConfigFor("typescript/basics", { - fileType: "ts", - ignore: [ - /** - * Other babylon parse errors relating to invalid syntax. - */ - "abstract-class-with-abstract-constructor", // babylon parse errors - "class-with-export-parameter-properties", // babylon parse errors - "class-with-optional-methods", // babylon parse errors - "class-with-static-parameter-properties", // babylon parse errors - "interface-with-all-property-types", // babylon parse errors - "interface-with-construct-signature-with-parameter-accessibility", // babylon parse errors - "class-with-implements-and-extends", // babylon parse errors - "var-with-definite-assignment", // babylon parse errors - "class-with-definite-assignment", // babylon parse errors - /** - * typescript-estree erroring, but babylon not. - */ - "arrow-function-with-type-parameters", // typescript-estree parse errors - /** - * Babylon: ClassDeclaration + abstract: true - * tsep: TSAbstractClassDeclaration - */ - "abstract-class-with-abstract-properties", - /** - * Babylon: ClassProperty + abstract: true - * tsep: TSAbstractClassProperty - */ - "abstract-class-with-abstract-readonly-property", - /** - * Babylon: TSExpressionWithTypeArguments - * tsep: ClassImplements - */ - "class-with-implements-generic-multiple", - "class-with-implements-generic", - "class-with-implements", - "class-with-extends-and-implements", - /** - * Babylon: TSDeclareFunction + declare: true - * tsep: DeclareFunction - */ - "declare-function", - /** - * Babylon: TSTypeReference + identifier - * tsep: TSUnknownKeyword - */ - "unknown-type-annotation", - /** - * Other major AST differences (e.g. fundamentally different node types) - */ - "class-with-mixin", - "function-with-types-assignation", - "interface-extends-multiple", - "interface-extends", - "interface-type-parameters", - "interface-with-extends-type-parameters", - "interface-with-generic", - "interface-with-jsdoc", - "interface-with-optional-properties", - "interface-without-type-annotation", - "type-alias-declaration-with-constrained-type-parameter", - "type-alias-declaration", - "type-alias-object-without-annotation", - "typed-this", - "export-type-function-declaration", - "export-type-class-declaration", - "abstract-interface", - "export-type-alias-declaration", - "unique-symbol", - "keyof-operator", - /** - * tsep bug - Program.body[0].expression.left.properties[0].value.right is currently showing up - * as `ArrayPattern`, babylon, acorn and espree say it should be `ArrayExpression` - * TODO: Fix this - */ - "destructuring-assignment", - /** - * Babylon bug for optional or abstract methods? - */ - "abstract-class-with-abstract-method", // babylon parse errors - "abstract-class-with-optional-method", // babylon parse errors - "declare-class-with-optional-method", // babylon parse errors - /** - * Awaiting feedback on Babylon issue https://github.com/babel/babylon/issues/700 - */ - "class-with-private-parameter-properties", - "class-with-protected-parameter-properties", - "class-with-public-parameter-properties", - "class-with-readonly-parameter-properties", - /** - * Not yet supported in Babylon https://github.com/babel/babel/issues/7749 - */ - "import-type", - "import-type-with-type-parameters-in-type-reference" - ], - parseWithSourceTypeModule: [ - "export-named-enum", - "export-assignment", - "export-default-class-with-generic", - "export-default-class-with-multiple-generics", - "export-named-class-with-generic", - "export-named-class-with-multiple-generics" - ] - }), - - createFixturePatternConfigFor("typescript/decorators/accessor-decorators", { fileType: "ts" }), - createFixturePatternConfigFor("typescript/decorators/class-decorators", { fileType: "ts" }), - createFixturePatternConfigFor("typescript/decorators/method-decorators", { fileType: "ts" }), - createFixturePatternConfigFor("typescript/decorators/parameter-decorators", { fileType: "ts" }), - createFixturePatternConfigFor("typescript/decorators/property-decorators", { fileType: "ts" }), - - createFixturePatternConfigFor("typescript/expressions", { - fileType: "ts", - ignore: [ - /** - * currently babylon not supported - */ - "tagged-template-expression-type-arguments" - ] - }), - - createFixturePatternConfigFor("typescript/errorRecovery", { - fileType: "ts", - ignore: [ - /** - * AST difference - */ - "interface-empty-extends", - /** - * TypeScript-specific tests taken from "errorRecovery". Babylon is not being as forgiving as the TypeScript compiler here. - */ - "class-empty-extends-implements", // babylon parse errors - "class-empty-extends", // babylon parse errors - "decorator-on-enum-declaration", // babylon parse errors - "decorator-on-interface-declaration", // babylon parse errors - "interface-property-modifiers", // babylon parse errors - "enum-with-keywords" // babylon parse errors - ] - }), - - createFixturePatternConfigFor("typescript/namespaces-and-modules", { - fileType: "ts", - ignore: [ - /** - * Minor AST difference - */ - "nested-internal-module", - /** - * Babylon: TSDeclareFunction - * tsep: TSNamespaceFunctionDeclaration - */ - "declare-namespace-with-exported-function" - ] - }) + createFixturePatternConfigFor('basics'), + + createFixturePatternConfigFor('comments', { + ignore: [ + 'export-default-anonymous-class', // needs to be parsed with `sourceType: "module"` + /** + * Template strings seem to also be affected by the difference in opinion between different parsers in: + * https://github.com/babel/babylon/issues/673 + */ + 'no-comment-template', // Purely AST diffs + 'template-string-block' // Purely AST diffs + ] + }), + + createFixturePatternConfigFor('ecma-features/templateStrings', { + ignore: ['**/*'] + }), + + createFixturePatternConfigFor('ecma-features/experimentalObjectRestSpread', { + ignore: [ + /** + * Trailing comma is not permitted after a "RestElement" in Babylon + */ + 'invalid-rest-trailing-comma' + ] + }), + + createFixturePatternConfigFor('ecma-features/arrowFunctions', { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-dup-params', // babylon parse errors + 'error-dup-params', // babylon parse errors + 'error-strict-dup-params', // babylon parse errors + 'error-strict-octal', // babylon parse errors + 'error-two-lines' // babylon parse errors + ] + }), + + createFixturePatternConfigFor('ecma-features/binaryLiterals'), + createFixturePatternConfigFor('ecma-features/blockBindings'), + + createFixturePatternConfigFor('ecma-features/classes', { + ignore: [ + /** + * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. + */ + 'class-one-method-super', // babylon parse errors + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-class-declaration', // babylon parse errors + 'invalid-class-setter-declaration' // babylon parse errors + ] + }), + + createFixturePatternConfigFor('ecma-features/defaultParams'), + + createFixturePatternConfigFor('ecma-features/destructuring', { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-defaults-object-assign' // babylon parse errors + ] + }), + + createFixturePatternConfigFor( + 'ecma-features/destructuring-and-arrowFunctions' + ), + createFixturePatternConfigFor( + 'ecma-features/destructuring-and-blockBindings' + ), + createFixturePatternConfigFor( + 'ecma-features/destructuring-and-defaultParams' + ), + createFixturePatternConfigFor('ecma-features/destructuring-and-forOf'), + + createFixturePatternConfigFor('ecma-features/destructuring-and-spread', { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-complex-destructured-spread-first' // babylon parse errors + ] + }), + + createFixturePatternConfigFor('ecma-features/experimentalAsyncIteration'), + createFixturePatternConfigFor('ecma-features/experimentalDynamicImport'), + createFixturePatternConfigFor('ecma-features/exponentiationOperators'), + + createFixturePatternConfigFor('ecma-features/forOf', { + ignore: [ + /** + * TypeScript, espree and acorn parse this fine - esprima, flow and babylon do not... + */ + 'for-of-with-function-initializer' // babylon parse errors + ] + }), + + createFixturePatternConfigFor('ecma-features/generators'), + createFixturePatternConfigFor('ecma-features/globalReturn'), + + createFixturePatternConfigFor('ecma-features/modules', { + ignore: [ + /** + * TypeScript, flow and babylon parse this fine - esprima, espree and acorn do not... + */ + 'invalid-export-default', // typescript-estree parse errors + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-export-named-default', // babylon parse errors + 'invalid-import-default-module-specifier', // babylon parse errors + 'invalid-import-module-specifier', // babylon parse errors + /** + * Deleting local variable in strict mode + */ + 'error-delete', // babylon parse errors + /** + * 'with' in strict mode + */ + 'error-strict' // babylon parse errors + ], + parseWithSourceTypeModule: [ + 'export-default-array', + 'export-default-class', + 'export-default-expression', + 'export-default-function', + 'export-default-named-class', + 'export-default-named-function', + 'export-default-number', + 'export-default-object', + 'export-default-value', + 'export-from-batch', + 'export-from-default', + 'export-from-named-as-default', + 'export-from-named-as-specifier', + 'export-from-named-as-specifiers', + 'export-from-specifier', + 'export-from-specifiers', + 'export-function', + 'export-named-as-default', + 'export-named-as-specifier', + 'export-named-as-specifiers', + 'export-named-class', + 'export-named-empty', + 'export-named-specifier', + 'export-named-specifiers-comma', + 'export-named-specifiers', + 'export-var-anonymous-function', + 'export-var-number', + 'export-var', + 'import-default-and-named-specifiers', + 'import-default-and-namespace-specifiers', + 'import-default-as', + 'import-default', + 'import-jquery', + 'import-module', + 'import-named-as-specifier', + 'import-named-as-specifiers', + 'import-named-empty', + 'import-named-specifier', + 'import-named-specifiers-comma', + 'import-named-specifiers', + 'import-namespace-specifier', + 'import-null-as-nil', + 'invalid-await', + 'invalid-class' + ] + }), + + createFixturePatternConfigFor('ecma-features/newTarget', { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-new-target', // babylon parse errors + 'invalid-unknown-property' // babylon parse errors + ] + }), + + createFixturePatternConfigFor( + 'ecma-features/objectLiteralComputedProperties' + ), + + createFixturePatternConfigFor( + 'ecma-features/objectLiteralDuplicateProperties', + { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-proto-property', // babylon parse errors + 'error-proto-string-property' // babylon parse errors + ] + } + ), + + createFixturePatternConfigFor('ecma-features/objectLiteralShorthandMethods'), + createFixturePatternConfigFor( + 'ecma-features/objectLiteralShorthandProperties' + ), + createFixturePatternConfigFor('ecma-features/octalLiterals'), + createFixturePatternConfigFor('ecma-features/regex'), + createFixturePatternConfigFor('ecma-features/regexUFlag'), + createFixturePatternConfigFor('ecma-features/regexYFlag'), + + createFixturePatternConfigFor('ecma-features/restParams', { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-no-default', // babylon parse errors + 'error-not-last' // babylon parse errors + ] + }), + + createFixturePatternConfigFor('ecma-features/spread'), + createFixturePatternConfigFor('ecma-features/unicodeCodePointEscapes'), + createFixturePatternConfigFor('jsx', { ignore: jsxFilesWithKnownIssues }), + createFixturePatternConfigFor('jsx-useJSXTextNode'), + + /* ================================================== */ + + /** + * TSX-SPECIFIC FILES + */ + + createFixturePatternConfigFor('tsx', { + fileType: 'tsx', + ignore: [ + /** + * AST difference + */ + 'react-typed-props', + /** + * currently babylon not supported + */ + 'generic-jsx-element' + ] + }), + + /* ================================================== */ + + /** + * TYPESCRIPT-SPECIFIC FILES + */ + + createFixturePatternConfigFor('typescript/babylon-convergence', { + fileType: 'ts' + }), + + createFixturePatternConfigFor('typescript/basics', { + fileType: 'ts', + ignore: [ + /** + * Other babylon parse errors relating to invalid syntax. + */ + 'abstract-class-with-abstract-constructor', // babylon parse errors + 'class-with-export-parameter-properties', // babylon parse errors + 'class-with-optional-methods', // babylon parse errors + 'class-with-static-parameter-properties', // babylon parse errors + 'interface-with-all-property-types', // babylon parse errors + 'interface-with-construct-signature-with-parameter-accessibility', // babylon parse errors + 'class-with-implements-and-extends', // babylon parse errors + 'var-with-definite-assignment', // babylon parse errors + 'class-with-definite-assignment', // babylon parse errors + /** + * typescript-estree erroring, but babylon not. + */ + 'arrow-function-with-type-parameters', // typescript-estree parse errors + /** + * Babylon: ClassDeclaration + abstract: true + * tsep: TSAbstractClassDeclaration + */ + 'abstract-class-with-abstract-properties', + /** + * Babylon: ClassProperty + abstract: true + * tsep: TSAbstractClassProperty + */ + 'abstract-class-with-abstract-readonly-property', + /** + * Babylon: TSExpressionWithTypeArguments + * tsep: ClassImplements + */ + 'class-with-implements-generic-multiple', + 'class-with-implements-generic', + 'class-with-implements', + 'class-with-extends-and-implements', + /** + * Babylon: TSDeclareFunction + declare: true + * tsep: DeclareFunction + */ + 'declare-function', + /** + * Babylon: TSTypeReference + identifier + * tsep: TSUnknownKeyword + */ + 'unknown-type-annotation', + /** + * Other major AST differences (e.g. fundamentally different node types) + */ + 'class-with-mixin', + 'function-with-types-assignation', + 'interface-extends-multiple', + 'interface-extends', + 'interface-type-parameters', + 'interface-with-extends-type-parameters', + 'interface-with-generic', + 'interface-with-jsdoc', + 'interface-with-optional-properties', + 'interface-without-type-annotation', + 'type-alias-declaration-with-constrained-type-parameter', + 'type-alias-declaration', + 'type-alias-object-without-annotation', + 'typed-this', + 'export-type-function-declaration', + 'export-type-class-declaration', + 'abstract-interface', + 'export-type-alias-declaration', + 'unique-symbol', + 'keyof-operator', + /** + * tsep bug - Program.body[0].expression.left.properties[0].value.right is currently showing up + * as `ArrayPattern`, babylon, acorn and espree say it should be `ArrayExpression` + * TODO: Fix this + */ + 'destructuring-assignment', + /** + * Babylon bug for optional or abstract methods? + */ + 'abstract-class-with-abstract-method', // babylon parse errors + 'abstract-class-with-optional-method', // babylon parse errors + 'declare-class-with-optional-method', // babylon parse errors + /** + * Awaiting feedback on Babylon issue https://github.com/babel/babylon/issues/700 + */ + 'class-with-private-parameter-properties', + 'class-with-protected-parameter-properties', + 'class-with-public-parameter-properties', + 'class-with-readonly-parameter-properties', + /** + * Not yet supported in Babylon https://github.com/babel/babel/issues/7749 + */ + 'import-type', + 'import-type-with-type-parameters-in-type-reference' + ], + parseWithSourceTypeModule: [ + 'export-named-enum', + 'export-assignment', + 'export-default-class-with-generic', + 'export-default-class-with-multiple-generics', + 'export-named-class-with-generic', + 'export-named-class-with-multiple-generics' + ] + }), + + createFixturePatternConfigFor('typescript/decorators/accessor-decorators', { + fileType: 'ts' + }), + createFixturePatternConfigFor('typescript/decorators/class-decorators', { + fileType: 'ts' + }), + createFixturePatternConfigFor('typescript/decorators/method-decorators', { + fileType: 'ts' + }), + createFixturePatternConfigFor('typescript/decorators/parameter-decorators', { + fileType: 'ts' + }), + createFixturePatternConfigFor('typescript/decorators/property-decorators', { + fileType: 'ts' + }), + + createFixturePatternConfigFor('typescript/expressions', { + fileType: 'ts', + ignore: [ + /** + * currently babylon not supported + */ + 'tagged-template-expression-type-arguments' + ] + }), + + createFixturePatternConfigFor('typescript/errorRecovery', { + fileType: 'ts', + ignore: [ + /** + * AST difference + */ + 'interface-empty-extends', + /** + * TypeScript-specific tests taken from "errorRecovery". Babylon is not being as forgiving as the TypeScript compiler here. + */ + 'class-empty-extends-implements', // babylon parse errors + 'class-empty-extends', // babylon parse errors + 'decorator-on-enum-declaration', // babylon parse errors + 'decorator-on-interface-declaration', // babylon parse errors + 'interface-property-modifiers', // babylon parse errors + 'enum-with-keywords' // babylon parse errors + ] + }), + + createFixturePatternConfigFor('typescript/namespaces-and-modules', { + fileType: 'ts', + ignore: [ + /** + * Minor AST difference + */ + 'nested-internal-module', + /** + * Babylon: TSDeclareFunction + * tsep: TSNamespaceFunctionDeclaration + */ + 'declare-namespace-with-exported-function' + ] + }) ]; /** * Add in all the fixtures which need to be parsed with sourceType: "module" */ -fixturePatternConfigsToTest = [].concat(fixturePatternConfigsToTest, fixturesRequiringSourceTypeModule); +fixturePatternConfigsToTest = [].concat( + fixturePatternConfigsToTest, + fixturesRequiringSourceTypeModule +); /** * interface Fixture { @@ -507,22 +538,25 @@ fixturePatternConfigsToTest = [].concat(fixturePatternConfigsToTest, fixturesReq * } */ const fixturesToTest = []; -const fixturesDirPath = path.join(__dirname, "../fixtures"); +const fixturesDirPath = path.join(__dirname, '../fixtures'); /** * Resolve the glob patterns into actual Fixture files that we can run assertions for... */ fixturePatternConfigsToTest.forEach(fixturePatternConfig => { - /** - * Find the fixture files which match the given pattern - */ - const matchingFixtures = glob.sync(`${fixturesDirPath}/${fixturePatternConfig.pattern}`, {}); - matchingFixtures.forEach(filename => { - fixturesToTest.push({ - filename, - config: fixturePatternConfig.config - }); + /** + * Find the fixture files which match the given pattern + */ + const matchingFixtures = glob.sync( + `${fixturesDirPath}/${fixturePatternConfig.pattern}`, + {} + ); + matchingFixtures.forEach(filename => { + fixturesToTest.push({ + filename, + config: fixturePatternConfig.config }); + }); }); module.exports = fixturesToTest; diff --git a/packages/typescript-estree/tests/ast-alignment/jest.config.js b/packages/typescript-estree/tests/ast-alignment/jest.config.js index 2a310d0ddf36..b2a29f24a095 100644 --- a/packages/typescript-estree/tests/ast-alignment/jest.config.js +++ b/packages/typescript-estree/tests/ast-alignment/jest.config.js @@ -1,6 +1,6 @@ -"use strict"; +'use strict'; module.exports = { - testEnvironment: "node", - testRegex: "spec\\.js$" + testEnvironment: 'node', + testRegex: 'spec\\.js$' }; diff --git a/packages/typescript-estree/tests/ast-alignment/parse.js b/packages/typescript-estree/tests/ast-alignment/parse.js index 3dc7d7a07627..7ff763932ed1 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.js +++ b/packages/typescript-estree/tests/ast-alignment/parse.js @@ -1,96 +1,108 @@ -"use strict"; +'use strict'; -const codeFrame = require("babel-code-frame"); -const parseUtils = require("./utils"); +const codeFrame = require('babel-code-frame'); +const parseUtils = require('./utils'); function createError(message, line, column) { - // Construct an error similar to the ones thrown by Babylon. - const error = new SyntaxError(`${message} (${line}:${column})`); - error.loc = { - line, - column - }; - return error; + // Construct an error similar to the ones thrown by Babylon. + const error = new SyntaxError(`${message} (${line}:${column})`); + error.loc = { + line, + column + }; + return error; } function parseWithBabylonPluginTypescript(text, parserOptions) { - parserOptions = parserOptions || {}; - const babylon = require("babylon"); - return babylon.parse(text, Object.assign({ - sourceType: "script", + parserOptions = parserOptions || {}; + const babylon = require('babylon'); + return babylon.parse( + text, + Object.assign( + { + sourceType: 'script', allowImportExportEverywhere: true, allowReturnOutsideFunction: true, ranges: true, plugins: [ - "jsx", - "typescript", - "objectRestSpread", - "decorators", - "classProperties", - "asyncGenerators", - "dynamicImport", - "estree" + 'jsx', + 'typescript', + 'objectRestSpread', + 'decorators', + 'classProperties', + 'asyncGenerators', + 'dynamicImport', + 'estree' ] - }, parserOptions)); + }, + parserOptions + ) + ); } function parseWithTypeScriptESTree(text, parserOptions) { - parserOptions = parserOptions || {}; - const parser = require("../../parser"); - try { - return parser.parse(text, Object.assign({ - loc: true, - range: true, - tokens: false, - comment: false, - useJSXTextNode: true, - errorOnUnknownASTType: true, - ecmaFeatures: { - jsx: true - } - }, parserOptions)); - } catch (e) { - throw createError( - e.message, - e.lineNumber, - e.column - ); - } + parserOptions = parserOptions || {}; + const parser = require('../../parser'); + try { + return parser.parse( + text, + Object.assign( + { + loc: true, + range: true, + tokens: false, + comment: false, + useJSXTextNode: true, + errorOnUnknownASTType: true, + ecmaFeatures: { + jsx: true + } + }, + parserOptions + ) + ); + } catch (e) { + throw createError(e.message, e.lineNumber, e.column); + } } module.exports = function parse(text, opts) { + /** + * Always return a consistent interface, there will be times when we expect both + * parsers to fail to parse the invalid source. + */ + const result = { + parseError: null, + ast: null + }; - /** - * Always return a consistent interface, there will be times when we expect both - * parsers to fail to parse the invalid source. - */ - const result = { - parseError: null, - ast: null - }; - - try { - switch (opts.parser) { - case "typescript-estree": - result.ast = parseUtils.normalizeNodeTypes(parseWithTypeScriptESTree(text, opts.typeScriptESTreeOptions)); - break; - case "babylon-plugin-typescript": - result.ast = parseUtils.normalizeNodeTypes(parseWithBabylonPluginTypescript(text, opts.babylonParserOptions)); - break; - default: - throw new Error("Please provide a valid parser: either \"typescript-estree\" or \"babylon-plugin-typescript\""); - } - } catch (error) { - const loc = error.loc; - if (loc) { - error.codeFrame = codeFrame(text, loc.line, loc.column + 1, { - highlightCode: true - }); - error.message += `\n${error.codeFrame}`; - } - result.parseError = error; + try { + switch (opts.parser) { + case 'typescript-estree': + result.ast = parseUtils.normalizeNodeTypes( + parseWithTypeScriptESTree(text, opts.typeScriptESTreeOptions) + ); + break; + case 'babylon-plugin-typescript': + result.ast = parseUtils.normalizeNodeTypes( + parseWithBabylonPluginTypescript(text, opts.babylonParserOptions) + ); + break; + default: + throw new Error( + 'Please provide a valid parser: either "typescript-estree" or "babylon-plugin-typescript"' + ); } + } catch (error) { + const loc = error.loc; + if (loc) { + error.codeFrame = codeFrame(text, loc.line, loc.column + 1, { + highlightCode: true + }); + error.message += `\n${error.codeFrame}`; + } + result.parseError = error; + } - return result; - + return result; }; diff --git a/packages/typescript-estree/tests/ast-alignment/spec.js b/packages/typescript-estree/tests/ast-alignment/spec.js index 562a5a39d175..b78b01714259 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.js +++ b/packages/typescript-estree/tests/ast-alignment/spec.js @@ -1,80 +1,90 @@ -"use strict"; +'use strict'; -const fs = require("fs"); +const fs = require('fs'); -const parse = require("./parse"); -const parseUtils = require("./utils"); -const fixturesToTest = require("./fixtures-to-test"); +const parse = require('./parse'); +const parseUtils = require('./utils'); +const fixturesToTest = require('./fixtures-to-test'); fixturesToTest.forEach(fixture => { + const filename = fixture.filename; + const source = fs.readFileSync(filename, 'utf8').replace(/\r\n/g, '\n'); - const filename = fixture.filename; - const source = fs.readFileSync(filename, "utf8").replace(/\r\n/g, "\n"); + /** + * Parse with typescript-estree + */ + const typeScriptESTreeResult = parse(source, { + parser: 'typescript-estree', + typeScriptESTreeOptions: + fixture.config && fixture.config.typeScriptESTreeOptions + ? fixture.config.typeScriptESTreeOptions + : null + }); - /** - * Parse with typescript-estree - */ - const typeScriptESTreeResult = parse(source, { - parser: "typescript-estree", - typeScriptESTreeOptions: (fixture.config && fixture.config.typeScriptESTreeOptions) ? fixture.config.typeScriptESTreeOptions : null - }); - - /** - * Parse the source with babylon typescript-plugin - */ - const babylonTypeScriptPluginResult = parse(source, { - parser: "babylon-plugin-typescript", - babylonParserOptions: (fixture.config && fixture.config.babylonParserOptions) ? fixture.config.babylonParserOptions : null - }); + /** + * Parse the source with babylon typescript-plugin + */ + const babylonTypeScriptPluginResult = parse(source, { + parser: 'babylon-plugin-typescript', + babylonParserOptions: + fixture.config && fixture.config.babylonParserOptions + ? fixture.config.babylonParserOptions + : null + }); + /** + * If babylon fails to parse the source, ensure that typescript-estree has the same fundamental issue + */ + if (babylonTypeScriptPluginResult.parseError) { /** - * If babylon fails to parse the source, ensure that typescript-estree has the same fundamental issue + * FAIL: babylon errored but typescript-estree did not */ - if (babylonTypeScriptPluginResult.parseError) { - /** - * FAIL: babylon errored but typescript-estree did not - */ - if (!typeScriptESTreeResult.parseError) { - test(`TEST FAIL [BABYLON ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { - expect(typeScriptESTreeResult.parseError).toEqual(babylonTypeScriptPluginResult.parseError); - }); - return; - } - /** - * Both parsers errored - this is OK as long as the errors are of the same "type" - */ - test(`[Both parsers error as expected] - ${filename}`, () => { - expect(babylonTypeScriptPluginResult.parseError.name).toEqual(typeScriptESTreeResult.parseError.name); - }); - return; + if (!typeScriptESTreeResult.parseError) { + test(`TEST FAIL [BABYLON ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { + expect(typeScriptESTreeResult.parseError).toEqual( + babylonTypeScriptPluginResult.parseError + ); + }); + return; } - /** - * FAIL: typescript-estree errored but babylon did not + * Both parsers errored - this is OK as long as the errors are of the same "type" */ - if (typeScriptESTreeResult.parseError) { - test(`TEST FAIL [TSEP ERRORED, BUT BABYLON DID NOT] - ${filename}`, () => { - expect(babylonTypeScriptPluginResult.parseError).toEqual(typeScriptESTreeResult.parseError); - }); - return; - } + test(`[Both parsers error as expected] - ${filename}`, () => { + expect(babylonTypeScriptPluginResult.parseError.name).toEqual( + typeScriptESTreeResult.parseError.name + ); + }); + return; + } - /** - * No errors, assert the two ASTs match - */ - test(`${filename}`, () => { - expect(babylonTypeScriptPluginResult.ast).toBeTruthy(); - expect(typeScriptESTreeResult.ast).toBeTruthy(); - /** - * Perform some extra formatting steps on the babylon AST before comparing - */ - expect( - parseUtils.removeLocationDataFromProgramNode( - parseUtils.preprocessBabylonAST(babylonTypeScriptPluginResult.ast) - ) - ).toEqual( - parseUtils.removeLocationDataFromProgramNode(typeScriptESTreeResult.ast) - ); + /** + * FAIL: typescript-estree errored but babylon did not + */ + if (typeScriptESTreeResult.parseError) { + test(`TEST FAIL [TSEP ERRORED, BUT BABYLON DID NOT] - ${filename}`, () => { + expect(babylonTypeScriptPluginResult.parseError).toEqual( + typeScriptESTreeResult.parseError + ); }); + return; + } + /** + * No errors, assert the two ASTs match + */ + test(`${filename}`, () => { + expect(babylonTypeScriptPluginResult.ast).toBeTruthy(); + expect(typeScriptESTreeResult.ast).toBeTruthy(); + /** + * Perform some extra formatting steps on the babylon AST before comparing + */ + expect( + parseUtils.removeLocationDataFromProgramNode( + parseUtils.preprocessBabylonAST(babylonTypeScriptPluginResult.ast) + ) + ).toEqual( + parseUtils.removeLocationDataFromProgramNode(typeScriptESTreeResult.ast) + ); + }); }); diff --git a/packages/typescript-estree/tests/ast-alignment/utils.js b/packages/typescript-estree/tests/ast-alignment/utils.js index 9e6aea5bdc94..bd1acca7fb40 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.js +++ b/packages/typescript-estree/tests/ast-alignment/utils.js @@ -1,6 +1,6 @@ -"use strict"; +'use strict'; -const isPlainObject = require("lodash.isplainobject"); +const isPlainObject = require('lodash.isplainobject'); /** * By default, pretty-format (within Jest matchers) retains the names/types of nodes from the babylon AST, @@ -11,7 +11,7 @@ const isPlainObject = require("lodash.isplainobject"); * @returns {Object} normalized AST */ function normalizeNodeTypes(ast) { - return JSON.parse(JSON.stringify(ast)); + return JSON.parse(JSON.stringify(ast)); } /** @@ -21,58 +21,58 @@ function normalizeNodeTypes(ast) { * @returns {Object} formatted object */ function omitDeep(obj, keysToOmit) { - keysToOmit = keysToOmit || []; - function shouldOmit(keyName, val) { - if (!keysToOmit || !keysToOmit.length) { - return false; - } - for (const keyConfig of keysToOmit) { - if (keyConfig.key !== keyName) { - continue; - } - return keyConfig.predicate(val); - } - return false; + keysToOmit = keysToOmit || []; + function shouldOmit(keyName, val) { + if (!keysToOmit || !keysToOmit.length) { + return false; } + for (const keyConfig of keysToOmit) { + if (keyConfig.key !== keyName) { + continue; + } + return keyConfig.predicate(val); + } + return false; + } - for (const key in obj) { - if (!obj.hasOwnProperty(key)) { - continue; - } - const val = obj[key]; - if (isPlainObject(val)) { - if (shouldOmit(key, val)) { - delete obj[key]; - // re-run with the same arguments - // in case the object has multiple keys to omit - return omitDeep(obj, keysToOmit); - } - omitDeep(val, keysToOmit); - } else if (Array.isArray(val)) { - if (shouldOmit(key, val)) { - delete obj[key]; - // re-run with the same arguments - // in case the object has multiple keys to omit - return omitDeep(obj, keysToOmit); - } - for (const i of val) { - omitDeep(i, keysToOmit); - } - } else if (shouldOmit(key, val)) { - delete obj[key]; - // re-run with the same arguments - // in case the object has multiple keys to omit - return omitDeep(obj, keysToOmit); - } + for (const key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + const val = obj[key]; + if (isPlainObject(val)) { + if (shouldOmit(key, val)) { + delete obj[key]; + // re-run with the same arguments + // in case the object has multiple keys to omit + return omitDeep(obj, keysToOmit); + } + omitDeep(val, keysToOmit); + } else if (Array.isArray(val)) { + if (shouldOmit(key, val)) { + delete obj[key]; + // re-run with the same arguments + // in case the object has multiple keys to omit + return omitDeep(obj, keysToOmit); + } + for (const i of val) { + omitDeep(i, keysToOmit); + } + } else if (shouldOmit(key, val)) { + delete obj[key]; + // re-run with the same arguments + // in case the object has multiple keys to omit + return omitDeep(obj, keysToOmit); } - return obj; + } + return obj; } /** * Common predicates for Babylon AST preprocessing */ const always = () => true; -const ifNumber = (val) => typeof val === "number"; +const ifNumber = val => typeof val === 'number'; /** * - Babylon wraps the "Program" node in an extra "File" node, normalize this for simplicity for now... @@ -83,50 +83,50 @@ const ifNumber = (val) => typeof val === "number"; * @returns {Object} processed babylon AST */ function preprocessBabylonAST(ast) { - return omitDeep(ast.program, [ - { - key: "start", - // only remove the "start" number (not the "start" object within loc) - predicate: ifNumber - }, - { - key: "end", - // only remove the "end" number (not the "end" object within loc) - predicate: ifNumber - }, - { - key: "identifierName", - predicate: always - }, - { - key: "extra", - predicate: always - }, - { - key: "directives", - predicate: always - }, - { - key: "directive", - predicate: always - }, - { - key: "innerComments", - predicate: always - }, - { - key: "leadingComments", - predicate: always - }, - { - key: "trailingComments", - predicate: always - }, - { - key: "guardedHandlers", - predicate: always - } - ]); + return omitDeep(ast.program, [ + { + key: 'start', + // only remove the "start" number (not the "start" object within loc) + predicate: ifNumber + }, + { + key: 'end', + // only remove the "end" number (not the "end" object within loc) + predicate: ifNumber + }, + { + key: 'identifierName', + predicate: always + }, + { + key: 'extra', + predicate: always + }, + { + key: 'directives', + predicate: always + }, + { + key: 'directive', + predicate: always + }, + { + key: 'innerComments', + predicate: always + }, + { + key: 'leadingComments', + predicate: always + }, + { + key: 'trailingComments', + predicate: always + }, + { + key: 'guardedHandlers', + predicate: always + } + ]); } /** @@ -140,13 +140,13 @@ function preprocessBabylonAST(ast) { * @returns {Object} the ast with the location data removed from the Program node */ function removeLocationDataFromProgramNode(ast) { - delete ast.loc; - delete ast.range; - return ast; + delete ast.loc; + delete ast.range; + return ast; } module.exports = { - normalizeNodeTypes, - preprocessBabylonAST, - removeLocationDataFromProgramNode + normalizeNodeTypes, + preprocessBabylonAST, + removeLocationDataFromProgramNode }; diff --git a/packages/typescript-estree/tests/jsx-known-issues.js b/packages/typescript-estree/tests/jsx-known-issues.js index 92cb4d661cc9..42855526a596 100644 --- a/packages/typescript-estree/tests/jsx-known-issues.js +++ b/packages/typescript-estree/tests/jsx-known-issues.js @@ -1,11 +1,11 @@ -"use strict"; +'use strict'; /** * Export the list to allow it to be used within both unit and AST comparison tests */ module.exports = [ - "jsx/embedded-tags", // https://github.com/Microsoft/TypeScript/issues/7410 - "jsx/namespaced-attribute-and-value-inserted", // https://github.com/Microsoft/TypeScript/issues/7411 - "jsx/namespaced-name-and-attribute", // https://github.com/Microsoft/TypeScript/issues/7411 - "jsx/invalid-namespace-value-with-dots" // https://github.com/Microsoft/TypeScript/issues/7411 + 'jsx/embedded-tags', // https://github.com/Microsoft/TypeScript/issues/7410 + 'jsx/namespaced-attribute-and-value-inserted', // https://github.com/Microsoft/TypeScript/issues/7411 + 'jsx/namespaced-name-and-attribute', // https://github.com/Microsoft/TypeScript/issues/7411 + 'jsx/invalid-namespace-value-with-dots' // https://github.com/Microsoft/TypeScript/issues/7411 ]; diff --git a/packages/typescript-estree/tests/lib/.eslintrc.yml b/packages/typescript-estree/tests/lib/.eslintrc.yml deleted file mode 100644 index e19b2cfa824a..000000000000 --- a/packages/typescript-estree/tests/lib/.eslintrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -env: - jest: true diff --git a/packages/typescript-estree/tests/lib/basics.js b/packages/typescript-estree/tests/lib/basics.js index 8a727e8e8b3b..90c6f1e5cea9 100644 --- a/packages/typescript-estree/tests/lib/basics.js +++ b/packages/typescript-estree/tests/lib/basics.js @@ -6,45 +6,49 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const path = require("path"), - shelljs = require("shelljs"), - testUtils = require("../../tools/test-utils"); +const path = require('path'), + shelljs = require('shelljs'), + testUtils = require('../../tools/test-utils'); //------------------------------------------------------------------------------ // Setup //------------------------------------------------------------------------------ -const FIXTURES_DIR = "./tests/fixtures/basics"; +const FIXTURES_DIR = './tests/fixtures/basics'; -const testFiles = shelljs.find(FIXTURES_DIR) - .filter(filename => filename.indexOf(".src.js") > -1) - // strip off ".src.js" - .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); +const testFiles = shelljs + .find(FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.js') > -1) + // strip off ".src.js" + .map(filename => + filename.substring(FIXTURES_DIR.length - 1, filename.length - 7) + ); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -describe("basics", () => { - - testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; - const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); - const config = { - loc: true, - range: true, - tokens: true, - ecmaFeatures: {}, - errorOnUnknownASTType: true - }; - test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); - }); - +describe('basics', () => { + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); + const config = { + loc: true, + range: true, + tokens: true, + ecmaFeatures: {}, + errorOnUnknownASTType: true + }; + test( + `fixtures/${filename}.src`, + testUtils.createSnapshotTestBlock(code, config) + ); + }); }); diff --git a/packages/typescript-estree/tests/lib/comments.js b/packages/typescript-estree/tests/lib/comments.js index ec54992c2b13..85911c6020a5 100644 --- a/packages/typescript-estree/tests/lib/comments.js +++ b/packages/typescript-estree/tests/lib/comments.js @@ -6,45 +6,49 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const path = require("path"), - shelljs = require("shelljs"), - testUtils = require("../../tools/test-utils"); +const path = require('path'), + shelljs = require('shelljs'), + testUtils = require('../../tools/test-utils'); //------------------------------------------------------------------------------ // Setup //------------------------------------------------------------------------------ -const FIXTURES_DIR = "./tests/fixtures/comments"; +const FIXTURES_DIR = './tests/fixtures/comments'; -const testFiles = shelljs.find(FIXTURES_DIR) - .filter(filename => filename.indexOf(".src.js") > -1) - // strip off ".src.js" - .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); +const testFiles = shelljs + .find(FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.js') > -1) + // strip off ".src.js" + .map(filename => + filename.substring(FIXTURES_DIR.length - 1, filename.length - 7) + ); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -describe("Comments", () => { - - testFiles.forEach(filename => { - const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); - const config = { - loc: true, - range: true, - tokens: true, - comment: true, - ecmaFeatures: { - jsx: true - } - }; - test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); - }); - +describe('Comments', () => { + testFiles.forEach(filename => { + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); + const config = { + loc: true, + range: true, + tokens: true, + comment: true, + ecmaFeatures: { + jsx: true + } + }; + test( + `fixtures/${filename}.src`, + testUtils.createSnapshotTestBlock(code, config) + ); + }); }); diff --git a/packages/typescript-estree/tests/lib/ecma-features.js b/packages/typescript-estree/tests/lib/ecma-features.js index 40b619f2e1f9..4da61e11d253 100644 --- a/packages/typescript-estree/tests/lib/ecma-features.js +++ b/packages/typescript-estree/tests/lib/ecma-features.js @@ -6,50 +6,51 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const path = require("path"), - shelljs = require("shelljs"), - testUtils = require("../../tools/test-utils"); +const path = require('path'), + shelljs = require('shelljs'), + testUtils = require('../../tools/test-utils'); //------------------------------------------------------------------------------ // Setup //------------------------------------------------------------------------------ -const FIXTURES_DIR = "./tests/fixtures/ecma-features"; +const FIXTURES_DIR = './tests/fixtures/ecma-features'; -const testFiles = shelljs.find(FIXTURES_DIR) - .filter(filename => filename.indexOf(".src.js") > -1) - // strip off ".src.js" - .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); +const testFiles = shelljs + .find(FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.js') > -1) + // strip off ".src.js" + .map(filename => + filename.substring(FIXTURES_DIR.length - 1, filename.length - 7) + ); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -describe("ecmaFeatures", () => { - - testFiles.forEach(filename => { - - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; - const feature = path.dirname(filename), - code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`), - config = { - loc: true, - range: true, - tokens: true, - ecmaFeatures: {}, - errorOnUnknownASTType: true - }; - - test(`fixtures/${filename}.src`, () => { - config.ecmaFeatures[feature] = true; - testUtils.createSnapshotTestBlock(code, config)(); - }); +describe('ecmaFeatures', () => { + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const feature = path.dirname(filename), + code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`), + config = { + loc: true, + range: true, + tokens: true, + ecmaFeatures: {}, + errorOnUnknownASTType: true + }; + + test(`fixtures/${filename}.src`, () => { + config.ecmaFeatures[feature] = true; + testUtils.createSnapshotTestBlock(code, config)(); }); + }); }); diff --git a/packages/typescript-estree/tests/lib/jsx.js b/packages/typescript-estree/tests/lib/jsx.js index ba1dce33917a..6148cc3abfda 100644 --- a/packages/typescript-estree/tests/lib/jsx.js +++ b/packages/typescript-estree/tests/lib/jsx.js @@ -6,74 +6,83 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const path = require("path"), - shelljs = require("shelljs"), - testUtils = require("../../tools/test-utils"), - filesWithKnownIssues = require("../jsx-known-issues"); +const path = require('path'), + shelljs = require('shelljs'), + testUtils = require('../../tools/test-utils'), + filesWithKnownIssues = require('../jsx-known-issues'); //------------------------------------------------------------------------------ // Setup //------------------------------------------------------------------------------ -const JSX_FIXTURES_DIR = "./tests/fixtures/jsx"; +const JSX_FIXTURES_DIR = './tests/fixtures/jsx'; -const jsxTestFiles = shelljs.find(JSX_FIXTURES_DIR) - .filter(filename => filename.indexOf(".src.js") > -1) - .filter(filename => filesWithKnownIssues.every(fileName => filename.indexOf(fileName) === -1)) - // strip off ".src.js" - .map(filename => filename.substring(JSX_FIXTURES_DIR.length - 1, filename.length - 7)); +const jsxTestFiles = shelljs + .find(JSX_FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.js') > -1) + .filter(filename => + filesWithKnownIssues.every(fileName => filename.indexOf(fileName) === -1) + ) + // strip off ".src.js" + .map(filename => + filename.substring(JSX_FIXTURES_DIR.length - 1, filename.length - 7) + ); -const JSX_JSXTEXT_FIXTURES_DIR = "./tests/fixtures/jsx-useJSXTextNode"; +const JSX_JSXTEXT_FIXTURES_DIR = './tests/fixtures/jsx-useJSXTextNode'; -const jsxTextTestFiles = shelljs.find(JSX_JSXTEXT_FIXTURES_DIR) - .filter(filename => filename.indexOf(".src.js") > -1) - // strip off ".src.js" - .map(filename => filename.substring(JSX_JSXTEXT_FIXTURES_DIR.length - 1, filename.length - 7)); +const jsxTextTestFiles = shelljs + .find(JSX_JSXTEXT_FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.js') > -1) + // strip off ".src.js" + .map(filename => + filename.substring(JSX_JSXTEXT_FIXTURES_DIR.length - 1, filename.length - 7) + ); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -describe("JSX", () => { +describe('JSX', () => { + /** + * Test each fixture file + * @param {string} fixturesDir Fixtures Directory + * @param {boolean} useJSXTextNode Use JSX Text Node + * @returns {void} + */ + function testFixture(fixturesDir, useJSXTextNode) { + return filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat(`${path.resolve(fixturesDir, filename)}.src.js`); - /** - * Test each fixture file - * @param {string} fixturesDir Fixtures Directory - * @param {boolean} useJSXTextNode Use JSX Text Node - * @returns {void} - */ - function testFixture(fixturesDir, useJSXTextNode) { + const config = { + loc: true, + range: true, + tokens: true, + errorOnUnknownASTType: true, + useJSXTextNode, + ecmaFeatures: { + jsx: true + } + }; - return filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; - const code = shelljs.cat(`${path.resolve(fixturesDir, filename)}.src.js`); + test( + `fixtures/${filename}.src`, + testUtils.createSnapshotTestBlock(code, config) + ); + }; + } - const config = { - loc: true, - range: true, - tokens: true, - errorOnUnknownASTType: true, - useJSXTextNode, - ecmaFeatures: { - jsx: true - } - }; - - test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); - }; - } - - describe("useJSXTextNode: false", () => { - jsxTestFiles.forEach(testFixture(JSX_FIXTURES_DIR, false)); - }); - describe("useJSXTextNode: true", () => { - jsxTextTestFiles.forEach(testFixture(JSX_JSXTEXT_FIXTURES_DIR, true)); - }); + describe('useJSXTextNode: false', () => { + jsxTestFiles.forEach(testFixture(JSX_FIXTURES_DIR, false)); + }); + describe('useJSXTextNode: true', () => { + jsxTextTestFiles.forEach(testFixture(JSX_JSXTEXT_FIXTURES_DIR, true)); + }); }); diff --git a/packages/typescript-estree/tests/lib/parse.js b/packages/typescript-estree/tests/lib/parse.js index c84499233819..f9f2ef5ef65a 100644 --- a/packages/typescript-estree/tests/lib/parse.js +++ b/packages/typescript-estree/tests/lib/parse.js @@ -6,59 +6,52 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const parser = require("../../parser"), - testUtils = require("../../tools/test-utils"); +const parser = require('../../parser'), + testUtils = require('../../tools/test-utils'); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -describe("parse()", () => { - - - describe("basic functionality", () => { - - it("should parse an empty string", () => { - expect(parser.parse("").body).toEqual([]); - expect(parser.parse("", {}).body).toEqual([]); - }); - - }); - - describe("modules", () => { - - it("should have correct column number when strict mode error occurs", () => { - try { - parser.parse("function fn(a, a) {\n}", { sourceType: "module" }); - } catch (err) { - expect(err.column).toEqual(16); - } - }); - +describe('parse()', () => { + describe('basic functionality', () => { + it('should parse an empty string', () => { + expect(parser.parse('').body).toEqual([]); + expect(parser.parse('', {}).body).toEqual([]); }); - - describe("general", () => { - - const code = "let foo = bar;"; - const config = { - ecmaFeatures: { - blockBindings: true - }, - comment: true, - tokens: true, - range: true, - loc: true - }; - - test("output tokens, comments, locs, and ranges when called with those options", testUtils.createSnapshotTestBlock(code, config)); - + }); + + describe('modules', () => { + it('should have correct column number when strict mode error occurs', () => { + try { + parser.parse('function fn(a, a) {\n}', { sourceType: 'module' }); + } catch (err) { + expect(err.column).toEqual(16); + } }); - - + }); + + describe('general', () => { + const code = 'let foo = bar;'; + const config = { + ecmaFeatures: { + blockBindings: true + }, + comment: true, + tokens: true, + range: true, + loc: true + }; + + test( + 'output tokens, comments, locs, and ranges when called with those options', + testUtils.createSnapshotTestBlock(code, config) + ); + }); }); diff --git a/packages/typescript-estree/tests/lib/tsx.js b/packages/typescript-estree/tests/lib/tsx.js index a29b57fdb073..cdc16b5c26e4 100644 --- a/packages/typescript-estree/tests/lib/tsx.js +++ b/packages/typescript-estree/tests/lib/tsx.js @@ -5,46 +5,54 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const path = require("path"), - shelljs = require("shelljs"), - testUtils = require("../../tools/test-utils"); +const path = require('path'), + shelljs = require('shelljs'), + testUtils = require('../../tools/test-utils'); //------------------------------------------------------------------------------ // Setup //------------------------------------------------------------------------------ -const TSX_FIXTURES_DIR = "./tests/fixtures/tsx"; +const TSX_FIXTURES_DIR = './tests/fixtures/tsx'; -const testFiles = shelljs.find(TSX_FIXTURES_DIR) - .filter(filename => filename.indexOf(".src.tsx") > -1) - // strip off ".src.tsx" - .map(filename => filename.substring(TSX_FIXTURES_DIR.length - 1, filename.length - 8)); +const testFiles = shelljs + .find(TSX_FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.tsx') > -1) + // strip off ".src.tsx" + .map(filename => + filename.substring(TSX_FIXTURES_DIR.length - 1, filename.length - 8) + ); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -describe("TSX", () => { - testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; - const code = shelljs.cat(`${path.resolve(TSX_FIXTURES_DIR, filename)}.src.tsx`); - const config = { - loc: true, - range: true, - tokens: true, - errorOnUnknownASTType: true, - useJSXTextNode: true, - ecmaFeatures: { - jsx: true - } - }; - test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); - }); +describe('TSX', () => { + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat( + `${path.resolve(TSX_FIXTURES_DIR, filename)}.src.tsx` + ); + const config = { + loc: true, + range: true, + tokens: true, + errorOnUnknownASTType: true, + useJSXTextNode: true, + ecmaFeatures: { + jsx: true + } + }; + test( + `fixtures/${filename}.src`, + testUtils.createSnapshotTestBlock(code, config) + ); + }); }); diff --git a/packages/typescript-estree/tests/lib/typescript.js b/packages/typescript-estree/tests/lib/typescript.js index 8032dac66263..8f8ee640b21a 100644 --- a/packages/typescript-estree/tests/lib/typescript.js +++ b/packages/typescript-estree/tests/lib/typescript.js @@ -6,45 +6,49 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const path = require("path"), - shelljs = require("shelljs"), - testUtils = require("../../tools/test-utils"); +const path = require('path'), + shelljs = require('shelljs'), + testUtils = require('../../tools/test-utils'); //------------------------------------------------------------------------------ // Setup //------------------------------------------------------------------------------ -const FIXTURES_DIR = "./tests/fixtures/typescript"; +const FIXTURES_DIR = './tests/fixtures/typescript'; -const testFiles = shelljs.find(FIXTURES_DIR) - .filter(filename => filename.indexOf(".src.ts") > -1) - // strip off ".src.ts" - .map(filename => filename.substring(FIXTURES_DIR.length - 1, filename.length - 7)); +const testFiles = shelljs + .find(FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.ts') > -1) + // strip off ".src.ts" + .map(filename => + filename.substring(FIXTURES_DIR.length - 1, filename.length - 7) + ); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -describe("typescript", () => { - - testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; - const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.ts`); - const config = { - loc: true, - range: true, - tokens: true, - ecmaFeatures: {}, - errorOnUnknownASTType: true - }; - test(`fixtures/${filename}.src`, testUtils.createSnapshotTestBlock(code, config)); - }); - +describe('typescript', () => { + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.ts`); + const config = { + loc: true, + range: true, + tokens: true, + ecmaFeatures: {}, + errorOnUnknownASTType: true + }; + test( + `fixtures/${filename}.src`, + testUtils.createSnapshotTestBlock(code, config) + ); + }); }); diff --git a/packages/typescript-estree/tools/test-utils.js b/packages/typescript-estree/tools/test-utils.js index 76a7c9ed100b..57fe8c714d4f 100644 --- a/packages/typescript-estree/tools/test-utils.js +++ b/packages/typescript-estree/tools/test-utils.js @@ -6,13 +6,13 @@ * MIT License */ -"use strict"; +'use strict'; //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const parser = require("../parser"); +const parser = require('../parser'); //------------------------------------------------------------------------------ // Private @@ -24,12 +24,14 @@ const parser = require("../parser"); * @returns {Object} copy of the AST object */ function getRaw(ast) { - return JSON.parse(JSON.stringify(ast, (key, value) => { - if ((key === "start" || key === "end") && typeof value === "number") { - return undefined; - } - return value; - })); + return JSON.parse( + JSON.stringify(ast, (key, value) => { + if ((key === 'start' || key === 'end') && typeof value === 'number') { + return undefined; + } + return value; + }) + ); } /** @@ -40,34 +42,32 @@ function getRaw(ast) { * @returns {Function} callback for Jest test() block */ function createSnapshotTestBlock(code, config) { + /** + * @returns {Object} the AST object + */ + function parse() { + const ast = parser.parse(code, config); + return getRaw(ast); + } - /** - * @returns {Object} the AST object - */ - function parse() { - const ast = parser.parse(code, config); - return getRaw(ast); + return () => { + try { + const result = parse(); + expect(result).toMatchSnapshot(); + } catch (e) { + /** + * If we are deliberately throwing because of encountering an unknown + * AST_NODE_TYPE, we rethrow to cause the test to fail + */ + if (e.message.match('Unknown AST_NODE_TYPE')) { + throw new Error(e); + } + expect(parse).toThrowErrorMatchingSnapshot(); } - - return () => { - try { - const result = parse(); - expect(result).toMatchSnapshot(); - } catch (e) { - /** - * If we are deliberately throwing because of encountering an unknown - * AST_NODE_TYPE, we rethrow to cause the test to fail - */ - if (e.message.match("Unknown AST_NODE_TYPE")) { - throw new Error(e); - } - expect(parse).toThrowErrorMatchingSnapshot(); - } - }; - + }; } module.exports = { - getRaw, - createSnapshotTestBlock + getRaw, + createSnapshotTestBlock }; diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index f10a7ad2ee45..0bf58f8db108 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -5396,6 +5396,10 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +prettier@^1.14.3: + version "1.14.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" + pretty-format@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" From 8a053ee645ba3efa350848e5358296d94bd0082f Mon Sep 17 00:00:00 2001 From: evelyn masso Date: Mon, 8 Oct 2018 08:06:58 -0700 Subject: [PATCH 07/84] feat: support TypeScript 3.1 (#14) BREAKING CHANGE: Supported TypeScript version is now 3.1 --- packages/typescript-estree/README.md | 2 +- packages/typescript-estree/package.json | 2 +- packages/typescript-estree/yarn.lock | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index b6babb7f40c6..8b6be62d6992 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -27,7 +27,7 @@ In fact, it is already used within these hyper-popular open-source projects to p We will always endeavor to support the latest stable version of TypeScript. -The version of TypeScript currently supported by this parser is `~3.0.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. +The version of TypeScript currently supported by this parser is `~3.1.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. If you use a non-supported version of TypeScript, the parser will log a warning to the console. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 8205fb5662d7..7bdc8e0b06d7 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -32,7 +32,7 @@ "semantic-release": "^15.9.16", "shelljs": "0.8.2", "travis-deploy-once": "^5.0.8", - "typescript": "~3.0.1" + "typescript": "~3.1.1" }, "keywords": [ "ast", diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 0bf58f8db108..a5729506f423 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -6673,9 +6673,9 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb" +typescript@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.1.tgz#3362ba9dd1e482ebb2355b02dfe8bcd19a2c7c96" uglify-js@^2.6: version "2.8.29" From 7d378b144e07789c768dfc4785ffb0d7a06fde5e Mon Sep 17 00:00:00 2001 From: Will Sabransky Date: Mon, 8 Oct 2018 08:11:58 -0700 Subject: [PATCH 08/84] feat: support shorthand JSX fragments (#15) --- .../typescript-estree/lib/ast-node-types.js | 3 + packages/typescript-estree/lib/convert.js | 21 + .../tests/ast-alignment/fixtures-to-test.js | 6 + ...valid-shorthand-fragment-no-closing.src.js | 1 + .../jsx/shorthand-fragment-with-child.src.js | 1 + .../fixtures/jsx/shorthand-fragment.src.js | 1 + .../tests/lib/__snapshots__/jsx.js.snap | 435 ++++++++++++++++++ 7 files changed, 468 insertions(+) create mode 100644 packages/typescript-estree/tests/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment-with-child.src.js create mode 100644 packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment.src.js diff --git a/packages/typescript-estree/lib/ast-node-types.js b/packages/typescript-estree/lib/ast-node-types.js index 496a31be2b28..162a8958fbb8 100644 --- a/packages/typescript-estree/lib/ast-node-types.js +++ b/packages/typescript-estree/lib/ast-node-types.js @@ -62,13 +62,16 @@ module.exports = { ImportSpecifier: 'ImportSpecifier', JSXAttribute: 'JSXAttribute', JSXClosingElement: 'JSXClosingElement', + JSXClosingFragment: 'JSXClosingFragment', JSXElement: 'JSXElement', JSXEmptyExpression: 'JSXEmptyExpression', JSXExpressionContainer: 'JSXExpressionContainer', + JSXFragment: 'JSXFragment', JSXIdentifier: 'JSXIdentifier', JSXMemberExpression: 'JSXMemberExpression', JSXNamespacedName: 'JSXNamespacedName', JSXOpeningElement: 'JSXOpeningElement', + JSXOpeningFragment: 'JSXOpeningFragment', JSXSpreadAttribute: 'JSXSpreadAttribute', JSXSpreadChild: 'JSXSpreadChild', JSXText: 'JSXText', diff --git a/packages/typescript-estree/lib/convert.js b/packages/typescript-estree/lib/convert.js index f764d9081eda..27d208709c39 100644 --- a/packages/typescript-estree/lib/convert.js +++ b/packages/typescript-estree/lib/convert.js @@ -1976,6 +1976,15 @@ module.exports = function convert(config) { break; + case SyntaxKind.JsxFragment: + Object.assign(result, { + type: AST_NODE_TYPES.JSXFragment, + openingElement: convertChild(node.openingElement), + closingElement: convertChild(node.closingElement), + children: node.children.map(convertChild) + }); + break; + case SyntaxKind.JsxSelfClosingElement: { /** * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, @@ -2015,6 +2024,18 @@ module.exports = function convert(config) { }); break; + case SyntaxKind.JsxOpeningFragment: + Object.assign(result, { + type: AST_NODE_TYPES.JSXOpeningFragment, + selfClosing: false + }); + break; + case SyntaxKind.JsxClosingFragment: + Object.assign(result, { + type: AST_NODE_TYPES.JSXClosingFragment + }); + break; + case SyntaxKind.JsxExpression: { const eloc = ast.getLineAndCharacterOfPosition(result.range[0] + 1); const expression = node.expression diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js index 872a4430ce5a..b649810b815d 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js @@ -19,6 +19,12 @@ const jsxFilesWithKnownIssues = require('../jsx-known-issues').map(f => */ jsxFilesWithKnownIssues.push('invalid-no-tag-name'); +/** + * JSX shorthand fragments are not supported by Babylon + */ +jsxFilesWithKnownIssues.push('shorthand-fragment'); +jsxFilesWithKnownIssues.push('shorthand-fragment-with-child'); + /** * Custom constructs/concepts used in this file: * diff --git a/packages/typescript-estree/tests/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js b/packages/typescript-estree/tests/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js new file mode 100644 index 000000000000..20c0a6617600 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js @@ -0,0 +1 @@ +<>
diff --git a/packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment-with-child.src.js b/packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment-with-child.src.js new file mode 100644 index 000000000000..ac72d178fa84 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment-with-child.src.js @@ -0,0 +1 @@ +<>
diff --git a/packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment.src.js b/packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment.src.js new file mode 100644 index 000000000000..4a80b22beeff --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/jsx/shorthand-fragment.src.js @@ -0,0 +1 @@ +<> diff --git a/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap index 0be9fe0b5b7b..0372f0f62fd3 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap @@ -4311,6 +4311,8 @@ exports[`JSX useJSXTextNode: false fixtures/invalid-no-tag-name.src 1`] = `"Decl exports[`JSX useJSXTextNode: false fixtures/invalid-placeholder-in-closing-tag.src 1`] = `"'>' expected."`; +exports[`JSX useJSXTextNode: false fixtures/invalid-shorthand-fragment-no-closing.src 1`] = `"JSX fragment has no corresponding closing tag."`; + exports[`JSX useJSXTextNode: false fixtures/invalid-trailing-dot-tag-name.src 1`] = `"Identifier expected."`; exports[`JSX useJSXTextNode: false fixtures/invalid-unexpected-comma.src 1`] = `"Identifier expected."`; @@ -6824,6 +6826,439 @@ Object { exports[`JSX useJSXTextNode: false fixtures/self-closing-tag-with-newline.src 1`] = `"Invalid character."`; +exports[`JSX useJSXTextNode: false fixtures/shorthand-fragment.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": null, + "range": Array [ + 0, + 5, + ], + "type": "JSXFragment", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`JSX useJSXTextNode: false fixtures/shorthand-fragment-with-child.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "children": Array [ + Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "div", + "range": Array [ + 3, + 6, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 2, + 9, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 2, + 9, + ], + "type": "JSXElement", + }, + ], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "openingElement": null, + "range": Array [ + 0, + 12, + ], + "type": "JSXFragment", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "type": "JSXIdentifier", + "value": "div", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + exports[`JSX useJSXTextNode: false fixtures/spread-child.src 1`] = ` Object { "body": Array [ From c9c6610132aee3af2ebd19537ac8d8a846ed2a5b Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Mon, 8 Oct 2018 23:17:04 +0800 Subject: [PATCH 09/84] fix(ast): fix wrong node type on literal expressions (#4) BREAKING CHANGE: This changes the AST --- packages/typescript-estree/lib/convert.js | 4 + .../arrayLiteral/array-literal-in-lhs.src.js | 1 + .../object-literal-in-lhs.src.js | 1 + .../lib/__snapshots__/ecma-features.js.snap | 698 ++++++++++++++++++ 4 files changed, 704 insertions(+) create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literal-in-lhs.src.js create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/objectLiteral/object-literal-in-lhs.src.js diff --git a/packages/typescript-estree/lib/convert.js b/packages/typescript-estree/lib/convert.js index 27d208709c39..04eb5296ccbe 100644 --- a/packages/typescript-estree/lib/convert.js +++ b/packages/typescript-estree/lib/convert.js @@ -746,6 +746,8 @@ module.exports = function convert(config) { if (arrayAssignNode) { if (arrayAssignNode.left === node) { arrayIsInAssignment = true; + } else if (node.parent.kind === SyntaxKind.CallExpression) { + arrayIsInAssignment = false; } else { arrayIsInAssignment = nodeUtils.findChildOfKind( @@ -790,6 +792,8 @@ module.exports = function convert(config) { if (objectAssignNode) { if (objectAssignNode.left === node) { objectIsInAssignment = true; + } else if (node.parent.kind === SyntaxKind.CallExpression) { + objectIsInAssignment = false; } else { objectIsInAssignment = nodeUtils.findChildOfKind( diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literal-in-lhs.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literal-in-lhs.src.js new file mode 100644 index 000000000000..b8cd557d4732 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literal-in-lhs.src.js @@ -0,0 +1 @@ +fn([]).x = obj; diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteral/object-literal-in-lhs.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteral/object-literal-in-lhs.src.js new file mode 100644 index 000000000000..a55f0f860c71 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteral/object-literal-in-lhs.src.js @@ -0,0 +1 @@ +fn({}).x = obj; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap index 1b3cad147936..313ee6fa172b 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap @@ -1,5 +1,354 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`ecmaFeatures fixtures/arrayLiteral/array-literal-in-lhs.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "arguments": Array [ + Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "ArrayExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "fn", + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "CallExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 8, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "obj", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`ecmaFeatures fixtures/arrowFunctions/as-param.src 1`] = ` Object { "body": Array [ @@ -89459,6 +89808,355 @@ Object { } `; +exports[`ecmaFeatures fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 3, + 5, + ], + "type": "ObjectExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "fn", + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "CallExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 8, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "obj", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` Object { "body": Array [ From dd25c098ec65f8fc1363ecd718a6e4054ab415ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20D=C3=A1nyi?= Date: Sun, 28 Oct 2018 15:37:23 -0700 Subject: [PATCH 10/84] fix: parse ArrayExpressions correctly (#20) BREAKING CHANGE: This changes the AST --- packages/typescript-estree/lib/convert.js | 13 +- .../array-literals-in-binary-expr.src.js | 1 + .../lib/__snapshots__/ecma-features.js.snap | 204 ++++++++++++++++++ 3 files changed, 213 insertions(+), 5 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literals-in-binary-expr.src.js diff --git a/packages/typescript-estree/lib/convert.js b/packages/typescript-estree/lib/convert.js index 04eb5296ccbe..fc49c3deb6a7 100644 --- a/packages/typescript-estree/lib/convert.js +++ b/packages/typescript-estree/lib/convert.js @@ -744,17 +744,20 @@ module.exports = function convert(config) { let arrayIsInAssignment; if (arrayAssignNode) { - if (arrayAssignNode.left === node) { - arrayIsInAssignment = true; - } else if (node.parent.kind === SyntaxKind.CallExpression) { + if (node.parent.kind === SyntaxKind.CallExpression) { arrayIsInAssignment = false; - } else { + } else if ( + nodeUtils.getBinaryExpressionType(arrayAssignNode.operatorToken) === + AST_NODE_TYPES.AssignmentExpression + ) { arrayIsInAssignment = nodeUtils.findChildOfKind( arrayAssignNode.left, SyntaxKind.ArrayLiteralExpression, ast - ) === node; + ) === node || arrayAssignNode.left === node; + } else { + arrayIsInAssignment = false; } } diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literals-in-binary-expr.src.js b/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literals-in-binary-expr.src.js new file mode 100644 index 000000000000..e0c12c216910 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literals-in-binary-expr.src.js @@ -0,0 +1 @@ +[] + []; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap index 313ee6fa172b..eba134af60cb 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap @@ -349,6 +349,210 @@ Object { } `; +exports[`ecmaFeatures fixtures/arrayLiteral/array-literals-in-binary-expr.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "+", + "range": Array [ + 0, + 7, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 7, + ], + "type": "ArrayExpression", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`ecmaFeatures fixtures/arrowFunctions/as-param.src 1`] = ` Object { "body": Array [ From 991e01767f27a6d5235a732dd3a2f4c0d53146f8 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Tue, 30 Oct 2018 19:59:28 -0500 Subject: [PATCH 11/84] feat: document API and standardize config options (#22) BREAKING CHANGE: ecmaFeatures has been removed --- packages/typescript-estree/README.md | 88 ++- packages/typescript-estree/parser.js | 26 +- .../tests/ast-alignment/parse.js | 4 +- .../lib/__snapshots__/ecma-features.js.snap | 654 +++++++++--------- .../typescript-estree/tests/lib/basics.js | 3 - .../typescript-estree/tests/lib/comments.js | 4 +- .../tests/lib/ecma-features.js | 6 +- packages/typescript-estree/tests/lib/jsx.js | 6 +- packages/typescript-estree/tests/lib/parse.js | 3 - packages/typescript-estree/tests/lib/tsx.js | 6 +- .../typescript-estree/tests/lib/typescript.js | 3 - 11 files changed, 427 insertions(+), 376 deletions(-) diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index 8b6be62d6992..42184b401dcc 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -1,6 +1,6 @@

TypeScript ESTree

-

A parser that converts TypeScript source code into an ESTree-compatible form: https://github.com/estree/estree

+

A parser that converts TypeScript source code into an ESTree-compatible form

Travis @@ -13,9 +13,9 @@
-## Usage +## About -This parser is somewhat generic and robust, it could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatiable AST. +This parser is somewhat generic and robust, and could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatiable AST. In fact, it is already used within these hyper-popular open-source projects to power their TypeScript support: @@ -23,6 +23,88 @@ In fact, it is already used within these hyper-popular open-source projects to p - See [typescript-eslint-parser](https://github.com/eslint/typescript-eslint-parser) for more details - [Prettier](https://prettier.io), an opinionated code formatter +## Installation + +``` +npm install --save typescript-estree +``` + +## API + +### parse(code, options) + +Parses the given string of code with the options provided and returns an ESTree-compatible AST. The options object has the following properties: + +```javascript +{ + // attach range information to each node + range: false, + + // attach line/column location information to each node + loc: false, + + // create a top-level tokens array containing all tokens + tokens: false, + + // create a top-level comments array containing all comments + comment: false, + + // enable parsing JSX. For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html + jsx: false, + + /* + * The JSX AST changed the node type for string literals + * inside a JSX Element from `Literal` to `JSXText`. + * When value is `true`, these nodes will be parsed as type `JSXText`. + * When value is `false`, these nodes will be parsed as type `Literal`. + */ + useJSXTextNode: false, + + // Cause the parser to error if it encounters an unknown AST node type (useful for testing) + errorOnUnknownASTType: false, + + /* + * Allows overriding of function used for logging. + * When value is `false`, no logging will occur. + * When value is not provided, `console.log()` will be used. + */ + loggerFn: undefined +} +``` + +Example usage: + +```javascript +const parser = require('typescript-estree'); +const code = "const hello: string = 'world';"; +const ast = parser.parse(code, { + range: true, + loc: true +}); +``` + +### version + +Exposes the current version of typescript-estree as specified in package.json. + +Example usage: + +```javascript +const parser = require('typescript-estree'); +const version = parser.version; +``` + +### AST_NODE_TYPES + +Exposes an object that contains the AST node types produced by the parser. + +Example usage: + +```javascript +const parser = require('typescript-estree'); +const astNodeTypes = parser.AST_NODE_TYPES; +``` + ## Supported TypeScript Version We will always endeavor to support the latest stable version of TypeScript. diff --git a/packages/typescript-estree/parser.js b/packages/typescript-estree/parser.js index 033bec8aa30b..3268ebc767db 100644 --- a/packages/typescript-estree/parser.js +++ b/packages/typescript-estree/parser.js @@ -35,10 +35,8 @@ function resetExtra() { loc: false, comment: false, comments: [], - tolerant: false, - errors: [], strict: false, - ecmaFeatures: {}, + jsx: false, useJSXTextNode: false, log: console.log }; @@ -67,31 +65,27 @@ function generateAST(code, options) { extra.range = typeof options.range === 'boolean' && options.range; extra.loc = typeof options.loc === 'boolean' && options.loc; - if (extra.loc && options.source !== null && options.source !== undefined) { - extra.source = toString(options.source); - } - if (typeof options.tokens === 'boolean' && options.tokens) { extra.tokens = []; } + if (typeof options.comment === 'boolean' && options.comment) { extra.comment = true; extra.comments = []; } - if (typeof options.tolerant === 'boolean' && options.tolerant) { - extra.errors = []; - } - if (options.ecmaFeatures && typeof options.ecmaFeatures === 'object') { - // pass through jsx option - extra.ecmaFeatures.jsx = options.ecmaFeatures.jsx; + if (typeof options.jsx === 'boolean' && options.jsx) { + extra.jsx = true; } /** * Allow the user to cause the parser to error if it encounters an unknown AST Node Type * (used in testing). */ - if (options.errorOnUnknownASTType) { + if ( + typeof options.errorOnUnknownASTType === 'boolean' && + options.errorOnUnknownASTType + ) { extra.errorOnUnknownASTType = true; } @@ -126,7 +120,7 @@ function generateAST(code, options) { // Even if jsx option is set in typescript compiler, filename still has to // contain .tsx file extension - const FILENAME = extra.ecmaFeatures.jsx ? 'estree.tsx' : 'estree.ts'; + const FILENAME = extra.jsx ? 'estree.tsx' : 'estree.ts'; const compilerHost = { fileExists() { @@ -165,7 +159,7 @@ function generateAST(code, options) { { noResolve: true, target: ts.ScriptTarget.Latest, - jsx: extra.ecmaFeatures.jsx ? 'preserve' : undefined + jsx: extra.jsx ? 'preserve' : undefined }, compilerHost ); diff --git a/packages/typescript-estree/tests/ast-alignment/parse.js b/packages/typescript-estree/tests/ast-alignment/parse.js index 7ff763932ed1..d350cb85095a 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.js +++ b/packages/typescript-estree/tests/ast-alignment/parse.js @@ -54,9 +54,7 @@ function parseWithTypeScriptESTree(text, parserOptions) { comment: false, useJSXTextNode: true, errorOnUnknownASTType: true, - ecmaFeatures: { - jsx: true - } + jsx: true }, parserOptions ) diff --git a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap index eba134af60cb..f696d0d320f1 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ecmaFeatures fixtures/arrayLiteral/array-literal-in-lhs.src 1`] = ` +exports[`ecma-features fixtures/arrayLiteral/array-literal-in-lhs.src 1`] = ` Object { "body": Array [ Object { @@ -349,7 +349,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrayLiteral/array-literals-in-binary-expr.src 1`] = ` +exports[`ecma-features fixtures/arrayLiteral/array-literals-in-binary-expr.src 1`] = ` Object { "body": Array [ Object { @@ -553,7 +553,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/as-param.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/as-param.src 1`] = ` Object { "body": Array [ Object { @@ -834,7 +834,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/as-param-with-params.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/as-param-with-params.src 1`] = ` Object { "body": Array [ Object { @@ -1206,7 +1206,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/basic.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/basic.src 1`] = ` Object { "body": Array [ Object { @@ -1379,7 +1379,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` Object { "body": Array [ Object { @@ -2062,7 +2062,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/block-body.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/block-body.src 1`] = ` Object { "body": Array [ Object { @@ -2326,7 +2326,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/block-body-not-object.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/block-body-not-object.src 1`] = ` Object { "body": Array [ Object { @@ -2643,7 +2643,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-dup-params.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-dup-params.src 1`] = ` Object { "body": Array [ Object { @@ -2907,17 +2907,17 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-missing-paren.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/arrowFunctions/error-missing-paren.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/arrowFunctions/error-not-arrow.src 1`] = `"Expression expected."`; +exports[`ecma-features fixtures/arrowFunctions/error-not-arrow.src 1`] = `"Expression expected."`; -exports[`ecmaFeatures fixtures/arrowFunctions/error-numeric-param.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/arrowFunctions/error-numeric-param.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/arrowFunctions/error-numeric-param-multi.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/arrowFunctions/error-numeric-param-multi.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/arrowFunctions/error-reverse-arrow.src 1`] = `"Expression expected."`; +exports[`ecma-features fixtures/arrowFunctions/error-reverse-arrow.src 1`] = `"Expression expected."`; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-default-param-eval.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-default-param-eval.src 1`] = ` Object { "body": Array [ Object { @@ -3271,7 +3271,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-dup-params.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-dup-params.src 1`] = ` Object { "body": Array [ Object { @@ -3607,7 +3607,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-eval.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-eval.src 1`] = ` Object { "body": Array [ Object { @@ -3943,7 +3943,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-eval-return.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-eval-return.src 1`] = ` Object { "body": Array [ Object { @@ -4207,7 +4207,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-octal.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-octal.src 1`] = ` Object { "body": Array [ Object { @@ -4489,7 +4489,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-arguments.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-param-arguments.src 1`] = ` Object { "body": Array [ Object { @@ -4825,7 +4825,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-eval.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-param-eval.src 1`] = ` Object { "body": Array [ Object { @@ -5161,7 +5161,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-names.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-param-names.src 1`] = ` Object { "body": Array [ Object { @@ -5497,7 +5497,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-no-paren-arguments.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-param-no-paren-arguments.src 1`] = ` Object { "body": Array [ Object { @@ -5743,7 +5743,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-strict-param-no-paren-eval.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-strict-param-no-paren-eval.src 1`] = ` Object { "body": Array [ Object { @@ -5989,7 +5989,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-two-lines.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/error-two-lines.src 1`] = ` Object { "body": Array [ Object { @@ -6254,9 +6254,9 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/error-wrapped-param.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/arrowFunctions/error-wrapped-param.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/arrowFunctions/expression.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/expression.src 1`] = ` Object { "body": Array [ Object { @@ -6465,7 +6465,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/iife.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/iife.src 1`] = ` Object { "body": Array [ Object { @@ -6805,7 +6805,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/multiple-params.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/multiple-params.src 1`] = ` Object { "body": Array [ Object { @@ -7069,7 +7069,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/no-auto-return.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/no-auto-return.src 1`] = ` Object { "body": Array [ Object { @@ -7423,7 +7423,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` Object { "body": Array [ Object { @@ -7597,7 +7597,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/not-strict-eval.src 1`] = ` Object { "body": Array [ Object { @@ -7771,7 +7771,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-eval-params.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/not-strict-eval-params.src 1`] = ` Object { "body": Array [ Object { @@ -8035,7 +8035,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/not-strict-octal.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/not-strict-octal.src 1`] = ` Object { "body": Array [ Object { @@ -8245,7 +8245,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/return-arrow-function.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/return-arrow-function.src 1`] = ` Object { "body": Array [ Object { @@ -8496,7 +8496,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/return-sequence.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/return-sequence.src 1`] = ` Object { "body": Array [ Object { @@ -9071,7 +9071,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/single-param.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/single-param.src 1`] = ` Object { "body": Array [ Object { @@ -9245,7 +9245,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/single-param-parens.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/single-param-parens.src 1`] = ` Object { "body": Array [ Object { @@ -9455,7 +9455,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` +exports[`ecma-features fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` Object { "body": Array [ Object { @@ -9664,9 +9664,9 @@ Object { } `; -exports[`ecmaFeatures fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/binaryLiterals/lowercase.src 1`] = ` +exports[`ecma-features fixtures/binaryLiterals/lowercase.src 1`] = ` Object { "body": Array [ Object { @@ -9763,7 +9763,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/binaryLiterals/uppercase.src 1`] = ` +exports[`ecma-features fixtures/binaryLiterals/uppercase.src 1`] = ` Object { "body": Array [ Object { @@ -9860,7 +9860,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/blockBindings/const.src 1`] = ` +exports[`ecma-features fixtures/blockBindings/const.src 1`] = ` Object { "body": Array [ Object { @@ -10048,7 +10048,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/blockBindings/let.src 1`] = ` +exports[`ecma-features fixtures/blockBindings/let.src 1`] = ` Object { "body": Array [ Object { @@ -10236,7 +10236,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/blockBindings/let-in-switchcase.src 1`] = ` +exports[`ecma-features fixtures/blockBindings/let-in-switchcase.src 1`] = ` Object { "body": Array [ Object { @@ -10716,7 +10716,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-accessor-properties.src 1`] = ` +exports[`ecma-features fixtures/classes/class-accessor-properties.src 1`] = ` Object { "body": Array [ Object { @@ -11330,7 +11330,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-computed-static-method.src 1`] = ` +exports[`ecma-features fixtures/classes/class-computed-static-method.src 1`] = ` Object { "body": Array [ Object { @@ -11757,7 +11757,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-expression.src 1`] = ` +exports[`ecma-features fixtures/classes/class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -11944,7 +11944,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-method-named-prototype.src 1`] = ` +exports[`ecma-features fixtures/classes/class-method-named-prototype.src 1`] = ` Object { "body": Array [ Object { @@ -12299,7 +12299,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-method-named-static.src 1`] = ` +exports[`ecma-features fixtures/classes/class-method-named-static.src 1`] = ` Object { "body": Array [ Object { @@ -12672,7 +12672,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-method-named-with-space.src 1`] = ` +exports[`ecma-features fixtures/classes/class-method-named-with-space.src 1`] = ` Object { "body": Array [ Object { @@ -12992,7 +12992,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-one-method.src 1`] = ` +exports[`ecma-features fixtures/classes/class-one-method.src 1`] = ` Object { "body": Array [ Object { @@ -13347,7 +13347,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-one-method-super.src 1`] = ` +exports[`ecma-features fixtures/classes/class-one-method-super.src 1`] = ` Object { "body": Array [ Object { @@ -13827,7 +13827,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-static-method.src 1`] = ` +exports[`ecma-features fixtures/classes/class-static-method.src 1`] = ` Object { "body": Array [ Object { @@ -14218,7 +14218,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-static-method-named-prototype.src 1`] = ` +exports[`ecma-features fixtures/classes/class-static-method-named-prototype.src 1`] = ` Object { "body": Array [ Object { @@ -14628,7 +14628,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-static-method-named-static.src 1`] = ` +exports[`ecma-features fixtures/classes/class-static-method-named-static.src 1`] = ` Object { "body": Array [ Object { @@ -15019,7 +15019,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` +exports[`ecma-features fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` Object { "body": Array [ Object { @@ -15837,7 +15837,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-two-computed-static-methods.src 1`] = ` +exports[`ecma-features fixtures/classes/class-two-computed-static-methods.src 1`] = ` Object { "body": Array [ Object { @@ -16486,7 +16486,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-two-methods.src 1`] = ` +exports[`ecma-features fixtures/classes/class-two-methods.src 1`] = ` Object { "body": Array [ Object { @@ -17009,7 +17009,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` +exports[`ecma-features fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -17570,7 +17570,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-two-methods-semi.src 1`] = ` +exports[`ecma-features fixtures/classes/class-two-methods-semi.src 1`] = ` Object { "body": Array [ Object { @@ -18111,7 +18111,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-two-methods-three-semi.src 1`] = ` +exports[`ecma-features fixtures/classes/class-two-methods-three-semi.src 1`] = ` Object { "body": Array [ Object { @@ -18688,7 +18688,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-two-methods-two-semi.src 1`] = ` +exports[`ecma-features fixtures/classes/class-two-methods-two-semi.src 1`] = ` Object { "body": Array [ Object { @@ -19247,7 +19247,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` +exports[`ecma-features fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -19806,7 +19806,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-with-constructor.src 1`] = ` +exports[`ecma-features fixtures/classes/class-with-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -20161,7 +20161,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-with-constructor-parameters.src 1`] = ` +exports[`ecma-features fixtures/classes/class-with-constructor-parameters.src 1`] = ` Object { "body": Array [ Object { @@ -20572,7 +20572,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/class-with-constructor-with-space.src 1`] = ` +exports[`ecma-features fixtures/classes/class-with-constructor-with-space.src 1`] = ` Object { "body": Array [ Object { @@ -20927,7 +20927,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/derived-class-assign-to-var.src 1`] = ` +exports[`ecma-features fixtures/classes/derived-class-assign-to-var.src 1`] = ` Object { "body": Array [ Object { @@ -21259,7 +21259,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/derived-class-expression.src 1`] = ` +exports[`ecma-features fixtures/classes/derived-class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -21500,7 +21500,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/empty-class.src 1`] = ` +exports[`ecma-features fixtures/classes/empty-class.src 1`] = ` Object { "body": Array [ Object { @@ -21686,7 +21686,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/empty-class-double-semi.src 1`] = ` +exports[`ecma-features fixtures/classes/empty-class-double-semi.src 1`] = ` Object { "body": Array [ Object { @@ -21872,7 +21872,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/empty-class-semi.src 1`] = ` +exports[`ecma-features fixtures/classes/empty-class-semi.src 1`] = ` Object { "body": Array [ Object { @@ -22076,7 +22076,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/empty-literal-derived-class.src 1`] = ` +exports[`ecma-features fixtures/classes/empty-literal-derived-class.src 1`] = ` Object { "body": Array [ Object { @@ -22316,7 +22316,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/invalid-class-declaration.src 1`] = ` +exports[`ecma-features fixtures/classes/invalid-class-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -22467,7 +22467,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/invalid-class-setter-declaration.src 1`] = ` +exports[`ecma-features fixtures/classes/invalid-class-setter-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -22840,9 +22840,9 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; +exports[`ecma-features fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; -exports[`ecmaFeatures fixtures/classes/named-class-expression.src 1`] = ` +exports[`ecma-features fixtures/classes/named-class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -23064,7 +23064,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/classes/named-derived-class-expression.src 1`] = ` +exports[`ecma-features fixtures/classes/named-derived-class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -23340,7 +23340,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/defaultParams/class-constructor.src 1`] = ` +exports[`ecma-features fixtures/defaultParams/class-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -23769,7 +23769,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/defaultParams/class-method.src 1`] = ` +exports[`ecma-features fixtures/defaultParams/class-method.src 1`] = ` Object { "body": Array [ Object { @@ -24198,7 +24198,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/defaultParams/declaration.src 1`] = ` +exports[`ecma-features fixtures/defaultParams/declaration.src 1`] = ` Object { "body": Array [ Object { @@ -24497,7 +24497,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/defaultParams/expression.src 1`] = ` +exports[`ecma-features fixtures/defaultParams/expression.src 1`] = ` Object { "body": Array [ Object { @@ -24850,7 +24850,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/defaultParams/method.src 1`] = ` +exports[`ecma-features fixtures/defaultParams/method.src 1`] = ` Object { "body": Array [ Object { @@ -25333,7 +25333,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/defaultParams/not-all-params.src 1`] = ` +exports[`ecma-features fixtures/defaultParams/not-all-params.src 1`] = ` Object { "body": Array [ Object { @@ -25832,7 +25832,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/array-member.src 1`] = ` +exports[`ecma-features fixtures/destructuring/array-member.src 1`] = ` Object { "body": Array [ Object { @@ -26128,7 +26128,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/array-to-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/array-to-array.src 1`] = ` Object { "body": Array [ Object { @@ -26514,7 +26514,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/array-var-undefined.src 1`] = ` +exports[`ecma-features fixtures/destructuring/array-var-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -26775,7 +26775,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-constructor-params-array.src 1`] = ` Object { "body": Array [ Object { @@ -27241,7 +27241,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -27851,7 +27851,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -28539,7 +28539,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-constructor-params-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-constructor-params-object.src 1`] = ` Object { "body": Array [ Object { @@ -29083,7 +29083,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-method-params-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-method-params-array.src 1`] = ` Object { "body": Array [ Object { @@ -29549,7 +29549,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -30159,7 +30159,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -30847,7 +30847,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/class-method-params-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/class-method-params-object.src 1`] = ` Object { "body": Array [ Object { @@ -31391,7 +31391,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -31668,7 +31668,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-array-all.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-array-all.src 1`] = ` Object { "body": Array [ Object { @@ -32235,7 +32235,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` Object { "body": Array [ Object { @@ -33013,7 +33013,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-array-multi.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-array-multi.src 1`] = ` Object { "body": Array [ Object { @@ -33436,7 +33436,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-array-nested-all.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-array-nested-all.src 1`] = ` Object { "body": Array [ Object { @@ -33932,7 +33932,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` Object { "body": Array [ Object { @@ -34356,7 +34356,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -34692,7 +34692,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-all.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-all.src 1`] = ` Object { "body": Array [ Object { @@ -35376,7 +35376,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-longform.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-longform.src 1`] = ` Object { "body": Array [ Object { @@ -35766,7 +35766,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-longform-all.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-longform-all.src 1`] = ` Object { "body": Array [ Object { @@ -36558,7 +36558,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` Object { "body": Array [ Object { @@ -37206,7 +37206,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` Object { "body": Array [ Object { @@ -37782,7 +37782,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-multi.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-multi.src 1`] = ` Object { "body": Array [ Object { @@ -38322,7 +38322,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-nested-all.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-nested-all.src 1`] = ` Object { "body": Array [ Object { @@ -38971,7 +38971,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` +exports[`ecma-features fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` Object { "body": Array [ Object { @@ -39548,7 +39548,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/destructured-array-catch.src 1`] = ` +exports[`ecma-features fixtures/destructuring/destructured-array-catch.src 1`] = ` Object { "body": Array [ Object { @@ -40469,7 +40469,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/destructured-object-catch.src 1`] = ` +exports[`ecma-features fixtures/destructuring/destructured-object-catch.src 1`] = ` Object { "body": Array [ Object { @@ -41429,7 +41429,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` +exports[`ecma-features fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` Object { "body": Array [ Object { @@ -41964,7 +41964,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/named-param.src 1`] = ` +exports[`ecma-features fixtures/destructuring/named-param.src 1`] = ` Object { "body": Array [ Object { @@ -42298,7 +42298,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/nested-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/nested-array.src 1`] = ` Object { "body": Array [ Object { @@ -42964,7 +42964,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/nested-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/nested-object.src 1`] = ` Object { "body": Array [ Object { @@ -43932,7 +43932,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/object-var-named.src 1`] = ` +exports[`ecma-features fixtures/destructuring/object-var-named.src 1`] = ` Object { "body": Array [ Object { @@ -44268,7 +44268,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/object-var-undefined.src 1`] = ` +exports[`ecma-features fixtures/destructuring/object-var-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -44568,7 +44568,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/param-defaults-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/param-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -44922,7 +44922,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/param-defaults-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/param-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -45315,7 +45315,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/param-defaults-object-nested.src 1`] = ` +exports[`ecma-features fixtures/destructuring/param-defaults-object-nested.src 1`] = ` Object { "body": Array [ Object { @@ -46038,7 +46038,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/params-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/params-array.src 1`] = ` Object { "body": Array [ Object { @@ -46409,7 +46409,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/params-array-wrapped.src 1`] = ` +exports[`ecma-features fixtures/destructuring/params-array-wrapped.src 1`] = ` Object { "body": Array [ Object { @@ -46816,7 +46816,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/params-multi-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/params-multi-object.src 1`] = ` Object { "body": Array [ Object { @@ -47226,7 +47226,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/params-nested-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/params-nested-array.src 1`] = ` Object { "body": Array [ Object { @@ -47690,7 +47690,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/params-nested-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/params-nested-object.src 1`] = ` Object { "body": Array [ Object { @@ -48341,7 +48341,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/params-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring/params-object.src 1`] = ` Object { "body": Array [ Object { @@ -48790,7 +48790,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/params-object-wrapped.src 1`] = ` +exports[`ecma-features fixtures/destructuring/params-object-wrapped.src 1`] = ` Object { "body": Array [ Object { @@ -49275,7 +49275,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring/sparse-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring/sparse-array.src 1`] = ` Object { "body": Array [ Object { @@ -49571,7 +49571,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` Object { "body": Array [ Object { @@ -49835,7 +49835,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` Object { "body": Array [ Object { @@ -50208,7 +50208,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` Object { "body": Array [ Object { @@ -50734,7 +50734,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` Object { "body": Array [ Object { @@ -51332,7 +51332,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` Object { "body": Array [ Object { @@ -51635,7 +51635,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -51953,7 +51953,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -52310,7 +52310,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` Object { "body": Array [ Object { @@ -53071,7 +53071,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -53332,7 +53332,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -53593,7 +53593,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` Object { "body": Array [ Object { @@ -53929,7 +53929,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -54229,7 +54229,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` Object { "body": Array [ Object { @@ -54565,7 +54565,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -54865,7 +54865,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` Object { "body": Array [ Object { @@ -55309,7 +55309,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` Object { "body": Array [ Object { @@ -55904,7 +55904,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` Object { "body": Array [ Object { @@ -56557,7 +56557,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-forOf/loop.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-forOf/loop.src 1`] = ` Object { "body": Array [ Object { @@ -56834,7 +56834,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -57333,7 +57333,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` Object { "body": Array [ Object { @@ -57754,7 +57754,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` Object { "body": Array [ Object { @@ -58269,7 +58269,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` Object { "body": Array [ Object { @@ -58768,7 +58768,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -59080,7 +59080,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/single-destructured.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/single-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -59338,7 +59338,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -59857,7 +59857,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` Object { "body": Array [ Object { @@ -60298,7 +60298,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -60630,7 +60630,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` +exports[`ecma-features fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -60908,7 +60908,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` +exports[`ecma-features fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` Object { "body": Array [ Object { @@ -61134,7 +61134,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` +exports[`ecma-features fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` Object { "body": Array [ Object { @@ -61633,7 +61633,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` +exports[`ecma-features fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` Object { "body": Array [ Object { @@ -61983,7 +61983,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` Object { "body": Array [ Object { @@ -62393,7 +62393,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` Object { "body": Array [ Object { @@ -62945,7 +62945,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` Object { "body": Array [ Object { @@ -63262,9 +63262,9 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; +exports[`ecma-features fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` Object { "body": Array [ Object { @@ -63746,7 +63746,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` Object { "body": Array [ Object { @@ -64731,7 +64731,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` Object { "body": Array [ Object { @@ -65593,7 +65593,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` Object { "body": Array [ Object { @@ -66226,7 +66226,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` Object { "body": Array [ Object { @@ -66915,7 +66915,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` Object { "body": Array [ Object { @@ -67633,7 +67633,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` Object { "body": Array [ Object { @@ -68423,7 +68423,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` Object { "body": Array [ Object { @@ -68831,7 +68831,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` +exports[`ecma-features fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` Object { "body": Array [ Object { @@ -69581,7 +69581,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` +exports[`ecma-features fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` Object { "body": Array [ Object { @@ -69786,7 +69786,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` +exports[`ecma-features fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` Object { "body": Array [ Object { @@ -70062,7 +70062,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/exponentiationOperators/exponential-operators.src 1`] = ` +exports[`ecma-features fixtures/exponentiationOperators/exponential-operators.src 1`] = ` Object { "body": Array [ Object { @@ -70468,7 +70468,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/forOf/for-of-with-function-initializer.src 1`] = ` +exports[`ecma-features fixtures/forOf/for-of-with-function-initializer.src 1`] = ` Object { "body": Array [ Object { @@ -71183,7 +71183,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` +exports[`ecma-features fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` Object { "body": Array [ Object { @@ -71606,7 +71606,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` +exports[`ecma-features fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` Object { "body": Array [ Object { @@ -71974,7 +71974,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` +exports[`ecma-features fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` Object { "body": Array [ Object { @@ -72342,7 +72342,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` +exports[`ecma-features fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` Object { "body": Array [ Object { @@ -72710,7 +72710,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/anonymous-generator.src 1`] = ` +exports[`ecma-features fixtures/generators/anonymous-generator.src 1`] = ` Object { "body": Array [ Object { @@ -73044,7 +73044,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/async-generator-function.src 1`] = ` +exports[`ecma-features fixtures/generators/async-generator-function.src 1`] = ` Object { "body": Array [ Object { @@ -73270,7 +73270,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/async-generator-method.src 1`] = ` +exports[`ecma-features fixtures/generators/async-generator-method.src 1`] = ` Object { "body": Array [ Object { @@ -73898,7 +73898,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/double-yield.src 1`] = ` +exports[`ecma-features fixtures/generators/double-yield.src 1`] = ` Object { "body": Array [ Object { @@ -74269,7 +74269,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/empty-generator-declaration.src 1`] = ` +exports[`ecma-features fixtures/generators/empty-generator-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -74512,7 +74512,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/generator-declaration.src 1`] = ` +exports[`ecma-features fixtures/generators/generator-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -74863,7 +74863,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/yield-delegation.src 1`] = ` +exports[`ecma-features fixtures/generators/yield-delegation.src 1`] = ` Object { "body": Array [ Object { @@ -75215,7 +75215,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/yield-without-value.src 1`] = ` +exports[`ecma-features fixtures/generators/yield-without-value.src 1`] = ` Object { "body": Array [ Object { @@ -75532,7 +75532,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/yield-without-value-in-call.src 1`] = ` +exports[`ecma-features fixtures/generators/yield-without-value-in-call.src 1`] = ` Object { "body": Array [ Object { @@ -75940,7 +75940,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/generators/yield-without-value-no-semi.src 1`] = ` +exports[`ecma-features fixtures/generators/yield-without-value-no-semi.src 1`] = ` Object { "body": Array [ Object { @@ -76239,7 +76239,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/globalReturn/return-identifier.src 1`] = ` +exports[`ecma-features fixtures/globalReturn/return-identifier.src 1`] = ` Object { "body": Array [ Object { @@ -76353,7 +76353,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/globalReturn/return-no-arg.src 1`] = ` +exports[`ecma-features fixtures/globalReturn/return-no-arg.src 1`] = ` Object { "body": Array [ Object { @@ -76432,7 +76432,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/globalReturn/return-true.src 1`] = ` +exports[`ecma-features fixtures/globalReturn/return-true.src 1`] = ` Object { "body": Array [ Object { @@ -76547,7 +76547,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/importMeta/simple-import-meta.src 1`] = ` +exports[`ecma-features fixtures/importMeta/simple-import-meta.src 1`] = ` Object { "body": Array [ Object { @@ -76786,7 +76786,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/error-delete.src 1`] = ` +exports[`ecma-features fixtures/modules/error-delete.src 1`] = ` Object { "body": Array [ Object { @@ -77082,7 +77082,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/error-function.src 1`] = ` +exports[`ecma-features fixtures/modules/error-function.src 1`] = ` Object { "body": Array [ Object { @@ -77380,7 +77380,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/error-strict.src 1`] = ` +exports[`ecma-features fixtures/modules/error-strict.src 1`] = ` Object { "body": Array [ Object { @@ -77964,7 +77964,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-array.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-array.src 1`] = ` Object { "body": Array [ Object { @@ -78114,7 +78114,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-class.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-class.src 1`] = ` Object { "body": Array [ Object { @@ -78283,7 +78283,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-expression.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-expression.src 1`] = ` Object { "body": Array [ Object { @@ -78525,7 +78525,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-function.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-function.src 1`] = ` Object { "body": Array [ Object { @@ -78733,7 +78733,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-named-class.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-named-class.src 1`] = ` Object { "body": Array [ Object { @@ -78937,7 +78937,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-named-function.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-named-function.src 1`] = ` Object { "body": Array [ Object { @@ -79180,7 +79180,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-number.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-number.src 1`] = ` Object { "body": Array [ Object { @@ -79313,7 +79313,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-object.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-object.src 1`] = ` Object { "body": Array [ Object { @@ -79576,7 +79576,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-default-value.src 1`] = ` +exports[`ecma-features fixtures/modules/export-default-value.src 1`] = ` Object { "body": Array [ Object { @@ -79708,7 +79708,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-from-batch.src 1`] = ` +exports[`ecma-features fixtures/modules/export-from-batch.src 1`] = ` Object { "body": Array [ Object { @@ -79859,7 +79859,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-from-default.src 1`] = ` +exports[`ecma-features fixtures/modules/export-from-default.src 1`] = ` Object { "body": Array [ Object { @@ -80102,7 +80102,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-from-named-as-default.src 1`] = ` +exports[`ecma-features fixtures/modules/export-from-named-as-default.src 1`] = ` Object { "body": Array [ Object { @@ -80381,7 +80381,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-from-named-as-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/export-from-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -80660,7 +80660,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-from-named-as-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/export-from-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -81028,7 +81028,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-from-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/export-from-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -81271,7 +81271,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-from-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/export-from-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -81603,7 +81603,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-function.src 1`] = ` +exports[`ecma-features fixtures/modules/export-function.src 1`] = ` Object { "body": Array [ Object { @@ -81830,7 +81830,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-as-default.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-as-default.src 1`] = ` Object { "body": Array [ Object { @@ -82055,7 +82055,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-as-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -82280,7 +82280,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-as-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -82594,7 +82594,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-class.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-class.src 1`] = ` Object { "body": Array [ Object { @@ -82782,7 +82782,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-empty.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-empty.src 1`] = ` Object { "body": Array [ Object { @@ -82899,7 +82899,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -83088,7 +83088,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -83366,7 +83366,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-named-specifiers-comma.src 1`] = ` +exports[`ecma-features fixtures/modules/export-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { @@ -83662,7 +83662,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-var.src 1`] = ` +exports[`ecma-features fixtures/modules/export-var.src 1`] = ` Object { "body": Array [ Object { @@ -83834,7 +83834,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-var-anonymous-function.src 1`] = ` +exports[`ecma-features fixtures/modules/export-var-anonymous-function.src 1`] = ` Object { "body": Array [ Object { @@ -84153,7 +84153,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/export-var-number.src 1`] = ` +exports[`ecma-features fixtures/modules/export-var-number.src 1`] = ` Object { "body": Array [ Object { @@ -84379,7 +84379,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-default.src 1`] = ` +exports[`ecma-features fixtures/modules/import-default.src 1`] = ` Object { "body": Array [ Object { @@ -84567,7 +84567,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-default-and-named-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/import-default-and-named-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -84880,7 +84880,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -85175,7 +85175,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-default-as.src 1`] = ` +exports[`ecma-features fixtures/modules/import-default-as.src 1`] = ` Object { "body": Array [ Object { @@ -85453,7 +85453,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-jquery.src 1`] = ` +exports[`ecma-features fixtures/modules/import-jquery.src 1`] = ` Object { "body": Array [ Object { @@ -85623,7 +85623,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-module.src 1`] = ` +exports[`ecma-features fixtures/modules/import-module.src 1`] = ` Object { "body": Array [ Object { @@ -85739,7 +85739,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-named-as-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/import-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -86017,7 +86017,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-named-as-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/import-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -86384,7 +86384,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-named-empty.src 1`] = ` +exports[`ecma-features fixtures/modules/import-named-empty.src 1`] = ` Object { "body": Array [ Object { @@ -86554,7 +86554,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-named-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/import-named-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -86796,7 +86796,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-named-specifiers.src 1`] = ` +exports[`ecma-features fixtures/modules/import-named-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -87127,7 +87127,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-named-specifiers-comma.src 1`] = ` +exports[`ecma-features fixtures/modules/import-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { @@ -87476,7 +87476,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-namespace-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/import-namespace-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -87700,7 +87700,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/import-null-as-nil.src 1`] = ` +exports[`ecma-features fixtures/modules/import-null-as-nil.src 1`] = ` Object { "body": Array [ Object { @@ -87960,7 +87960,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/invalid-await.src 1`] = ` +exports[`ecma-features fixtures/modules/invalid-await.src 1`] = ` Object { "body": Array [ Object { @@ -88132,7 +88132,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/invalid-class.src 1`] = ` +exports[`ecma-features fixtures/modules/invalid-class.src 1`] = ` Object { "body": Array [ Object { @@ -88301,17 +88301,17 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; +exports[`ecma-features fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-export-named-default.src 1`] = ` +exports[`ecma-features fixtures/modules/invalid-export-named-default.src 1`] = ` Object { "body": Array [ Object { @@ -88482,19 +88482,19 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; +exports[`ecma-features fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; +exports[`ecma-features fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; +exports[`ecma-features fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -88681,9 +88681,9 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-module-specifier.src 1`] = ` +exports[`ecma-features fixtures/modules/invalid-import-module-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -88907,21 +88907,21 @@ Object { } `; -exports[`ecmaFeatures fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; +exports[`ecma-features fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; +exports[`ecma-features fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; -exports[`ecmaFeatures fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; +exports[`ecma-features fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; -exports[`ecmaFeatures fixtures/newTarget/invalid-new-target.src 1`] = ` +exports[`ecma-features fixtures/newTarget/invalid-new-target.src 1`] = ` Object { "body": Array [ Object { @@ -89180,7 +89180,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/newTarget/invalid-unknown-property.src 1`] = ` +exports[`ecma-features fixtures/newTarget/invalid-unknown-property.src 1`] = ` Object { "body": Array [ Object { @@ -89587,7 +89587,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/newTarget/simple-new-target.src 1`] = ` +exports[`ecma-features fixtures/newTarget/simple-new-target.src 1`] = ` Object { "body": Array [ Object { @@ -90012,7 +90012,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` +exports[`ecma-features fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` Object { "body": Array [ Object { @@ -90361,7 +90361,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` Object { "body": Array [ Object { @@ -90789,7 +90789,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` Object { "body": Array [ Object { @@ -91218,7 +91218,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` Object { "body": Array [ Object { @@ -91870,7 +91870,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` Object { "body": Array [ Object { @@ -92225,7 +92225,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` Object { "body": Array [ Object { @@ -92579,11 +92579,11 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; +exports[`ecma-features fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; +exports[`ecma-features fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` Object { "body": Array [ Object { @@ -92882,7 +92882,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` Object { "body": Array [ Object { @@ -93255,7 +93255,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` Object { "body": Array [ Object { @@ -93647,7 +93647,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` Object { "body": Array [ Object { @@ -94347,7 +94347,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` Object { "body": Array [ Object { @@ -95049,7 +95049,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` Object { "body": Array [ Object { @@ -95570,7 +95570,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` Object { "body": Array [ Object { @@ -96093,9 +96093,9 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; +exports[`ecma-features fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` Object { "body": Array [ Object { @@ -96561,7 +96561,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` Object { "body": Array [ Object { @@ -96952,7 +96952,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` Object { "body": Array [ Object { @@ -97343,7 +97343,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` Object { "body": Array [ Object { @@ -97734,7 +97734,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` Object { "body": Array [ Object { @@ -98162,7 +98162,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` Object { "body": Array [ Object { @@ -98554,7 +98554,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` Object { "body": Array [ Object { @@ -99021,7 +99021,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` +exports[`ecma-features fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` Object { "body": Array [ Object { @@ -99743,9 +99743,9 @@ Object { } `; -exports[`ecmaFeatures fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; +exports[`ecma-features fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; -exports[`ecmaFeatures fixtures/octalLiterals/lowercase.src 1`] = ` +exports[`ecma-features fixtures/octalLiterals/lowercase.src 1`] = ` Object { "body": Array [ Object { @@ -99842,7 +99842,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/octalLiterals/strict-uppercase.src 1`] = ` +exports[`ecma-features fixtures/octalLiterals/strict-uppercase.src 1`] = ` Object { "body": Array [ Object { @@ -100011,7 +100011,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/octalLiterals/uppercase.src 1`] = ` +exports[`ecma-features fixtures/octalLiterals/uppercase.src 1`] = ` Object { "body": Array [ Object { @@ -100108,7 +100108,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/regex/regexp-simple.src 1`] = ` +exports[`ecma-features fixtures/regex/regexp-simple.src 1`] = ` Object { "body": Array [ Object { @@ -100305,7 +100305,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` +exports[`ecma-features fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` Object { "body": Array [ Object { @@ -100502,7 +100502,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` +exports[`ecma-features fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` Object { "body": Array [ Object { @@ -100699,7 +100699,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/regexUFlag/regex-u-simple.src 1`] = ` +exports[`ecma-features fixtures/regexUFlag/regex-u-simple.src 1`] = ` Object { "body": Array [ Object { @@ -100896,7 +100896,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/regexYFlag/regexp-y-simple.src 1`] = ` +exports[`ecma-features fixtures/regexYFlag/regexp-y-simple.src 1`] = ` Object { "body": Array [ Object { @@ -101093,7 +101093,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/basic-rest.src 1`] = ` +exports[`ecma-features fixtures/restParams/basic-rest.src 1`] = ` Object { "body": Array [ Object { @@ -101444,7 +101444,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/class-constructor.src 1`] = ` +exports[`ecma-features fixtures/restParams/class-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -101836,7 +101836,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/class-method.src 1`] = ` +exports[`ecma-features fixtures/restParams/class-method.src 1`] = ` Object { "body": Array [ Object { @@ -102228,7 +102228,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/error-no-default.src 1`] = ` +exports[`ecma-features fixtures/restParams/error-no-default.src 1`] = ` Object { "body": Array [ Object { @@ -102545,7 +102545,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/error-not-last.src 1`] = ` +exports[`ecma-features fixtures/restParams/error-not-last.src 1`] = ` Object { "body": Array [ Object { @@ -102880,7 +102880,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/func-expression.src 1`] = ` +exports[`ecma-features fixtures/restParams/func-expression.src 1`] = ` Object { "body": Array [ Object { @@ -103234,7 +103234,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/func-expression-multi.src 1`] = ` +exports[`ecma-features fixtures/restParams/func-expression-multi.src 1`] = ` Object { "body": Array [ Object { @@ -103642,7 +103642,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/invalid-rest-param.src 1`] = ` +exports[`ecma-features fixtures/restParams/invalid-rest-param.src 1`] = ` Object { "body": Array [ Object { @@ -104033,7 +104033,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/restParams/single-rest.src 1`] = ` +exports[`ecma-features fixtures/restParams/single-rest.src 1`] = ` Object { "body": Array [ Object { @@ -104330,11 +104330,11 @@ Object { } `; -exports[`ecmaFeatures fixtures/spread/error-invalid-if.src 1`] = `"Expression expected."`; +exports[`ecma-features fixtures/spread/error-invalid-if.src 1`] = `"Expression expected."`; -exports[`ecmaFeatures fixtures/spread/error-invalid-sequence.src 1`] = `"Expression expected."`; +exports[`ecma-features fixtures/spread/error-invalid-sequence.src 1`] = `"Expression expected."`; -exports[`ecmaFeatures fixtures/spread/multi-function-call.src 1`] = ` +exports[`ecma-features fixtures/spread/multi-function-call.src 1`] = ` Object { "body": Array [ Object { @@ -104610,7 +104610,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/spread/not-final-param.src 1`] = ` +exports[`ecma-features fixtures/spread/not-final-param.src 1`] = ` Object { "body": Array [ Object { @@ -104886,7 +104886,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/spread/simple-function-call.src 1`] = ` +exports[`ecma-features fixtures/spread/simple-function-call.src 1`] = ` Object { "body": Array [ Object { @@ -105108,7 +105108,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/deeply-nested.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/deeply-nested.src 1`] = ` Object { "body": Array [ Object { @@ -105573,7 +105573,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/error-octal-literal.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/error-octal-literal.src 1`] = ` Object { "body": Array [ Object { @@ -105693,7 +105693,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/escape-characters.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/escape-characters.src 1`] = ` Object { "body": Array [ Object { @@ -105907,7 +105907,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/expressions.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/expressions.src 1`] = ` Object { "body": Array [ Object { @@ -106581,7 +106581,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/multi-line-template-string.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/multi-line-template-string.src 1`] = ` Object { "body": Array [ Object { @@ -106716,7 +106716,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/simple-template-string.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/simple-template-string.src 1`] = ` Object { "body": Array [ Object { @@ -106836,7 +106836,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/single-dollar-sign.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/single-dollar-sign.src 1`] = ` Object { "body": Array [ Object { @@ -107048,7 +107048,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/tagged-no-placeholders.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/tagged-no-placeholders.src 1`] = ` Object { "body": Array [ Object { @@ -107221,7 +107221,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/templateStrings/tagged-template-string.src 1`] = ` +exports[`ecma-features fixtures/templateStrings/tagged-template-string.src 1`] = ` Object { "body": Array [ Object { @@ -107947,7 +107947,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/basic-string-literal.src 1`] = ` +exports[`ecma-features fixtures/unicodeCodePointEscapes/basic-string-literal.src 1`] = ` Object { "body": Array [ Object { @@ -108044,7 +108044,7 @@ Object { } `; -exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/complex-string-literal.src 1`] = ` +exports[`ecma-features fixtures/unicodeCodePointEscapes/complex-string-literal.src 1`] = ` Object { "body": Array [ Object { @@ -108141,6 +108141,6 @@ Object { } `; -exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/invalid-empty-escape.src 1`] = `"Hexadecimal digit expected."`; +exports[`ecma-features fixtures/unicodeCodePointEscapes/invalid-empty-escape.src 1`] = `"Hexadecimal digit expected."`; -exports[`ecmaFeatures fixtures/unicodeCodePointEscapes/invalid-too-large-escape.src 1`] = `"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."`; +exports[`ecma-features fixtures/unicodeCodePointEscapes/invalid-too-large-escape.src 1`] = `"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."`; diff --git a/packages/typescript-estree/tests/lib/basics.js b/packages/typescript-estree/tests/lib/basics.js index 90c6f1e5cea9..302cd7dbeb78 100644 --- a/packages/typescript-estree/tests/lib/basics.js +++ b/packages/typescript-estree/tests/lib/basics.js @@ -36,14 +36,11 @@ const testFiles = shelljs describe('basics', () => { testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); const config = { loc: true, range: true, tokens: true, - ecmaFeatures: {}, errorOnUnknownASTType: true }; test( diff --git a/packages/typescript-estree/tests/lib/comments.js b/packages/typescript-estree/tests/lib/comments.js index 85911c6020a5..d589b4d0651e 100644 --- a/packages/typescript-estree/tests/lib/comments.js +++ b/packages/typescript-estree/tests/lib/comments.js @@ -42,9 +42,7 @@ describe('Comments', () => { range: true, tokens: true, comment: true, - ecmaFeatures: { - jsx: true - } + jsx: true }; test( `fixtures/${filename}.src`, diff --git a/packages/typescript-estree/tests/lib/ecma-features.js b/packages/typescript-estree/tests/lib/ecma-features.js index 4da61e11d253..a693a2d8524a 100644 --- a/packages/typescript-estree/tests/lib/ecma-features.js +++ b/packages/typescript-estree/tests/lib/ecma-features.js @@ -34,22 +34,18 @@ const testFiles = shelljs // Tests //------------------------------------------------------------------------------ -describe('ecmaFeatures', () => { +describe('ecma-features', () => { testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; const feature = path.dirname(filename), code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`), config = { loc: true, range: true, tokens: true, - ecmaFeatures: {}, errorOnUnknownASTType: true }; test(`fixtures/${filename}.src`, () => { - config.ecmaFeatures[feature] = true; testUtils.createSnapshotTestBlock(code, config)(); }); }); diff --git a/packages/typescript-estree/tests/lib/jsx.js b/packages/typescript-estree/tests/lib/jsx.js index 6148cc3abfda..43228da3070d 100644 --- a/packages/typescript-estree/tests/lib/jsx.js +++ b/packages/typescript-estree/tests/lib/jsx.js @@ -57,8 +57,6 @@ describe('JSX', () => { */ function testFixture(fixturesDir, useJSXTextNode) { return filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; const code = shelljs.cat(`${path.resolve(fixturesDir, filename)}.src.js`); const config = { @@ -67,9 +65,7 @@ describe('JSX', () => { tokens: true, errorOnUnknownASTType: true, useJSXTextNode, - ecmaFeatures: { - jsx: true - } + jsx: true }; test( diff --git a/packages/typescript-estree/tests/lib/parse.js b/packages/typescript-estree/tests/lib/parse.js index f9f2ef5ef65a..a7b321c05ce8 100644 --- a/packages/typescript-estree/tests/lib/parse.js +++ b/packages/typescript-estree/tests/lib/parse.js @@ -40,9 +40,6 @@ describe('parse()', () => { describe('general', () => { const code = 'let foo = bar;'; const config = { - ecmaFeatures: { - blockBindings: true - }, comment: true, tokens: true, range: true, diff --git a/packages/typescript-estree/tests/lib/tsx.js b/packages/typescript-estree/tests/lib/tsx.js index cdc16b5c26e4..4e0a8d5bf70b 100644 --- a/packages/typescript-estree/tests/lib/tsx.js +++ b/packages/typescript-estree/tests/lib/tsx.js @@ -35,8 +35,6 @@ const testFiles = shelljs describe('TSX', () => { testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; const code = shelljs.cat( `${path.resolve(TSX_FIXTURES_DIR, filename)}.src.tsx` ); @@ -46,9 +44,7 @@ describe('TSX', () => { tokens: true, errorOnUnknownASTType: true, useJSXTextNode: true, - ecmaFeatures: { - jsx: true - } + jsx: true }; test( `fixtures/${filename}.src`, diff --git a/packages/typescript-estree/tests/lib/typescript.js b/packages/typescript-estree/tests/lib/typescript.js index 8f8ee640b21a..5b8d9f0c0c66 100644 --- a/packages/typescript-estree/tests/lib/typescript.js +++ b/packages/typescript-estree/tests/lib/typescript.js @@ -36,14 +36,11 @@ const testFiles = shelljs describe('typescript', () => { testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.ts`); const config = { loc: true, range: true, tokens: true, - ecmaFeatures: {}, errorOnUnknownASTType: true }; test( From 32c6ff5c9e7a9b7e696ad5e2871dd71a6980efbd Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 4 Nov 2018 14:38:04 -0500 Subject: [PATCH 12/84] fix(*): brute force initial conversion to TS (#25) --- packages/typescript-estree/.gitignore | 3 +- packages/typescript-estree/.travis.yml | 1 + packages/typescript-estree/README.md | 2 +- packages/typescript-estree/package.json | 29 +- .../ast-converter.js => src/ast-converter.ts} | 28 +- .../ast-node-types.ts} | 15 +- .../convert-comments.ts} | 78 +- .../{lib/convert.js => src/convert.ts} | 1018 +++++++++-------- .../src/estree/experimental.ts | 30 + .../src/estree/extensions.ts | 63 + packages/typescript-estree/src/estree/spec.ts | 985 ++++++++++++++++ .../{lib/node-utils.js => src/node-utils.ts} | 325 +++--- .../{parser.js => src/parser.ts} | 50 +- .../src/temp-types-based-on-js-source.ts | 80 ++ ...ixtures-to-test.js => fixtures-to-test.ts} | 80 +- .../tests/ast-alignment/jest.config.js | 6 +- .../ast-alignment/{parse.js => parse.ts} | 61 +- .../tests/ast-alignment/{spec.js => spec.ts} | 19 +- .../ast-alignment/{utils.js => utils.ts} | 33 +- ...sx-known-issues.js => jsx-known-issues.ts} | 4 +- .../{basics.js.snap => basics.ts.snap} | 0 .../{comments.js.snap => comments.ts.snap} | 0 ...features.js.snap => ecma-features.ts.snap} | 0 .../{jsx.js.snap => jsx.ts.snap} | 0 .../{parse.js.snap => parse.ts.snap} | 0 .../{tsx.js.snap => tsx.ts.snap} | 0 ...{typescript.js.snap => typescript.ts.snap} | 0 .../tests/lib/{basics.js => basics.ts} | 18 +- .../tests/lib/{comments.js => comments.ts} | 18 +- .../{ecma-features.js => ecma-features.ts} | 24 +- .../tests/lib/{jsx.js => jsx.ts} | 28 +- .../tests/lib/{parse.js => parse.ts} | 22 +- .../tests/lib/{tsx.js => tsx.ts} | 18 +- .../lib/{typescript.js => typescript.ts} | 18 +- .../tools/{test-utils.js => test-utils.ts} | 27 +- packages/typescript-estree/tsconfig.json | 11 + packages/typescript-estree/yarn.lock | 96 +- 37 files changed, 2244 insertions(+), 946 deletions(-) rename packages/typescript-estree/{lib/ast-converter.js => src/ast-converter.ts} (62%) rename packages/typescript-estree/{lib/ast-node-types.js => src/ast-node-types.ts} (93%) rename packages/typescript-estree/{lib/convert-comments.js => src/convert-comments.ts} (68%) rename packages/typescript-estree/{lib/convert.js => src/convert.ts} (64%) create mode 100644 packages/typescript-estree/src/estree/experimental.ts create mode 100644 packages/typescript-estree/src/estree/extensions.ts create mode 100644 packages/typescript-estree/src/estree/spec.ts rename packages/typescript-estree/{lib/node-utils.js => src/node-utils.ts} (67%) rename packages/typescript-estree/{parser.js => src/parser.ts} (80%) create mode 100644 packages/typescript-estree/src/temp-types-based-on-js-source.ts rename packages/typescript-estree/tests/ast-alignment/{fixtures-to-test.js => fixtures-to-test.ts} (92%) rename packages/typescript-estree/tests/ast-alignment/{parse.js => parse.ts} (64%) rename packages/typescript-estree/tests/ast-alignment/{spec.js => spec.ts} (84%) rename packages/typescript-estree/tests/ast-alignment/{utils.js => utils.ts} (86%) rename packages/typescript-estree/tests/{jsx-known-issues.js => jsx-known-issues.ts} (93%) rename packages/typescript-estree/tests/lib/__snapshots__/{basics.js.snap => basics.ts.snap} (100%) rename packages/typescript-estree/tests/lib/__snapshots__/{comments.js.snap => comments.ts.snap} (100%) rename packages/typescript-estree/tests/lib/__snapshots__/{ecma-features.js.snap => ecma-features.ts.snap} (100%) rename packages/typescript-estree/tests/lib/__snapshots__/{jsx.js.snap => jsx.ts.snap} (100%) rename packages/typescript-estree/tests/lib/__snapshots__/{parse.js.snap => parse.ts.snap} (100%) rename packages/typescript-estree/tests/lib/__snapshots__/{tsx.js.snap => tsx.ts.snap} (100%) rename packages/typescript-estree/tests/lib/__snapshots__/{typescript.js.snap => typescript.ts.snap} (100%) rename packages/typescript-estree/tests/lib/{basics.js => basics.ts} (75%) rename packages/typescript-estree/tests/lib/{comments.js => comments.ts} (76%) rename packages/typescript-estree/tests/lib/{ecma-features.js => ecma-features.ts} (66%) rename packages/typescript-estree/tests/lib/{jsx.js => jsx.ts} (75%) rename packages/typescript-estree/tests/lib/{parse.js => parse.ts} (69%) rename packages/typescript-estree/tests/lib/{tsx.js => tsx.ts} (76%) rename packages/typescript-estree/tests/lib/{typescript.js => typescript.ts} (76%) rename packages/typescript-estree/tools/{test-utils.js => test-utils.ts} (68%) create mode 100644 packages/typescript-estree/tsconfig.json diff --git a/packages/typescript-estree/.gitignore b/packages/typescript-estree/.gitignore index 2ff496493963..557d485a3734 100644 --- a/packages/typescript-estree/.gitignore +++ b/packages/typescript-estree/.gitignore @@ -4,4 +4,5 @@ node_modules npm-debug.log _test.js .DS_Store -.vscode \ No newline at end of file +.vscode +dist \ No newline at end of file diff --git a/packages/typescript-estree/.travis.yml b/packages/typescript-estree/.travis.yml index 8a20fa68067c..9763bdffed1f 100644 --- a/packages/typescript-estree/.travis.yml +++ b/packages/typescript-estree/.travis.yml @@ -16,6 +16,7 @@ script: - commitlint-travis - yarn check-format - yarn test + - yarn build after_success: - npm run travis-deploy-once "npm run semantic-release" branches: diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index 42184b401dcc..7b39ea01555f 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -15,7 +15,7 @@ ## About -This parser is somewhat generic and robust, and could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatiable AST. +This parser is somewhat generic and robust, and could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatible AST. In fact, it is already used within these hyper-popular open-source projects to power their TypeScript support: diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 7bdc8e0b06d7..93f53d697baa 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -2,11 +2,12 @@ "name": "typescript-estree", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "homepage": "https://github.com/JamesHenry/typescript-estree", - "main": "parser.js", + "main": "dist/parser.js", "version": "0.0.0-development", "files": [ - "lib", - "parser.js" + "dist", + "README.md", + "LICENSE" ], "engines": { "node": ">=6.14.0" @@ -20,6 +21,12 @@ "@commitlint/cli": "^7.1.2", "@commitlint/config-conventional": "^7.1.2", "@commitlint/travis-cli": "^7.1.2", + "@types/babel-code-frame": "^6.20.1", + "@types/jest": "^23.3.9", + "@types/lodash.isplainobject": "^4.0.4", + "@types/lodash.unescape": "^4.0.4", + "@types/semver": "^5.5.0", + "@types/shelljs": "^0.8.0", "babel-code-frame": "6.26.0", "babylon": "7.0.0-beta.39", "cz-conventional-changelog": "2.1.0", @@ -32,6 +39,7 @@ "semantic-release": "^15.9.16", "shelljs": "0.8.2", "travis-deploy-once": "^5.0.8", + "ts-jest": "^23.10.4", "typescript": "~3.1.1" }, "keywords": [ @@ -44,6 +52,7 @@ "syntax" ], "scripts": { + "build": "tsc", "test": "npm run unit-tests && npm run ast-alignment-tests", "unit-tests": "jest", "ast-alignment-tests": "jest --config=./tests/ast-alignment/jest.config.js", @@ -79,8 +88,18 @@ }, "jest": { "testEnvironment": "node", - "testRegex": "tests/lib/.+\\.js$", - "testPathIgnorePatterns": [], + "transform": { + "^.+\\.tsx?$": "ts-jest" + }, + "testRegex": "(/tests/lib/.*)\\.(jsx?|tsx?)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ], "collectCoverage": true, "coverageReporters": [ "text-summary" diff --git a/packages/typescript-estree/lib/ast-converter.js b/packages/typescript-estree/src/ast-converter.ts similarity index 62% rename from packages/typescript-estree/lib/ast-converter.js rename to packages/typescript-estree/src/ast-converter.ts index 924a98e7d69e..f46ca74ee6b0 100644 --- a/packages/typescript-estree/lib/ast-converter.js +++ b/packages/typescript-estree/src/ast-converter.ts @@ -5,27 +5,17 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const convert = require('./convert'), - convertComments = require('./convert-comments').convertComments, - nodeUtils = require('./node-utils'); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ +import { convert } from './convert'; +import { convertComments } from './convert-comments'; +import nodeUtils from './node-utils'; +import { Extra } from './temp-types-based-on-js-source'; /** * Extends and formats a given error object * @param {Object} error the error object * @returns {Object} converted error object */ -function convertError(error) { +function convertError(error: any) { return nodeUtils.createError( error.file, error.start, @@ -33,11 +23,7 @@ function convertError(error) { ); } -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = (ast, extra) => { +export default (ast: any, extra: Extra) => { /** * The TypeScript compiler produced fundamental parse errors when parsing the * source. @@ -49,7 +35,7 @@ module.exports = (ast, extra) => { /** * Recursively convert the TypeScript AST into an ESTree-compatible AST */ - const estree = convert({ + const estree: any = convert({ node: ast, parent: null, ast, diff --git a/packages/typescript-estree/lib/ast-node-types.js b/packages/typescript-estree/src/ast-node-types.ts similarity index 93% rename from packages/typescript-estree/lib/ast-node-types.js rename to packages/typescript-estree/src/ast-node-types.ts index 162a8958fbb8..ea3ce8d24bc4 100644 --- a/packages/typescript-estree/lib/ast-node-types.js +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -5,20 +5,7 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { +export const AST_NODE_TYPES: { [key: string]: string } = { ArrayExpression: 'ArrayExpression', ArrayPattern: 'ArrayPattern', ArrowFunctionExpression: 'ArrowFunctionExpression', diff --git a/packages/typescript-estree/lib/convert-comments.js b/packages/typescript-estree/src/convert-comments.ts similarity index 68% rename from packages/typescript-estree/lib/convert-comments.js rename to packages/typescript-estree/src/convert-comments.ts index 728ca2cf312c..25d4287e7d7c 100644 --- a/packages/typescript-estree/lib/convert-comments.js +++ b/packages/typescript-estree/src/convert-comments.ts @@ -5,39 +5,34 @@ * MIT License */ -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const ts = require('typescript'), - nodeUtils = require('./node-utils'); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ +import ts from 'typescript'; +import nodeUtils from './node-utils'; +import { + ESTreeComment, + ESTreeToken, + LineAndColumnData +} from './temp-types-based-on-js-source'; /** * Converts a TypeScript comment to an Esprima comment. * @param {boolean} block True if it's a block comment, false if not. * @param {string} text The text of the comment. - * @param {int} start The index at which the comment starts. - * @param {int} end The index at which the comment ends. - * @param {Location} startLoc The location at which the comment starts. - * @param {Location} endLoc The location at which the comment ends. + * @param {number} start The index at which the comment starts. + * @param {number} end The index at which the comment ends. + * @param {LineAndColumnData} startLoc The location at which the comment starts. + * @param {LineAndColumnData} endLoc The location at which the comment ends. * @returns {Object} The comment object. * @private */ function convertTypeScriptCommentToEsprimaComment( - block, - text, - start, - end, - startLoc, - endLoc -) { - const comment = { + block: boolean, + text: string, + start: number, + end: number, + startLoc: LineAndColumnData, + endLoc: LineAndColumnData +): ESTreeComment { + const comment: Partial = { type: block ? 'Block' : 'Line', value: text }; @@ -53,18 +48,22 @@ function convertTypeScriptCommentToEsprimaComment( }; } - return comment; + return comment as ESTreeComment; } /** * Convert comment from TypeScript Triva Scanner. - * @param {Object} triviaScanner TS Scanner - * @param {Object} ast the AST object + * @param {ts.Scanner} triviaScanner TS Scanner + * @param {ts.SourceFile} ast the AST object * @param {string} code TypeScript code * @returns {ESTreeComment} the converted ESTreeComment * @private */ -function getCommentFromTriviaScanner(triviaScanner, ast, code) { +function getCommentFromTriviaScanner( + triviaScanner: ts.Scanner, + ast: ts.SourceFile, + code: string +): ESTreeComment { const kind = triviaScanner.getToken(); const isBlock = kind === ts.SyntaxKind.MultiLineCommentTrivia; const range = { @@ -91,23 +90,18 @@ function getCommentFromTriviaScanner(triviaScanner, ast, code) { return esprimaComment; } -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - convertComments -}; - /** * Convert all comments for the given AST. - * @param {Object} ast the AST object + * @param {ts.SourceFile} ast the AST object * @param {string} code the TypeScript code * @returns {ESTreeComment[]} the converted ESTreeComment * @private */ -function convertComments(ast, code) { - const comments = []; +export function convertComments( + ast: ts.SourceFile, + code: string +): ESTreeComment[] { + const comments: ESTreeComment[] = []; /** * Create a TypeScript Scanner, with skipTrivia set to false so that @@ -120,7 +114,7 @@ function convertComments(ast, code) { const start = triviaScanner.getTokenPos(); const end = triviaScanner.getTextPos(); - let container = null; + let container: ts.Token | null = null; switch (kind) { case ts.SyntaxKind.SingleLineCommentTrivia: case ts.SyntaxKind.MultiLineCommentTrivia: { @@ -130,7 +124,7 @@ function convertComments(ast, code) { break; } case ts.SyntaxKind.CloseBraceToken: - container = nodeUtils.getNodeContainer(ast, start, end); + container = nodeUtils.getNodeContainer(ast, start, end) as ts.Node; if ( container.kind === ts.SyntaxKind.TemplateMiddle || @@ -142,7 +136,7 @@ function convertComments(ast, code) { break; case ts.SyntaxKind.SlashToken: case ts.SyntaxKind.SlashEqualsToken: - container = nodeUtils.getNodeContainer(ast, start, end); + container = nodeUtils.getNodeContainer(ast, start, end) as ts.Node; if (container.kind === ts.SyntaxKind.RegularExpressionLiteral) { kind = triviaScanner.reScanSlashToken(); diff --git a/packages/typescript-estree/lib/convert.js b/packages/typescript-estree/src/convert.ts similarity index 64% rename from packages/typescript-estree/lib/convert.js rename to packages/typescript-estree/src/convert.ts index fc49c3deb6a7..13ead9d341a9 100644 --- a/packages/typescript-estree/lib/convert.js +++ b/packages/typescript-estree/src/convert.ts @@ -5,38 +5,24 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ +import ts from 'typescript'; +import nodeUtils from './node-utils'; +import { AST_NODE_TYPES } from './ast-node-types'; +import { ESTreeNode } from './temp-types-based-on-js-source'; -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const nodeUtils = require('./node-utils'), - AST_NODE_TYPES = require('./ast-node-types'); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -const SyntaxKind = nodeUtils.SyntaxKind; - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ +const SyntaxKind = ts.SyntaxKind; /** * Converts a TypeScript node into an ESTree node * @param {Object} config configuration options for the conversion - * @param {TSNode} config.node the TSNode - * @param {TSNode} config.parent the parent TSNode - * @param {TSNode} config.ast the full TypeScript AST + * @param {ts.Node} config.node the ts.Node + * @param {ts.Node} config.parent the parent ts.Node + * @param {ts.SourceFile} config.ast the full TypeScript AST * @param {Object} config.additionalOptions additional options for the conversion - * @param {Object} config.additionalOptions.errorOnUnknownASTType whether whether or not to throw an error if an unknown AST Node Type is encountered - * @returns {ESTreeNode} the converted ESTreeNode + * @returns {ESTreeNode|null} the converted ESTreeNode */ -module.exports = function convert(config) { - const node = config.node; +export function convert(config: any): ESTreeNode | null { + const node = config.node as ts.Node; const parent = config.parent; const ast = config.ast; const additionalOptions = config.additionalOptions || {}; @@ -51,7 +37,7 @@ module.exports = function convert(config) { /** * Create a new ESTree node */ - let result = { + let result: Partial = { type: '', range: [node.getStart(), node.end], loc: nodeUtils.getLoc(node, ast) @@ -62,7 +48,7 @@ module.exports = function convert(config) { * This is used only for leaf nodes that have no other properties. * @returns {void} */ - function simplyCopy() { + function simplyCopy(): void { Object.assign(result, { type: SyntaxKind[node.kind] }); @@ -70,20 +56,20 @@ module.exports = function convert(config) { /** * Converts a TypeScript node into an ESTree node. - * @param {TSNode} child the child TSNode - * @returns {ESTreeNode} the converted ESTree node + * @param {ts.Node} child the child ts.Node + * @returns {ESTreeNode|null} the converted ESTree node */ - function convertChild(child) { + function convertChild(child: ts.Node): ESTreeNode | null { return convert({ node: child, parent: node, ast, additionalOptions }); } /** * Converts a child into a type annotation. This creates an intermediary * TypeAnnotation node to match what Flow does. - * @param {TSNode} child The TypeScript AST node to convert. + * @param {ts.Node} child The TypeScript AST node to convert. * @returns {ESTreeNode} The type annotation node. */ - function convertTypeAnnotation(child) { + function convertTypeAnnotation(child: ts.Node): ESTreeNode { const annotation = convertChild(child); const annotationStartCol = child.getFullStart() - 1; const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); @@ -96,11 +82,13 @@ module.exports = function convert(config) { } /** - * Converts a TSNode's typeArguments array to a flow-like typeParameters node - * @param {TSNode[]} typeArguments TSNode typeArguments - * @returns {TypeParameterInstantiation} TypeParameterInstantiation node + * Converts a ts.Node's typeArguments ts.NodeArray to a flow-like typeParameters node + * @param {ts.NodeArray} typeArguments ts.Node typeArguments + * @returns {ESTreeNode} TypeParameterInstantiation node */ - function convertTypeArgumentsToTypeParameters(typeArguments) { + function convertTypeArgumentsToTypeParameters( + typeArguments: ts.NodeArray + ): ESTreeNode { /** * Even if typeArguments is an empty array, TypeScript sets a `pos` and `end` * property on the array object so we can safely read the values here @@ -158,11 +146,13 @@ module.exports = function convert(config) { } /** - * Converts a TSNode's typeParameters array to a flow-like TypeParameterDeclaration node - * @param {TSNode[]} typeParameters TSNode typeParameters - * @returns {TypeParameterDeclaration} TypeParameterDeclaration node + * Converts a ts.Node's typeParameters ts.ts.NodeArray to a flow-like TypeParameterDeclaration node + * @param {ts.NodeArray} typeParameters ts.Node typeParameters + * @returns {ESTreeNode} TypeParameterDeclaration node */ - function convertTSTypeParametersToTypeParametersDeclaration(typeParameters) { + function convertTSTypeParametersToTypeParametersDeclaration( + typeParameters: ts.NodeArray + ): ESTreeNode { const firstTypeParameter = typeParameters[0]; const lastTypeParameter = typeParameters[typeParameters.length - 1]; @@ -212,12 +202,12 @@ module.exports = function convert(config) { /** * Converts a child into a class implements node. This creates an intermediary * ClassImplements node to match what Flow does. - * @param {TSNode} child The TypeScript AST node to convert. + * @param {ts.Node} child The TypeScript AST node to convert. * @returns {ESTreeNode} The type annotation node. */ - function convertClassImplements(child) { - const id = convertChild(child.expression); - const classImplementsNode = { + function convertClassImplements(child: any): ESTreeNode { + const id = convertChild(child.expression) as ESTreeNode; + const classImplementsNode: ESTreeNode = { type: AST_NODE_TYPES.ClassImplements, loc: id.loc, range: id.range, @@ -233,12 +223,12 @@ module.exports = function convert(config) { /** * Converts a child into a interface heritage node. - * @param {TSNode} child The TypeScript AST node to convert. + * @param {ts.Node} child The TypeScript AST node to convert. * @returns {ESTreeNode} The type annotation node. */ - function convertInterfaceHeritageClause(child) { - const id = convertChild(child.expression); - const classImplementsNode = { + function convertInterfaceHeritageClause(child: any): ESTreeNode { + const id = convertChild(child.expression) as ESTreeNode; + const classImplementsNode: ESTreeNode = { type: AST_NODE_TYPES.TSInterfaceHeritage, loc: id.loc, range: id.range, @@ -254,11 +244,13 @@ module.exports = function convert(config) { } /** - * Converts an array of TSNode decorators into an array of ESTreeNode decorators - * @param {TSNode[]} decorators An array of TSNode decorators to be converted + * Converts a ts.NodeArray of ts.Decorators into an array of ESTreeNode decorators + * @param {ts.NodeArray} decorators A ts.NodeArray of ts.Decorators to be converted * @returns {ESTreeNode[]} an array of converted ESTreeNode decorators */ - function convertDecorators(decorators) { + function convertDecorators( + decorators: ts.NodeArray + ): ESTreeNode[] { if (!decorators || !decorators.length) { return []; } @@ -274,16 +266,16 @@ module.exports = function convert(config) { } /** - * Converts an array of TSNode parameters into an array of ESTreeNode params - * @param {TSNode[]} parameters An array of TSNode params to be converted + * Converts an array of ts.Node parameters into an array of ESTreeNode params + * @param {ts.Node[]} parameters An array of ts.Node params to be converted * @returns {ESTreeNode[]} an array of converted ESTreeNode params */ - function convertParameters(parameters) { + function convertParameters(parameters: ts.Node[]): ESTreeNode[] { if (!parameters || !parameters.length) { return []; } return parameters.map(param => { - const convertedParam = convertChild(param); + const convertedParam = convertChild(param) as ESTreeNode; if (!param.decorators || !param.decorators.length) { return convertedParam; } @@ -299,7 +291,7 @@ module.exports = function convert(config) { * property instead of a kind property. Recursively copies all children. * @returns {void} */ - function deeplyCopy() { + function deeplyCopy(): void { const customType = `TS${SyntaxKind[node.kind]}`; /** * If the "errorOnUnknownASTType" option is set to true, throw an error, @@ -321,31 +313,34 @@ module.exports = function convert(config) { ) .forEach(key => { if (key === 'type') { - result.typeAnnotation = node.type - ? convertTypeAnnotation(node.type) + result.typeAnnotation = (node as any).type + ? convertTypeAnnotation((node as any).type) : null; } else if (key === 'typeArguments') { - result.typeParameters = node.typeArguments - ? convertTypeArgumentsToTypeParameters(node.typeArguments) + result.typeParameters = (node as any).typeArguments + ? convertTypeArgumentsToTypeParameters((node as any).typeArguments) : null; } else if (key === 'typeParameters') { - result.typeParameters = node.typeParameters + result.typeParameters = (node as any).typeParameters ? convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + (node as any).typeParameters ) : null; } else if (key === 'decorators') { - const decorators = convertDecorators(node.decorators); + const decorators = convertDecorators((node as any).decorators); if (decorators && decorators.length) { result.decorators = decorators; } } else { - if (Array.isArray(node[key])) { - result[key] = node[key].map(convertChild); - } else if (node[key] && typeof node[key] === 'object') { - result[key] = convertChild(node[key]); + if (Array.isArray((node as any)[key])) { + (result as any)[key] = (node as any)[key].map(convertChild); + } else if ( + (node as any)[key] && + typeof (node as any)[key] === 'object' + ) { + (result as any)[key] = convertChild((node as any)[key]); } else { - result[key] = node[key]; + (result as any)[key] = (node as any)[key]; } } }); @@ -353,28 +348,28 @@ module.exports = function convert(config) { /** * Converts a TypeScript JSX node.tagName into an ESTree node.name - * @param {Object} tagName the tagName object from a JSX TSNode - * @param {Object} ast the AST object + * @param {Object} tagName the tagName object from a JSX ts.Node * @returns {Object} the converted ESTree name object */ - function convertTypeScriptJSXTagNameToESTreeName(tagName) { + function convertTypeScriptJSXTagNameToESTreeName(tagName: any): any { const tagNameToken = nodeUtils.convertToken(tagName, ast); if (tagNameToken.type === AST_NODE_TYPES.JSXMemberExpression) { const isNestedMemberExpression = - node.tagName.expression.kind === SyntaxKind.PropertyAccessExpression; + (node as any).tagName.expression.kind === + SyntaxKind.PropertyAccessExpression; // Convert TSNode left and right objects into ESTreeNode object // and property objects - tagNameToken.object = convertChild(node.tagName.expression); - tagNameToken.property = convertChild(node.tagName.name); + tagNameToken.object = convertChild((node as any).tagName.expression); + tagNameToken.property = convertChild((node as any).tagName.name); // Assign the appropriate types tagNameToken.object.type = isNestedMemberExpression ? AST_NODE_TYPES.JSXMemberExpression : AST_NODE_TYPES.JSXIdentifier; tagNameToken.property.type = AST_NODE_TYPES.JSXIdentifier; - if (tagName.expression.kind === SyntaxKind.ThisKeyword) { + if ((tagName as any).expression.kind === SyntaxKind.ThisKeyword) { tagNameToken.object.name = 'this'; } } else { @@ -389,10 +384,10 @@ module.exports = function convert(config) { /** * Applies the given TS modifiers to the given result object. - * @param {TSNode[]} modifiers original TSNodes from the node.modifiers array + * @param {ts.Node[]} modifiers original ts.Nodes from the node.modifiers array * @returns {void} (the current result object will be mutated) */ - function applyModifiersToResult(modifiers) { + function applyModifiersToResult(modifiers: ts.Node[]): void { if (!modifiers || !modifiers.length) { return; } @@ -402,7 +397,7 @@ module.exports = function convert(config) { * to the result, we remove them from the array, so that they * are not handled twice. */ - const handledModifierIndices = {}; + const handledModifierIndices: { [key: number]: boolean } = {}; for (let i = 0; i < modifiers.length; i++) { const modifier = modifiers[i]; switch (modifier.kind) { @@ -445,8 +440,10 @@ module.exports = function convert(config) { * @param {ESTreeNode} typeAnnotationParent The node that will have its location data mutated * @returns {void} */ - function fixTypeAnnotationParentLocation(typeAnnotationParent) { - const end = node.type.getEnd(); + function fixTypeAnnotationParentLocation( + typeAnnotationParent: ESTreeNode + ): void { + const end = (node as any).type.getEnd(); typeAnnotationParent.range[1] = end; const loc = nodeUtils.getLocFor( typeAnnotationParent.range[0], @@ -465,40 +462,44 @@ module.exports = function convert(config) { Object.assign(result, { type: AST_NODE_TYPES.Program, body: [], - sourceType: node.externalModuleIndicator ? 'module' : 'script' + sourceType: (node as any).externalModuleIndicator ? 'module' : 'script' }); // filter out unknown nodes for now - node.statements.forEach(statement => { + (node as any).statements.forEach((statement: any) => { const convertedStatement = convertChild(statement); if (convertedStatement) { result.body.push(convertedStatement); } }); - result.range[1] = node.endOfFileToken.end; - result.loc = nodeUtils.getLocFor(node.getStart(), result.range[1], ast); + (result as any).range[1] = (node as any).endOfFileToken.end; + result.loc = nodeUtils.getLocFor( + node.getStart(), + (result as any).range[1], + ast + ); break; case SyntaxKind.Block: Object.assign(result, { type: AST_NODE_TYPES.BlockStatement, - body: node.statements.map(convertChild) + body: (node as any).statements.map(convertChild) }); break; case SyntaxKind.Identifier: Object.assign(result, { type: AST_NODE_TYPES.Identifier, - name: node.text + name: (node as any).text }); break; case SyntaxKind.WithStatement: Object.assign(result, { type: AST_NODE_TYPES.WithStatement, - object: convertChild(node.expression), - body: convertChild(node.statement) + object: convertChild((node as any).expression), + body: convertChild((node as any).statement) }); break; @@ -507,15 +508,15 @@ module.exports = function convert(config) { case SyntaxKind.ReturnStatement: Object.assign(result, { type: AST_NODE_TYPES.ReturnStatement, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; case SyntaxKind.LabeledStatement: Object.assign(result, { type: AST_NODE_TYPES.LabeledStatement, - label: convertChild(node.label), - body: convertChild(node.statement) + label: convertChild((node as any).label), + body: convertChild((node as any).statement) }); break; @@ -523,7 +524,7 @@ module.exports = function convert(config) { case SyntaxKind.ContinueStatement: Object.assign(result, { type: SyntaxKind[node.kind], - label: convertChild(node.label) + label: convertChild((node as any).label) }); break; @@ -532,17 +533,17 @@ module.exports = function convert(config) { case SyntaxKind.IfStatement: Object.assign(result, { type: AST_NODE_TYPES.IfStatement, - test: convertChild(node.expression), - consequent: convertChild(node.thenStatement), - alternate: convertChild(node.elseStatement) + test: convertChild((node as any).expression), + consequent: convertChild((node as any).thenStatement), + alternate: convertChild((node as any).elseStatement) }); break; case SyntaxKind.SwitchStatement: Object.assign(result, { type: AST_NODE_TYPES.SwitchStatement, - discriminant: convertChild(node.expression), - cases: node.caseBlock.clauses.map(convertChild) + discriminant: convertChild((node as any).expression), + cases: (node as any).caseBlock.clauses.map(convertChild) }); break; @@ -550,8 +551,8 @@ module.exports = function convert(config) { case SyntaxKind.DefaultClause: Object.assign(result, { type: AST_NODE_TYPES.SwitchCase, - test: convertChild(node.expression), - consequent: node.statements.map(convertChild) + test: convertChild((node as any).expression), + consequent: (node as any).statements.map(convertChild) }); break; @@ -560,7 +561,7 @@ module.exports = function convert(config) { case SyntaxKind.ThrowStatement: Object.assign(result, { type: AST_NODE_TYPES.ThrowStatement, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; @@ -568,23 +569,23 @@ module.exports = function convert(config) { Object.assign(result, { type: AST_NODE_TYPES.TryStatement, block: convert({ - node: node.tryBlock, + node: (node as any).tryBlock, parent: null, ast, additionalOptions }), - handler: convertChild(node.catchClause), - finalizer: convertChild(node.finallyBlock) + handler: convertChild((node as any).catchClause), + finalizer: convertChild((node as any).finallyBlock) }); break; case SyntaxKind.CatchClause: Object.assign(result, { type: AST_NODE_TYPES.CatchClause, - param: node.variableDeclaration - ? convertChild(node.variableDeclaration.name) + param: (node as any).variableDeclaration + ? convertChild((node as any).variableDeclaration.name) : null, - body: convertChild(node.block) + body: convertChild((node as any).block) }); break; @@ -593,8 +594,8 @@ module.exports = function convert(config) { case SyntaxKind.WhileStatement: Object.assign(result, { type: AST_NODE_TYPES.WhileStatement, - test: convertChild(node.expression), - body: convertChild(node.statement) + test: convertChild((node as any).expression), + body: convertChild((node as any).statement) }); break; @@ -605,32 +606,32 @@ module.exports = function convert(config) { case SyntaxKind.DoStatement: Object.assign(result, { type: AST_NODE_TYPES.DoWhileStatement, - test: convertChild(node.expression), - body: convertChild(node.statement) + test: convertChild((node as any).expression), + body: convertChild((node as any).statement) }); break; case SyntaxKind.ForStatement: Object.assign(result, { type: AST_NODE_TYPES.ForStatement, - init: convertChild(node.initializer), - test: convertChild(node.condition), - update: convertChild(node.incrementor), - body: convertChild(node.statement) + init: convertChild((node as any).initializer), + test: convertChild((node as any).condition), + update: convertChild((node as any).incrementor), + body: convertChild((node as any).statement) }); break; case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: { const isAwait = !!( - node.awaitModifier && - node.awaitModifier.kind === SyntaxKind.AwaitKeyword + (node as any).awaitModifier && + (node as any).awaitModifier.kind === SyntaxKind.AwaitKeyword ); Object.assign(result, { type: SyntaxKind[node.kind], - left: convertChild(node.initializer), - right: convertChild(node.expression), - body: convertChild(node.statement), + left: convertChild((node as any).initializer), + right: convertChild((node as any).expression), + body: convertChild((node as any).statement), await: isAwait }); break; @@ -653,28 +654,28 @@ module.exports = function convert(config) { Object.assign(result, { type: functionDeclarationType, - id: convertChild(node.name), - generator: !!node.asteriskToken, + id: convertChild((node as any).name), + generator: !!(node as any).asteriskToken, expression: false, async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - params: convertParameters(node.parameters), - body: convertChild(node.body) + params: convertParameters((node as any).parameters), + body: convertChild((node as any).body) }); // Process returnType - if (node.type) { - result.returnType = convertTypeAnnotation(node.type); + if ((node as any).type) { + (result as any).returnType = convertTypeAnnotation((node as any).type); } // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { + if ((node as any).typeParameters && (node as any).typeParameters.length) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + (node as any).typeParameters ); } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = nodeUtils.fixExports(node, result as any, ast); break; } @@ -682,17 +683,19 @@ module.exports = function convert(config) { case SyntaxKind.VariableDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.VariableDeclarator, - id: convertChild(node.name), - init: convertChild(node.initializer) + id: convertChild((node as any).name), + init: convertChild((node as any).initializer) }); - if (node.exclamationToken) { - result.definite = true; + if ((node as any).exclamationToken) { + (result as any).definite = true; } - if (node.type) { - result.id.typeAnnotation = convertTypeAnnotation(node.type); - fixTypeAnnotationParentLocation(result.id); + if ((node as any).type) { + (result as any).id.typeAnnotation = convertTypeAnnotation( + (node as any).type + ); + fixTypeAnnotationParentLocation((result as any).id); } break; } @@ -700,19 +703,21 @@ module.exports = function convert(config) { case SyntaxKind.VariableStatement: Object.assign(result, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarationList.declarations.map(convertChild), - kind: nodeUtils.getDeclarationKind(node.declarationList) + declarations: (node as any).declarationList.declarations.map( + convertChild + ), + kind: nodeUtils.getDeclarationKind((node as any).declarationList) }); // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = nodeUtils.fixExports(node, result as any, ast); break; // mostly for for-of, for-in case SyntaxKind.VariableDeclarationList: Object.assign(result, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarations.map(convertChild), + declarations: (node as any).declarations.map(convertChild), kind: nodeUtils.getDeclarationKind(node) }); break; @@ -722,7 +727,7 @@ module.exports = function convert(config) { case SyntaxKind.ExpressionStatement: Object.assign(result, { type: AST_NODE_TYPES.ExpressionStatement, - expression: convertChild(node.expression) + expression: convertChild((node as any).expression) }); break; @@ -747,15 +752,16 @@ module.exports = function convert(config) { if (node.parent.kind === SyntaxKind.CallExpression) { arrayIsInAssignment = false; } else if ( - nodeUtils.getBinaryExpressionType(arrayAssignNode.operatorToken) === - AST_NODE_TYPES.AssignmentExpression + nodeUtils.getBinaryExpressionType( + (arrayAssignNode as any).operatorToken + ) === AST_NODE_TYPES.AssignmentExpression ) { arrayIsInAssignment = nodeUtils.findChildOfKind( - arrayAssignNode.left, + (arrayAssignNode as any).left, SyntaxKind.ArrayLiteralExpression, ast - ) === node || arrayAssignNode.left === node; + ) === node || (arrayAssignNode as any).left === node; } else { arrayIsInAssignment = false; } @@ -765,12 +771,12 @@ module.exports = function convert(config) { if (arrayIsInAssignment || arrayIsInForOf || arrayIsInForIn) { Object.assign(result, { type: AST_NODE_TYPES.ArrayPattern, - elements: node.elements.map(convertChild) + elements: (node as any).elements.map(convertChild) }); } else { Object.assign(result, { type: AST_NODE_TYPES.ArrayExpression, - elements: node.elements.map(convertChild) + elements: (node as any).elements.map(convertChild) }); } break; @@ -786,21 +792,21 @@ module.exports = function convert(config) { const objectAssignNode = ancestorNode && ancestorNode.kind === SyntaxKind.BinaryExpression && - ancestorNode.operatorToken.kind === SyntaxKind.FirstAssignment + (ancestorNode as any).operatorToken.kind === SyntaxKind.FirstAssignment ? ancestorNode : null; let objectIsInAssignment = false; if (objectAssignNode) { - if (objectAssignNode.left === node) { + if ((objectAssignNode as any).left === node) { objectIsInAssignment = true; } else if (node.parent.kind === SyntaxKind.CallExpression) { objectIsInAssignment = false; } else { objectIsInAssignment = nodeUtils.findChildOfKind( - objectAssignNode.left, + (objectAssignNode as any).left, SyntaxKind.ObjectLiteralExpression, ast ) === node; @@ -811,12 +817,12 @@ module.exports = function convert(config) { if (objectIsInAssignment) { Object.assign(result, { type: AST_NODE_TYPES.ObjectPattern, - properties: node.properties.map(convertChild) + properties: (node as any).properties.map(convertChild) }); } else { Object.assign(result, { type: AST_NODE_TYPES.ObjectExpression, - properties: node.properties.map(convertChild) + properties: (node as any).properties.map(convertChild) }); } @@ -826,9 +832,9 @@ module.exports = function convert(config) { case SyntaxKind.PropertyAssignment: Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: convertChild(node.initializer), - computed: nodeUtils.isComputedProperty(node.name), + key: convertChild((node as any).name), + value: convertChild((node as any).initializer), + computed: nodeUtils.isComputedProperty((node as any).name), method: false, shorthand: false, kind: 'init' @@ -836,14 +842,14 @@ module.exports = function convert(config) { break; case SyntaxKind.ShorthandPropertyAssignment: { - if (node.objectAssignmentInitializer) { + if ((node as any).objectAssignmentInitializer) { Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild(node.name), + key: convertChild((node as any).name), value: { type: AST_NODE_TYPES.AssignmentPattern, - left: convertChild(node.name), - right: convertChild(node.objectAssignmentInitializer), + left: convertChild((node as any).name), + right: convertChild((node as any).objectAssignmentInitializer), loc: result.loc, range: result.range }, @@ -855,8 +861,8 @@ module.exports = function convert(config) { } else { Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: convertChild(node.initializer || node.name), + key: convertChild((node as any).name), + value: convertChild((node as any).initializer || (node as any).name), computed: false, method: false, shorthand: true, @@ -870,15 +876,15 @@ module.exports = function convert(config) { if (parent.kind === SyntaxKind.ObjectLiteralExpression) { Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild(node.name), - value: convertChild(node.name), + key: convertChild((node as any).name), + value: convertChild((node as any).name), computed: false, method: false, shorthand: true, kind: 'init' }); } else { - return convertChild(node.expression); + return convertChild((node as any).expression); } break; @@ -891,16 +897,16 @@ module.exports = function convert(config) { type: isAbstract ? AST_NODE_TYPES.TSAbstractClassProperty : AST_NODE_TYPES.ClassProperty, - key: convertChild(node.name), - value: convertChild(node.initializer), - computed: nodeUtils.isComputedProperty(node.name), + key: convertChild((node as any).name), + value: convertChild((node as any).initializer), + computed: nodeUtils.isComputedProperty((node as any).name), static: nodeUtils.hasStaticModifierFlag(node), readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined }); - if (node.type) { - result.typeAnnotation = convertTypeAnnotation(node.type); + if ((node as any).type) { + result.typeAnnotation = convertTypeAnnotation((node as any).type); } if (node.decorators) { @@ -909,19 +915,25 @@ module.exports = function convert(config) { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - result.accessibility = accessibility; + (result as any).accessibility = accessibility; } - if (node.name.kind === SyntaxKind.Identifier && node.questionToken) { - result.optional = true; + if ( + (node as any).name.kind === SyntaxKind.Identifier && + (node as any).questionToken + ) { + (result as any).optional = true; } - if (node.exclamationToken) { - result.definite = true; + if ((node as any).exclamationToken) { + (result as any).definite = true; } - if (result.key.type === AST_NODE_TYPES.Literal && node.questionToken) { - result.optional = true; + if ( + (result as any).key.type === AST_NODE_TYPES.Literal && + (node as any).questionToken + ) { + (result as any).optional = true; } break; } @@ -930,9 +942,9 @@ module.exports = function convert(config) { case SyntaxKind.SetAccessor: case SyntaxKind.MethodDeclaration: { const openingParen = nodeUtils.findFirstMatchingToken( - node.name, + (node as any).name, ast, - token => { + (token: any) => { if (!token || !token.kind) { return false; } @@ -941,38 +953,38 @@ module.exports = function convert(config) { ); const methodLoc = ast.getLineAndCharacterOfPosition( - openingParen.getStart() + (openingParen as any).getStart() ), nodeIsMethod = node.kind === SyntaxKind.MethodDeclaration, method = { type: AST_NODE_TYPES.FunctionExpression, id: null, - generator: !!node.asteriskToken, + generator: !!(node as any).asteriskToken, expression: false, async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - body: convertChild(node.body), - range: [node.parameters.pos - 1, result.range[1]], + body: convertChild((node as any).body), + range: [(node as any).parameters.pos - 1, (result as any).range[1]], loc: { start: { line: methodLoc.line + 1, column: methodLoc.character }, - end: result.loc.end + end: (result as any).loc.end } }; - if (node.type) { - method.returnType = convertTypeAnnotation(node.type); + if ((node as any).type) { + (method as any).returnType = convertTypeAnnotation((node as any).type); } if (parent.kind === SyntaxKind.ObjectLiteralExpression) { - method.params = node.parameters.map(convertChild); + (method as any).params = (node as any).parameters.map(convertChild); Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild(node.name), + key: convertChild((node as any).name), value: method, - computed: nodeUtils.isComputedProperty(node.name), + computed: nodeUtils.isComputedProperty((node as any).name), method: nodeIsMethod, shorthand: false, kind: 'init' @@ -983,7 +995,7 @@ module.exports = function convert(config) { /** * Unlike in object literal methods, class method params can have decorators */ - method.params = convertParameters(node.parameters); + (method as any).params = convertParameters((node as any).parameters); /** * TypeScript class methods can be defined as "abstract" @@ -997,9 +1009,9 @@ module.exports = function convert(config) { Object.assign(result, { type: methodDefinitionType, - key: convertChild(node.name), + key: convertChild((node as any).name), value: method, - computed: nodeUtils.isComputedProperty(node.name), + computed: nodeUtils.isComputedProperty((node as any).name), static: nodeUtils.hasStaticModifierFlag(node), kind: 'method' }); @@ -1010,30 +1022,33 @@ module.exports = function convert(config) { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - result.accessibility = accessibility; + (result as any).accessibility = accessibility; } } - if (result.key.type === AST_NODE_TYPES.Identifier && node.questionToken) { - result.key.optional = true; + if ( + (result as any).key.type === AST_NODE_TYPES.Identifier && + (node as any).questionToken + ) { + (result as any).key.optional = true; } if (node.kind === SyntaxKind.GetAccessor) { - result.kind = 'get'; + (result as any).kind = 'get'; } else if (node.kind === SyntaxKind.SetAccessor) { - result.kind = 'set'; + (result as any).kind = 'set'; } else if ( - !result.static && - node.name.kind === SyntaxKind.StringLiteral && - node.name.text === 'constructor' + !(result as any).static && + (node as any).name.kind === SyntaxKind.StringLiteral && + (node as any).name.text === 'constructor' ) { - result.kind = 'constructor'; + (result as any).kind = 'constructor'; } // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { - method.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + if ((node as any).typeParameters && (node as any).typeParameters.length) { + (method as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + (node as any).typeParameters ); } @@ -1048,37 +1063,38 @@ module.exports = function convert(config) { node ), firstConstructorToken = constructorIsStatic - ? nodeUtils.findNextToken(node.getFirstToken(), ast) + ? nodeUtils.findNextToken((node as any).getFirstToken(), ast) : node.getFirstToken(), constructorLoc = ast.getLineAndCharacterOfPosition( - node.parameters.pos - 1 + (node as any).parameters.pos - 1 ), constructor = { type: AST_NODE_TYPES.FunctionExpression, id: null, - params: convertParameters(node.parameters), + params: convertParameters((node as any).parameters), generator: false, expression: false, async: false, - body: convertChild(node.body), - range: [node.parameters.pos - 1, result.range[1]], + body: convertChild((node as any).body), + range: [(node as any).parameters.pos - 1, (result as any).range[1]], loc: { start: { line: constructorLoc.line + 1, column: constructorLoc.character }, - end: result.loc.end + end: (result as any).loc.end } }; const constructorIdentifierLocStart = ast.getLineAndCharacterOfPosition( - firstConstructorToken.getStart() + (firstConstructorToken as any).getStart() ), constructorIdentifierLocEnd = ast.getLineAndCharacterOfPosition( - firstConstructorToken.getEnd() + (firstConstructorToken as any).getEnd() ), constructorIsComputed = - !!node.name && nodeUtils.isComputedProperty(node.name); + !!(node as any).name && + nodeUtils.isComputedProperty((node as any).name); let constructorKey; @@ -1086,8 +1102,11 @@ module.exports = function convert(config) { constructorKey = { type: AST_NODE_TYPES.Literal, value: 'constructor', - raw: node.name.getText(), - range: [firstConstructorToken.getStart(), firstConstructorToken.end], + raw: (node as any).name.getText(), + range: [ + (firstConstructorToken as any).getStart(), + (firstConstructorToken as any).end + ], loc: { start: { line: constructorIdentifierLocStart.line + 1, @@ -1103,7 +1122,10 @@ module.exports = function convert(config) { constructorKey = { type: AST_NODE_TYPES.Identifier, name: 'constructor', - range: [firstConstructorToken.getStart(), firstConstructorToken.end], + range: [ + (firstConstructorToken as any).getStart(), + (firstConstructorToken as any).end + ], loc: { start: { line: constructorIdentifierLocStart.line + 1, @@ -1133,7 +1155,7 @@ module.exports = function convert(config) { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - result.accessibility = accessibility; + (result as any).accessibility = accessibility; } break; @@ -1142,23 +1164,23 @@ module.exports = function convert(config) { case SyntaxKind.FunctionExpression: Object.assign(result, { type: AST_NODE_TYPES.FunctionExpression, - id: convertChild(node.name), - generator: !!node.asteriskToken, - params: convertParameters(node.parameters), - body: convertChild(node.body), + id: convertChild((node as any).name), + generator: !!(node as any).asteriskToken, + params: convertParameters((node as any).parameters), + body: convertChild((node as any).body), async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), expression: false }); // Process returnType - if (node.type) { - result.returnType = convertTypeAnnotation(node.type); + if ((node as any).type) { + (result as any).returnType = convertTypeAnnotation((node as any).type); } // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { + if ((node as any).typeParameters && (node as any).typeParameters.length) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + (node as any).typeParameters ); } break; @@ -1172,7 +1194,7 @@ module.exports = function convert(config) { case SyntaxKind.ArrayBindingPattern: Object.assign(result, { type: AST_NODE_TYPES.ArrayPattern, - elements: node.elements.map(convertChild) + elements: (node as any).elements.map(convertChild) }); break; @@ -1183,26 +1205,26 @@ module.exports = function convert(config) { case SyntaxKind.ObjectBindingPattern: Object.assign(result, { type: AST_NODE_TYPES.ObjectPattern, - properties: node.elements.map(convertChild) + properties: (node as any).elements.map(convertChild) }); break; case SyntaxKind.BindingElement: if (parent.kind === SyntaxKind.ArrayBindingPattern) { const arrayItem = convert({ - node: node.name, + node: (node as any).name, parent, ast, additionalOptions }); - if (node.initializer) { + if ((node as any).initializer) { Object.assign(result, { type: AST_NODE_TYPES.AssignmentPattern, left: arrayItem, - right: convertChild(node.initializer) + right: convertChild((node as any).initializer) }); - } else if (node.dotDotDotToken) { + } else if ((node as any).dotDotDotToken) { Object.assign(result, { type: AST_NODE_TYPES.RestElement, argument: arrayItem @@ -1211,35 +1233,41 @@ module.exports = function convert(config) { return arrayItem; } } else if (parent.kind === SyntaxKind.ObjectBindingPattern) { - if (node.dotDotDotToken) { + if ((node as any).dotDotDotToken) { Object.assign(result, { type: AST_NODE_TYPES.RestElement, - argument: convertChild(node.propertyName || node.name) + argument: convertChild( + (node as any).propertyName || (node as any).name + ) }); } else { Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild(node.propertyName || node.name), - value: convertChild(node.name), + key: convertChild((node as any).propertyName || (node as any).name), + value: convertChild((node as any).name), computed: Boolean( - node.propertyName && - node.propertyName.kind === SyntaxKind.ComputedPropertyName + (node as any).propertyName && + (node as any).propertyName.kind === + SyntaxKind.ComputedPropertyName ), method: false, - shorthand: !node.propertyName, + shorthand: !(node as any).propertyName, kind: 'init' }); } - if (node.initializer) { - result.value = { + if ((node as any).initializer) { + (result as any).value = { type: AST_NODE_TYPES.AssignmentPattern, - left: convertChild(node.name), - right: convertChild(node.initializer), - range: [node.name.getStart(), node.initializer.end], + left: convertChild((node as any).name), + right: convertChild((node as any).initializer), + range: [ + (node as any).name.getStart(), + (node as any).initializer.end + ], loc: nodeUtils.getLocFor( - node.name.getStart(), - node.initializer.end, + (node as any).name.getStart(), + (node as any).initializer.end, ast ) }; @@ -1252,21 +1280,21 @@ module.exports = function convert(config) { type: AST_NODE_TYPES.ArrowFunctionExpression, generator: false, id: null, - params: convertParameters(node.parameters), - body: convertChild(node.body), + params: convertParameters((node as any).parameters), + body: convertChild((node as any).body), async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - expression: node.body.kind !== SyntaxKind.Block + expression: (node as any).body.kind !== SyntaxKind.Block }); // Process returnType - if (node.type) { - result.returnType = convertTypeAnnotation(node.type); + if ((node as any).type) { + (result as any).returnType = convertTypeAnnotation((node as any).type); } // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { + if ((node as any).typeParameters && (node as any).typeParameters.length) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + (node as any).typeParameters ); } break; @@ -1274,15 +1302,15 @@ module.exports = function convert(config) { case SyntaxKind.YieldExpression: Object.assign(result, { type: AST_NODE_TYPES.YieldExpression, - delegate: !!node.asteriskToken, - argument: convertChild(node.expression) + delegate: !!(node as any).asteriskToken, + argument: convertChild((node as any).expression) }); break; case SyntaxKind.AwaitExpression: Object.assign(result, { type: AST_NODE_TYPES.AwaitExpression, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; @@ -1296,7 +1324,7 @@ module.exports = function convert(config) { type: AST_NODE_TYPES.TemplateElement, value: { raw: ast.text.slice(node.getStart() + 1, node.end - 1), - cooked: node.text + cooked: (node as any).text }, tail: true, range: result.range, @@ -1310,24 +1338,24 @@ module.exports = function convert(config) { case SyntaxKind.TemplateExpression: Object.assign(result, { type: AST_NODE_TYPES.TemplateLiteral, - quasis: [convertChild(node.head)], + quasis: [convertChild((node as any).head)], expressions: [] }); - node.templateSpans.forEach(templateSpan => { - result.expressions.push(convertChild(templateSpan.expression)); - result.quasis.push(convertChild(templateSpan.literal)); + (node as any).templateSpans.forEach((templateSpan: any) => { + (result as any).expressions.push(convertChild(templateSpan.expression)); + (result as any).quasis.push(convertChild(templateSpan.literal)); }); break; case SyntaxKind.TaggedTemplateExpression: Object.assign(result, { type: AST_NODE_TYPES.TaggedTemplateExpression, - typeParameters: node.typeArguments - ? convertTypeArgumentsToTypeParameters(node.typeArguments) + typeParameters: (node as any).typeArguments + ? convertTypeArgumentsToTypeParameters((node as any).typeArguments) : undefined, - tag: convertChild(node.tag), - quasi: convertChild(node.template) + tag: convertChild((node as any).tag), + quasi: convertChild((node as any).template) }); break; @@ -1339,7 +1367,7 @@ module.exports = function convert(config) { type: AST_NODE_TYPES.TemplateElement, value: { raw: ast.text.slice(node.getStart() + 1, node.end - (tail ? 1 : 2)), - cooked: node.text + cooked: (node as any).text }, tail }); @@ -1356,16 +1384,16 @@ module.exports = function convert(config) { node.parent.parent && node.parent.parent.kind === SyntaxKind.BinaryExpression ) { - if (node.parent.parent.left === node.parent) { + if ((node as any).parent.parent.left === node.parent) { type = AST_NODE_TYPES.RestElement; - } else if (node.parent.parent.right === node.parent) { + } else if ((node as any).parent.parent.right === node.parent) { type = AST_NODE_TYPES.SpreadElement; } } Object.assign(result, { type, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; } @@ -1377,16 +1405,16 @@ module.exports = function convert(config) { node.parent.parent && node.parent.parent.kind === SyntaxKind.BinaryExpression ) { - if (node.parent.parent.right === node.parent) { + if ((node as any).parent.parent.right === node.parent) { type = AST_NODE_TYPES.SpreadElement; - } else if (node.parent.parent.left === node.parent) { + } else if ((node as any).parent.parent.left === node.parent) { type = AST_NODE_TYPES.RestElement; } } Object.assign(result, { type, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; } @@ -1394,36 +1422,38 @@ module.exports = function convert(config) { case SyntaxKind.Parameter: { let parameter; - if (node.dotDotDotToken) { - parameter = convertChild(node.name); + if ((node as any).dotDotDotToken) { + parameter = convertChild((node as any).name); Object.assign(result, { type: AST_NODE_TYPES.RestElement, argument: parameter }); - } else if (node.initializer) { - parameter = convertChild(node.name); + } else if ((node as any).initializer) { + parameter = convertChild((node as any).name); Object.assign(result, { type: AST_NODE_TYPES.AssignmentPattern, left: parameter, - right: convertChild(node.initializer) + right: convertChild((node as any).initializer) }); } else { parameter = convert({ - node: node.name, + node: (node as any).name, parent, ast, additionalOptions }); - result = parameter; + (result as any) = parameter; } - if (node.type) { - parameter.typeAnnotation = convertTypeAnnotation(node.type); - fixTypeAnnotationParentLocation(parameter); + if ((node as any).type) { + (parameter as any).typeAnnotation = convertTypeAnnotation( + (node as any).type + ); + fixTypeAnnotationParentLocation(parameter as any); } - if (node.questionToken) { - parameter.optional = true; + if ((node as any).questionToken) { + (parameter as any).optional = true; } if (node.modifiers) { @@ -1450,22 +1480,23 @@ module.exports = function convert(config) { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: { - const heritageClauses = node.heritageClauses || []; + const heritageClauses = (node as any).heritageClauses || []; let classNodeType = SyntaxKind[node.kind]; let lastClassToken = heritageClauses.length ? heritageClauses[heritageClauses.length - 1] - : node.name; + : (node as any).name; - if (node.typeParameters && node.typeParameters.length) { - const lastTypeParameter = - node.typeParameters[node.typeParameters.length - 1]; + if ((node as any).typeParameters && (node as any).typeParameters.length) { + const lastTypeParameter = (node as any).typeParameters[ + (node as any).typeParameters.length - 1 + ]; if (!lastClassToken || lastTypeParameter.pos > lastClassToken.pos) { lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast); } result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + (node as any).typeParameters ); } @@ -1495,7 +1526,7 @@ module.exports = function convert(config) { const openBrace = nodeUtils.findNextToken(lastClassToken, ast); const superClass = heritageClauses.find( - clause => clause.token === SyntaxKind.ExtendsKeyword + (clause: any) => clause.token === SyntaxKind.ExtendsKeyword ); if (superClass) { @@ -1508,25 +1539,25 @@ module.exports = function convert(config) { } if (superClass.types[0] && superClass.types[0].typeArguments) { - result.superTypeParameters = convertTypeArgumentsToTypeParameters( + (result as any).superTypeParameters = convertTypeArgumentsToTypeParameters( superClass.types[0].typeArguments ); } } const implementsClause = heritageClauses.find( - clause => clause.token === SyntaxKind.ImplementsKeyword + (clause: any) => clause.token === SyntaxKind.ImplementsKeyword ); Object.assign(result, { type: classNodeType, - id: convertChild(node.name), + id: convertChild((node as any).name), body: { type: AST_NODE_TYPES.ClassBody, body: [], // TODO: Fix location info - range: [openBrace.getStart(), result.range[1]], + range: [openBrace.getStart(), (result as any).range[1]], loc: nodeUtils.getLocFor(openBrace.getStart(), node.end, ast) }, superClass: @@ -1536,14 +1567,16 @@ module.exports = function convert(config) { }); if (implementsClause) { - result.implements = implementsClause.types.map(convertClassImplements); + (result as any).implements = implementsClause.types.map( + convertClassImplements + ); } if (node.decorators) { result.decorators = convertDecorators(node.decorators); } - const filteredMembers = node.members.filter( + const filteredMembers = (node as any).members.filter( nodeUtils.isESTreeClassMember ); @@ -1552,7 +1585,7 @@ module.exports = function convert(config) { } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = nodeUtils.fixExports(node, result as any, ast); break; } @@ -1561,32 +1594,37 @@ module.exports = function convert(config) { case SyntaxKind.ModuleBlock: Object.assign(result, { type: AST_NODE_TYPES.TSModuleBlock, - body: node.statements.map(convertChild) + body: (node as any).statements.map(convertChild) }); break; case SyntaxKind.ImportDeclaration: Object.assign(result, { type: AST_NODE_TYPES.ImportDeclaration, - source: convertChild(node.moduleSpecifier), + source: convertChild((node as any).moduleSpecifier), specifiers: [] }); - if (node.importClause) { - if (node.importClause.name) { - result.specifiers.push(convertChild(node.importClause)); + if ((node as any).importClause) { + if ((node as any).importClause.name) { + (result as any).specifiers.push( + convertChild((node as any).importClause) + ); } - if (node.importClause.namedBindings) { + if ((node as any).importClause.namedBindings) { if ( - node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport + (node as any).importClause.namedBindings.kind === + SyntaxKind.NamespaceImport ) { - result.specifiers.push( - convertChild(node.importClause.namedBindings) + (result as any).specifiers.push( + convertChild((node as any).importClause.namedBindings) ); } else { - result.specifiers = result.specifiers.concat( - node.importClause.namedBindings.elements.map(convertChild) + result.specifiers = (result as any).specifiers.concat( + (node as any).importClause.namedBindings.elements.map( + convertChild + ) ); } } @@ -1597,48 +1635,52 @@ module.exports = function convert(config) { case SyntaxKind.NamespaceImport: Object.assign(result, { type: AST_NODE_TYPES.ImportNamespaceSpecifier, - local: convertChild(node.name) + local: convertChild((node as any).name) }); break; case SyntaxKind.ImportSpecifier: Object.assign(result, { type: AST_NODE_TYPES.ImportSpecifier, - local: convertChild(node.name), - imported: convertChild(node.propertyName || node.name) + local: convertChild((node as any).name), + imported: convertChild((node as any).propertyName || (node as any).name) }); break; case SyntaxKind.ImportClause: Object.assign(result, { type: AST_NODE_TYPES.ImportDefaultSpecifier, - local: convertChild(node.name) + local: convertChild((node as any).name) }); // have to adjust location information due to tree differences - result.range[1] = node.name.end; - result.loc = nodeUtils.getLocFor(result.range[0], result.range[1], ast); + (result as any).range[1] = (node as any).name.end; + result.loc = nodeUtils.getLocFor( + (result as any).range[0], + (result as any).range[1], + ast + ); break; case SyntaxKind.NamedImports: Object.assign(result, { type: AST_NODE_TYPES.ImportDefaultSpecifier, - local: convertChild(node.name) + local: convertChild((node as any).name) }); break; case SyntaxKind.ExportDeclaration: - if (node.exportClause) { + if ((node as any).exportClause) { Object.assign(result, { type: AST_NODE_TYPES.ExportNamedDeclaration, - source: convertChild(node.moduleSpecifier), - specifiers: node.exportClause.elements.map(convertChild), + source: convertChild((node as any).moduleSpecifier), + specifiers: (node as any).exportClause.elements.map(convertChild), declaration: null }); } else { Object.assign(result, { type: AST_NODE_TYPES.ExportAllDeclaration, - source: convertChild(node.moduleSpecifier) + source: convertChild((node as any).moduleSpecifier) }); } break; @@ -1646,21 +1688,21 @@ module.exports = function convert(config) { case SyntaxKind.ExportSpecifier: Object.assign(result, { type: AST_NODE_TYPES.ExportSpecifier, - local: convertChild(node.propertyName || node.name), - exported: convertChild(node.name) + local: convertChild((node as any).propertyName || (node as any).name), + exported: convertChild((node as any).name) }); break; case SyntaxKind.ExportAssignment: - if (node.isExportEquals) { + if ((node as any).isExportEquals) { Object.assign(result, { type: AST_NODE_TYPES.TSExportAssignment, - expression: convertChild(node.expression) + expression: convertChild((node as any).expression) }); } else { Object.assign(result, { type: AST_NODE_TYPES.ExportDefaultDeclaration, - declaration: convertChild(node.expression) + declaration: convertChild((node as any).expression) }); } break; @@ -1669,7 +1711,7 @@ module.exports = function convert(config) { case SyntaxKind.PrefixUnaryExpression: case SyntaxKind.PostfixUnaryExpression: { - const operator = nodeUtils.getTextForTokenKind(node.operator); + const operator = nodeUtils.getTextForTokenKind((node as any).operator); Object.assign(result, { /** * ESTree uses UpdateExpression for ++/-- @@ -1679,7 +1721,7 @@ module.exports = function convert(config) { : AST_NODE_TYPES.UnaryExpression, operator, prefix: node.kind === SyntaxKind.PrefixUnaryExpression, - argument: convertChild(node.operand) + argument: convertChild((node as any).operand) }); break; } @@ -1689,7 +1731,7 @@ module.exports = function convert(config) { type: AST_NODE_TYPES.UnaryExpression, operator: 'delete', prefix: true, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; @@ -1698,7 +1740,7 @@ module.exports = function convert(config) { type: AST_NODE_TYPES.UnaryExpression, operator: 'void', prefix: true, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; @@ -1707,15 +1749,15 @@ module.exports = function convert(config) { type: AST_NODE_TYPES.UnaryExpression, operator: 'typeof', prefix: true, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; case SyntaxKind.TypeOperator: Object.assign(result, { type: AST_NODE_TYPES.TSTypeOperator, - operator: nodeUtils.getTextForTokenKind(node.operator), - typeAnnotation: convertChild(node.type) + operator: nodeUtils.getTextForTokenKind((node as any).operator), + typeAnnotation: convertChild((node as any).type) }); break; @@ -1723,42 +1765,51 @@ module.exports = function convert(config) { case SyntaxKind.BinaryExpression: // TypeScript uses BinaryExpression for sequences as well - if (nodeUtils.isComma(node.operatorToken)) { + if (nodeUtils.isComma((node as any).operatorToken)) { Object.assign(result, { type: AST_NODE_TYPES.SequenceExpression, expressions: [] }); - const left = convertChild(node.left), - right = convertChild(node.right); + const left = convertChild((node as any).left), + right = convertChild((node as any).right); - if (left.type === AST_NODE_TYPES.SequenceExpression) { - result.expressions = result.expressions.concat(left.expressions); + if ((left as any).type === AST_NODE_TYPES.SequenceExpression) { + (result as any).expressions = (result as any).expressions.concat( + (left as any).expressions + ); } else { - result.expressions.push(left); + (result as any).expressions.push(left); } - if (right.type === AST_NODE_TYPES.SequenceExpression) { - result.expressions = result.expressions.concat(right.expressions); + if ((right as any).type === AST_NODE_TYPES.SequenceExpression) { + (result as any).expressions = (result as any).expressions.concat( + (right as any).expressions + ); } else { - result.expressions.push(right); + (result as any).expressions.push(right); } } else if ( - node.operatorToken && - node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken + (node as any).operatorToken && + (node as any).operatorToken.kind === + SyntaxKind.AsteriskAsteriskEqualsToken ) { Object.assign(result, { type: AST_NODE_TYPES.AssignmentExpression, - operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), - left: convertChild(node.left), - right: convertChild(node.right) + operator: nodeUtils.getTextForTokenKind( + (node as any).operatorToken.kind + ), + left: convertChild((node as any).left), + right: convertChild((node as any).right) }); } else { Object.assign(result, { - type: nodeUtils.getBinaryExpressionType(node.operatorToken), - operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), - left: convertChild(node.left), - right: convertChild(node.right) + type: nodeUtils.getBinaryExpressionType((node as any).operatorToken), + operator: nodeUtils.getTextForTokenKind( + (node as any).operatorToken.kind + ), + left: convertChild((node as any).left), + right: convertChild((node as any).right) }); // if the binary expression is in a destructured array, switch it @@ -1777,12 +1828,12 @@ module.exports = function convert(config) { let upperArrayIsInAssignment; if (upperArrayAssignNode) { - if (upperArrayAssignNode.left === upperArrayNode) { + if ((upperArrayAssignNode as any).left === upperArrayNode) { upperArrayIsInAssignment = true; } else { upperArrayIsInAssignment = nodeUtils.findChildOfKind( - upperArrayAssignNode.left, + (upperArrayAssignNode as any).left, SyntaxKind.ArrayLiteralExpression, ast ) === upperArrayNode; @@ -1790,7 +1841,7 @@ module.exports = function convert(config) { } if (upperArrayIsInAssignment) { - delete result.operator; + delete (result as any).operator; result.type = AST_NODE_TYPES.AssignmentPattern; } } @@ -1801,25 +1852,26 @@ module.exports = function convert(config) { if (nodeUtils.isJSXToken(parent)) { const jsxMemberExpression = { type: AST_NODE_TYPES.MemberExpression, - object: convertChild(node.expression), - property: convertChild(node.name) + object: convertChild((node as any).expression), + property: convertChild((node as any).name) }; const isNestedMemberExpression = - node.expression.kind === SyntaxKind.PropertyAccessExpression; - if (node.expression.kind === SyntaxKind.ThisKeyword) { - jsxMemberExpression.object.name = 'this'; + (node as any).expression.kind === SyntaxKind.PropertyAccessExpression; + if ((node as any).expression.kind === SyntaxKind.ThisKeyword) { + (jsxMemberExpression as any).object.name = 'this'; } - jsxMemberExpression.object.type = isNestedMemberExpression + (jsxMemberExpression as any).object.type = isNestedMemberExpression ? AST_NODE_TYPES.MemberExpression : AST_NODE_TYPES.JSXIdentifier; - jsxMemberExpression.property.type = AST_NODE_TYPES.JSXIdentifier; + (jsxMemberExpression as any).property.type = + AST_NODE_TYPES.JSXIdentifier; Object.assign(result, jsxMemberExpression); } else { Object.assign(result, { type: AST_NODE_TYPES.MemberExpression, - object: convertChild(node.expression), - property: convertChild(node.name), + object: convertChild((node as any).expression), + property: convertChild((node as any).name), computed: false }); } @@ -1828,8 +1880,8 @@ module.exports = function convert(config) { case SyntaxKind.ElementAccessExpression: Object.assign(result, { type: AST_NODE_TYPES.MemberExpression, - object: convertChild(node.expression), - property: convertChild(node.argumentExpression), + object: convertChild((node as any).expression), + property: convertChild((node as any).argumentExpression), computed: true }); break; @@ -1837,21 +1889,21 @@ module.exports = function convert(config) { case SyntaxKind.ConditionalExpression: Object.assign(result, { type: AST_NODE_TYPES.ConditionalExpression, - test: convertChild(node.condition), - consequent: convertChild(node.whenTrue), - alternate: convertChild(node.whenFalse) + test: convertChild((node as any).condition), + consequent: convertChild((node as any).whenTrue), + alternate: convertChild((node as any).whenFalse) }); break; case SyntaxKind.CallExpression: Object.assign(result, { type: AST_NODE_TYPES.CallExpression, - callee: convertChild(node.expression), - arguments: node.arguments.map(convertChild) + callee: convertChild((node as any).expression), + arguments: (node as any).arguments.map(convertChild) }); - if (node.typeArguments && node.typeArguments.length) { + if ((node as any).typeArguments && (node as any).typeArguments.length) { result.typeParameters = convertTypeArgumentsToTypeParameters( - node.typeArguments + (node as any).typeArguments ); } break; @@ -1859,27 +1911,32 @@ module.exports = function convert(config) { case SyntaxKind.NewExpression: Object.assign(result, { type: AST_NODE_TYPES.NewExpression, - callee: convertChild(node.expression), - arguments: node.arguments ? node.arguments.map(convertChild) : [] + callee: convertChild((node as any).expression), + arguments: (node as any).arguments + ? (node as any).arguments.map(convertChild) + : [] }); - if (node.typeArguments && node.typeArguments.length) { + if ((node as any).typeArguments && (node as any).typeArguments.length) { result.typeParameters = convertTypeArgumentsToTypeParameters( - node.typeArguments + (node as any).typeArguments ); } break; case SyntaxKind.MetaProperty: { - const newToken = nodeUtils.convertToken(node.getFirstToken(), ast); + const newToken = nodeUtils.convertToken( + (node as any).getFirstToken(), + ast + ); Object.assign(result, { type: AST_NODE_TYPES.MetaProperty, meta: { type: AST_NODE_TYPES.Identifier, range: newToken.range, loc: newToken.loc, - name: nodeUtils.getTextForTokenKind(node.keywordToken) + name: nodeUtils.getTextForTokenKind((node as any).keywordToken) }, - property: convertChild(node.name) + property: convertChild((node as any).name) }); break; } @@ -1889,26 +1946,33 @@ module.exports = function convert(config) { case SyntaxKind.StringLiteral: Object.assign(result, { type: AST_NODE_TYPES.Literal, - raw: ast.text.slice(result.range[0], result.range[1]) + raw: ast.text.slice((result as any).range[0], (result as any).range[1]) }); if (parent.name && parent.name === node) { - result.value = node.text; + (result as any).value = (node as any).text; } else { - result.value = nodeUtils.unescapeStringLiteralText(node.text); + (result as any).value = nodeUtils.unescapeStringLiteralText( + (node as any).text + ); } break; case SyntaxKind.NumericLiteral: Object.assign(result, { type: AST_NODE_TYPES.Literal, - value: Number(node.text), - raw: ast.text.slice(result.range[0], result.range[1]) + value: Number((node as any).text), + raw: ast.text.slice((result as any).range[0], (result as any).range[1]) }); break; case SyntaxKind.RegularExpressionLiteral: { - const pattern = node.text.slice(1, node.text.lastIndexOf('/')); - const flags = node.text.slice(node.text.lastIndexOf('/') + 1); + const pattern = (node as any).text.slice( + 1, + (node as any).text.lastIndexOf('/') + ); + const flags = (node as any).text.slice( + (node as any).text.lastIndexOf('/') + 1 + ); let regex = null; try { @@ -1920,7 +1984,7 @@ module.exports = function convert(config) { Object.assign(result, { type: AST_NODE_TYPES.Literal, value: regex, - raw: node.text, + raw: (node as any).text, regex: { pattern, flags @@ -1976,9 +2040,9 @@ module.exports = function convert(config) { case SyntaxKind.JsxElement: Object.assign(result, { type: AST_NODE_TYPES.JSXElement, - openingElement: convertChild(node.openingElement), - closingElement: convertChild(node.closingElement), - children: node.children.map(convertChild) + openingElement: convertChild((node as any).openingElement), + closingElement: convertChild((node as any).closingElement), + children: (node as any).children.map(convertChild) }); break; @@ -1986,9 +2050,9 @@ module.exports = function convert(config) { case SyntaxKind.JsxFragment: Object.assign(result, { type: AST_NODE_TYPES.JSXFragment, - openingElement: convertChild(node.openingElement), - closingElement: convertChild(node.closingElement), - children: node.children.map(convertChild) + openingElement: convertChild((node as any).openingElement), + closingElement: convertChild((node as any).closingElement), + children: (node as any).children.map(convertChild) }); break; @@ -2000,7 +2064,7 @@ module.exports = function convert(config) { node.kind = SyntaxKind.JsxOpeningElement; const openingElement = convertChild(node); - openingElement.selfClosing = true; + (openingElement as any).selfClosing = true; Object.assign(result, { type: AST_NODE_TYPES.JSXElement, @@ -2015,19 +2079,19 @@ module.exports = function convert(config) { case SyntaxKind.JsxOpeningElement: Object.assign(result, { type: AST_NODE_TYPES.JSXOpeningElement, - typeParameters: node.typeArguments - ? convertTypeArgumentsToTypeParameters(node.typeArguments) + typeParameters: (node as any).typeArguments + ? convertTypeArgumentsToTypeParameters((node as any).typeArguments) : undefined, selfClosing: false, - name: convertTypeScriptJSXTagNameToESTreeName(node.tagName), - attributes: node.attributes.properties.map(convertChild) + name: convertTypeScriptJSXTagNameToESTreeName((node as any).tagName), + attributes: (node as any).attributes.properties.map(convertChild) }); break; case SyntaxKind.JsxClosingElement: Object.assign(result, { type: AST_NODE_TYPES.JSXClosingElement, - name: convertTypeScriptJSXTagNameToESTreeName(node.tagName) + name: convertTypeScriptJSXTagNameToESTreeName((node as any).tagName) }); break; @@ -2044,9 +2108,11 @@ module.exports = function convert(config) { break; case SyntaxKind.JsxExpression: { - const eloc = ast.getLineAndCharacterOfPosition(result.range[0] + 1); - const expression = node.expression - ? convertChild(node.expression) + const eloc = ast.getLineAndCharacterOfPosition( + (result as any).range[0] + 1 + ); + const expression = (node as any).expression + ? convertChild((node as any).expression) : { type: AST_NODE_TYPES.JSXEmptyExpression, loc: { @@ -2055,15 +2121,15 @@ module.exports = function convert(config) { column: eloc.character }, end: { - line: result.loc.end.line, - column: result.loc.end.column - 1 + line: (result as any).loc.end.line, + column: (result as any).loc.end.column - 1 } }, - range: [result.range[0] + 1, result.range[1] - 1] + range: [(result as any).range[0] + 1, (result as any).range[1] - 1] }; Object.assign(result, { - type: node.dotDotDotToken + type: (node as any).dotDotDotToken ? AST_NODE_TYPES.JSXSpreadChild : AST_NODE_TYPES.JSXExpressionContainer, expression @@ -2073,7 +2139,7 @@ module.exports = function convert(config) { } case SyntaxKind.JsxAttribute: { - const attributeName = nodeUtils.convertToken(node.name, ast); + const attributeName = nodeUtils.convertToken((node as any).name, ast); attributeName.type = AST_NODE_TYPES.JSXIdentifier; attributeName.name = attributeName.value; delete attributeName.value; @@ -2081,7 +2147,7 @@ module.exports = function convert(config) { Object.assign(result, { type: AST_NODE_TYPES.JSXAttribute, name: attributeName, - value: convertChild(node.initializer) + value: convertChild((node as any).initializer) }); break; @@ -2116,7 +2182,7 @@ module.exports = function convert(config) { case SyntaxKind.JsxSpreadAttribute: Object.assign(result, { type: AST_NODE_TYPES.JSXSpreadAttribute, - argument: convertChild(node.expression) + argument: convertChild((node as any).expression) }); break; @@ -2124,8 +2190,8 @@ module.exports = function convert(config) { case SyntaxKind.FirstNode: { Object.assign(result, { type: AST_NODE_TYPES.TSQualifiedName, - left: convertChild(node.left), - right: convertChild(node.right) + left: convertChild((node as any).left), + right: convertChild((node as any).right) }); break; @@ -2134,7 +2200,12 @@ module.exports = function convert(config) { // TypeScript specific case SyntaxKind.ParenthesizedExpression: - return convert({ node: node.expression, parent, ast, additionalOptions }); + return convert({ + node: (node as any).expression, + parent, + ast, + additionalOptions + }); /** * Convert TypeAliasDeclaration node into VariableDeclaration @@ -2143,21 +2214,21 @@ module.exports = function convert(config) { case SyntaxKind.TypeAliasDeclaration: { const typeAliasDeclarator = { type: AST_NODE_TYPES.VariableDeclarator, - id: convertChild(node.name), - init: convertChild(node.type), - range: [node.name.getStart(), node.end] + id: convertChild((node as any).name), + init: convertChild((node as any).type), + range: [(node as any).name.getStart(), (node as any).end] }; - typeAliasDeclarator.loc = nodeUtils.getLocFor( + (typeAliasDeclarator as any).loc = nodeUtils.getLocFor( typeAliasDeclarator.range[0], typeAliasDeclarator.range[1], ast ); // Process typeParameters - if (node.typeParameters && node.typeParameters.length) { - typeAliasDeclarator.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + if ((node as any).typeParameters && (node as any).typeParameters.length) { + (typeAliasDeclarator as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + (node as any).typeParameters ); } @@ -2168,7 +2239,7 @@ module.exports = function convert(config) { }); // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = nodeUtils.fixExports(node, result as any, ast); break; } @@ -2177,10 +2248,12 @@ module.exports = function convert(config) { Object.assign(result, { type: AST_NODE_TYPES.TSMethodSignature, optional: nodeUtils.isOptional(node), - computed: nodeUtils.isComputedProperty(node.name), - key: convertChild(node.name), - params: convertParameters(node.parameters), - typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, + computed: nodeUtils.isComputedProperty((node as any).name), + key: convertChild((node as any).name), + params: convertParameters((node as any).parameters), + typeAnnotation: (node as any).type + ? convertTypeAnnotation((node as any).type) + : null, readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), @@ -2190,12 +2263,12 @@ module.exports = function convert(config) { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - result.accessibility = accessibility; + (result as any).accessibility = accessibility; } - if (node.typeParameters) { - result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + if ((node as any).typeParameters) { + (result as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + (node as any).typeParameters ); } @@ -2206,12 +2279,12 @@ module.exports = function convert(config) { Object.assign(result, { type: AST_NODE_TYPES.TSPropertySignature, optional: nodeUtils.isOptional(node) || undefined, - computed: nodeUtils.isComputedProperty(node.name), - key: convertChild(node.name), - typeAnnotation: node.type - ? convertTypeAnnotation(node.type) + computed: nodeUtils.isComputedProperty((node as any).name), + key: convertChild((node as any).name), + typeAnnotation: (node as any).type + ? convertTypeAnnotation((node as any).type) : undefined, - initializer: convertChild(node.initializer) || undefined, + initializer: convertChild((node as any).initializer) || undefined, readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: @@ -2222,7 +2295,7 @@ module.exports = function convert(config) { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - result.accessibility = accessibility; + (result as any).accessibility = accessibility; } break; @@ -2231,8 +2304,10 @@ module.exports = function convert(config) { case SyntaxKind.IndexSignature: { Object.assign(result, { type: AST_NODE_TYPES.TSIndexSignature, - index: convertChild(node.parameters[0]), - typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, + index: convertChild((node as any).parameters[0]), + typeAnnotation: (node as any).type + ? convertTypeAnnotation((node as any).type) + : null, readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), @@ -2242,7 +2317,7 @@ module.exports = function convert(config) { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - result.accessibility = accessibility; + (result as any).accessibility = accessibility; } break; @@ -2251,13 +2326,15 @@ module.exports = function convert(config) { case SyntaxKind.ConstructSignature: { Object.assign(result, { type: AST_NODE_TYPES.TSConstructSignature, - params: convertParameters(node.parameters), - typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null + params: convertParameters((node as any).parameters), + typeAnnotation: (node as any).type + ? convertTypeAnnotation((node as any).type) + : null }); - if (node.typeParameters) { + if ((node as any).typeParameters) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + (node as any).typeParameters ); } @@ -2265,15 +2342,16 @@ module.exports = function convert(config) { } case SyntaxKind.InterfaceDeclaration: { - const interfaceHeritageClauses = node.heritageClauses || []; + const interfaceHeritageClauses = (node as any).heritageClauses || []; let interfaceLastClassToken = interfaceHeritageClauses.length ? interfaceHeritageClauses[interfaceHeritageClauses.length - 1] - : node.name; + : (node as any).name; - if (node.typeParameters && node.typeParameters.length) { - const interfaceLastTypeParameter = - node.typeParameters[node.typeParameters.length - 1]; + if ((node as any).typeParameters && (node as any).typeParameters.length) { + const interfaceLastTypeParameter = (node as any).typeParameters[ + (node as any).typeParameters.length - 1 + ]; if ( !interfaceLastClassToken || @@ -2285,7 +2363,7 @@ module.exports = function convert(config) { ); } result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters + (node as any).typeParameters ); } @@ -2301,8 +2379,8 @@ module.exports = function convert(config) { const interfaceBody = { type: AST_NODE_TYPES.TSInterfaceBody, - body: node.members.map(member => convertChild(member)), - range: [interfaceOpenBrace.getStart(), result.range[1]], + body: (node as any).members.map((member: any) => convertChild(member)), + range: [interfaceOpenBrace.getStart(), (result as any).range[1]], loc: nodeUtils.getLocFor(interfaceOpenBrace.getStart(), node.end, ast) }; @@ -2310,7 +2388,7 @@ module.exports = function convert(config) { abstract: hasAbstractKeyword, type: AST_NODE_TYPES.TSInterfaceDeclaration, body: interfaceBody, - id: convertChild(node.name), + id: convertChild((node as any).name), heritage: hasImplementsClause ? interfaceHeritageClauses[0].types.map( convertInterfaceHeritageClause @@ -2326,7 +2404,7 @@ module.exports = function convert(config) { result.decorators = convertDecorators(node.decorators); } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = nodeUtils.fixExports(node, result as any, ast); break; } @@ -2334,24 +2412,24 @@ module.exports = function convert(config) { case SyntaxKind.FirstTypeNode: Object.assign(result, { type: AST_NODE_TYPES.TSTypePredicate, - parameterName: convertChild(node.parameterName), - typeAnnotation: convertTypeAnnotation(node.type) + parameterName: convertChild((node as any).parameterName), + typeAnnotation: convertTypeAnnotation((node as any).type) }); /** * Specific fix for type-guard location data */ - result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; - result.typeAnnotation.range = result.typeAnnotation.typeAnnotation.range; + (result as any).typeAnnotation.loc = (result as any).typeAnnotation.typeAnnotation.loc; + (result as any).typeAnnotation.range = (result as any).typeAnnotation.typeAnnotation.range; break; case SyntaxKind.ImportType: Object.assign(result, { type: AST_NODE_TYPES.TSImportType, - isTypeOf: !!node.isTypeOf, - parameter: convertChild(node.argument), - qualifier: convertChild(node.qualifier), - typeParameters: node.typeArguments - ? convertTypeArgumentsToTypeParameters(node.typeArguments) + isTypeOf: !!(node as any).isTypeOf, + parameter: convertChild((node as any).argument), + qualifier: convertChild((node as any).qualifier), + typeParameters: (node as any).typeArguments + ? convertTypeArgumentsToTypeParameters((node as any).typeArguments) : null }); break; @@ -2359,13 +2437,13 @@ module.exports = function convert(config) { case SyntaxKind.EnumDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.TSEnumDeclaration, - id: convertChild(node.name), - members: node.members.map(convertChild) + id: convertChild((node as any).name), + members: (node as any).members.map(convertChild) }); // apply modifiers first... - applyModifiersToResult(node.modifiers); + applyModifiersToResult((node as any).modifiers); // ...then check for exports - result = nodeUtils.fixExports(node, result, ast); + result = nodeUtils.fixExports(node, result as any, ast); /** * Semantically, decorators are not allowed on enum declarations, * but the TypeScript compiler will parse them and produce a valid AST, @@ -2380,10 +2458,10 @@ module.exports = function convert(config) { case SyntaxKind.EnumMember: { Object.assign(result, { type: AST_NODE_TYPES.TSEnumMember, - id: convertChild(node.name) + id: convertChild((node as any).name) }); - if (node.initializer) { - result.initializer = convertChild(node.initializer); + if ((node as any).initializer) { + (result as any).initializer = convertChild((node as any).initializer); } break; } @@ -2398,15 +2476,15 @@ module.exports = function convert(config) { case SyntaxKind.ModuleDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.TSModuleDeclaration, - id: convertChild(node.name) + id: convertChild((node as any).name) }); - if (node.body) { - result.body = convertChild(node.body); + if ((node as any).body) { + result.body = convertChild((node as any).body); } // apply modifiers first... - applyModifiersToResult(node.modifiers); + applyModifiersToResult((node as any).modifiers); // ...then check for exports - result = nodeUtils.fixExports(node, result, ast); + result = nodeUtils.fixExports(node, result as any, ast); break; } @@ -2414,5 +2492,5 @@ module.exports = function convert(config) { deeplyCopy(); } - return result; -}; + return result as any; +} diff --git a/packages/typescript-estree/src/estree/experimental.ts b/packages/typescript-estree/src/estree/experimental.ts new file mode 100644 index 000000000000..103d9ffd53a5 --- /dev/null +++ b/packages/typescript-estree/src/estree/experimental.ts @@ -0,0 +1,30 @@ +import { Node, Expression, MethodDefinition, Property, Class } from './spec'; + +/** + * Decorator + */ +export interface Decorator extends Node { + type: 'Decorator'; + expression: Expression; +} + +/** + * MethodDefinition + */ +export interface ExtendedMethodDefinition extends MethodDefinition { + decorators: Decorator[]; +} + +/** + * Property + */ +export interface ExtendedProperty extends Property { + decorators: Decorator[]; +} + +/** + * Class + */ +export interface ExtendedClass extends Class { + decorators: Decorator[]; +} diff --git a/packages/typescript-estree/src/estree/extensions.ts b/packages/typescript-estree/src/estree/extensions.ts new file mode 100644 index 000000000000..5e036917a3b3 --- /dev/null +++ b/packages/typescript-estree/src/estree/extensions.ts @@ -0,0 +1,63 @@ +/** + * Based on https://github.com/estree/estree/blob/master/extensions/type-annotations.md + */ + +import { + Identifier, + Function, + ObjectPattern, + ArrayPattern, + RestElement +} from './spec'; + +/** + * Type Annotations + */ + +/** + * Any type annotation. + */ +export interface TypeAnnotation extends Node {} + +/** + * Identifier + * + * The `typeAnnotation` property is used only in the case of variable declarations with type annotations or function arguments with type annotations. + */ +export interface ExtendedIdentifier extends Identifier { + typeAnnotation: TypeAnnotation | null; +} + +/** + * Functions + * + * The `returnType` property is used to specify the type annotation for the return value of the function. + */ +export interface ExtendedFunction extends Function { + returnType: TypeAnnotation | null; +} + +/** + * Patterns + */ + +/** + * ObjectPattern + */ +export interface ExtendedObjectPattern extends ObjectPattern { + typeAnnotation: TypeAnnotation | null; +} + +/** + * ArrayPattern + */ +export interface ExtendedArrayPattern extends ArrayPattern { + typeAnnotation: TypeAnnotation | null; +} + +/** + * RestElement + */ +export interface ExtendedRestElement extends RestElement { + typeAnnotation: TypeAnnotation | null; +} diff --git a/packages/typescript-estree/src/estree/spec.ts b/packages/typescript-estree/src/estree/spec.ts new file mode 100644 index 000000000000..1d2a0a765ee6 --- /dev/null +++ b/packages/typescript-estree/src/estree/spec.ts @@ -0,0 +1,985 @@ +/** + * This document specifies the core ESTree AST node types based on: + * - ES5: https://github.com/estree/estree/blob/master/es5.md + * - ES2015: https://github.com/estree/estree/blob/master/es2015.md + * - ES2016: https://github.com/estree/estree/blob/master/es2016.md + * - ES2017: https://github.com/estree/estree/blob/master/es2017.md + * - ES2018: https://github.com/estree/estree/blob/master/es2018.md + */ + +/** + * Node objects + * + * ESTree AST nodes are represented as `Node` objects, which may have any prototype inheritance but which implement the following interface: + */ + +export interface Node { + type: string; + loc: SourceLocation | null; +} + +/** + * The `type` field is a string representing the AST variant type. Each subtype of `Node` is documented below with the specific string of its `type` field. You can use this field to determine which interface a node implements. + * + * The `loc` field represents the source location information of the node. If the node contains no information about the source location, the field is `null`; otherwise it is an object consisting of a start position (the position of the first character of the parsed source region) and an end position (the position of the first character after the parsed source region): + */ +export interface SourceLocation { + source: string | null; + start: Position; + end: Position; +} + +/** + * Each `Position` object consists of a `line` number (1-indexed) and a `column` number (0-indexed): + */ +export interface Position { + line: number; // >= 1 + column: number; // >= 0 +} + +/** + * Identifier + * + * An identifier. Note that an identifier may be an expression or a destructuring pattern. + */ +export interface Identifier extends Expression, Pattern { + type: 'Identifier'; + name: string; +} + +/** + * Literal + * + * A literal token. Note that a literal can be an expression. + */ +export interface Literal extends Expression { + type: 'Literal'; + value: string | boolean | null | number | RegExp; +} + +/** + * RegExpLiteral + * + * The `regex` property allows regexes to be represented in environments that don’t + * support certain flags such as `y` or `u`. In environments that don't support + * these flags `value` will be `null` as the regex can't be represented natively. + */ +export interface RegExpLiteral extends Literal { + regex: { + pattern: string; + flags: string; + }; +} + +/** + * Programs + * + * A complete program source tree. + * + * ES2015+ Parsers must specify sourceType as "module" if the source has been parsed as an ES6 module. Otherwise, sourceType must be "script". + */ +export interface Program extends Node { + type: 'Program'; + body: Array; + sourceType: 'script' | 'module'; +} + +/** + * Functions + * + * A function declaration or expression. + */ +export interface Function extends Node { + id: Identifier | null; + params: Pattern[]; + body: FunctionBody; + generator: boolean; + async: boolean; +} + +/** + * Statements + * + * Any statement. + */ +export interface Statement extends Node {} + +/** + * ExpressionStatement + * + * An expression statement, i.e., a statement consisting of a single expression. + */ +export interface ExpressionStatement extends Statement { + type: 'ExpressionStatement'; + expression: Expression; +} + +/** + * Directive + * + * A directive from the directive prologue of a script or function. + * The `directive` property is the raw string source of the directive without quotes. + */ +export interface Directive extends Node { + type: 'ExpressionStatement'; + expression: Literal; + directive: string; +} + +/** + * BlockStatement + * + * A block statement, i.e., a sequence of statements surrounded by braces. + */ +export interface BlockStatement extends Statement { + type: 'BlockStatement'; + body: Statement[]; +} + +/** + * FunctionBody + * + * The body of a function, which is a block statement that may begin with directives. + */ +export interface FunctionBody extends BlockStatement { + body: Array; +} + +/** + * EmptyStatement + * + * An empty statement, i.e., a solitary semicolon. + */ +export interface EmptyStatement extends Statement { + type: 'EmptyStatement'; +} + +/** + * DebuggerStatement + * + * A `debugger` statement. + */ +export interface DebuggerStatement extends Statement { + type: 'DebuggerStatement'; +} + +/** + * WithStatement + * + * A `with` statement. + */ +export interface WithStatement extends Statement { + type: 'WithStatement'; + object: Expression; + body: Statement; +} + +/** + * Control flow + */ + +/** + * ReturnStatement + * + * A `return` statement. + */ +export interface ReturnStatement extends Statement { + type: 'ReturnStatement'; + argument: Expression | null; +} + +/** + * LabeledStatement + * + * A labeled statement, i.e., a statement prefixed by a `break`/`continue` label. + */ +export interface LabeledStatement extends Statement { + type: 'LabeledStatement'; + label: Identifier; + body: Statement; +} + +/** + * BreakStatement + * + * A `break` statement. + */ +export interface BreakStatement extends Statement { + type: 'BreakStatement'; + label: Identifier | null; +} + +/** + * ContinueStatement + * + * A `continue` statement. + */ +export interface ContinueStatement extends Statement { + type: 'ContinueStatement'; + label: Identifier | null; +} + +/** + * Choice + */ + +/** + * IfStatement + * + * An `if` statement. + */ +export interface IfStatement extends Statement { + type: 'IfStatement'; + test: Expression; + consequent: Statement; + alternate: Statement | null; +} + +/** + * SwitchStatement + * + * A `switch` statement. + */ +export interface SwitchStatement extends Statement { + type: 'SwitchStatement'; + discriminant: Expression; + cases: SwitchCase[]; +} + +/** + * SwitchCase + * + * A `case` (if `test` is an `Expression`) or `default` (if `test === null`) clause in the body of a `switch` statement. + */ +export interface SwitchCase extends Node { + type: 'SwitchCase'; + test: Expression | null; + consequent: Statement[]; +} + +/** + * Exceptions + */ + +/** + * ThrowStatement + * + * A `throw` statement. + */ +export interface ThrowStatement extends Statement { + type: 'ThrowStatement'; + argument: Expression; +} + +/** + * TryStatement + * + * A `try` statement. If `handler` is `null` then `finalizer` must be a `BlockStatement`. + */ +export interface TryStatement extends Statement { + type: 'TryStatement'; + block: BlockStatement; + handler: CatchClause | null; + finalizer: BlockStatement | null; +} + +/** + * CatchClause + * + * A `catch` clause following a `try` block. + * + * The param is null if the catch binding is omitted. E.g., try { foo() } catch { bar() } + */ +export interface CatchClause extends Node { + type: 'CatchClause'; + param: Pattern | null; + body: BlockStatement; +} + +/** + * Loops + */ + +/** + * WhileStatement + * + * A `while` statement. + */ +export interface WhileStatement extends Statement { + type: 'WhileStatement'; + test: Expression; + body: Statement; +} + +/** + * DoWhileStatement + * + * A `do`/`while` statement. + */ +export interface DoWhileStatement extends Statement { + type: 'DoWhileStatement'; + body: Statement; + test: Expression; +} + +/** + * ForStatement + * + * A `for` statement. + */ +export interface ForStatement extends Statement { + type: 'ForStatement'; + init: VariableDeclaration | Expression | null; + test: Expression | null; + update: Expression | null; + body: Statement; +} + +/** + * ForInStatement + * + * A `for`/`in` statement. + */ +export interface ForInStatement extends Statement { + type: 'ForInStatement'; + left: VariableDeclaration | Pattern; + right: Expression; + body: Statement; +} + +/** + * ForOfStatement + * + * A `for`/`of` statement and for-await-of statements, e.g., for await (const x of xs) { + */ +export interface ForOfStatement { + type: 'ForOfStatement'; + left: VariableDeclaration | Pattern; + right: Expression; + body: Statement; + await: boolean; +} + +/** + * Declarations + * + * Any declaration node. Note that declarations are considered statements; this is because declarations can appear in any statement context. + */ +export interface Declaration extends Statement {} + +/** + * FunctionDeclaration + * + * A function declaration. Note that unlike in the parent interface `Function`, the `id` cannot be `null`. + */ +export interface FunctionDeclaration extends Function, Declaration { + type: 'FunctionDeclaration'; + id: Identifier; +} + +/** + * VariableDeclaration + * + * A variable declaration. + */ +export interface VariableDeclaration extends Declaration { + type: 'VariableDeclaration'; + declarations: VariableDeclarator[]; + kind: 'var' | 'let' | 'const'; +} + +/** + * VariableDeclarator + * + * A variable declarator. + */ +export interface VariableDeclarator extends Node { + type: 'VariableDeclarator'; + id: Pattern; + init: Expression | null; +} + +/** + * Expressions + * + * Any expression node. Since the left-hand side of an assignment may be any expression in general, an expression can also be a pattern. + */ +export interface Expression extends Node {} + +/** + * Super + * + * A super pseudo-expression. + */ +export interface Super extends Node { + type: 'Super'; +} + +/** + * ThisExpression + * + * A `this` expression. + */ +export interface ThisExpression extends Expression { + type: 'ThisExpression'; +} + +/** + * SpreadElement + * + * Spread expression, e.g., [head, ...iter, tail], f(head, ...iter, ...tail). + */ +export interface SpreadElement extends Node { + type: 'SpreadElement'; + argument: Expression; +} + +/** + * ArrayExpression + * + * An array expression. + */ +export interface ArrayExpression extends Expression { + type: 'ArrayExpression'; + elements: Array; +} + +/** + * ObjectExpression + * + * An object expression. + * + * Spread properties, e.g., {a: 1, ...obj, b: 2}. + */ +export interface ObjectExpression extends Expression { + type: 'ObjectExpression'; + properties: Array; +} + +/** + * Property + * + * A literal property in an object expression can have either a string or number as its `value`. Ordinary property initializers have a `kind` value `"init"`; getters and setters have the kind values `"get"` and `"set"`, respectively. + */ +export interface Property extends Node { + type: 'Property'; + key: Literal | Identifier | Expression; + value: Expression; + kind: 'init' | 'get' | 'set'; + method: boolean; + shorthand: boolean; + computed: boolean; +} + +/** + * FunctionExpression + * + * A `function` expression. + */ +export interface FunctionExpression extends Function, Expression { + type: 'FunctionExpression'; +} + +/** + * ArrowFunctionExpression + * + * A fat arrow function expression, e.g., let foo = (bar) => { / body / }. + */ +export interface ArrowFunctionExpression extends Expression { + id: Identifier | null; + params: Pattern[]; + type: 'ArrowFunctionExpression'; + body: FunctionBody | Expression; + generator: boolean; + expression: boolean; +} + +/** + * Unary operations + */ + +/** + * UnaryExpression + * + * A unary operator expression. + */ +export interface UnaryExpression extends Expression { + type: 'UnaryExpression'; + operator: UnaryOperator; + prefix: boolean; + argument: Expression; +} + +/** + * UnaryOperator + * + * A unary operator token. + */ +export type UnaryOperator = + | '-' + | '+' + | '!' + | '~' + | 'typeof' + | 'void' + | 'delete'; + +/** + * UpdateExpression + * + * An update (increment or decrement) operator expression. + */ +export interface UpdateExpression extends Expression { + type: 'UpdateExpression'; + operator: UpdateOperator; + argument: Expression; + prefix: boolean; +} + +/** + * UpdateOperator + * + * An update (increment or decrement) operator token. + */ +export type UpdateOperator = '++' | '--'; + +/** + * Binary operations + */ + +/** + * BinaryExpression + * + * A binary operator expression. + */ +export interface BinaryExpression extends Expression { + type: 'BinaryExpression'; + operator: BinaryOperator; + left: Expression; + right: Expression; +} + +/** + * BinaryOperator + * + * A binary operator token. + */ +export type BinaryOperator = + | '==' + | '!=' + | '===' + | '!==' + | '<' + | '<=' + | '>' + | '>=' + | '<<' + | '>>' + | '>>>' + | '+' + | '-' + | '*' + | '/' + | '%' + | '|' + | '^' + | '&' + | 'in' + | 'instanceof' + | '**'; + +/** + * AssignmentExpression + * + * An assignment operator expression. + * + * FROM ESTREE DOCS: + * + * ``` + * FIXME: This describes the Esprima and Acorn behaviors, which is not currently aligned with the SpiderMonkey behavior. + * + * extend interface AssignmentExpression { + * left: Pattern; + * } + * + * Note that pre-ES6 code was allowed to pass references around and so left was much more liberal; an implementation might choose to continue using old definition if it needs to support such legacy code. + * ``` + */ +export interface AssignmentExpression extends Expression { + type: 'AssignmentExpression'; + operator: AssignmentOperator; + left: Pattern | Expression; + right: Expression; +} + +/** + * AssignmentOperator + * + * An assignment operator token. + */ +export type AssignmentOperator = + | '=' + | '+=' + | '-=' + | '*=' + | '/=' + | '%=' + | '<<=' + | '>>=' + | '>>>=' + | '|=' + | '^=' + | '&=' + | '**='; + +/** + * LogicalExpression + * + * A logical operator expression. + */ +export interface LogicalExpression extends Expression { + type: 'LogicalExpression'; + operator: LogicalOperator; + left: Expression; + right: Expression; +} + +/** + * LogicalOperator + * + * A logical operator token. + */ +export type LogicalOperator = '||' | '&&'; + +/** + * MemberExpression + * + * A member expression. If `computed` is `true`, the node corresponds to a computed (`a[b]`) member expression and `property` is an `Expression`. If `computed` is `false`, the node corresponds to a static (`a.b`) member expression and `property` is an `Identifier`. + */ +export interface MemberExpression extends Expression, Pattern { + type: 'MemberExpression'; + object: Expression | Super; + property: Expression; + computed: boolean; +} + +/** + * ConditionalExpression + * + * A conditional expression, i.e., a ternary `?`/`:` expression. + */ +export interface ConditionalExpression extends Expression { + type: 'ConditionalExpression'; + test: Expression; + alternate: Expression; + consequent: Expression; +} + +/** + * CallExpression + * + * A function or method call expression. + */ +export interface CallExpression extends Expression { + type: 'CallExpression'; + callee: Expression | Super; + arguments: Array; +} + +/** + * NewExpression + * + * A `new` expression. + */ +export interface NewExpression extends Expression { + type: 'NewExpression'; + callee: Expression; + arguments: Array; +} + +/** + * SequenceExpression + * + * A sequence expression, i.e., a comma-separated sequence of expressions. + */ +export interface SequenceExpression extends Expression { + type: 'SequenceExpression'; + expressions: Expression[]; +} + +/** + * YieldExpression + * + * A yield expression. + */ +export interface YieldExpression extends Expression { + type: 'YieldExpression'; + argument: Expression | null; + delegate: boolean; +} + +/** + * AwaitExpression + */ +export interface AwaitExpression extends Expression { + type: 'AwaitExpression'; + argument: Expression; +} + +/** + * Template Literals + */ + +/** + * TemplateLiteral + */ +export interface TemplateLiteral extends Expression { + type: 'TemplateLiteral'; + quasis: TemplateElement[]; + expressions: Expression[]; +} + +/** + * TaggedTemplateExpression + */ +export interface TaggedTemplateExpression extends Expression { + type: 'TaggedTemplateExpression'; + tag: Expression; + quasi: TemplateLiteral; +} + +/** + * TemplateElement + * + * If the template literal is tagged and the text has an invalid escape, cooked will be null, e.g., tag`\unicode and \u{55}` + */ +export interface TemplateElement extends Node { + type: 'TemplateElement'; + tail: boolean; + value: { + cooked: string | null; + raw: string; + }; +} + +/** + * Patterns + * + * Destructuring binding and assignment are not part of ES5, but all binding positions accept Pattern to allow for destructuring in ES6. Nevertheless, for ES5, the only Pattern subtype is Identifier. + */ +export interface Pattern extends Node {} + +/** + * AssignmentProperty + */ +export interface AssignmentProperty extends Property { + type: 'Property'; // inherited + value: Pattern; + kind: 'init'; + method: false; +} + +/** + * ObjectPattern + * + * Rest properties, e.g., {a, ...rest} = obj. + */ +export interface ObjectPattern extends Pattern { + type: 'ObjectPattern'; + properties: Array; +} + +/** + * ArrayPattern + */ +export interface ArrayPattern extends Pattern { + type: 'ArrayPattern'; + elements: Array; +} + +/** + * RestElement + */ +export interface RestElement extends Pattern { + type: 'RestElement'; + argument: Pattern; +} + +/** + * AssignmentPattern + */ +export interface AssignmentPattern extends Pattern { + type: 'AssignmentPattern'; + left: Pattern; + right: Expression; +} + +/** + * Classes + */ + +/** + * Class + */ +export interface Class extends Node { + id: Identifier | null; + superClass: Expression | null; + body: ClassBody; +} + +/** + * ClassBody + */ +export interface ClassBody extends Node { + type: 'ClassBody'; + body: MethodDefinition[]; +} + +/** + * MethodDefinition + */ +export interface MethodDefinition extends Node { + type: 'MethodDefinition'; + key: Expression; + value: FunctionExpression; + kind: 'constructor' | 'method' | 'get' | 'set'; + computed: boolean; + static: boolean; +} + +/** + * ClassDeclaration + */ +export interface ClassDeclaration extends Class, Declaration { + type: 'ClassDeclaration'; + id: Identifier; +} + +/** + * ClassExpression + */ +export interface ClassExpression extends Class, Expression { + type: 'ClassExpression'; +} + +/** + * MetaProperty + */ +export interface MetaProperty extends Expression { + type: 'MetaProperty'; + meta: Identifier; + property: Identifier; +} + +/** + * Modules + */ + +/** + * ModuleDeclaration + * + * A module `import` or `export` declaration. + */ +export interface ModuleDeclaration extends Node {} + +/** + * ModuleSpecifier + * + * A specifier in an import or export declaration. + */ +export interface ModuleSpecifier extends Node { + local: Identifier; +} + +/** + * Imports + */ + +/** + * ImportDeclaration + * + * An import declaration, e.g., `import foo from "mod";`. + */ +export interface ImportDeclaration extends ModuleDeclaration { + type: 'ImportDeclaration'; + specifiers: Array< + ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier + >; + source: Literal; +} + +/** + * ImportSpecifier + * + * An imported variable binding, e.g., `{foo}` in `import {foo} from "mod"` or `{foo as bar}` in `import {foo as bar} from "mod"`. The `imported` field refers to the name of the export imported from the module. The `local` field refers to the binding imported into the local module scope. If it is a basic named import, such as in `import {foo} from "mod"`, both `imported` and `local` are equivalent `Identifier` nodes; in this case an `Identifier` node representing `foo`. If it is an aliased import, such as in `import {foo as bar} from "mod"`, the `imported` field is an `Identifier` node representing `foo`, and the `local` field is an `Identifier` node representing `bar`. + */ +export interface ImportSpecifier extends ModuleSpecifier { + type: 'ImportSpecifier'; + imported: Identifier; +} + +/** + * ImportDefaultSpecifier + * + * A default import specifier, e.g., `foo` in `import foo from "mod.js"`. + */ +export interface ImportDefaultSpecifier extends ModuleSpecifier { + type: 'ImportDefaultSpecifier'; +} + +/** + * ImportNamespaceSpecifier + * + * A namespace import specifier, e.g., `* as foo` in `import * as foo from "mod.js"`. + */ +export interface ImportNamespaceSpecifier extends ModuleSpecifier { + type: 'ImportNamespaceSpecifier'; +} + +/** + * Exports + */ + +/** + * ExportNamedDeclaration + * + * An export named declaration, e.g., `export {foo, bar};`, `export {foo} from "mod";` or `export var foo = 1;`. + * + * _Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state._ + */ +export interface ExportNamedDeclaration extends ModuleDeclaration { + type: 'ExportNamedDeclaration'; + declaration: Declaration | null; + specifiers: [ExportSpecifier]; + source: Literal | null; +} + +/** + * ExportSpecifier + * + * An exported variable binding, e.g., `{foo}` in `export {foo}` or `{bar as foo}` in `export {bar as foo}`. The `exported` field refers to the name exported in the module. The `local` field refers to the binding into the local module scope. If it is a basic named export, such as in `export {foo}`, both `exported` and `local` are equivalent `Identifier` nodes; in this case an `Identifier` node representing `foo`. If it is an aliased export, such as in `export {bar as foo}`, the `exported` field is an `Identifier` node representing `foo`, and the `local` field is an `Identifier` node representing `bar`. + */ +export interface ExportSpecifier extends ModuleSpecifier { + type: 'ExportSpecifier'; + exported: Identifier; +} + +/** + * ExportDefaultDeclaration + * + * An export default declaration, e.g., `export default function () {};` or `export default 1;`. + */ +export interface ExportDefaultDeclaration extends ModuleDeclaration { + type: 'ExportDefaultDeclaration'; + declaration: Declaration | Expression; +} + +/** + * ExportAllDeclaration + * + * An export batch declaration, e.g., `export * from "mod";`. + */ +export interface ExportAllDeclaration extends ModuleDeclaration { + type: 'ExportAllDeclaration'; + source: Literal; +} diff --git a/packages/typescript-estree/lib/node-utils.js b/packages/typescript-estree/src/node-utils.ts similarity index 67% rename from packages/typescript-estree/lib/node-utils.js rename to packages/typescript-estree/src/node-utils.ts index 5f83a67067a2..89618cd65069 100644 --- a/packages/typescript-estree/lib/node-utils.js +++ b/packages/typescript-estree/src/node-utils.ts @@ -1,22 +1,16 @@ /** - * @fileoverview Utilities for finding and converting TSNodes into ESTreeNodes + * @fileoverview Utilities for finding and converting ts.Nodes into ESTreeNodes * @author James Henry * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const ts = require('typescript'), - unescape = require('lodash.unescape'); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ +import ts from 'typescript'; +import unescape from 'lodash.unescape'; +import { + ESTreeNodeLoc, + ESTreeNode, + ESTreeToken +} from './temp-types-based-on-js-source'; const SyntaxKind = ts.SyntaxKind; @@ -40,7 +34,7 @@ const LOGICAL_OPERATORS = [ SyntaxKind.AmpersandAmpersandToken ]; -const TOKEN_TO_TEXT = {}; +const TOKEN_TO_TEXT: { [key: number]: string } = {}; TOKEN_TO_TEXT[SyntaxKind.OpenBraceToken] = '{'; TOKEN_TO_TEXT[SyntaxKind.CloseBraceToken] = '}'; TOKEN_TO_TEXT[SyntaxKind.OpenParenToken] = '('; @@ -104,12 +98,16 @@ TOKEN_TO_TEXT[SyntaxKind.ImportKeyword] = 'import'; /** * Find the first matching child based on the given sourceFile and predicate function. - * @param {TSNode} node The current TSNode - * @param {Object} sourceFile The full AST source file + * @param {ts.Node} node The current ts.Node + * @param {ts.SourceFile} sourceFile The full AST source file * @param {Function} predicate The predicate function to apply to each checked child - * @returns {TSNode|undefined} a matching child TSNode + * @returns {ts.Node|undefined} a matching child ts.Node */ -function findFirstMatchingChild(node, sourceFile, predicate) { +function findFirstMatchingChild( + node: ts.Node, + sourceFile: ts.SourceFile, + predicate: (node: ts.Node) => boolean +): ts.Node | undefined { const children = node.getChildren(sourceFile); for (let i = 0; i < children.length; i++) { const child = children[i]; @@ -125,11 +123,7 @@ function findFirstMatchingChild(node, sourceFile, predicate) { return undefined; } -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { +export default { /** * Expose the enum of possible TSNode `kind`s. */ @@ -170,20 +164,20 @@ module.exports = { }; /** - * Returns true if the given TSToken is the assignment operator - * @param {TSToken} operator the operator token + * Returns true if the given ts.Token is the assignment operator + * @param {ts.Token} operator the operator token * @returns {boolean} is assignment */ -function isAssignmentOperator(operator) { +function isAssignmentOperator(operator: ts.Token): boolean { return ASSIGNMENT_OPERATORS.indexOf(operator.kind) > -1; } /** - * Returns true if the given TSToken is a logical operator - * @param {TSToken} operator the operator token + * Returns true if the given ts.Token is a logical operator + * @param {ts.Token} operator the operator token * @returns {boolean} is a logical operator */ -function isLogicalOperator(operator) { +function isLogicalOperator(operator: ts.Token): boolean { return LOGICAL_OPERATORS.indexOf(operator.kind) > -1; } @@ -192,26 +186,26 @@ function isLogicalOperator(operator) { * @param {number} kind the token's SyntaxKind * @returns {string} the token applicable token as a string */ -function getTextForTokenKind(kind) { +function getTextForTokenKind(kind: number): string { return TOKEN_TO_TEXT[kind]; } /** - * Returns true if the given TSNode is a valid ESTree class member - * @param {TSNode} node TypeScript AST node + * Returns true if the given ts.Node is a valid ESTree class member + * @param {ts.Node} node TypeScript AST node * @returns {boolean} is valid ESTree class member */ -function isESTreeClassMember(node) { +function isESTreeClassMember(node: ts.Node): boolean { return node.kind !== SyntaxKind.SemicolonClassElement; } /** - * Checks if a TSNode has a modifier - * @param {SyntaxKind} modifierKind TypeScript SyntaxKind modifier - * @param {TSNode} node TypeScript AST node + * Checks if a ts.Node has a modifier + * @param {number} modifierKind TypeScript SyntaxKind modifier + * @param {ts.Node} node TypeScript AST node * @returns {boolean} has the modifier specified */ -function hasModifier(modifierKind, node) { +function hasModifier(modifierKind: number, node: ts.Node): boolean { return ( !!node.modifiers && !!node.modifiers.length && @@ -220,20 +214,20 @@ function hasModifier(modifierKind, node) { } /** - * Returns true if the given TSToken is a comma - * @param {TSToken} token the TypeScript token + * Returns true if the given ts.Token is a comma + * @param {ts.Token} token the TypeScript token * @returns {boolean} is comma */ -function isComma(token) { +function isComma(token: ts.Token): boolean { return token.kind === SyntaxKind.CommaToken; } /** - * Returns true if the given TSNode is a comment - * @param {TSNode} node the TypeScript node - * @returns {boolean} is commment + * Returns true if the given ts.Node is a comment + * @param {ts.Node} node the TypeScript node + * @returns {boolean} is comment */ -function isComment(node) { +function isComment(node: ts.Node): boolean { return ( node.kind === SyntaxKind.SingleLineCommentTrivia || node.kind === SyntaxKind.MultiLineCommentTrivia @@ -241,20 +235,20 @@ function isComment(node) { } /** - * Returns true if the given TSNode is a JSDoc comment - * @param {TSNode} node the TypeScript node + * Returns true if the given ts.Node is a JSDoc comment + * @param {ts.Node} node the TypeScript node * @returns {boolean} is JSDoc comment */ -function isJSDocComment(node) { +function isJSDocComment(node: ts.Node): boolean { return node.kind === SyntaxKind.JSDocComment; } /** - * Returns the binary expression type of the given TSToken - * @param {TSToken} operator the operator token + * Returns the binary expression type of the given ts.Token + * @param {ts.Token} operator the operator token * @returns {string} the binary expression type */ -function getBinaryExpressionType(operator) { +function getBinaryExpressionType(operator: ts.Token): string { if (isAssignmentOperator(operator)) { return 'AssignmentExpression'; } else if (isLogicalOperator(operator)) { @@ -266,12 +260,16 @@ function getBinaryExpressionType(operator) { /** * Returns line and column data for the given start and end positions, * for the given AST - * @param {Object} start start data - * @param {Object} end end data - * @param {Object} ast the AST object - * @returns {Object} the loc data - */ -function getLocFor(start, end, ast) { + * @param {number} start start data + * @param {number} end end data + * @param {ts.SourceFile} ast the AST object + * @returns {ESTreeNodeLoc} the loc data + */ +function getLocFor( + start: number, + end: number, + ast: ts.SourceFile +): ESTreeNodeLoc { const startLoc = ast.getLineAndCharacterOfPosition(start), endLoc = ast.getLineAndCharacterOfPosition(end); @@ -288,44 +286,47 @@ function getLocFor(start, end, ast) { } /** - * Returns line and column data for the given ESTreeNode or ESTreeToken, + * Returns line and column data for the given ts.Node or ts.Token, * for the given AST - * @param {ESTreeToken|ESTreeNode} nodeOrToken the ESTreeNode or ESTreeToken - * @param {Object} ast the AST object - * @returns {Object} the loc data - */ -function getLoc(nodeOrToken, ast) { + * @param {ts.Token|ts.Node} nodeOrToken the ts.Node or ts.Token + * @param {ts.SourceFile} ast the AST object + * @returns {ESTreeLoc} the loc data + */ +function getLoc( + nodeOrToken: ts.Node | ts.Token, + ast: ts.SourceFile +): ESTreeNodeLoc { return getLocFor(nodeOrToken.getStart(), nodeOrToken.end, ast); } /** - * Returns true if a given TSNode is a token - * @param {TSNode} node the TSNode + * Returns true if a given ts.Node is a token + * @param {ts.Node} node the ts.Node * @returns {boolean} is a token */ -function isToken(node) { +function isToken(node: ts.Node): boolean { return ( node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken ); } /** - * Returns true if a given TSNode is a JSX token - * @param {TSNode} node TSNode to be checked + * Returns true if a given ts.Node is a JSX token + * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is a JSX token */ -function isJSXToken(node) { +function isJSXToken(node: ts.Node): boolean { return ( node.kind >= SyntaxKind.JsxElement && node.kind <= SyntaxKind.JsxAttribute ); } /** - * Returns true if the given TSNode.kind value corresponds to a type keyword + * Returns true if the given ts.Node.kind value corresponds to a type keyword * @param {number} kind TypeScript SyntaxKind * @returns {boolean} is a type keyword */ -function isTypeKeyword(kind) { +function isTypeKeyword(kind: number): boolean { switch (kind) { case SyntaxKind.AnyKeyword: case SyntaxKind.BooleanKeyword: @@ -343,11 +344,11 @@ function isTypeKeyword(kind) { } /** - * Returns the declaration kind of the given TSNode - * @param {TSNode} node TypeScript AST node + * Returns the declaration kind of the given ts.Node + * @param {ts.Node} node TypeScript AST node * @returns {string} declaration kind */ -function getDeclarationKind(node) { +function getDeclarationKind(node: ts.Node): string { switch (node.kind) { case SyntaxKind.TypeAliasDeclaration: return 'type'; @@ -365,11 +366,11 @@ function getDeclarationKind(node) { } /** - * Gets a TSNode's accessibility level - * @param {TSNode} node The TSNode + * Gets a ts.Node's accessibility level + * @param {ts.Node} node The ts.Node * @returns {string | null} accessibility "public", "protected", "private", or null */ -function getTSNodeAccessibility(node) { +function getTSNodeAccessibility(node: ts.Node): string | null { const modifiers = node.modifiers; if (!modifiers) { return null; @@ -391,39 +392,46 @@ function getTSNodeAccessibility(node) { } /** - * Returns true if the given TSNode has the modifier flag set which corresponds + * Returns true if the given ts.Node has the modifier flag set which corresponds * to the static keyword. - * @param {TSNode} node The TSNode + * @param {ts.Node} node The ts.Node * @returns {boolean} whether or not the static modifier flag is set */ -function hasStaticModifierFlag(node) { +function hasStaticModifierFlag(node: ts.Node): boolean { /** * TODO: Remove dependency on private TypeScript method */ - return Boolean(ts.getModifierFlags(node) & ts.ModifierFlags.Static); + return Boolean((ts as any).getModifierFlags(node) & ts.ModifierFlags.Static); } /** * Finds the next token based on the previous one and its parent - * @param {TSToken} previousToken The previous TSToken - * @param {TSNode} parent The parent TSNode - * @returns {TSToken} the next TSToken - */ -function findNextToken(previousToken, parent) { + * @param {ts.Token} previousToken The previous ts.Token + * @param {ts.Node} parent The parent ts.Node + * @returns {ts.Token} the next TSToken + */ +function findNextToken( + previousToken: ts.Token, + parent: ts.Node +): ts.Token { /** * TODO: Remove dependency on private TypeScript method */ - return ts.findNextToken(previousToken, parent); + return (ts as any).findNextToken(previousToken, parent); } /** * Find the first matching token based on the given predicate function. - * @param {TSToken} previousToken The previous TSToken - * @param {TSNode} parent The parent TSNode + * @param {ts.Token} previousToken The previous ts.Token + * @param {ts.Node} parent The parent ts.Node * @param {Function} predicate The predicate function to apply to each checked token - * @returns {TSToken|undefined} a matching TSToken + * @returns {ts.Token|undefined} a matching ts.Token */ -function findFirstMatchingToken(previousToken, parent, predicate) { +function findFirstMatchingToken( + previousToken: ts.Token, + parent: ts.Node, + predicate: (node: ts.Node) => boolean +): ts.Token | undefined { while (previousToken) { if (predicate(previousToken)) { return previousToken; @@ -434,23 +442,30 @@ function findFirstMatchingToken(previousToken, parent, predicate) { } /** - * Finds the first child TSNode which matches the given kind - * @param {TSNode} node The parent TSNode - * @param {number} kind The TSNode kind to match against - * @param {Object} sourceFile The full AST source file - * @returns {TSNode|undefined} a matching TSNode + * Finds the first child ts.Node which matches the given kind + * @param {ts.Node} node The parent ts.Node + * @param {number} kind The ts.Node kind to match against + * @param {ts.SourceFile} sourceFile The full AST source file + * @returns {ts.Node|undefined} a matching ts.Node */ -function findChildOfKind(node, kind, sourceFile) { +function findChildOfKind( + node: ts.Node, + kind: number, + sourceFile: ts.SourceFile +): ts.Node | undefined { return findFirstMatchingChild(node, sourceFile, child => child.kind === kind); } /** * Find the first matching ancestor based on the given predicate function. - * @param {TSNode} node The current TSNode + * @param {ts.Node} node The current ts.Node * @param {Function} predicate The predicate function to apply to each checked ancestor - * @returns {TSNode|undefined} a matching parent TSNode + * @returns {ts.Node|undefined} a matching parent ts.Node */ -function findFirstMatchingAncestor(node, predicate) { +function findFirstMatchingAncestor( + node: ts.Node, + predicate: (node: ts.Node) => boolean +): ts.Node | undefined { while (node) { if (predicate(node)) { return node; @@ -461,21 +476,21 @@ function findFirstMatchingAncestor(node, predicate) { } /** - * Finds the first parent TSNode which mastches the given kind - * @param {TSNode} node The current TSNode - * @param {number} kind The TSNode kind to match against - * @returns {TSNode|undefined} a matching parent TSNode + * Finds the first parent ts.Node which matches the given kind + * @param {ts.Node} node The current ts.Node + * @param {number} kind The ts.Node kind to match against + * @returns {ts.Node|undefined} a matching parent ts.Node */ -function findAncestorOfKind(node, kind) { +function findAncestorOfKind(node: ts.Node, kind: number): ts.Node | undefined { return findFirstMatchingAncestor(node, parent => parent.kind === kind); } /** - * Returns true if a given TSNode has a JSX token within its hierarchy - * @param {TSNode} node TSNode to be checked + * Returns true if a given ts.Node has a JSX token within its hierarchy + * @param {ts.Node} node ts.Node to be checked * @returns {boolean} has JSX ancestor */ -function hasJSXAncestor(node) { +function hasJSXAncestor(node: ts.Node): boolean { return !!findFirstMatchingAncestor(node, isJSXToken); } @@ -484,37 +499,37 @@ function hasJSXAncestor(node) { * @param {string} text The escaped string literal text. * @returns {string} The unescaped string literal text. */ -function unescapeStringLiteralText(text) { +function unescapeStringLiteralText(text: string): string { return unescape(text); } /** - * Returns true if a given TSNode is a computed property - * @param {TSNode} node TSNode to be checked + * Returns true if a given ts.Node is a computed property + * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is Computed Property */ -function isComputedProperty(node) { +function isComputedProperty(node: ts.Node): boolean { return node.kind === SyntaxKind.ComputedPropertyName; } /** - * Returns true if a given TSNode is optional (has QuestionToken) - * @param {TSNode} node TSNode to be checked + * Returns true if a given ts.Node is optional (has QuestionToken) + * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is Optional */ -function isOptional(node) { +function isOptional(node: any): boolean { return node.questionToken ? node.questionToken.kind === SyntaxKind.QuestionToken : false; } /** - * Returns true if the given TSNode is within the context of a "typeAnnotation", + * Returns true if the given ts.Node is within the context of a "typeAnnotation", * which effectively means - is it coming from its parent's `type` or `types` property - * @param {TSNode} node TSNode to be checked + * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is within "typeAnnotation context" */ -function isWithinTypeAnnotation(node) { +function isWithinTypeAnnotation(node: any): boolean { return ( node.parent.type === node || (node.parent.types && node.parent.types.indexOf(node) > -1) @@ -522,13 +537,17 @@ function isWithinTypeAnnotation(node) { } /** - * Fixes the exports of the given TSNode - * @param {TSNode} node the TSNode - * @param {Object} result result - * @param {Object} ast the AST - * @returns {TSNode} the TSNode with fixed exports + * Fixes the exports of the given ts.Node + * @param {ts.Node} node the ts.Node + * @param {ESTreeNode} result result + * @param {ts.SourceFile} ast the AST + * @returns {ESTreeNode} the ESTreeNode with fixed exports */ -function fixExports(node, result, ast) { +function fixExports( + node: ts.Node, + result: ESTreeNode, + ast: ts.SourceFile +): ESTreeNode { // check for exports if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) { const exportKeyword = node.modifiers[0], @@ -545,7 +564,7 @@ function fixExports(node, result, ast) { ? 'ExportDefaultDeclaration' : 'ExportNamedDeclaration'; - const newResult = { + const newResult: any = { type: declarationType, declaration: result, range: [exportKeyword.getStart(), result.range[1]], @@ -564,11 +583,11 @@ function fixExports(node, result, ast) { } /** - * Returns the type of a given ESTreeToken - * @param {ESTreeToken} token the ESTreeToken + * Returns the type of a given ts.Token + * @param {ts.Token} token the ts.Token * @returns {string} the token type */ -function getTokenType(token) { +function getTokenType(token: any): string { // Need two checks for keywords since some are also identifiers if (token.originalKeywordKind) { switch (token.originalKeywordKind) { @@ -671,19 +690,19 @@ function getTokenType(token) { } /** - * Extends and formats a given ESTreeToken, for a given AST - * @param {ESTreeToken} token the ESTreeToken - * @param {Object} ast the AST object + * Extends and formats a given ts.Token, for a given AST + * @param {ts.Token} token the ts.Token + * @param {ts.SourceFile} ast the AST object * @returns {ESTreeToken} the converted ESTreeToken */ -function convertToken(token, ast) { +function convertToken(token: ts.Token, ast: ts.SourceFile): ESTreeToken { const start = token.kind === SyntaxKind.JsxText ? token.getFullStart() : token.getStart(), end = token.getEnd(), value = ast.text.slice(start, end), - newToken = { + newToken: any = { type: getTokenType(token), value, range: [start, end], @@ -702,16 +721,16 @@ function convertToken(token, ast) { /** * Converts all tokens for the given AST - * @param {Object} ast the AST object + * @param {ts.SourceFile} ast the AST object * @returns {ESTreeToken[]} the converted ESTreeTokens */ -function convertTokens(ast) { - const result = []; +function convertTokens(ast: ts.SourceFile): ESTreeToken[] { + const result: ESTreeToken[] = []; /** - * @param {TSNode} node the TSNode - * @returns {undefined} + * @param {ts.Node} node the ts.Node + * @returns {void} */ - function walk(node) { + function walk(node: ts.Node): void { // TypeScript generates tokens for types in JSDoc blocks. Comment tokens // and their children should not be walked or added to the resulting tokens list. if (isComment(node) || isJSDocComment(node)) { @@ -734,20 +753,24 @@ function convertTokens(ast) { /** * Get container token node between range - * @param {Object} ast the AST object - * @param {int} start The index at which the comment starts. - * @param {int} end The index at which the comment ends. - * @returns {TSToken} typescript container token + * @param {ts.SourceFile} ast the AST object + * @param {number} start The index at which the comment starts. + * @param {number} end The index at which the comment ends. + * @returns {ts.Token} typescript container token * @private */ -function getNodeContainer(ast, start, end) { +function getNodeContainer( + ast: ts.SourceFile, + start: number, + end: number +): ts.Token { let container = null; /** - * @param {TSNode} node the TSNode - * @returns {undefined} + * @param {ts.Node} node the ts.Node + * @returns {void} */ - function walk(node) { + function walk(node: ts.Node): void { const nodeStart = node.pos; const nodeEnd = node.end; @@ -761,16 +784,16 @@ function getNodeContainer(ast, start, end) { } walk(ast); - return container; + return (container as unknown) as ts.Token; } /** - * @param {Object} ast the AST object - * @param {int} start the index at which the error starts + * @param {ts.SourceFile} ast the AST object + * @param {number} start the index at which the error starts * @param {string} message the error message * @returns {Object} converted error object */ -function createError(ast, start, message) { +function createError(ast: ts.SourceFile, start: number, message: string) { const loc = ast.getLineAndCharacterOfPosition(start); return { index: start, diff --git a/packages/typescript-estree/parser.js b/packages/typescript-estree/src/parser.ts similarity index 80% rename from packages/typescript-estree/parser.js rename to packages/typescript-estree/src/parser.ts index 3268ebc767db..3d7c5d048e8f 100644 --- a/packages/typescript-estree/parser.js +++ b/packages/typescript-estree/src/parser.ts @@ -5,30 +5,28 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ +import semver from 'semver'; +import ts from 'typescript'; +import convert from './ast-converter'; +import { Extra, ParserOptions } from './temp-types-based-on-js-source'; -'use strict'; +const packageJSON = require('../package.json'); -const astNodeTypes = require('./lib/ast-node-types'), - ts = require('typescript'), - convert = require('./lib/ast-converter'), - semver = require('semver'); - -const SUPPORTED_TYPESCRIPT_VERSIONS = require('./package.json').devDependencies - .typescript; +const SUPPORTED_TYPESCRIPT_VERSIONS = packageJSON.devDependencies.typescript; const ACTIVE_TYPESCRIPT_VERSION = ts.version; const isRunningSupportedTypeScriptVersion = semver.satisfies( ACTIVE_TYPESCRIPT_VERSION, SUPPORTED_TYPESCRIPT_VERSIONS ); -let extra; +let extra: Extra; let warnedAboutTSVersion = false; /** * Resets the extra config object * @returns {void} */ -function resetExtra() { +function resetExtra(): void { extra = { tokens: null, range: false, @@ -38,7 +36,9 @@ function resetExtra() { strict: false, jsx: false, useJSXTextNode: false, - log: console.log + log: console.log, + errorOnUnknownASTType: false, + code: '' }; } @@ -48,14 +48,14 @@ function resetExtra() { /** * Parses the given source code to produce a valid AST - * @param {mixed} code TypeScript code - * @param {Object} options configuration object for the parser + * @param {string} code TypeScript code + * @param {ParserOptions} options configuration object for the parser * @returns {Object} the AST */ -function generateAST(code, options) { +function generateAST(code: string, options: ParserOptions): any { const toString = String; - if (typeof code !== 'string' && !(code instanceof String)) { + if (typeof code !== 'string' && !((code as any) instanceof String)) { code = toString(code); } @@ -140,17 +140,20 @@ function generateAST(code, options) { getNewLine() { return '\n'; }, - getSourceFile(filename) { + getSourceFile(filename: string) { return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true); }, readFile() { - return null; + return undefined; }, useCaseSensitiveFileNames() { return true; }, writeFile() { return null; + }, + getDirectories() { + return []; } }; @@ -159,7 +162,7 @@ function generateAST(code, options) { { noResolve: true, target: ts.ScriptTarget.Latest, - jsx: extra.jsx ? 'preserve' : undefined + jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined }, compilerHost ); @@ -174,10 +177,11 @@ function generateAST(code, options) { // Public //------------------------------------------------------------------------------ -exports.version = require('./package.json').version; +export { AST_NODE_TYPES } from './ast-node-types'; +export { version }; -exports.parse = function parse(code, options) { - return generateAST(code, options); -}; +const version = packageJSON.version; -exports.AST_NODE_TYPES = astNodeTypes; +export function parse(code: string, options: ParserOptions) { + return generateAST(code, options); +} diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts new file mode 100644 index 000000000000..9fe32a5195f8 --- /dev/null +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -0,0 +1,80 @@ +/** + * NOTE: The following types are inferred from usage within the original JavaScript source. + * + * They will be gradually replaced with the more accurate types derived from the ESTree spec, and its + * applicable extensions + */ +export interface ESTreeToken { + type: string; + value: string; + range: number[]; + loc: ESTreeNodeLoc; + regex?: { + pattern: string; + flags: string; + }; + object?: any; + property?: any; + name?: any; +} + +export interface ESTreeNode { + type: string; + loc: ESTreeNodeLoc; + range: number[]; + declaration?: ESTreeNode; + specifiers?: any[]; + source?: any; + typeAnnotation?: ESTreeNode | null; + typeParameters?: any; + id?: ESTreeNode | null; + expression?: ESTreeNode | null; + decorators?: any; + const?: boolean; + declare?: boolean; + modifiers?: any; + body?: any; + params?: any; + accessibility?: any; + readonly?: boolean; + static?: boolean; + export?: boolean; + parameter?: any; +} + +export interface ESTreeComment extends ESTreeNode {} + +export interface LineAndColumnData { + line: number; + column: number; +} + +export interface ESTreeNodeLoc { + start: LineAndColumnData; + end: LineAndColumnData; +} + +export interface Extra { + errorOnUnknownASTType: boolean; + useJSXTextNode: boolean; + tokens: null | ESTreeToken[]; + comment: boolean; + code: string; + range: boolean; + loc: boolean; + comments: ESTreeComment[]; + strict: boolean; + jsx: boolean; + log: Function; +} + +export interface ParserOptions { + range: boolean; + loc: boolean; + tokens: boolean; + comment: boolean; + jsx: boolean; + errorOnUnknownASTType: boolean; + useJSXTextNode: boolean; + loggerFn: Function | false; +} diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts similarity index 92% rename from packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js rename to packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index b649810b815d..b6349bea04d0 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.js +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -1,14 +1,30 @@ -'use strict'; +import glob from 'glob'; +import path from 'path'; +import jsxKnownIssues from '../jsx-known-issues'; -const path = require('path'); -const glob = require('glob'); +interface Fixture { + filename: string; + config?: any; +} + +interface FixturePatternConfig { + pattern: string; + config?: { + babylonParserOptions?: any; + typeScriptESTreeOptions?: any; + }; +} + +interface CreateFixturePatternConfig { + ignore?: string[]; + fileType?: string; + parseWithSourceTypeModule?: string[]; +} /** * JSX fixtures which have known issues for typescript-estree */ -const jsxFilesWithKnownIssues = require('../jsx-known-issues').map(f => - f.replace('jsx/', '') -); +const jsxFilesWithKnownIssues = jsxKnownIssues.map(f => f.replace('jsx/', '')); /** * Current random error difference on jsx/invalid-no-tag-name.src.js @@ -25,39 +41,30 @@ jsxFilesWithKnownIssues.push('invalid-no-tag-name'); jsxFilesWithKnownIssues.push('shorthand-fragment'); jsxFilesWithKnownIssues.push('shorthand-fragment-with-child'); -/** - * Custom constructs/concepts used in this file: - * - * type Pattern = string; // used for node-glob matching - * - * interface FixturePatternConfig { - * pattern: Pattern, - * config?: { - * babylonParserOptions: any, - * typeScriptESTreeOptions: any - * } - * } - */ - /** * Globally track which fixtures need to be parsed with sourceType: "module" * so that they can be added with the correct FixturePatternConfig */ -let fixturesRequiringSourceTypeModule = []; +let fixturesRequiringSourceTypeModule: FixturePatternConfig[] = []; /** * Utility to generate a FixturePatternConfig object containing the glob pattern for specific subsections of the fixtures/ directory, * including the capability to ignore specific nested patterns. * * @param {string} fixturesSubPath the sub-path within the fixtures/ directory - * @param {Object?} config an optional configuration object with optional sub-paths to ignore and/or parse with sourceType: module + * @param {CreateFixturePatternConfig?} config an optional configuration object with optional sub-paths to ignore and/or parse with sourceType: module * @returns {FixturePatternConfig} an object containing the glob pattern and optional additional config */ -function createFixturePatternConfigFor(fixturesSubPath, config) { +function createFixturePatternConfigFor( + fixturesSubPath: string, + config?: CreateFixturePatternConfig +): FixturePatternConfig { if (!fixturesSubPath) { - return ''; + throw new Error( + 'fixtureSubPath was not provided for the current fixture pattern' + ); } - config = config || {}; + config = config || ({} as CreateFixturePatternConfig); config.ignore = config.ignore || []; config.fileType = config.fileType || 'js'; config.parseWithSourceTypeModule = config.parseWithSourceTypeModule || []; @@ -72,12 +79,17 @@ function createFixturePatternConfigFor(fixturesSubPath, config) { * ignore list, and then add their full config into the global array. */ if (config.parseWithSourceTypeModule.length) { - config.ignore = [].concat(config.ignore, config.parseWithSourceTypeModule); - fixturesRequiringSourceTypeModule = [].concat( + config.ignore = ([] as string[]).concat( + config.ignore, + config.parseWithSourceTypeModule + ); + fixturesRequiringSourceTypeModule = ([] as FixturePatternConfig[]).concat( fixturesRequiringSourceTypeModule, config.parseWithSourceTypeModule.map(fixture => ({ // It needs to be the full path from within fixtures/ for the pattern - pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, + pattern: `${fixturesSubPath}/${fixture}.src.${ + (config as CreateFixturePatternConfig).fileType + }`, config: { babylonParserOptions: { sourceType: 'module' } } })) ); @@ -532,18 +544,12 @@ let fixturePatternConfigsToTest = [ /** * Add in all the fixtures which need to be parsed with sourceType: "module" */ -fixturePatternConfigsToTest = [].concat( +fixturePatternConfigsToTest = ([] as FixturePatternConfig[]).concat( fixturePatternConfigsToTest, fixturesRequiringSourceTypeModule ); -/** - * interface Fixture { - * filename: string, - * config?: any - * } - */ -const fixturesToTest = []; +const fixturesToTest: Fixture[] = []; const fixturesDirPath = path.join(__dirname, '../fixtures'); /** @@ -565,4 +571,4 @@ fixturePatternConfigsToTest.forEach(fixturePatternConfig => { }); }); -module.exports = fixturesToTest; +export { fixturesToTest }; diff --git a/packages/typescript-estree/tests/ast-alignment/jest.config.js b/packages/typescript-estree/tests/ast-alignment/jest.config.js index b2a29f24a095..b8b278046367 100644 --- a/packages/typescript-estree/tests/ast-alignment/jest.config.js +++ b/packages/typescript-estree/tests/ast-alignment/jest.config.js @@ -2,5 +2,9 @@ module.exports = { testEnvironment: 'node', - testRegex: 'spec\\.js$' + transform: { + '.+\\.tsx?$': 'ts-jest' + }, + testRegex: 'spec\\.ts$', + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'] }; diff --git a/packages/typescript-estree/tests/ast-alignment/parse.js b/packages/typescript-estree/tests/ast-alignment/parse.ts similarity index 64% rename from packages/typescript-estree/tests/ast-alignment/parse.js rename to packages/typescript-estree/tests/ast-alignment/parse.ts index d350cb85095a..d875556fa460 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.js +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -1,19 +1,19 @@ -'use strict'; +import codeFrame from 'babel-code-frame'; +import * as parser from '../../src/parser'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import * as parseUtils from './utils'; -const codeFrame = require('babel-code-frame'); -const parseUtils = require('./utils'); - -function createError(message, line, column) { +function createError(message: string, line: number, column: number) { // Construct an error similar to the ones thrown by Babylon. const error = new SyntaxError(`${message} (${line}:${column})`); - error.loc = { + (error as any).loc = { line, column }; return error; } -function parseWithBabylonPluginTypescript(text, parserOptions) { +function parseWithBabylonPluginTypescript(text: string, parserOptions?: any) { parserOptions = parserOptions || {}; const babylon = require('babylon'); return babylon.parse( @@ -40,36 +40,41 @@ function parseWithBabylonPluginTypescript(text, parserOptions) { ); } -function parseWithTypeScriptESTree(text, parserOptions) { - parserOptions = parserOptions || {}; - const parser = require('../../parser'); +function parseWithTypeScriptESTree( + text: string, + parserOptions?: ParserOptions +) { + parserOptions = parserOptions || ({} as ParserOptions); try { - return parser.parse( - text, - Object.assign( - { - loc: true, - range: true, - tokens: false, - comment: false, - useJSXTextNode: true, - errorOnUnknownASTType: true, - jsx: true - }, - parserOptions - ) - ); + return parser.parse(text, Object.assign( + { + loc: true, + range: true, + tokens: false, + comment: false, + useJSXTextNode: true, + errorOnUnknownASTType: true, + jsx: true + }, + parserOptions + ) as any); } catch (e) { throw createError(e.message, e.lineNumber, e.column); } } -module.exports = function parse(text, opts) { +interface ASTComparisonParseOptions { + parser: string; + typeScriptESTreeOptions?: ParserOptions; + babylonParserOptions?: any; +} + +export function parse(text: string, opts: ASTComparisonParseOptions) { /** * Always return a consistent interface, there will be times when we expect both * parsers to fail to parse the invalid source. */ - const result = { + const result: any = { parseError: null, ast: null }; @@ -103,4 +108,4 @@ module.exports = function parse(text, opts) { } return result; -}; +} diff --git a/packages/typescript-estree/tests/ast-alignment/spec.js b/packages/typescript-estree/tests/ast-alignment/spec.ts similarity index 84% rename from packages/typescript-estree/tests/ast-alignment/spec.js rename to packages/typescript-estree/tests/ast-alignment/spec.ts index b78b01714259..bf1359af5c79 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.js +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -1,10 +1,7 @@ -'use strict'; - -const fs = require('fs'); - -const parse = require('./parse'); -const parseUtils = require('./utils'); -const fixturesToTest = require('./fixtures-to-test'); +import fs from 'fs'; +import { fixturesToTest } from './fixtures-to-test'; +import { parse } from './parse'; +import * as parseUtils from './utils'; fixturesToTest.forEach(fixture => { const filename = fixture.filename; @@ -40,7 +37,7 @@ fixturesToTest.forEach(fixture => { * FAIL: babylon errored but typescript-estree did not */ if (!typeScriptESTreeResult.parseError) { - test(`TEST FAIL [BABYLON ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { + it(`TEST FAIL [BABYLON ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { expect(typeScriptESTreeResult.parseError).toEqual( babylonTypeScriptPluginResult.parseError ); @@ -50,7 +47,7 @@ fixturesToTest.forEach(fixture => { /** * Both parsers errored - this is OK as long as the errors are of the same "type" */ - test(`[Both parsers error as expected] - ${filename}`, () => { + it(`[Both parsers error as expected] - ${filename}`, () => { expect(babylonTypeScriptPluginResult.parseError.name).toEqual( typeScriptESTreeResult.parseError.name ); @@ -62,7 +59,7 @@ fixturesToTest.forEach(fixture => { * FAIL: typescript-estree errored but babylon did not */ if (typeScriptESTreeResult.parseError) { - test(`TEST FAIL [TSEP ERRORED, BUT BABYLON DID NOT] - ${filename}`, () => { + it(`TEST FAIL [TSEP ERRORED, BUT BABYLON DID NOT] - ${filename}`, () => { expect(babylonTypeScriptPluginResult.parseError).toEqual( typeScriptESTreeResult.parseError ); @@ -73,7 +70,7 @@ fixturesToTest.forEach(fixture => { /** * No errors, assert the two ASTs match */ - test(`${filename}`, () => { + it(`${filename}`, () => { expect(babylonTypeScriptPluginResult.ast).toBeTruthy(); expect(typeScriptESTreeResult.ast).toBeTruthy(); /** diff --git a/packages/typescript-estree/tests/ast-alignment/utils.js b/packages/typescript-estree/tests/ast-alignment/utils.ts similarity index 86% rename from packages/typescript-estree/tests/ast-alignment/utils.js rename to packages/typescript-estree/tests/ast-alignment/utils.ts index bd1acca7fb40..0d1b1caa6543 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.js +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -1,6 +1,4 @@ -'use strict'; - -const isPlainObject = require('lodash.isplainobject'); +import isPlainObject from 'lodash.isplainobject'; /** * By default, pretty-format (within Jest matchers) retains the names/types of nodes from the babylon AST, @@ -10,7 +8,7 @@ const isPlainObject = require('lodash.isplainobject'); * @param {Object} ast raw AST * @returns {Object} normalized AST */ -function normalizeNodeTypes(ast) { +export function normalizeNodeTypes(ast: any): any { return JSON.parse(JSON.stringify(ast)); } @@ -20,9 +18,12 @@ function normalizeNodeTypes(ast) { * @param {Object[]} keysToOmit Names and predicate functions use to determine what keys to omit from the final object * @returns {Object} formatted object */ -function omitDeep(obj, keysToOmit) { +export function omitDeep( + obj: any, + keysToOmit: { key: string; predicate: Function }[] +): any { keysToOmit = keysToOmit || []; - function shouldOmit(keyName, val) { + function shouldOmit(keyName: string, val: any) { if (!keysToOmit || !keysToOmit.length) { return false; } @@ -39,10 +40,10 @@ function omitDeep(obj, keysToOmit) { if (!obj.hasOwnProperty(key)) { continue; } - const val = obj[key]; + const val = (obj as any)[key]; if (isPlainObject(val)) { if (shouldOmit(key, val)) { - delete obj[key]; + delete (obj as any)[key]; // re-run with the same arguments // in case the object has multiple keys to omit return omitDeep(obj, keysToOmit); @@ -50,7 +51,7 @@ function omitDeep(obj, keysToOmit) { omitDeep(val, keysToOmit); } else if (Array.isArray(val)) { if (shouldOmit(key, val)) { - delete obj[key]; + delete (obj as any)[key]; // re-run with the same arguments // in case the object has multiple keys to omit return omitDeep(obj, keysToOmit); @@ -59,7 +60,7 @@ function omitDeep(obj, keysToOmit) { omitDeep(i, keysToOmit); } } else if (shouldOmit(key, val)) { - delete obj[key]; + delete (obj as any)[key]; // re-run with the same arguments // in case the object has multiple keys to omit return omitDeep(obj, keysToOmit); @@ -72,7 +73,7 @@ function omitDeep(obj, keysToOmit) { * Common predicates for Babylon AST preprocessing */ const always = () => true; -const ifNumber = val => typeof val === 'number'; +const ifNumber = (val: any) => typeof val === 'number'; /** * - Babylon wraps the "Program" node in an extra "File" node, normalize this for simplicity for now... @@ -82,7 +83,7 @@ const ifNumber = val => typeof val === 'number'; * @param {Object} ast raw babylon AST * @returns {Object} processed babylon AST */ -function preprocessBabylonAST(ast) { +export function preprocessBabylonAST(ast: any): any { return omitDeep(ast.program, [ { key: 'start', @@ -139,14 +140,8 @@ function preprocessBabylonAST(ast) { * @param {Object} ast the raw AST with a Program node at its top level * @returns {Object} the ast with the location data removed from the Program node */ -function removeLocationDataFromProgramNode(ast) { +export function removeLocationDataFromProgramNode(ast: any) { delete ast.loc; delete ast.range; return ast; } - -module.exports = { - normalizeNodeTypes, - preprocessBabylonAST, - removeLocationDataFromProgramNode -}; diff --git a/packages/typescript-estree/tests/jsx-known-issues.js b/packages/typescript-estree/tests/jsx-known-issues.ts similarity index 93% rename from packages/typescript-estree/tests/jsx-known-issues.js rename to packages/typescript-estree/tests/jsx-known-issues.ts index 42855526a596..6f1178c7a824 100644 --- a/packages/typescript-estree/tests/jsx-known-issues.js +++ b/packages/typescript-estree/tests/jsx-known-issues.ts @@ -1,9 +1,7 @@ -'use strict'; - /** * Export the list to allow it to be used within both unit and AST comparison tests */ -module.exports = [ +export default [ 'jsx/embedded-tags', // https://github.com/Microsoft/TypeScript/issues/7410 'jsx/namespaced-attribute-and-value-inserted', // https://github.com/Microsoft/TypeScript/issues/7411 'jsx/namespaced-name-and-attribute', // https://github.com/Microsoft/TypeScript/issues/7411 diff --git a/packages/typescript-estree/tests/lib/__snapshots__/basics.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/basics.ts.snap similarity index 100% rename from packages/typescript-estree/tests/lib/__snapshots__/basics.js.snap rename to packages/typescript-estree/tests/lib/__snapshots__/basics.ts.snap diff --git a/packages/typescript-estree/tests/lib/__snapshots__/comments.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap similarity index 100% rename from packages/typescript-estree/tests/lib/__snapshots__/comments.js.snap rename to packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap diff --git a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.ts.snap similarity index 100% rename from packages/typescript-estree/tests/lib/__snapshots__/ecma-features.js.snap rename to packages/typescript-estree/tests/lib/__snapshots__/ecma-features.ts.snap diff --git a/packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/jsx.ts.snap similarity index 100% rename from packages/typescript-estree/tests/lib/__snapshots__/jsx.js.snap rename to packages/typescript-estree/tests/lib/__snapshots__/jsx.ts.snap diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap similarity index 100% rename from packages/typescript-estree/tests/lib/__snapshots__/parse.js.snap rename to packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap diff --git a/packages/typescript-estree/tests/lib/__snapshots__/tsx.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap similarity index 100% rename from packages/typescript-estree/tests/lib/__snapshots__/tsx.js.snap rename to packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap similarity index 100% rename from packages/typescript-estree/tests/lib/__snapshots__/typescript.js.snap rename to packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap diff --git a/packages/typescript-estree/tests/lib/basics.js b/packages/typescript-estree/tests/lib/basics.ts similarity index 75% rename from packages/typescript-estree/tests/lib/basics.js rename to packages/typescript-estree/tests/lib/basics.ts index 302cd7dbeb78..364d3bb036f4 100644 --- a/packages/typescript-estree/tests/lib/basics.js +++ b/packages/typescript-estree/tests/lib/basics.ts @@ -5,16 +5,10 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const path = require('path'), - shelljs = require('shelljs'), - testUtils = require('../../tools/test-utils'); +import path from 'path'; +import shelljs from 'shelljs'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { createSnapshotTestBlock } from '../../tools/test-utils'; //------------------------------------------------------------------------------ // Setup @@ -43,9 +37,9 @@ describe('basics', () => { tokens: true, errorOnUnknownASTType: true }; - test( + it( `fixtures/${filename}.src`, - testUtils.createSnapshotTestBlock(code, config) + createSnapshotTestBlock(code, config as ParserOptions) ); }); }); diff --git a/packages/typescript-estree/tests/lib/comments.js b/packages/typescript-estree/tests/lib/comments.ts similarity index 76% rename from packages/typescript-estree/tests/lib/comments.js rename to packages/typescript-estree/tests/lib/comments.ts index d589b4d0651e..936b7a249d98 100644 --- a/packages/typescript-estree/tests/lib/comments.js +++ b/packages/typescript-estree/tests/lib/comments.ts @@ -5,16 +5,10 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const path = require('path'), - shelljs = require('shelljs'), - testUtils = require('../../tools/test-utils'); +import path from 'path'; +import shelljs from 'shelljs'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { createSnapshotTestBlock } from '../../tools/test-utils'; //------------------------------------------------------------------------------ // Setup @@ -44,9 +38,9 @@ describe('Comments', () => { comment: true, jsx: true }; - test( + it( `fixtures/${filename}.src`, - testUtils.createSnapshotTestBlock(code, config) + createSnapshotTestBlock(code, config as ParserOptions) ); }); }); diff --git a/packages/typescript-estree/tests/lib/ecma-features.js b/packages/typescript-estree/tests/lib/ecma-features.ts similarity index 66% rename from packages/typescript-estree/tests/lib/ecma-features.js rename to packages/typescript-estree/tests/lib/ecma-features.ts index a693a2d8524a..e2a3b9804f6e 100644 --- a/packages/typescript-estree/tests/lib/ecma-features.js +++ b/packages/typescript-estree/tests/lib/ecma-features.ts @@ -5,16 +5,10 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const path = require('path'), - shelljs = require('shelljs'), - testUtils = require('../../tools/test-utils'); +import path from 'path'; +import shelljs from 'shelljs'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { createSnapshotTestBlock } from '../../tools/test-utils'; //------------------------------------------------------------------------------ // Setup @@ -36,8 +30,7 @@ const testFiles = shelljs describe('ecma-features', () => { testFiles.forEach(filename => { - const feature = path.dirname(filename), - code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`), + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`), config = { loc: true, range: true, @@ -45,8 +38,9 @@ describe('ecma-features', () => { errorOnUnknownASTType: true }; - test(`fixtures/${filename}.src`, () => { - testUtils.createSnapshotTestBlock(code, config)(); - }); + it( + `fixtures/${filename}.src`, + createSnapshotTestBlock(code, config as ParserOptions) + ); }); }); diff --git a/packages/typescript-estree/tests/lib/jsx.js b/packages/typescript-estree/tests/lib/jsx.ts similarity index 75% rename from packages/typescript-estree/tests/lib/jsx.js rename to packages/typescript-estree/tests/lib/jsx.ts index 43228da3070d..406eab5ce70e 100644 --- a/packages/typescript-estree/tests/lib/jsx.js +++ b/packages/typescript-estree/tests/lib/jsx.ts @@ -5,17 +5,11 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const path = require('path'), - shelljs = require('shelljs'), - testUtils = require('../../tools/test-utils'), - filesWithKnownIssues = require('../jsx-known-issues'); +import path from 'path'; +import shelljs from 'shelljs'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { createSnapshotTestBlock } from '../../tools/test-utils'; +import filesWithKnownIssues from '../jsx-known-issues'; //------------------------------------------------------------------------------ // Setup @@ -51,11 +45,11 @@ const jsxTextTestFiles = shelljs describe('JSX', () => { /** * Test each fixture file - * @param {string} fixturesDir Fixtures Directory - * @param {boolean} useJSXTextNode Use JSX Text Node - * @returns {void} */ - function testFixture(fixturesDir, useJSXTextNode) { + function testFixture( + fixturesDir: string, + useJSXTextNode: boolean + ): (filename: string) => void { return filename => { const code = shelljs.cat(`${path.resolve(fixturesDir, filename)}.src.js`); @@ -68,9 +62,9 @@ describe('JSX', () => { jsx: true }; - test( + it( `fixtures/${filename}.src`, - testUtils.createSnapshotTestBlock(code, config) + createSnapshotTestBlock(code, config as ParserOptions) ); }; } diff --git a/packages/typescript-estree/tests/lib/parse.js b/packages/typescript-estree/tests/lib/parse.ts similarity index 69% rename from packages/typescript-estree/tests/lib/parse.js rename to packages/typescript-estree/tests/lib/parse.ts index a7b321c05ce8..cbb9bebfd052 100644 --- a/packages/typescript-estree/tests/lib/parse.js +++ b/packages/typescript-estree/tests/lib/parse.ts @@ -5,15 +5,9 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const parser = require('../../parser'), - testUtils = require('../../tools/test-utils'); +import * as parser from '../../src/parser'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { createSnapshotTestBlock } from '../../tools/test-utils'; //------------------------------------------------------------------------------ // Tests @@ -22,15 +16,15 @@ const parser = require('../../parser'), describe('parse()', () => { describe('basic functionality', () => { it('should parse an empty string', () => { - expect(parser.parse('').body).toEqual([]); - expect(parser.parse('', {}).body).toEqual([]); + expect((parser as any).parse('').body).toEqual([]); + expect(parser.parse('', {} as any).body).toEqual([]); }); }); describe('modules', () => { it('should have correct column number when strict mode error occurs', () => { try { - parser.parse('function fn(a, a) {\n}', { sourceType: 'module' }); + parser.parse('function fn(a, a) {\n}', { sourceType: 'module' } as any); } catch (err) { expect(err.column).toEqual(16); } @@ -46,9 +40,9 @@ describe('parse()', () => { loc: true }; - test( + it( 'output tokens, comments, locs, and ranges when called with those options', - testUtils.createSnapshotTestBlock(code, config) + createSnapshotTestBlock(code, config as ParserOptions) ); }); }); diff --git a/packages/typescript-estree/tests/lib/tsx.js b/packages/typescript-estree/tests/lib/tsx.ts similarity index 76% rename from packages/typescript-estree/tests/lib/tsx.js rename to packages/typescript-estree/tests/lib/tsx.ts index 4e0a8d5bf70b..7efddecf276e 100644 --- a/packages/typescript-estree/tests/lib/tsx.js +++ b/packages/typescript-estree/tests/lib/tsx.ts @@ -4,16 +4,10 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const path = require('path'), - shelljs = require('shelljs'), - testUtils = require('../../tools/test-utils'); +import path from 'path'; +import shelljs from 'shelljs'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { createSnapshotTestBlock } from '../../tools/test-utils'; //------------------------------------------------------------------------------ // Setup @@ -46,9 +40,9 @@ describe('TSX', () => { useJSXTextNode: true, jsx: true }; - test( + it( `fixtures/${filename}.src`, - testUtils.createSnapshotTestBlock(code, config) + createSnapshotTestBlock(code, config as ParserOptions) ); }); }); diff --git a/packages/typescript-estree/tests/lib/typescript.js b/packages/typescript-estree/tests/lib/typescript.ts similarity index 76% rename from packages/typescript-estree/tests/lib/typescript.js rename to packages/typescript-estree/tests/lib/typescript.ts index 5b8d9f0c0c66..92a2092caf38 100644 --- a/packages/typescript-estree/tests/lib/typescript.js +++ b/packages/typescript-estree/tests/lib/typescript.ts @@ -5,16 +5,10 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const path = require('path'), - shelljs = require('shelljs'), - testUtils = require('../../tools/test-utils'); +import path from 'path'; +import shelljs from 'shelljs'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { createSnapshotTestBlock } from '../../tools/test-utils'; //------------------------------------------------------------------------------ // Setup @@ -43,9 +37,9 @@ describe('typescript', () => { tokens: true, errorOnUnknownASTType: true }; - test( + it( `fixtures/${filename}.src`, - testUtils.createSnapshotTestBlock(code, config) + createSnapshotTestBlock(code, config as ParserOptions) ); }); }); diff --git a/packages/typescript-estree/tools/test-utils.js b/packages/typescript-estree/tools/test-utils.ts similarity index 68% rename from packages/typescript-estree/tools/test-utils.js rename to packages/typescript-estree/tools/test-utils.ts index 57fe8c714d4f..453a8db50f1d 100644 --- a/packages/typescript-estree/tools/test-utils.js +++ b/packages/typescript-estree/tools/test-utils.ts @@ -5,25 +5,15 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ - -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const parser = require('../parser'); - -//------------------------------------------------------------------------------ -// Private -//-------------------------------------------------------------------------------- +import * as parser from '../src/parser'; +import { ParserOptions } from '../src/temp-types-based-on-js-source'; /** * Returns a raw copy of the given AST * @param {Object} ast the AST object * @returns {Object} copy of the AST object */ -function getRaw(ast) { +export function getRaw(ast: any) { return JSON.parse( JSON.stringify(ast, (key, value) => { if ((key === 'start' || key === 'end') && typeof value === 'number') { @@ -38,10 +28,10 @@ function getRaw(ast) { * Returns a function which can be used as the callback of a Jest test() block, * and which performs an assertion on the snapshot for the given code and config. * @param {string} code The source code to parse - * @param {*} config the parser configuration - * @returns {Function} callback for Jest test() block + * @param {ParserOptions} config the parser configuration + * @returns {Function} callback for Jest it() block */ -function createSnapshotTestBlock(code, config) { +export function createSnapshotTestBlock(code: string, config: ParserOptions) { /** * @returns {Object} the AST object */ @@ -66,8 +56,3 @@ function createSnapshotTestBlock(code, config) { } }; } - -module.exports = { - getRaw, - createSnapshotTestBlock -}; diff --git a/packages/typescript-estree/tsconfig.json b/packages/typescript-estree/tsconfig.json new file mode 100644 index 000000000000..207c6dc6d497 --- /dev/null +++ b/packages/typescript-estree/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "es2017", + "module": "commonjs", + "declaration": true, + "outDir": "./dist", + "strict": true, + "esModuleInterop": true + }, + "include": ["src"] +} diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index a5729506f423..2be682c9d5a7 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -803,6 +803,61 @@ dependencies: defer-to-connect "^1.0.1" +"@types/babel-code-frame@^6.20.1": + version "6.20.1" + resolved "https://registry.yarnpkg.com/@types/babel-code-frame/-/babel-code-frame-6.20.1.tgz#e79a40ea81435034df7b46b5e32e8ed638aea4dd" + +"@types/events@*": + version "1.2.0" + resolved "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" + +"@types/glob@*": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + +"@types/jest@^23.3.9": + version "23.3.9" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.9.tgz#c16b55186ee73ae65e001fbee69d392c51337ad1" + +"@types/lodash.isplainobject@^4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/lodash.isplainobject/-/lodash.isplainobject-4.0.4.tgz#ac28008a145ea19ac9f6dc46045aa92e11a09322" + dependencies: + "@types/lodash" "*" + +"@types/lodash.unescape@^4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/lodash.unescape/-/lodash.unescape-4.0.4.tgz#b8eec58cdd642d3a52adc13fbdee1ef0e878a132" + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.14.117" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.117.tgz#695a7f514182771a1e0f4345d189052ee33c8778" + +"@types/minimatch@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + +"@types/node@*": + version "10.12.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.2.tgz#d77f9faa027cadad9c912cd47f4f8b07b0fb0864" + +"@types/semver@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" + +"@types/shelljs@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.0.tgz#0caa56b68baae4f68f44e0dd666ab30b098e3632" + dependencies: + "@types/glob" "*" + "@types/node" "*" + JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.4.tgz#615bb2adb0cd34c8f4c447b5f6512fa1d8f16a2e" @@ -1329,6 +1384,12 @@ browserslist@^4.1.0: electron-to-chromium "^1.3.62" node-releases "^1.0.0-alpha.11" +bs-logger@0.x: + version "0.2.5" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.5.tgz#1d82f0cf88864e1341cd9262237f8d0748a49b22" + dependencies: + fast-json-stable-stringify "^2.0.0" + bser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" @@ -1339,7 +1400,7 @@ btoa-lite@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" -buffer-from@^1.0.0: +buffer-from@1.x, buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -2392,7 +2453,7 @@ fast-glob@^2.0.2: merge2 "^1.2.1" micromatch "^3.1.10" -fast-json-stable-stringify@^2.0.0: +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -3838,6 +3899,12 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" +json5@2.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + dependencies: + minimist "^1.2.0" + json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -4277,6 +4344,10 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" +make-error@1.x: + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + "make-fetch-happen@^2.5.0 || 3 || 4", make-fetch-happen@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" @@ -4560,7 +4631,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@0.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -6046,6 +6117,10 @@ semver-regex@^1.0.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +semver@^5.5: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -6649,6 +6724,19 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +ts-jest@^23.10.4: + version "23.10.4" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.10.4.tgz#a7a953f55c9165bcaa90ff91014a178e87fe0df8" + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + json5 "2.x" + make-error "1.x" + mkdirp "0.x" + semver "^5.5" + yargs-parser "10.x" + tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -7017,7 +7105,7 @@ yallist@^3.0.0, yallist@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" -yargs-parser@^10.0.0, yargs-parser@^10.1.0: +yargs-parser@10.x, yargs-parser@^10.0.0, yargs-parser@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" dependencies: From 69c0000f4eae770b69eb2ed388904d835f847a20 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Wed, 7 Nov 2018 19:32:36 -0500 Subject: [PATCH 13/84] chore: test Node v11 in CI (#29) --- packages/typescript-estree/.travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/typescript-estree/.travis.yml b/packages/typescript-estree/.travis.yml index 9763bdffed1f..91faa15bbfc7 100644 --- a/packages/typescript-estree/.travis.yml +++ b/packages/typescript-estree/.travis.yml @@ -6,6 +6,7 @@ cache: notifications: email: false node_js: + - '11' - '10' - '9' - '8' @@ -21,4 +22,4 @@ after_success: - npm run travis-deploy-once "npm run semantic-release" branches: only: - - master \ No newline at end of file + - master From 1942eb657a614391f1cd21f3043b5f8cb5f9d730 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Sun, 11 Nov 2018 11:32:14 -0500 Subject: [PATCH 14/84] chore: combine basics and ecmaFeatures into javascript tests (#26) --- .../arrayLiteral/array-literal-in-lhs.src.js | 0 .../array-literals-in-binary-expr.src.js | 0 .../as-param-with-params.src.js | 0 .../arrowFunctions/as-param.src.js | 0 .../basic-in-binary-expression.src.js | 0 .../arrowFunctions/basic.src.js | 0 .../block-body-not-object.src.js | 0 .../arrowFunctions/block-body.src.js | 0 .../arrowFunctions/error-dup-params.src.js | 0 .../arrowFunctions/error-missing-paren.src.js | 0 .../arrowFunctions/error-not-arrow.src.js | 0 .../error-numeric-param-multi.src.js | 0 .../arrowFunctions/error-numeric-param.src.js | 0 .../arrowFunctions/error-reverse-arrow.src.js | 0 .../error-strict-default-param-eval.src.js | 0 .../error-strict-dup-params.src.js | 0 .../error-strict-eval-return.src.js | 0 .../arrowFunctions/error-strict-eval.src.js | 0 .../arrowFunctions/error-strict-octal.src.js | 0 .../error-strict-param-arguments.src.js | 0 .../error-strict-param-eval.src.js | 0 .../error-strict-param-names.src.js | 0 ...ror-strict-param-no-paren-arguments.src.js | 0 .../error-strict-param-no-paren-eval.src.js | 0 .../arrowFunctions/error-two-lines.src.js | 0 .../arrowFunctions/error-wrapped-param.src.js | 0 .../arrowFunctions/expression.src.js | 0 .../arrowFunctions/iife.src.js | 0 .../arrowFunctions/multiple-params.src.js | 0 .../arrowFunctions/no-auto-return.src.js | 0 .../not-strict-arguments.src.js | 0 .../not-strict-eval-params.src.js | 0 .../arrowFunctions/not-strict-eval.src.js | 0 .../arrowFunctions/not-strict-octal.src.js | 0 .../return-arrow-function.src.js | 0 .../arrowFunctions/return-sequence.src.js | 0 .../arrowFunctions/single-param-parens.src.js | 0 .../single-param-return-identifier.src.js | 0 .../arrowFunctions/single-param.src.js | 0 .../basics/delete-expression.src.js | 0 .../basics/do-while-statements.src.js | 0 .../identifiers-double-underscore.src.js | 0 .../{ => javascript}/basics/instanceof.src.js | 0 .../basics/new-with-member-expression.src.js | 0 .../basics/new-without-parens.src.js | 0 .../basics/typeof-expression.src.js | 0 .../basics/update-expression.src.js | 0 .../basics/void-expression.src.js | 0 .../binaryLiterals/invalid.src.js | 0 .../binaryLiterals/lowercase.src.js | 0 .../binaryLiterals/uppercase.src.js | 0 .../blockBindings/const.src.js | 0 .../blockBindings/let-in-switchcase.src.js | 0 .../blockBindings/let.src.js | 0 .../classes/class-accessor-properties.src.js | 0 .../class-computed-static-method.src.js | 0 .../classes/class-expression.src.js | 0 .../class-method-named-prototype.src.js | 0 .../classes/class-method-named-static.src.js | 0 .../class-method-named-with-space.src.js | 0 .../classes/class-one-method-super.src.js | 0 .../classes/class-one-method.src.js | 0 ...class-static-method-named-prototype.src.js | 0 .../class-static-method-named-static.src.js | 0 .../classes/class-static-method.src.js | 0 ...tic-methods-and-accessor-properties.src.js | 0 .../class-two-computed-static-methods.src.js | 0 ...ss-two-methods-computed-constructor.src.js | 0 .../classes/class-two-methods-semi.src.js | 0 .../class-two-methods-three-semi.src.js | 0 .../classes/class-two-methods-two-semi.src.js | 0 .../classes/class-two-methods.src.js | 0 ...wo-static-methods-named-constructor.src.js | 0 .../class-with-constructor-parameters.src.js | 0 .../class-with-constructor-with-space.src.js | 0 .../classes/class-with-constructor.src.js | 0 .../derived-class-assign-to-var.src.js | 0 .../classes/derived-class-expression.src.js | 0 .../classes/empty-class-double-semi.src.js | 0 .../classes/empty-class-semi.src.js | 0 .../classes/empty-class.src.js | 0 .../empty-literal-derived-class.src.js | 0 .../classes/invalid-class-declaration.src.js | 0 .../invalid-class-setter-declaration.src.js | 0 .../invalid-class-two-super-classes.src.js | 0 .../classes/named-class-expression.src.js | 0 .../named-derived-class-expression.src.js | 0 .../defaultParams/class-constructor.src.js | 0 .../defaultParams/class-method.src.js | 0 .../defaultParams/declaration.src.js | 0 .../defaultParams/expression.src.js | 0 .../defaultParams/method.src.js | 0 .../defaultParams/not-all-params.src.js | 0 .../arrow-param-array.src.js | 0 .../arrow-param-nested-array.src.js | 0 .../arrow-param-nested-object-named.src.js | 0 .../arrow-param-nested-object.src.js | 0 .../arrow-param-object.src.js | 0 .../param-defaults-array.src.js | 0 .../param-defaults-object-nested.src.js | 0 .../param-defaults-object.src.js | 0 .../array-const-undefined.src.js | 0 .../array-let-undefined.src.js | 0 .../object-const-named.src.js | 0 .../object-const-undefined.src.js | 0 .../object-let-named.src.js | 0 .../object-let-undefined.src.js | 0 .../param-array.src.js | 0 .../param-object-short.src.js | 0 .../param-object-wrapped.src.xjs | 0 .../param-object.src.js | 0 .../destructuring-and-forOf/loop.src.js | 0 .../complex-destructured.src.js | 0 .../destructured-array-literal.src.js | 0 .../destructuring-param.src.js | 0 ...r-complex-destructured-spread-first.src.js | 0 .../invalid-not-final-array-empty.src.xjs | 0 .../multi-destructured.src.js | 0 .../not-final-array.src.xjs | 0 .../single-destructured.src.js | 0 .../var-complex-destructured.src.js | 0 .../var-destructured-array-literal.src.js | 0 .../var-multi-destructured.src.js | 0 .../var-single-destructured.src.js | 0 .../destructuring/array-member.src.js | 0 .../destructuring/array-to-array.src.js | 0 .../destructuring/array-var-undefined.src.js | 0 .../class-constructor-params-array.src.js | 0 ...s-constructor-params-defaults-array.src.js | 0 ...-constructor-params-defaults-object.src.js | 0 .../class-constructor-params-object.src.js | 0 .../class-method-params-array.src.js | 0 .../class-method-params-defaults-array.src.js | 0 ...class-method-params-defaults-object.src.js | 0 .../class-method-params-object.src.js | 0 .../destructuring/defaults-array-all.src.js | 0 ...efaults-array-longform-nested-multi.src.js | 0 .../destructuring/defaults-array-multi.src.js | 0 .../defaults-array-nested-all.src.js | 0 .../defaults-array-nested-multi.src.js | 0 .../destructuring/defaults-array.src.js | 0 .../destructuring/defaults-object-all.src.js | 0 .../defaults-object-longform-all.src.js | 0 .../defaults-object-longform-multi.src.js | 0 .../defaults-object-longform.src.js | 0 .../defaults-object-mixed-multi.src.js | 0 .../defaults-object-multi.src.js | 0 .../defaults-object-nested-all.src.js | 0 .../defaults-object-nested-multi.src.js | 0 .../destructuring/defaults-object.src.js | 0 .../destructured-array-catch.src.js | 0 .../destructured-object-catch.src.js | 0 .../invalid-defaults-object-assign.src.js | 0 .../destructuring/named-param.src.js | 0 .../destructuring/nested-array.src.js | 0 .../destructuring/nested-object.src.js | 0 .../destructuring/object-var-named.src.js | 0 .../destructuring/object-var-undefined.src.js | 0 .../destructuring/param-defaults-array.src.js | 0 .../param-defaults-object-nested.src.js | 0 .../param-defaults-object.src.js | 0 .../destructuring/params-array-wrapped.src.js | 0 .../destructuring/params-array.src.js | 0 .../destructuring/params-multi-object.src.js | 0 .../destructuring/params-nested-array.src.js | 0 .../destructuring/params-nested-object.src.js | 0 .../params-object-wrapped.src.js | 0 .../destructuring/params-object.src.js | 0 .../destructuring/sparse-array.src.js | 0 .../async-generators.src.js | 0 .../async-iterator.src.js | 0 .../dynamic-import.src.js | 0 .../arg-spread.src.js | 0 .../destructuring-assign-mirror.src.js | 0 .../function-parameter-object-spread.src.js | 0 .../invalid-rest-trailing-comma.src.js | 0 .../invalid-rest.src.js | 0 .../object-rest.src.js | 0 .../property-spread.src.js | 0 .../shorthand-method-args.src.js | 0 .../shorthand-methods.src.js | 0 .../shorthand-properties.src.js | 0 .../single-spread.src.js | 0 .../spread-trailing-comma.src.js | 0 .../two-spread.src.js | 0 .../optional-catch-binding-finally.src.js | 0 .../optional-catch-binding.src.js | 0 .../exponential-operators.src.js | 0 .../for-of-with-function-initializer.src.js | 0 .../forOf/for-of-with-var-and-braces.src.js | 0 .../for-of-with-var-and-no-braces.src.js | 0 ...lid-for-of-with-const-and-no-braces.src.js | 0 ...valid-for-of-with-let-and-no-braces.src.js | 0 .../generators/anonymous-generator.src.js | 0 .../async-generator-function.src.js | 0 .../generators/async-generator-method.src.js | 0 .../generators/double-yield.src.js | 0 .../empty-generator-declaration.src.js | 0 .../generators/generator-declaration.src.js | 0 .../generators/yield-delegation.src.js | 0 .../yield-without-value-in-call.src.js | 0 .../yield-without-value-no-semi.src.js | 0 .../generators/yield-without-value.src.js | 0 .../globalReturn/return-identifier.src.js | 0 .../globalReturn/return-no-arg.src.js | 0 .../globalReturn/return-true.src.js | 0 .../importMeta/simple-import-meta.src.js | 0 .../modules/error-delete.src.js | 0 .../modules/error-function.src.js | 0 .../modules/error-strict.src.js | 0 .../modules/export-default-array.src.js | 0 .../modules/export-default-class.src.js | 0 .../modules/export-default-expression.src.js | 0 .../modules/export-default-function.src.js | 0 .../modules/export-default-named-class.src.js | 0 .../export-default-named-function.src.js | 0 .../modules/export-default-number.src.js | 0 .../modules/export-default-object.src.js | 0 .../modules/export-default-value.src.js | 0 .../modules/export-from-batch.src.js | 0 .../modules/export-from-default.src.js | 0 .../export-from-named-as-default.src.js | 0 .../export-from-named-as-specifier.src.js | 0 .../export-from-named-as-specifiers.src.js | 0 .../modules/export-from-specifier.src.js | 0 .../modules/export-from-specifiers.src.js | 0 .../modules/export-function.src.js | 0 .../modules/export-named-as-default.src.js | 0 .../modules/export-named-as-specifier.src.js | 0 .../modules/export-named-as-specifiers.src.js | 0 .../modules/export-named-class.src.js | 0 .../modules/export-named-empty.src.js | 0 .../modules/export-named-specifier.src.js | 0 .../export-named-specifiers-comma.src.js | 0 .../modules/export-named-specifiers.src.js | 0 .../export-var-anonymous-function.src.js | 0 .../modules/export-var-number.src.js | 0 .../modules/export-var.src.js | 0 ...import-default-and-named-specifiers.src.js | 0 ...rt-default-and-namespace-specifiers.src.js | 0 .../modules/import-default-as.src.js | 0 .../modules/import-default.src.js | 0 .../modules/import-jquery.src.js | 0 .../modules/import-module.src.js | 0 .../modules/import-named-as-specifier.src.js | 0 .../modules/import-named-as-specifiers.src.js | 0 .../modules/import-named-empty.src.js | 0 .../modules/import-named-specifier.src.js | 0 .../import-named-specifiers-comma.src.js | 0 .../modules/import-named-specifiers.src.js | 0 .../modules/import-namespace-specifier.src.js | 0 .../modules/import-null-as-nil.src.js | 0 .../modules/invalid-await.src.js | 0 .../modules/invalid-class.src.js | 0 ...id-export-batch-missing-from-clause.src.js | 0 .../modules/invalid-export-batch-token.src.js | 0 .../invalid-export-default-equal.src.js | 0 .../invalid-export-default-token.src.js | 0 .../modules/invalid-export-default.src.js | 0 .../invalid-export-named-default.src.js | 0 .../invalid-export-named-extra-comma.src.js | 0 .../invalid-export-named-middle-comma.src.js | 0 ...t-default-after-named-after-default.src.js | 0 .../invalid-import-default-after-named.src.js | 0 ...rt-default-missing-module-specifier.src.js | 0 ...lid-import-default-module-specifier.src.js | 0 .../modules/invalid-import-default.src.js | 0 ...lid-import-missing-module-specifier.src.js | 0 .../invalid-import-module-specifier.src.js | 0 .../invalid-import-named-after-named.src.js | 0 ...nvalid-import-named-after-namespace.src.js | 0 ...nvalid-import-named-as-missing-from.src.js | 0 .../invalid-import-named-extra-comma.src.js | 0 .../invalid-import-named-middle-comma.src.js | 0 ...nvalid-import-namespace-after-named.src.js | 0 ...invalid-import-namespace-missing-as.src.js | 0 .../newTarget/invalid-new-target.src.js | 0 .../newTarget/invalid-unknown-property.src.js | 0 .../newTarget/simple-new-target.src.js | 0 .../object-literal-in-lhs.src.js | 0 .../computed-addition-property.src.js | 0 .../computed-and-identifier.src.js | 0 .../computed-getter-and-setter.src.js | 0 .../computed-string-property.src.js | 0 .../computed-variable-property.src.js | 0 .../invalid-computed-variable-property.src.js | 0 ...andalone-computed-variable-property.src.js | 0 ...standalone-expression-with-addition.src.js | 0 .../standalone-expression-with-method.src.js | 0 .../standalone-expression.src.js | 0 .../error-proto-property.src.js | 0 .../error-proto-string-property.src.js | 0 .../strict-duplicate-properties.src.js | 0 .../strict-duplicate-string-properties.src.js | 0 .../invalid-method-no-braces.src.js | 0 .../method-property.src.js | 0 .../simple-method-named-get.src.js | 0 .../simple-method-named-set.src.js | 0 .../simple-method-with-argument.src.js | 0 .../simple-method-with-string-name.src.js | 0 .../simple-method.src.js | 0 .../string-name-method-property.src.js | 0 .../shorthand-properties.src.js | 0 .../octalLiterals/invalid.src.js | 0 .../octalLiterals/lowercase.src.js | 0 .../octalLiterals/strict-uppercase.src.js | 0 .../octalLiterals/uppercase.src.js | 0 .../regex/regexp-simple.src.js | 0 .../regexUFlag/regex-u-extended-escape.src.js | 0 .../regex-u-invalid-extended-escape.src.js | 0 .../regexUFlag/regex-u-simple.src.js | 0 .../regexYFlag/regexp-y-simple.src.js | 0 .../restParams/basic-rest.src.js | 0 .../restParams/class-constructor.src.js | 0 .../restParams/class-method.src.js | 0 .../restParams/error-no-default.src.js | 0 .../restParams/error-not-last.src.js | 0 .../restParams/func-expression-multi.src.js | 0 .../restParams/func-expression.src.js | 0 .../restParams/invalid-rest-param.src.js | 0 .../restParams/single-rest.src.js | 0 .../spread/error-invalid-if.src.js | 0 .../spread/error-invalid-sequence.src.js | 0 .../spread/multi-function-call.src.js | 0 .../spread/not-final-param.src.js | 0 .../spread/simple-function-call.src.js | 0 .../templateStrings/deeply-nested.src.js | 0 .../error-octal-literal.src.js | 0 .../templateStrings/escape-characters.src.js | 0 .../templateStrings/expressions.src.js | 0 .../multi-line-template-string.src.js | 0 .../simple-template-string.src.js | 0 .../templateStrings/single-dollar-sign.src.js | 0 .../tagged-no-placeholders.src.js | 0 .../tagged-template-string.src.js | 0 .../basic-string-literal.src.js | 0 .../complex-string-literal.src.js | 0 .../invalid-empty-escape.src.js | 0 .../invalid-too-large-escape.src.js | 0 .../tests/lib/__snapshots__/basics.ts.snap | 3140 -------------- ...ma-features.ts.snap => javascript.ts.snap} | 3793 +++++++++++++++-- .../typescript-estree/tests/lib/basics.ts | 45 - .../lib/{ecma-features.ts => javascript.ts} | 4 +- 343 files changed, 3468 insertions(+), 3514 deletions(-) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrayLiteral/array-literal-in-lhs.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrayLiteral/array-literals-in-binary-expr.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/as-param-with-params.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/as-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/basic-in-binary-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/basic.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/block-body-not-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/block-body.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-dup-params.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-missing-paren.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-not-arrow.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-numeric-param-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-numeric-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-reverse-arrow.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-default-param-eval.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-dup-params.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-eval-return.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-eval.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-octal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-param-arguments.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-param-eval.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-param-names.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-param-no-paren-arguments.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-strict-param-no-paren-eval.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-two-lines.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/error-wrapped-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/iife.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/multiple-params.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/no-auto-return.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/not-strict-arguments.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/not-strict-eval-params.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/not-strict-eval.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/not-strict-octal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/return-arrow-function.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/return-sequence.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/single-param-parens.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/single-param-return-identifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/arrowFunctions/single-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/delete-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/do-while-statements.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/identifiers-double-underscore.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/instanceof.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/new-with-member-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/new-without-parens.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/typeof-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/update-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ => javascript}/basics/void-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/binaryLiterals/invalid.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/binaryLiterals/lowercase.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/binaryLiterals/uppercase.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/blockBindings/const.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/blockBindings/let-in-switchcase.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/blockBindings/let.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-accessor-properties.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-computed-static-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-method-named-prototype.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-method-named-static.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-method-named-with-space.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-one-method-super.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-one-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-static-method-named-prototype.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-static-method-named-static.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-static-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-static-methods-and-accessor-properties.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-two-computed-static-methods.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-two-methods-computed-constructor.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-two-methods-semi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-two-methods-three-semi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-two-methods-two-semi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-two-methods.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-two-static-methods-named-constructor.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-with-constructor-parameters.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-with-constructor-with-space.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/class-with-constructor.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/derived-class-assign-to-var.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/derived-class-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/empty-class-double-semi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/empty-class-semi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/empty-class.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/empty-literal-derived-class.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/invalid-class-declaration.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/invalid-class-setter-declaration.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/invalid-class-two-super-classes.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/named-class-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/classes/named-derived-class-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/defaultParams/class-constructor.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/defaultParams/class-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/defaultParams/declaration.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/defaultParams/expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/defaultParams/method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/defaultParams/not-all-params.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/arrow-param-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/arrow-param-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/param-defaults-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-arrowFunctions/param-defaults-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-blockBindings/array-const-undefined.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-blockBindings/array-let-undefined.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-blockBindings/object-const-named.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-blockBindings/object-const-undefined.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-blockBindings/object-let-named.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-blockBindings/object-let-undefined.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-defaultParams/param-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-defaultParams/param-object-short.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-defaultParams/param-object-wrapped.src.xjs (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-defaultParams/param-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-forOf/loop.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/complex-destructured.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/destructured-array-literal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/destructuring-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/error-complex-destructured-spread-first.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/invalid-not-final-array-empty.src.xjs (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/multi-destructured.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/not-final-array.src.xjs (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/single-destructured.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/var-complex-destructured.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/var-destructured-array-literal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/var-multi-destructured.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring-and-spread/var-single-destructured.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/array-member.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/array-to-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/array-var-undefined.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-constructor-params-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-constructor-params-defaults-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-constructor-params-defaults-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-constructor-params-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-method-params-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-method-params-defaults-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-method-params-defaults-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/class-method-params-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-array-all.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-array-longform-nested-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-array-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-array-nested-all.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-array-nested-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-all.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-longform-all.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-longform-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-longform.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-mixed-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-nested-all.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object-nested-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/defaults-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/destructured-array-catch.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/destructured-object-catch.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/invalid-defaults-object-assign.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/named-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/nested-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/nested-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/object-var-named.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/object-var-undefined.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/param-defaults-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/param-defaults-object-nested.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/param-defaults-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/params-array-wrapped.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/params-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/params-multi-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/params-nested-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/params-nested-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/params-object-wrapped.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/params-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/destructuring/sparse-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalAsyncIteration/async-generators.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalAsyncIteration/async-iterator.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalDynamicImport/dynamic-import.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/arg-spread.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/destructuring-assign-mirror.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/function-parameter-object-spread.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/invalid-rest.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/object-rest.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/property-spread.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/shorthand-method-args.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/shorthand-methods.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/shorthand-properties.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/single-spread.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/spread-trailing-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalObjectRestSpread/two-spread.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/experimentalOptionalCatchBinding/optional-catch-binding.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/exponentiationOperators/exponential-operators.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/forOf/for-of-with-function-initializer.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/forOf/for-of-with-var-and-braces.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/forOf/for-of-with-var-and-no-braces.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/forOf/invalid-for-of-with-const-and-no-braces.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/forOf/invalid-for-of-with-let-and-no-braces.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/anonymous-generator.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/async-generator-function.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/async-generator-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/double-yield.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/empty-generator-declaration.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/generator-declaration.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/yield-delegation.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/yield-without-value-in-call.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/yield-without-value-no-semi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/generators/yield-without-value.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/globalReturn/return-identifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/globalReturn/return-no-arg.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/globalReturn/return-true.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/importMeta/simple-import-meta.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/error-delete.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/error-function.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/error-strict.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-array.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-class.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-function.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-named-class.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-named-function.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-number.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-object.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-default-value.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-from-batch.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-from-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-from-named-as-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-from-named-as-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-from-named-as-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-from-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-from-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-function.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-as-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-as-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-as-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-class.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-empty.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-specifiers-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-named-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-var-anonymous-function.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-var-number.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/export-var.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-default-and-named-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-default-and-namespace-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-default-as.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-jquery.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-module.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-named-as-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-named-as-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-named-empty.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-named-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-named-specifiers-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-named-specifiers.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-namespace-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/import-null-as-nil.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-await.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-class.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-batch-missing-from-clause.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-batch-token.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-default-equal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-default-token.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-named-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-named-extra-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-export-named-middle-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-default-after-named-after-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-default-after-named.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-default-missing-module-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-default-module-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-missing-module-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-module-specifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-named-after-named.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-named-after-namespace.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-named-as-missing-from.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-named-extra-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-named-middle-comma.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-namespace-after-named.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/modules/invalid-import-namespace-missing-as.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/newTarget/invalid-new-target.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/newTarget/invalid-unknown-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/newTarget/simple-new-target.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteral/object-literal-in-lhs.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/computed-addition-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/computed-and-identifier.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/computed-getter-and-setter.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/computed-string-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/computed-variable-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/invalid-computed-variable-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/standalone-expression-with-addition.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/standalone-expression-with-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralComputedProperties/standalone-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralDuplicateProperties/error-proto-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralDuplicateProperties/error-proto-string-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/invalid-method-no-braces.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/method-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/simple-method-named-get.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/simple-method-named-set.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/simple-method-with-argument.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/simple-method-with-string-name.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/simple-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandMethods/string-name-method-property.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/objectLiteralShorthandProperties/shorthand-properties.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/octalLiterals/invalid.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/octalLiterals/lowercase.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/octalLiterals/strict-uppercase.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/octalLiterals/uppercase.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/regex/regexp-simple.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/regexUFlag/regex-u-extended-escape.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/regexUFlag/regex-u-invalid-extended-escape.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/regexUFlag/regex-u-simple.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/regexYFlag/regexp-y-simple.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/basic-rest.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/class-constructor.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/class-method.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/error-no-default.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/error-not-last.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/func-expression-multi.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/func-expression.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/invalid-rest-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/restParams/single-rest.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/spread/error-invalid-if.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/spread/error-invalid-sequence.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/spread/multi-function-call.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/spread/not-final-param.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/spread/simple-function-call.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/deeply-nested.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/error-octal-literal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/escape-characters.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/expressions.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/multi-line-template-string.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/simple-template-string.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/single-dollar-sign.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/tagged-no-placeholders.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/templateStrings/tagged-template-string.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/unicodeCodePointEscapes/basic-string-literal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/unicodeCodePointEscapes/complex-string-literal.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/unicodeCodePointEscapes/invalid-empty-escape.src.js (100%) rename packages/typescript-estree/tests/fixtures/{ecma-features => javascript}/unicodeCodePointEscapes/invalid-too-large-escape.src.js (100%) delete mode 100644 packages/typescript-estree/tests/lib/__snapshots__/basics.ts.snap rename packages/typescript-estree/tests/lib/__snapshots__/{ecma-features.ts.snap => javascript.ts.snap} (96%) delete mode 100644 packages/typescript-estree/tests/lib/basics.ts rename packages/typescript-estree/tests/lib/{ecma-features.ts => javascript.ts} (93%) diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literal-in-lhs.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literal-in-lhs.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literals-in-binary-expr.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrayLiteral/array-literals-in-binary-expr.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param-with-params.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/as-param-with-params.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param-with-params.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/as-param-with-params.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/as-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/as-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/as-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic-in-binary-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic-in-binary-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/basic.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/basic.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/basic.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body-not-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/block-body-not-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body-not-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/block-body-not-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/block-body.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/block-body.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/block-body.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-dup-params.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-dup-params.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-dup-params.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-dup-params.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-missing-paren.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-missing-paren.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-missing-paren.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-missing-paren.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-not-arrow.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-not-arrow.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-not-arrow.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-not-arrow.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-numeric-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-numeric-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-numeric-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-reverse-arrow.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-reverse-arrow.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-default-param-eval.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-default-param-eval.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-dup-params.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-dup-params.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval-return.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval-return.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-eval.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-eval.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-eval.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-octal.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-octal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-octal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-octal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-arguments.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-arguments.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-eval.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-eval.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-names.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-names.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-names.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-names.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-arguments.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-arguments.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-eval.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-strict-param-no-paren-eval.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-two-lines.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-two-lines.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-two-lines.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-two-lines.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-wrapped-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-wrapped-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/error-wrapped-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/error-wrapped-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/iife.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/iife.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/iife.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/iife.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/multiple-params.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/multiple-params.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/multiple-params.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/multiple-params.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/no-auto-return.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/no-auto-return.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/no-auto-return.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/no-auto-return.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-arguments.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-arguments.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-arguments.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-arguments.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval-params.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval-params.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-eval.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-eval.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-eval.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-octal.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-octal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/not-strict-octal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/not-strict-octal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-arrow-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/return-arrow-function.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-arrow-function.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/return-arrow-function.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-sequence.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/return-sequence.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/return-sequence.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/return-sequence.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-parens.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/single-param-parens.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-parens.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/single-param-parens.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-return-identifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param-return-identifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/single-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/arrowFunctions/single-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/arrowFunctions/single-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/delete-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/delete-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/delete-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/delete-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/do-while-statements.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/do-while-statements.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/do-while-statements.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/do-while-statements.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/identifiers-double-underscore.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/identifiers-double-underscore.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/identifiers-double-underscore.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/identifiers-double-underscore.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/instanceof.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/instanceof.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/instanceof.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/instanceof.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/new-with-member-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/new-with-member-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/new-with-member-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/new-with-member-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/new-without-parens.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/new-without-parens.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/new-without-parens.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/new-without-parens.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/typeof-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/typeof-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/typeof-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/typeof-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/update-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/update-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/update-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/update-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/basics/void-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/void-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/basics/void-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/basics/void-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/invalid.src.js b/packages/typescript-estree/tests/fixtures/javascript/binaryLiterals/invalid.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/invalid.src.js rename to packages/typescript-estree/tests/fixtures/javascript/binaryLiterals/invalid.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/lowercase.src.js b/packages/typescript-estree/tests/fixtures/javascript/binaryLiterals/lowercase.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/lowercase.src.js rename to packages/typescript-estree/tests/fixtures/javascript/binaryLiterals/lowercase.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/uppercase.src.js b/packages/typescript-estree/tests/fixtures/javascript/binaryLiterals/uppercase.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/binaryLiterals/uppercase.src.js rename to packages/typescript-estree/tests/fixtures/javascript/binaryLiterals/uppercase.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/const.src.js b/packages/typescript-estree/tests/fixtures/javascript/blockBindings/const.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/const.src.js rename to packages/typescript-estree/tests/fixtures/javascript/blockBindings/const.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let-in-switchcase.src.js b/packages/typescript-estree/tests/fixtures/javascript/blockBindings/let-in-switchcase.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let-in-switchcase.src.js rename to packages/typescript-estree/tests/fixtures/javascript/blockBindings/let-in-switchcase.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let.src.js b/packages/typescript-estree/tests/fixtures/javascript/blockBindings/let.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/blockBindings/let.src.js rename to packages/typescript-estree/tests/fixtures/javascript/blockBindings/let.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-accessor-properties.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-accessor-properties.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-accessor-properties.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-accessor-properties.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-computed-static-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-computed-static-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-computed-static-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-computed-static-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-prototype.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-method-named-prototype.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-prototype.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-method-named-prototype.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-static.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-method-named-static.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-static.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-method-named-static.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-with-space.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-method-named-with-space.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-method-named-with-space.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-method-named-with-space.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method-super.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-one-method-super.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method-super.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-one-method-super.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-one-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-one-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-one-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-prototype.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-static-method-named-prototype.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-prototype.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-static-method-named-prototype.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-static.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-static-method-named-static.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method-named-static.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-static-method-named-static.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-static-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-static-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-methods-and-accessor-properties.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-static-methods-and-accessor-properties.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-computed-static-methods.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-two-computed-static-methods.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-computed-static-methods.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-two-computed-static-methods.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-computed-constructor.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-computed-constructor.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-computed-constructor.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-computed-constructor.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-semi.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-semi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-semi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-semi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-three-semi.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-three-semi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-three-semi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-three-semi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-two-semi.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-two-semi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods-two-semi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods-two-semi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-methods.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-two-methods.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-static-methods-named-constructor.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-two-static-methods-named-constructor.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-parameters.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-with-constructor-parameters.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-parameters.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-with-constructor-parameters.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-with-space.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-with-constructor-with-space.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor-with-space.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-with-constructor-with-space.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/class-with-constructor.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/class-with-constructor.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/class-with-constructor.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-assign-to-var.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/derived-class-assign-to-var.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-assign-to-var.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/derived-class-assign-to-var.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/derived-class-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/derived-class-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/derived-class-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-double-semi.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/empty-class-double-semi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-double-semi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/empty-class-double-semi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-semi.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/empty-class-semi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class-semi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/empty-class-semi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/empty-class.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-class.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/empty-class.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-literal-derived-class.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/empty-literal-derived-class.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/empty-literal-derived-class.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/empty-literal-derived-class.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-declaration.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/invalid-class-declaration.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-declaration.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/invalid-class-declaration.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-setter-declaration.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/invalid-class-setter-declaration.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-setter-declaration.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/invalid-class-setter-declaration.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-two-super-classes.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/invalid-class-two-super-classes.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/invalid-class-two-super-classes.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/invalid-class-two-super-classes.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-class-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/named-class-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/named-class-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/named-class-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/classes/named-derived-class-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/classes/named-derived-class-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/classes/named-derived-class-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/classes/named-derived-class-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-constructor.src.js b/packages/typescript-estree/tests/fixtures/javascript/defaultParams/class-constructor.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-constructor.src.js rename to packages/typescript-estree/tests/fixtures/javascript/defaultParams/class-constructor.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/defaultParams/class-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/class-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/defaultParams/class-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/declaration.src.js b/packages/typescript-estree/tests/fixtures/javascript/defaultParams/declaration.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/declaration.src.js rename to packages/typescript-estree/tests/fixtures/javascript/defaultParams/declaration.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/defaultParams/expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/defaultParams/expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/method.src.js b/packages/typescript-estree/tests/fixtures/javascript/defaultParams/method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/defaultParams/method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/not-all-params.src.js b/packages/typescript-estree/tests/fixtures/javascript/defaultParams/not-all-params.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/defaultParams/not-all-params.src.js rename to packages/typescript-estree/tests/fixtures/javascript/defaultParams/not-all-params.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/arrow-param-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-arrowFunctions/param-defaults-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-const-undefined.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-const-undefined.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-let-undefined.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/array-let-undefined.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-named.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-named.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-undefined.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-const-undefined.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-named.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-named.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-undefined.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-blockBindings/object-let-undefined.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-short.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-short.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-wrapped.src.xjs b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.xjs similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object-wrapped.src.xjs rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.xjs diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-defaultParams/param-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-forOf/loop.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-forOf/loop.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-forOf/loop.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-forOf/loop.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/complex-destructured.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/complex-destructured.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/complex-destructured.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/complex-destructured.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructured-array-literal.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructured-array-literal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructuring-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/destructuring-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/destructuring-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/destructuring-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/error-complex-destructured-spread-first.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/error-complex-destructured-spread-first.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/invalid-not-final-array-empty.src.xjs b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.xjs similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/invalid-not-final-array-empty.src.xjs rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.xjs diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/multi-destructured.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/multi-destructured.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/multi-destructured.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/multi-destructured.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/not-final-array.src.xjs b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/not-final-array.src.xjs similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/not-final-array.src.xjs rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/not-final-array.src.xjs diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/single-destructured.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/single-destructured.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/single-destructured.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/single-destructured.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-complex-destructured.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-complex-destructured.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-destructured-array-literal.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-destructured-array-literal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-multi-destructured.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-multi-destructured.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-single-destructured.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring-and-spread/var-single-destructured.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-member.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/array-member.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-member.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/array-member.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-to-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/array-to-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-to-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/array-to-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-var-undefined.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/array-var-undefined.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/array-var-undefined.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/array-var-undefined.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-defaults-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-constructor-params-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-constructor-params-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-defaults-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-defaults-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-defaults-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-defaults-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-defaults-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/class-method-params-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/class-method-params-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-all.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-all.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-all.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-all.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-longform-nested-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-longform-nested-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-all.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-nested-all.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-all.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-nested-all.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-nested-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array-nested-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array-nested-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-all.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-all.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-all.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-all.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-all.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-longform-all.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-all.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-longform-all.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-longform-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-longform-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-longform.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-longform.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-longform.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-mixed-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-mixed-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-all.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-nested-all.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-all.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-nested-all.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-nested-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object-nested-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-nested-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/defaults-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-array-catch.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/destructured-array-catch.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-array-catch.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/destructured-array-catch.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-object-catch.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/destructured-object-catch.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/destructured-object-catch.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/destructured-object-catch.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/invalid-defaults-object-assign.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/invalid-defaults-object-assign.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/named-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/named-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/named-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/named-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/nested-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/nested-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/nested-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/nested-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/nested-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-named.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/object-var-named.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-named.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/object-var-named.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-undefined.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/object-var-undefined.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/object-var-undefined.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/object-var-undefined.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/param-defaults-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/param-defaults-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object-nested.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/param-defaults-object-nested.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object-nested.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/param-defaults-object-nested.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/param-defaults-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/param-defaults-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/param-defaults-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array-wrapped.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/params-array-wrapped.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array-wrapped.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/params-array-wrapped.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/params-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/params-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-multi-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/params-multi-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-multi-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/params-multi-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/params-nested-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/params-nested-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/params-nested-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-nested-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/params-nested-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object-wrapped.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/params-object-wrapped.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object-wrapped.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/params-object-wrapped.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/params-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/params-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/params-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/destructuring/sparse-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/sparse-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/destructuring/sparse-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/destructuring/sparse-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-generators.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalAsyncIteration/async-generators.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-generators.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalAsyncIteration/async-generators.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-iterator.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalAsyncIteration/async-iterator.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalDynamicImport/dynamic-import.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalDynamicImport/dynamic-import.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/arg-spread.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/destructuring-assign-mirror.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/function-parameter-object-spread.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/function-parameter-object-spread.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/invalid-rest.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/object-rest.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-method-args.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-methods.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/shorthand-properties.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/spread-trailing-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding.src.js b/packages/typescript-estree/tests/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/experimentalOptionalCatchBinding/optional-catch-binding.src.js rename to packages/typescript-estree/tests/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/exponentiationOperators/exponential-operators.src.js b/packages/typescript-estree/tests/fixtures/javascript/exponentiationOperators/exponential-operators.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/exponentiationOperators/exponential-operators.src.js rename to packages/typescript-estree/tests/fixtures/javascript/exponentiationOperators/exponential-operators.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-function-initializer.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-function-initializer.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-function-initializer.src.js rename to packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-function-initializer.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-braces.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-var-and-braces.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-braces.src.js rename to packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-var-and-braces.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-no-braces.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/forOf/for-of-with-var-and-no-braces.src.js rename to packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-const-and-no-braces.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-const-and-no-braces.src.js rename to packages/typescript-estree/tests/fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-let-and-no-braces.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/forOf/invalid-for-of-with-let-and-no-braces.src.js rename to packages/typescript-estree/tests/fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/anonymous-generator.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/anonymous-generator.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/anonymous-generator.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/anonymous-generator.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/async-generator-function.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-function.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/async-generator-function.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/async-generator-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/async-generator-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/async-generator-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/double-yield.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/double-yield.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/double-yield.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/double-yield.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/empty-generator-declaration.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/empty-generator-declaration.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/empty-generator-declaration.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/empty-generator-declaration.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/generator-declaration.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/generator-declaration.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/generator-declaration.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/generator-declaration.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-delegation.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/yield-delegation.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-delegation.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/yield-delegation.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-in-call.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/yield-without-value-in-call.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-in-call.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/yield-without-value-in-call.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-no-semi.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/yield-without-value-no-semi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value-no-semi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/yield-without-value-no-semi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value.src.js b/packages/typescript-estree/tests/fixtures/javascript/generators/yield-without-value.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/generators/yield-without-value.src.js rename to packages/typescript-estree/tests/fixtures/javascript/generators/yield-without-value.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-identifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/globalReturn/return-identifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-identifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/globalReturn/return-identifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-no-arg.src.js b/packages/typescript-estree/tests/fixtures/javascript/globalReturn/return-no-arg.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-no-arg.src.js rename to packages/typescript-estree/tests/fixtures/javascript/globalReturn/return-no-arg.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-true.src.js b/packages/typescript-estree/tests/fixtures/javascript/globalReturn/return-true.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/globalReturn/return-true.src.js rename to packages/typescript-estree/tests/fixtures/javascript/globalReturn/return-true.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/importMeta/simple-import-meta.src.js b/packages/typescript-estree/tests/fixtures/javascript/importMeta/simple-import-meta.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/importMeta/simple-import-meta.src.js rename to packages/typescript-estree/tests/fixtures/javascript/importMeta/simple-import-meta.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-delete.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/error-delete.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/error-delete.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/error-delete.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/error-function.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/error-function.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/error-function.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/error-strict.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/error-strict.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/error-strict.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/error-strict.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-array.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-class.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-class.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-class.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-class.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-function.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-function.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-function.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-class.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-named-class.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-class.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-named-class.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-named-function.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-named-function.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-named-function.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-number.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-number.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-number.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-number.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-object.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-object.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-object.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-value.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-default-value.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-default-value.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-default-value.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-batch.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-from-batch.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-batch.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-from-batch.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-from-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-from-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-from-named-as-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-from-named-as-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-from-named-as-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-from-named-as-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-from-named-as-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-named-as-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-from-named-as-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-from-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-from-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-from-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-from-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-from-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-function.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-function.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-function.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-as-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-as-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-as-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-as-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-as-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-as-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-as-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-class.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-class.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-class.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-class.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-empty.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-empty.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-empty.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-empty.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-specifiers-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-specifiers-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-named-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-named-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-named-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-anonymous-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-var-anonymous-function.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-anonymous-function.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-var-anonymous-function.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-number.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-var-number.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var-number.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-var-number.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/export-var.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/export-var.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/export-var.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-named-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-default-and-named-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-named-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-default-and-named-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-namespace-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-and-namespace-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-as.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-default-as.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default-as.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-default-as.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-jquery.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-jquery.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-jquery.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-jquery.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-module.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-module.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-module.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-module.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-named-as-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-named-as-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-named-as-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-as-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-named-as-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-empty.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-named-empty.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-empty.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-named-empty.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-named-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-named-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-named-specifiers-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-named-specifiers-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-named-specifiers.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-named-specifiers.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-named-specifiers.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-namespace-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-namespace-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-namespace-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-namespace-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/import-null-as-nil.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/import-null-as-nil.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/import-null-as-nil.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/import-null-as-nil.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-await.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-await.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-await.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-await.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-class.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-class.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-class.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-class.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-missing-from-clause.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-missing-from-clause.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-token.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-batch-token.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-batch-token.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-batch-token.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-equal.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-default-equal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-equal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-default-equal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-token.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-default-token.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default-token.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-default-token.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-named-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-named-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-extra-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-named-extra-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-extra-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-named-extra-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-middle-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-named-middle-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-export-named-middle-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-export-named-middle-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named-after-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named-after-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-after-named.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-after-named.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-after-named.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-missing-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-missing-module-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-module-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default-module-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default-module-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-missing-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-missing-module-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-module-specifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-module-specifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-module-specifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-module-specifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-named.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-after-named.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-named.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-after-named.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-namespace.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-after-namespace.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-after-namespace.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-after-namespace.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-as-missing-from.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-as-missing-from.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-extra-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-extra-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-extra-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-extra-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-middle-comma.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-middle-comma.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-named-middle-comma.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-named-middle-comma.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-after-named.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-namespace-after-named.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-after-named.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-namespace-after-named.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-missing-as.src.js b/packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/modules/invalid-import-namespace-missing-as.src.js rename to packages/typescript-estree/tests/fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-new-target.src.js b/packages/typescript-estree/tests/fixtures/javascript/newTarget/invalid-new-target.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-new-target.src.js rename to packages/typescript-estree/tests/fixtures/javascript/newTarget/invalid-new-target.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-unknown-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/newTarget/invalid-unknown-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/newTarget/invalid-unknown-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/newTarget/invalid-unknown-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/newTarget/simple-new-target.src.js b/packages/typescript-estree/tests/fixtures/javascript/newTarget/simple-new-target.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/newTarget/simple-new-target.src.js rename to packages/typescript-estree/tests/fixtures/javascript/newTarget/simple-new-target.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteral/object-literal-in-lhs.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteral/object-literal-in-lhs.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-addition-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-addition-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-and-identifier.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-and-identifier.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-getter-and-setter.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-getter-and-setter.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-string-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-string-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-variable-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/computed-variable-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-computed-variable-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-computed-variable-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-addition.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-addition.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression-with-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralComputedProperties/standalone-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-string-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/error-proto-string-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/invalid-method-no-braces.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/invalid-method-no-braces.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/method-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/method-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-get.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-get.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-set.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-named-set.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-argument.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-argument.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-string-name.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method-with-string-name.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/simple-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/string-name-method-property.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandMethods/string-name-method-property.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandProperties/shorthand-properties.src.js b/packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/objectLiteralShorthandProperties/shorthand-properties.src.js rename to packages/typescript-estree/tests/fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/invalid.src.js b/packages/typescript-estree/tests/fixtures/javascript/octalLiterals/invalid.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/invalid.src.js rename to packages/typescript-estree/tests/fixtures/javascript/octalLiterals/invalid.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/lowercase.src.js b/packages/typescript-estree/tests/fixtures/javascript/octalLiterals/lowercase.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/lowercase.src.js rename to packages/typescript-estree/tests/fixtures/javascript/octalLiterals/lowercase.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/strict-uppercase.src.js b/packages/typescript-estree/tests/fixtures/javascript/octalLiterals/strict-uppercase.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/strict-uppercase.src.js rename to packages/typescript-estree/tests/fixtures/javascript/octalLiterals/strict-uppercase.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/uppercase.src.js b/packages/typescript-estree/tests/fixtures/javascript/octalLiterals/uppercase.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/octalLiterals/uppercase.src.js rename to packages/typescript-estree/tests/fixtures/javascript/octalLiterals/uppercase.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regex/regexp-simple.src.js b/packages/typescript-estree/tests/fixtures/javascript/regex/regexp-simple.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/regex/regexp-simple.src.js rename to packages/typescript-estree/tests/fixtures/javascript/regex/regexp-simple.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-extended-escape.src.js b/packages/typescript-estree/tests/fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-extended-escape.src.js rename to packages/typescript-estree/tests/fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-invalid-extended-escape.src.js b/packages/typescript-estree/tests/fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-invalid-extended-escape.src.js rename to packages/typescript-estree/tests/fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-simple.src.js b/packages/typescript-estree/tests/fixtures/javascript/regexUFlag/regex-u-simple.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/regexUFlag/regex-u-simple.src.js rename to packages/typescript-estree/tests/fixtures/javascript/regexUFlag/regex-u-simple.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/regexYFlag/regexp-y-simple.src.js b/packages/typescript-estree/tests/fixtures/javascript/regexYFlag/regexp-y-simple.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/regexYFlag/regexp-y-simple.src.js rename to packages/typescript-estree/tests/fixtures/javascript/regexYFlag/regexp-y-simple.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/basic-rest.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/basic-rest.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/basic-rest.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/basic-rest.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-constructor.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/class-constructor.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-constructor.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/class-constructor.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-method.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/class-method.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/class-method.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/class-method.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-no-default.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/error-no-default.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-no-default.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/error-no-default.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-not-last.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/error-not-last.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/error-not-last.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/error-not-last.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression-multi.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/func-expression-multi.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression-multi.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/func-expression-multi.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/func-expression.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/func-expression.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/func-expression.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/invalid-rest-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/invalid-rest-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/invalid-rest-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/invalid-rest-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/restParams/single-rest.src.js b/packages/typescript-estree/tests/fixtures/javascript/restParams/single-rest.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/restParams/single-rest.src.js rename to packages/typescript-estree/tests/fixtures/javascript/restParams/single-rest.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-if.src.js b/packages/typescript-estree/tests/fixtures/javascript/spread/error-invalid-if.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-if.src.js rename to packages/typescript-estree/tests/fixtures/javascript/spread/error-invalid-if.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-sequence.src.js b/packages/typescript-estree/tests/fixtures/javascript/spread/error-invalid-sequence.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/spread/error-invalid-sequence.src.js rename to packages/typescript-estree/tests/fixtures/javascript/spread/error-invalid-sequence.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/multi-function-call.src.js b/packages/typescript-estree/tests/fixtures/javascript/spread/multi-function-call.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/spread/multi-function-call.src.js rename to packages/typescript-estree/tests/fixtures/javascript/spread/multi-function-call.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/not-final-param.src.js b/packages/typescript-estree/tests/fixtures/javascript/spread/not-final-param.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/spread/not-final-param.src.js rename to packages/typescript-estree/tests/fixtures/javascript/spread/not-final-param.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/spread/simple-function-call.src.js b/packages/typescript-estree/tests/fixtures/javascript/spread/simple-function-call.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/spread/simple-function-call.src.js rename to packages/typescript-estree/tests/fixtures/javascript/spread/simple-function-call.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/deeply-nested.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/deeply-nested.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/deeply-nested.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/deeply-nested.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/error-octal-literal.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/error-octal-literal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/error-octal-literal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/error-octal-literal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/escape-characters.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/escape-characters.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/escape-characters.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/escape-characters.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/expressions.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/expressions.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/expressions.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/expressions.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/multi-line-template-string.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/multi-line-template-string.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/multi-line-template-string.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/multi-line-template-string.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/simple-template-string.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/simple-template-string.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/simple-template-string.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/simple-template-string.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/single-dollar-sign.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/single-dollar-sign.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/single-dollar-sign.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/single-dollar-sign.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-no-placeholders.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/tagged-no-placeholders.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-no-placeholders.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/tagged-no-placeholders.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-template-string.src.js b/packages/typescript-estree/tests/fixtures/javascript/templateStrings/tagged-template-string.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/templateStrings/tagged-template-string.src.js rename to packages/typescript-estree/tests/fixtures/javascript/templateStrings/tagged-template-string.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/basic-string-literal.src.js b/packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/basic-string-literal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/complex-string-literal.src.js b/packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/complex-string-literal.src.js rename to packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-empty-escape.src.js b/packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-empty-escape.src.js rename to packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js diff --git a/packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-too-large-escape.src.js b/packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/ecma-features/unicodeCodePointEscapes/invalid-too-large-escape.src.js rename to packages/typescript-estree/tests/fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js diff --git a/packages/typescript-estree/tests/lib/__snapshots__/basics.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/basics.ts.snap deleted file mode 100644 index 68590ebf8bfe..000000000000 --- a/packages/typescript-estree/tests/lib/__snapshots__/basics.ts.snap +++ /dev/null @@ -1,3140 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`basics fixtures/delete-expression.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "range": Array [ - 7, - 14, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "delete", - "prefix": true, - "range": Array [ - 0, - 14, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 15, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "delete", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/do-while-statements.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "EmptyStatement", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "test": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "DoWhileStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "i", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 23, - 24, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 24, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 25, - ], - "type": "VariableDeclaration", - }, - Object { - "body": Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "name": "i", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "operator": "+=", - "range": Array [ - 34, - 40, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 39, - 40, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "range": Array [ - 34, - 41, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 3, - "line": 4, - }, - }, - "range": Array [ - 29, - 43, - ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 26, - 58, - ], - "test": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "name": "i", - "range": Array [ - 51, - 52, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "operator": "<", - "range": Array [ - 51, - 56, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "range": Array [ - 55, - 56, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, - "type": "BinaryExpression", - }, - "type": "DoWhileStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 59, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 2, - ], - "type": "Keyword", - "value": "do", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 9, - ], - "type": "Keyword", - "value": "while", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - "value": "i", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Numeric", - "value": "0", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 26, - 28, - ], - "type": "Keyword", - "value": "do", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 4, - }, - "start": Object { - "column": 3, - "line": 4, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - "value": "i", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 5, - }, - "start": Object { - "column": 5, - "line": 5, - }, - }, - "range": Array [ - 36, - 38, - ], - "type": "Punctuator", - "value": "+=", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 5, - }, - "start": Object { - "column": 9, - "line": 5, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 6, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 6, - }, - }, - "range": Array [ - 44, - 49, - ], - "type": "Keyword", - "value": "while", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 50, - 51, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 51, - 52, - ], - "type": "Identifier", - "value": "i", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 11, - "line": 6, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 6, - }, - }, - "range": Array [ - 55, - 56, - ], - "type": "Numeric", - "value": "5", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 6, - }, - "start": Object { - "column": 14, - "line": 6, - }, - }, - "range": Array [ - 56, - 57, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 15, - "line": 6, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/identifiers-double-underscore.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 17, - ], - "raw": "'ff'", - "type": "Literal", - "value": "ff", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 32, - 36, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 20, - 36, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 17, - "line": 7, - }, - }, - "range": Array [ - 55, - 59, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "name": "__Bar", - "range": Array [ - 47, - 52, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "params": Array [], - "range": Array [ - 38, - 59, - ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 60, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - "value": "__test", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 17, - ], - "type": "String", - "value": "'ff'", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 20, - 25, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - "value": "__Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 38, - 46, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "range": Array [ - 47, - 52, - ], - "type": "Identifier", - "value": "__Bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 7, - }, - "start": Object { - "column": 14, - "line": 7, - }, - }, - "range": Array [ - 52, - 53, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 7, - }, - "start": Object { - "column": 15, - "line": 7, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 7, - }, - "start": Object { - "column": 17, - "line": 7, - }, - }, - "range": Array [ - 55, - 56, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/instanceof.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 2, - ], - "raw": "''", - "type": "Literal", - "value": "", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "instanceof", - "range": Array [ - 0, - 17, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "Set", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 17, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 2, - ], - "type": "String", - "value": "''", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 13, - ], - "type": "Keyword", - "value": "instanceof", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - "value": "Set", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/new-with-member-expression.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 4, - 11, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "NewExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 14, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/new-without-parens.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 0, - 16, - ], - "type": "FunctionDeclaration", - }, - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "X", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 17, - 22, - ], - "type": "NewExpression", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 17, - 23, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 23, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 17, - 20, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/typeof-expression.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 12, - ], - "raw": "'str'", - "type": "Literal", - "value": "str", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "typeof", - "prefix": true, - "range": Array [ - 0, - 12, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "typeof", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 12, - ], - "type": "String", - "value": "'str'", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/update-expression.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "i", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 9, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 10, - ], - "type": "VariableDeclaration", - }, - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "i", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "operator": "++", - "prefix": false, - "range": Array [ - 28, - 31, - ], - "type": "UpdateExpression", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 28, - 32, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 24, - 34, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "f", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 11, - 34, - ], - "type": "FunctionDeclaration", - }, - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "name": "f", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 35, - 38, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 35, - 39, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 39, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - "value": "i", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Numeric", - "value": "0", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 11, - 19, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - "value": "i", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "Punctuator", - "value": "++", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`basics fixtures/void-expression.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "void", - "prefix": true, - "range": Array [ - 0, - 6, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 7, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 13, - 14, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "operator": "void", - "prefix": true, - "range": Array [ - 8, - 15, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 8, - 16, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 4, - ], - "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "type": "Numeric", - "value": "4", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 8, - 12, - ], - "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Numeric", - "value": "3", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap similarity index 96% rename from packages/typescript-estree/tests/lib/__snapshots__/ecma-features.ts.snap rename to packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index f696d0d320f1..35c0cb478abb 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/ecma-features.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ecma-features fixtures/arrayLiteral/array-literal-in-lhs.src 1`] = ` +exports[`javascript fixtures/arrayLiteral/array-literal-in-lhs.src 1`] = ` Object { "body": Array [ Object { @@ -349,7 +349,7 @@ Object { } `; -exports[`ecma-features fixtures/arrayLiteral/array-literals-in-binary-expr.src 1`] = ` +exports[`javascript fixtures/arrayLiteral/array-literals-in-binary-expr.src 1`] = ` Object { "body": Array [ Object { @@ -553,7 +553,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/as-param.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/as-param.src 1`] = ` Object { "body": Array [ Object { @@ -834,7 +834,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/as-param-with-params.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/as-param-with-params.src 1`] = ` Object { "body": Array [ Object { @@ -1206,7 +1206,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/basic.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/basic.src 1`] = ` Object { "body": Array [ Object { @@ -1379,7 +1379,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/basic-in-binary-expression.src 1`] = ` Object { "body": Array [ Object { @@ -2062,7 +2062,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/block-body.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/block-body.src 1`] = ` Object { "body": Array [ Object { @@ -2326,7 +2326,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/block-body-not-object.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/block-body-not-object.src 1`] = ` Object { "body": Array [ Object { @@ -2643,7 +2643,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-dup-params.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-dup-params.src 1`] = ` Object { "body": Array [ Object { @@ -2907,17 +2907,17 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-missing-paren.src 1`] = `"';' expected."`; +exports[`javascript fixtures/arrowFunctions/error-missing-paren.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/arrowFunctions/error-not-arrow.src 1`] = `"Expression expected."`; +exports[`javascript fixtures/arrowFunctions/error-not-arrow.src 1`] = `"Expression expected."`; -exports[`ecma-features fixtures/arrowFunctions/error-numeric-param.src 1`] = `"';' expected."`; +exports[`javascript fixtures/arrowFunctions/error-numeric-param.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/arrowFunctions/error-numeric-param-multi.src 1`] = `"';' expected."`; +exports[`javascript fixtures/arrowFunctions/error-numeric-param-multi.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/arrowFunctions/error-reverse-arrow.src 1`] = `"Expression expected."`; +exports[`javascript fixtures/arrowFunctions/error-reverse-arrow.src 1`] = `"Expression expected."`; -exports[`ecma-features fixtures/arrowFunctions/error-strict-default-param-eval.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-default-param-eval.src 1`] = ` Object { "body": Array [ Object { @@ -3271,7 +3271,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-dup-params.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-dup-params.src 1`] = ` Object { "body": Array [ Object { @@ -3607,7 +3607,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-eval.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-eval.src 1`] = ` Object { "body": Array [ Object { @@ -3943,7 +3943,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-eval-return.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-eval-return.src 1`] = ` Object { "body": Array [ Object { @@ -4207,7 +4207,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-octal.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-octal.src 1`] = ` Object { "body": Array [ Object { @@ -4489,7 +4489,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-param-arguments.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-param-arguments.src 1`] = ` Object { "body": Array [ Object { @@ -4825,7 +4825,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-param-eval.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-param-eval.src 1`] = ` Object { "body": Array [ Object { @@ -5161,7 +5161,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-param-names.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-param-names.src 1`] = ` Object { "body": Array [ Object { @@ -5497,7 +5497,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-param-no-paren-arguments.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-param-no-paren-arguments.src 1`] = ` Object { "body": Array [ Object { @@ -5743,7 +5743,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-strict-param-no-paren-eval.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-strict-param-no-paren-eval.src 1`] = ` Object { "body": Array [ Object { @@ -5989,7 +5989,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-two-lines.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/error-two-lines.src 1`] = ` Object { "body": Array [ Object { @@ -6254,9 +6254,9 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/error-wrapped-param.src 1`] = `"';' expected."`; +exports[`javascript fixtures/arrowFunctions/error-wrapped-param.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/arrowFunctions/expression.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/expression.src 1`] = ` Object { "body": Array [ Object { @@ -6465,7 +6465,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/iife.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/iife.src 1`] = ` Object { "body": Array [ Object { @@ -6805,7 +6805,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/multiple-params.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/multiple-params.src 1`] = ` Object { "body": Array [ Object { @@ -7069,7 +7069,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/no-auto-return.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/no-auto-return.src 1`] = ` Object { "body": Array [ Object { @@ -7423,7 +7423,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/not-strict-arguments.src 1`] = ` Object { "body": Array [ Object { @@ -7597,7 +7597,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/not-strict-eval.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/not-strict-eval.src 1`] = ` Object { "body": Array [ Object { @@ -7771,7 +7771,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/not-strict-eval-params.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/not-strict-eval-params.src 1`] = ` Object { "body": Array [ Object { @@ -8035,7 +8035,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/not-strict-octal.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/not-strict-octal.src 1`] = ` Object { "body": Array [ Object { @@ -8245,7 +8245,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/return-arrow-function.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/return-arrow-function.src 1`] = ` Object { "body": Array [ Object { @@ -8496,7 +8496,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/return-sequence.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/return-sequence.src 1`] = ` Object { "body": Array [ Object { @@ -9071,7 +9071,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/single-param.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/single-param.src 1`] = ` Object { "body": Array [ Object { @@ -9245,7 +9245,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/single-param-parens.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/single-param-parens.src 1`] = ` Object { "body": Array [ Object { @@ -9455,7 +9455,7 @@ Object { } `; -exports[`ecma-features fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` +exports[`javascript fixtures/arrowFunctions/single-param-return-identifier.src 1`] = ` Object { "body": Array [ Object { @@ -9664,9 +9664,3148 @@ Object { } `; -exports[`ecma-features fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; +exports[`javascript fixtures/basics/delete-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 14, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "delete", + "prefix": true, + "range": Array [ + 0, + 14, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "delete", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/do-while-statements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "EmptyStatement", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "DoWhileStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "i", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 25, + ], + "type": "VariableDeclaration", + }, + Object { + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "name": "i", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "operator": "+=", + "range": Array [ + 34, + 40, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 29, + 43, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 26, + 58, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "name": "i", + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "operator": "<", + "range": Array [ + 51, + 56, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "BinaryExpression", + }, + "type": "DoWhileStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Keyword", + "value": "do", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "Keyword", + "value": "do", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "Punctuator", + "value": "+=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 44, + 49, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 15, + "line": 6, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/identifiers-double-underscore.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "__test", + "range": Array [ + 4, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "raw": "'ff'", + "type": "Literal", + "value": "ff", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 32, + 36, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "__Foo", + "range": Array [ + 26, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 20, + 36, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 55, + 59, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "name": "__Bar", + "range": Array [ + 47, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "params": Array [], + "range": Array [ + 38, + 59, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 60, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 10, + ], + "type": "Identifier", + "value": "__test", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "String", + "value": "'ff'", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 20, + 25, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 26, + 31, + ], + "type": "Identifier", + "value": "__Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 38, + 46, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 47, + 52, + ], + "type": "Identifier", + "value": "__Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 7, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/instanceof.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "raw": "''", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "instanceof", + "range": Array [ + 0, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "Set", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "String", + "value": "''", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 13, + ], + "type": "Keyword", + "value": "instanceof", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "Set", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/new-with-member-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 4, + 11, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "NewExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/new-without-parens.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 16, + ], + "type": "FunctionDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "X", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 22, + ], + "type": "NewExpression", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/typeof-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "'str'", + "type": "Literal", + "value": "str", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "typeof", + "prefix": true, + "range": Array [ + 0, + 12, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "'str'", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/update-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "i", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "operator": "++", + "prefix": false, + "range": Array [ + 28, + 31, + ], + "type": "UpdateExpression", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 24, + 34, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "f", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 11, + 34, + ], + "type": "FunctionDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "name": "f", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 11, + 19, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Punctuator", + "value": "++", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/void-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "void", + "prefix": true, + "range": Array [ + 0, + 6, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "void", + "prefix": true, + "range": Array [ + 8, + 15, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 12, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/binaryLiterals/lowercase.src 1`] = ` +exports[`javascript fixtures/binaryLiterals/lowercase.src 1`] = ` Object { "body": Array [ Object { @@ -9763,7 +12902,7 @@ Object { } `; -exports[`ecma-features fixtures/binaryLiterals/uppercase.src 1`] = ` +exports[`javascript fixtures/binaryLiterals/uppercase.src 1`] = ` Object { "body": Array [ Object { @@ -9860,7 +12999,7 @@ Object { } `; -exports[`ecma-features fixtures/blockBindings/const.src 1`] = ` +exports[`javascript fixtures/blockBindings/const.src 1`] = ` Object { "body": Array [ Object { @@ -10048,7 +13187,7 @@ Object { } `; -exports[`ecma-features fixtures/blockBindings/let.src 1`] = ` +exports[`javascript fixtures/blockBindings/let.src 1`] = ` Object { "body": Array [ Object { @@ -10236,7 +13375,7 @@ Object { } `; -exports[`ecma-features fixtures/blockBindings/let-in-switchcase.src 1`] = ` +exports[`javascript fixtures/blockBindings/let-in-switchcase.src 1`] = ` Object { "body": Array [ Object { @@ -10716,7 +13855,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-accessor-properties.src 1`] = ` +exports[`javascript fixtures/classes/class-accessor-properties.src 1`] = ` Object { "body": Array [ Object { @@ -11330,7 +14469,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-computed-static-method.src 1`] = ` +exports[`javascript fixtures/classes/class-computed-static-method.src 1`] = ` Object { "body": Array [ Object { @@ -11757,7 +14896,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-expression.src 1`] = ` +exports[`javascript fixtures/classes/class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -11944,7 +15083,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-method-named-prototype.src 1`] = ` +exports[`javascript fixtures/classes/class-method-named-prototype.src 1`] = ` Object { "body": Array [ Object { @@ -12299,7 +15438,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-method-named-static.src 1`] = ` +exports[`javascript fixtures/classes/class-method-named-static.src 1`] = ` Object { "body": Array [ Object { @@ -12672,7 +15811,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-method-named-with-space.src 1`] = ` +exports[`javascript fixtures/classes/class-method-named-with-space.src 1`] = ` Object { "body": Array [ Object { @@ -12992,7 +16131,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-one-method.src 1`] = ` +exports[`javascript fixtures/classes/class-one-method.src 1`] = ` Object { "body": Array [ Object { @@ -13347,7 +16486,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-one-method-super.src 1`] = ` +exports[`javascript fixtures/classes/class-one-method-super.src 1`] = ` Object { "body": Array [ Object { @@ -13827,7 +16966,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-static-method.src 1`] = ` +exports[`javascript fixtures/classes/class-static-method.src 1`] = ` Object { "body": Array [ Object { @@ -14218,7 +17357,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-static-method-named-prototype.src 1`] = ` +exports[`javascript fixtures/classes/class-static-method-named-prototype.src 1`] = ` Object { "body": Array [ Object { @@ -14628,7 +17767,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-static-method-named-static.src 1`] = ` +exports[`javascript fixtures/classes/class-static-method-named-static.src 1`] = ` Object { "body": Array [ Object { @@ -15019,7 +18158,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` +exports[`javascript fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` Object { "body": Array [ Object { @@ -15837,7 +18976,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-two-computed-static-methods.src 1`] = ` +exports[`javascript fixtures/classes/class-two-computed-static-methods.src 1`] = ` Object { "body": Array [ Object { @@ -16486,7 +19625,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-two-methods.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods.src 1`] = ` Object { "body": Array [ Object { @@ -17009,7 +20148,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -17570,7 +20709,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-two-methods-semi.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-semi.src 1`] = ` Object { "body": Array [ Object { @@ -18111,7 +21250,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-two-methods-three-semi.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-three-semi.src 1`] = ` Object { "body": Array [ Object { @@ -18688,7 +21827,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-two-methods-two-semi.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-two-semi.src 1`] = ` Object { "body": Array [ Object { @@ -19247,7 +22386,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` +exports[`javascript fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -19806,7 +22945,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-with-constructor.src 1`] = ` +exports[`javascript fixtures/classes/class-with-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -20161,7 +23300,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-with-constructor-parameters.src 1`] = ` +exports[`javascript fixtures/classes/class-with-constructor-parameters.src 1`] = ` Object { "body": Array [ Object { @@ -20572,7 +23711,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/class-with-constructor-with-space.src 1`] = ` +exports[`javascript fixtures/classes/class-with-constructor-with-space.src 1`] = ` Object { "body": Array [ Object { @@ -20927,7 +24066,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/derived-class-assign-to-var.src 1`] = ` +exports[`javascript fixtures/classes/derived-class-assign-to-var.src 1`] = ` Object { "body": Array [ Object { @@ -21259,7 +24398,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/derived-class-expression.src 1`] = ` +exports[`javascript fixtures/classes/derived-class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -21500,7 +24639,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/empty-class.src 1`] = ` +exports[`javascript fixtures/classes/empty-class.src 1`] = ` Object { "body": Array [ Object { @@ -21686,7 +24825,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/empty-class-double-semi.src 1`] = ` +exports[`javascript fixtures/classes/empty-class-double-semi.src 1`] = ` Object { "body": Array [ Object { @@ -21872,7 +25011,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/empty-class-semi.src 1`] = ` +exports[`javascript fixtures/classes/empty-class-semi.src 1`] = ` Object { "body": Array [ Object { @@ -22076,7 +25215,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/empty-literal-derived-class.src 1`] = ` +exports[`javascript fixtures/classes/empty-literal-derived-class.src 1`] = ` Object { "body": Array [ Object { @@ -22316,7 +25455,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/invalid-class-declaration.src 1`] = ` +exports[`javascript fixtures/classes/invalid-class-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -22467,7 +25606,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/invalid-class-setter-declaration.src 1`] = ` +exports[`javascript fixtures/classes/invalid-class-setter-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -22840,9 +25979,9 @@ Object { } `; -exports[`ecma-features fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; +exports[`javascript fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; -exports[`ecma-features fixtures/classes/named-class-expression.src 1`] = ` +exports[`javascript fixtures/classes/named-class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -23064,7 +26203,7 @@ Object { } `; -exports[`ecma-features fixtures/classes/named-derived-class-expression.src 1`] = ` +exports[`javascript fixtures/classes/named-derived-class-expression.src 1`] = ` Object { "body": Array [ Object { @@ -23340,7 +26479,7 @@ Object { } `; -exports[`ecma-features fixtures/defaultParams/class-constructor.src 1`] = ` +exports[`javascript fixtures/defaultParams/class-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -23769,7 +26908,7 @@ Object { } `; -exports[`ecma-features fixtures/defaultParams/class-method.src 1`] = ` +exports[`javascript fixtures/defaultParams/class-method.src 1`] = ` Object { "body": Array [ Object { @@ -24198,7 +27337,7 @@ Object { } `; -exports[`ecma-features fixtures/defaultParams/declaration.src 1`] = ` +exports[`javascript fixtures/defaultParams/declaration.src 1`] = ` Object { "body": Array [ Object { @@ -24497,7 +27636,7 @@ Object { } `; -exports[`ecma-features fixtures/defaultParams/expression.src 1`] = ` +exports[`javascript fixtures/defaultParams/expression.src 1`] = ` Object { "body": Array [ Object { @@ -24850,7 +27989,7 @@ Object { } `; -exports[`ecma-features fixtures/defaultParams/method.src 1`] = ` +exports[`javascript fixtures/defaultParams/method.src 1`] = ` Object { "body": Array [ Object { @@ -25333,7 +28472,7 @@ Object { } `; -exports[`ecma-features fixtures/defaultParams/not-all-params.src 1`] = ` +exports[`javascript fixtures/defaultParams/not-all-params.src 1`] = ` Object { "body": Array [ Object { @@ -25832,7 +28971,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/array-member.src 1`] = ` +exports[`javascript fixtures/destructuring/array-member.src 1`] = ` Object { "body": Array [ Object { @@ -26128,7 +29267,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/array-to-array.src 1`] = ` +exports[`javascript fixtures/destructuring/array-to-array.src 1`] = ` Object { "body": Array [ Object { @@ -26514,7 +29653,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/array-var-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring/array-var-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -26775,7 +29914,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-constructor-params-array.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-array.src 1`] = ` Object { "body": Array [ Object { @@ -27241,7 +30380,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -27851,7 +30990,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -28539,7 +31678,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-constructor-params-object.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-object.src 1`] = ` Object { "body": Array [ Object { @@ -29083,7 +32222,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-method-params-array.src 1`] = ` +exports[`javascript fixtures/destructuring/class-method-params-array.src 1`] = ` Object { "body": Array [ Object { @@ -29549,7 +32688,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` +exports[`javascript fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -30159,7 +33298,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` +exports[`javascript fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -30847,7 +33986,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/class-method-params-object.src 1`] = ` +exports[`javascript fixtures/destructuring/class-method-params-object.src 1`] = ` Object { "body": Array [ Object { @@ -31391,7 +34530,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-array.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -31668,7 +34807,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-array-all.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-all.src 1`] = ` Object { "body": Array [ Object { @@ -32235,7 +35374,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` Object { "body": Array [ Object { @@ -33013,7 +36152,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-array-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-multi.src 1`] = ` Object { "body": Array [ Object { @@ -33436,7 +36575,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-array-nested-all.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-nested-all.src 1`] = ` Object { "body": Array [ Object { @@ -33932,7 +37071,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` Object { "body": Array [ Object { @@ -34356,7 +37495,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -34692,7 +37831,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-all.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-all.src 1`] = ` Object { "body": Array [ Object { @@ -35376,7 +38515,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-longform.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-longform.src 1`] = ` Object { "body": Array [ Object { @@ -35766,7 +38905,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-longform-all.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-longform-all.src 1`] = ` Object { "body": Array [ Object { @@ -36558,7 +39697,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` Object { "body": Array [ Object { @@ -37206,7 +40345,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` Object { "body": Array [ Object { @@ -37782,7 +40921,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-multi.src 1`] = ` Object { "body": Array [ Object { @@ -38322,7 +41461,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-nested-all.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-nested-all.src 1`] = ` Object { "body": Array [ Object { @@ -38971,7 +42110,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` Object { "body": Array [ Object { @@ -39548,7 +42687,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/destructured-array-catch.src 1`] = ` +exports[`javascript fixtures/destructuring/destructured-array-catch.src 1`] = ` Object { "body": Array [ Object { @@ -40469,7 +43608,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/destructured-object-catch.src 1`] = ` +exports[`javascript fixtures/destructuring/destructured-object-catch.src 1`] = ` Object { "body": Array [ Object { @@ -41429,7 +44568,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` +exports[`javascript fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` Object { "body": Array [ Object { @@ -41964,7 +45103,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/named-param.src 1`] = ` +exports[`javascript fixtures/destructuring/named-param.src 1`] = ` Object { "body": Array [ Object { @@ -42298,7 +45437,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/nested-array.src 1`] = ` +exports[`javascript fixtures/destructuring/nested-array.src 1`] = ` Object { "body": Array [ Object { @@ -42964,7 +46103,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/nested-object.src 1`] = ` +exports[`javascript fixtures/destructuring/nested-object.src 1`] = ` Object { "body": Array [ Object { @@ -43932,7 +47071,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/object-var-named.src 1`] = ` +exports[`javascript fixtures/destructuring/object-var-named.src 1`] = ` Object { "body": Array [ Object { @@ -44268,7 +47407,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/object-var-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring/object-var-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -44568,7 +47707,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/param-defaults-array.src 1`] = ` +exports[`javascript fixtures/destructuring/param-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -44922,7 +48061,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/param-defaults-object.src 1`] = ` +exports[`javascript fixtures/destructuring/param-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -45315,7 +48454,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/param-defaults-object-nested.src 1`] = ` +exports[`javascript fixtures/destructuring/param-defaults-object-nested.src 1`] = ` Object { "body": Array [ Object { @@ -46038,7 +49177,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/params-array.src 1`] = ` +exports[`javascript fixtures/destructuring/params-array.src 1`] = ` Object { "body": Array [ Object { @@ -46409,7 +49548,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/params-array-wrapped.src 1`] = ` +exports[`javascript fixtures/destructuring/params-array-wrapped.src 1`] = ` Object { "body": Array [ Object { @@ -46816,7 +49955,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/params-multi-object.src 1`] = ` +exports[`javascript fixtures/destructuring/params-multi-object.src 1`] = ` Object { "body": Array [ Object { @@ -47226,7 +50365,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/params-nested-array.src 1`] = ` +exports[`javascript fixtures/destructuring/params-nested-array.src 1`] = ` Object { "body": Array [ Object { @@ -47690,7 +50829,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/params-nested-object.src 1`] = ` +exports[`javascript fixtures/destructuring/params-nested-object.src 1`] = ` Object { "body": Array [ Object { @@ -48341,7 +51480,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/params-object.src 1`] = ` +exports[`javascript fixtures/destructuring/params-object.src 1`] = ` Object { "body": Array [ Object { @@ -48790,7 +51929,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/params-object-wrapped.src 1`] = ` +exports[`javascript fixtures/destructuring/params-object-wrapped.src 1`] = ` Object { "body": Array [ Object { @@ -49275,7 +52414,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring/sparse-array.src 1`] = ` +exports[`javascript fixtures/destructuring/sparse-array.src 1`] = ` Object { "body": Array [ Object { @@ -49571,7 +52710,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` Object { "body": Array [ Object { @@ -49835,7 +52974,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` Object { "body": Array [ Object { @@ -50208,7 +53347,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` Object { "body": Array [ Object { @@ -50734,7 +53873,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` Object { "body": Array [ Object { @@ -51332,7 +54471,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` Object { "body": Array [ Object { @@ -51635,7 +54774,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -51953,7 +55092,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -52310,7 +55449,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` Object { "body": Array [ Object { @@ -53071,7 +56210,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -53332,7 +56471,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -53593,7 +56732,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` Object { "body": Array [ Object { @@ -53929,7 +57068,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -54229,7 +57368,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` Object { "body": Array [ Object { @@ -54565,7 +57704,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -54865,7 +58004,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` Object { "body": Array [ Object { @@ -55309,7 +58448,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` Object { "body": Array [ Object { @@ -55904,7 +59043,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` +exports[`javascript fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` Object { "body": Array [ Object { @@ -56557,7 +59696,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-forOf/loop.src 1`] = ` +exports[`javascript fixtures/destructuring-and-forOf/loop.src 1`] = ` Object { "body": Array [ Object { @@ -56834,7 +59973,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -57333,7 +60472,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` Object { "body": Array [ Object { @@ -57754,7 +60893,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` Object { "body": Array [ Object { @@ -58269,7 +61408,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` Object { "body": Array [ Object { @@ -58768,7 +61907,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -59080,7 +62219,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/single-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/single-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -59338,7 +62477,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -59857,7 +62996,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` Object { "body": Array [ Object { @@ -60298,7 +63437,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -60630,7 +63769,7 @@ Object { } `; -exports[`ecma-features fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -60908,7 +64047,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` +exports[`javascript fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` Object { "body": Array [ Object { @@ -61134,7 +64273,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` +exports[`javascript fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` Object { "body": Array [ Object { @@ -61633,7 +64772,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` +exports[`javascript fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` Object { "body": Array [ Object { @@ -61983,7 +65122,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` Object { "body": Array [ Object { @@ -62393,7 +65532,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` Object { "body": Array [ Object { @@ -62945,7 +66084,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` Object { "body": Array [ Object { @@ -63262,9 +66401,9 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; +exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; -exports[`ecma-features fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` Object { "body": Array [ Object { @@ -63746,7 +66885,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` Object { "body": Array [ Object { @@ -64731,7 +67870,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` Object { "body": Array [ Object { @@ -65593,7 +68732,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` Object { "body": Array [ Object { @@ -66226,7 +69365,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` Object { "body": Array [ Object { @@ -66915,7 +70054,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` Object { "body": Array [ Object { @@ -67633,7 +70772,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` Object { "body": Array [ Object { @@ -68423,7 +71562,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` Object { "body": Array [ Object { @@ -68831,7 +71970,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` Object { "body": Array [ Object { @@ -69581,7 +72720,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` +exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` Object { "body": Array [ Object { @@ -69786,7 +72925,7 @@ Object { } `; -exports[`ecma-features fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` +exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` Object { "body": Array [ Object { @@ -70062,7 +73201,7 @@ Object { } `; -exports[`ecma-features fixtures/exponentiationOperators/exponential-operators.src 1`] = ` +exports[`javascript fixtures/exponentiationOperators/exponential-operators.src 1`] = ` Object { "body": Array [ Object { @@ -70468,7 +73607,7 @@ Object { } `; -exports[`ecma-features fixtures/forOf/for-of-with-function-initializer.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-function-initializer.src 1`] = ` Object { "body": Array [ Object { @@ -71183,7 +74322,7 @@ Object { } `; -exports[`ecma-features fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` Object { "body": Array [ Object { @@ -71606,7 +74745,7 @@ Object { } `; -exports[`ecma-features fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` Object { "body": Array [ Object { @@ -71974,7 +75113,7 @@ Object { } `; -exports[`ecma-features fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` +exports[`javascript fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` Object { "body": Array [ Object { @@ -72342,7 +75481,7 @@ Object { } `; -exports[`ecma-features fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` +exports[`javascript fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` Object { "body": Array [ Object { @@ -72710,7 +75849,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/anonymous-generator.src 1`] = ` +exports[`javascript fixtures/generators/anonymous-generator.src 1`] = ` Object { "body": Array [ Object { @@ -73044,7 +76183,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/async-generator-function.src 1`] = ` +exports[`javascript fixtures/generators/async-generator-function.src 1`] = ` Object { "body": Array [ Object { @@ -73270,7 +76409,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/async-generator-method.src 1`] = ` +exports[`javascript fixtures/generators/async-generator-method.src 1`] = ` Object { "body": Array [ Object { @@ -73898,7 +77037,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/double-yield.src 1`] = ` +exports[`javascript fixtures/generators/double-yield.src 1`] = ` Object { "body": Array [ Object { @@ -74269,7 +77408,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/empty-generator-declaration.src 1`] = ` +exports[`javascript fixtures/generators/empty-generator-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -74512,7 +77651,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/generator-declaration.src 1`] = ` +exports[`javascript fixtures/generators/generator-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -74863,7 +78002,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/yield-delegation.src 1`] = ` +exports[`javascript fixtures/generators/yield-delegation.src 1`] = ` Object { "body": Array [ Object { @@ -75215,7 +78354,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/yield-without-value.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value.src 1`] = ` Object { "body": Array [ Object { @@ -75532,7 +78671,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/yield-without-value-in-call.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value-in-call.src 1`] = ` Object { "body": Array [ Object { @@ -75940,7 +79079,7 @@ Object { } `; -exports[`ecma-features fixtures/generators/yield-without-value-no-semi.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value-no-semi.src 1`] = ` Object { "body": Array [ Object { @@ -76239,7 +79378,7 @@ Object { } `; -exports[`ecma-features fixtures/globalReturn/return-identifier.src 1`] = ` +exports[`javascript fixtures/globalReturn/return-identifier.src 1`] = ` Object { "body": Array [ Object { @@ -76353,7 +79492,7 @@ Object { } `; -exports[`ecma-features fixtures/globalReturn/return-no-arg.src 1`] = ` +exports[`javascript fixtures/globalReturn/return-no-arg.src 1`] = ` Object { "body": Array [ Object { @@ -76432,7 +79571,7 @@ Object { } `; -exports[`ecma-features fixtures/globalReturn/return-true.src 1`] = ` +exports[`javascript fixtures/globalReturn/return-true.src 1`] = ` Object { "body": Array [ Object { @@ -76547,7 +79686,7 @@ Object { } `; -exports[`ecma-features fixtures/importMeta/simple-import-meta.src 1`] = ` +exports[`javascript fixtures/importMeta/simple-import-meta.src 1`] = ` Object { "body": Array [ Object { @@ -76786,7 +79925,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/error-delete.src 1`] = ` +exports[`javascript fixtures/modules/error-delete.src 1`] = ` Object { "body": Array [ Object { @@ -77082,7 +80221,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/error-function.src 1`] = ` +exports[`javascript fixtures/modules/error-function.src 1`] = ` Object { "body": Array [ Object { @@ -77380,7 +80519,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/error-strict.src 1`] = ` +exports[`javascript fixtures/modules/error-strict.src 1`] = ` Object { "body": Array [ Object { @@ -77964,7 +81103,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-array.src 1`] = ` +exports[`javascript fixtures/modules/export-default-array.src 1`] = ` Object { "body": Array [ Object { @@ -78114,7 +81253,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-class.src 1`] = ` +exports[`javascript fixtures/modules/export-default-class.src 1`] = ` Object { "body": Array [ Object { @@ -78283,7 +81422,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-expression.src 1`] = ` +exports[`javascript fixtures/modules/export-default-expression.src 1`] = ` Object { "body": Array [ Object { @@ -78525,7 +81664,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-function.src 1`] = ` +exports[`javascript fixtures/modules/export-default-function.src 1`] = ` Object { "body": Array [ Object { @@ -78733,7 +81872,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-named-class.src 1`] = ` +exports[`javascript fixtures/modules/export-default-named-class.src 1`] = ` Object { "body": Array [ Object { @@ -78937,7 +82076,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-named-function.src 1`] = ` +exports[`javascript fixtures/modules/export-default-named-function.src 1`] = ` Object { "body": Array [ Object { @@ -79180,7 +82319,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-number.src 1`] = ` +exports[`javascript fixtures/modules/export-default-number.src 1`] = ` Object { "body": Array [ Object { @@ -79313,7 +82452,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-object.src 1`] = ` +exports[`javascript fixtures/modules/export-default-object.src 1`] = ` Object { "body": Array [ Object { @@ -79576,7 +82715,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-default-value.src 1`] = ` +exports[`javascript fixtures/modules/export-default-value.src 1`] = ` Object { "body": Array [ Object { @@ -79708,7 +82847,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-from-batch.src 1`] = ` +exports[`javascript fixtures/modules/export-from-batch.src 1`] = ` Object { "body": Array [ Object { @@ -79859,7 +82998,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-from-default.src 1`] = ` +exports[`javascript fixtures/modules/export-from-default.src 1`] = ` Object { "body": Array [ Object { @@ -80102,7 +83241,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-from-named-as-default.src 1`] = ` +exports[`javascript fixtures/modules/export-from-named-as-default.src 1`] = ` Object { "body": Array [ Object { @@ -80381,7 +83520,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-from-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-from-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -80660,7 +83799,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-from-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-from-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -81028,7 +84167,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-from-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-from-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -81271,7 +84410,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-from-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-from-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -81603,7 +84742,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-function.src 1`] = ` +exports[`javascript fixtures/modules/export-function.src 1`] = ` Object { "body": Array [ Object { @@ -81830,7 +84969,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-as-default.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-default.src 1`] = ` Object { "body": Array [ Object { @@ -82055,7 +85194,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -82280,7 +85419,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -82594,7 +85733,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-class.src 1`] = ` +exports[`javascript fixtures/modules/export-named-class.src 1`] = ` Object { "body": Array [ Object { @@ -82782,7 +85921,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-empty.src 1`] = ` +exports[`javascript fixtures/modules/export-named-empty.src 1`] = ` Object { "body": Array [ Object { @@ -82899,7 +86038,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-named-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -83088,7 +86227,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-named-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -83366,7 +86505,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-named-specifiers-comma.src 1`] = ` +exports[`javascript fixtures/modules/export-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { @@ -83662,7 +86801,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-var.src 1`] = ` +exports[`javascript fixtures/modules/export-var.src 1`] = ` Object { "body": Array [ Object { @@ -83834,7 +86973,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-var-anonymous-function.src 1`] = ` +exports[`javascript fixtures/modules/export-var-anonymous-function.src 1`] = ` Object { "body": Array [ Object { @@ -84153,7 +87292,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/export-var-number.src 1`] = ` +exports[`javascript fixtures/modules/export-var-number.src 1`] = ` Object { "body": Array [ Object { @@ -84379,7 +87518,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-default.src 1`] = ` +exports[`javascript fixtures/modules/import-default.src 1`] = ` Object { "body": Array [ Object { @@ -84567,7 +87706,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-default-and-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-default-and-named-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -84880,7 +88019,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -85175,7 +88314,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-default-as.src 1`] = ` +exports[`javascript fixtures/modules/import-default-as.src 1`] = ` Object { "body": Array [ Object { @@ -85453,7 +88592,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-jquery.src 1`] = ` +exports[`javascript fixtures/modules/import-jquery.src 1`] = ` Object { "body": Array [ Object { @@ -85623,7 +88762,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-module.src 1`] = ` +exports[`javascript fixtures/modules/import-module.src 1`] = ` Object { "body": Array [ Object { @@ -85739,7 +88878,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/import-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -86017,7 +89156,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -86384,7 +89523,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-named-empty.src 1`] = ` +exports[`javascript fixtures/modules/import-named-empty.src 1`] = ` Object { "body": Array [ Object { @@ -86554,7 +89693,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-named-specifier.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -86796,7 +89935,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -87127,7 +90266,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-named-specifiers-comma.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { @@ -87476,7 +90615,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-namespace-specifier.src 1`] = ` +exports[`javascript fixtures/modules/import-namespace-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -87700,7 +90839,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/import-null-as-nil.src 1`] = ` +exports[`javascript fixtures/modules/import-null-as-nil.src 1`] = ` Object { "body": Array [ Object { @@ -87960,7 +91099,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/invalid-await.src 1`] = ` +exports[`javascript fixtures/modules/invalid-await.src 1`] = ` Object { "body": Array [ Object { @@ -88132,7 +91271,7 @@ Object { } `; -exports[`ecma-features fixtures/modules/invalid-class.src 1`] = ` +exports[`javascript fixtures/modules/invalid-class.src 1`] = ` Object { "body": Array [ Object { @@ -88301,17 +91440,17 @@ Object { } `; -exports[`ecma-features fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; +exports[`javascript fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; +exports[`javascript fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; -exports[`ecma-features fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; +exports[`javascript fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/modules/invalid-export-named-default.src 1`] = ` +exports[`javascript fixtures/modules/invalid-export-named-default.src 1`] = ` Object { "body": Array [ Object { @@ -88482,19 +91621,19 @@ Object { } `; -exports[`ecma-features fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; +exports[`javascript fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; -exports[`ecma-features fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; +exports[`javascript fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; -exports[`ecma-features fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; +exports[`javascript fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; -exports[`ecma-features fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; +exports[`javascript fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` +exports[`javascript fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -88681,9 +91820,9 @@ Object { } `; -exports[`ecma-features fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-module-specifier.src 1`] = ` +exports[`javascript fixtures/modules/invalid-import-module-specifier.src 1`] = ` Object { "body": Array [ Object { @@ -88907,21 +92046,21 @@ Object { } `; -exports[`ecma-features fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; +exports[`javascript fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; -exports[`ecma-features fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; +exports[`javascript fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; -exports[`ecma-features fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; +exports[`javascript fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; -exports[`ecma-features fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; +exports[`javascript fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; -exports[`ecma-features fixtures/newTarget/invalid-new-target.src 1`] = ` +exports[`javascript fixtures/newTarget/invalid-new-target.src 1`] = ` Object { "body": Array [ Object { @@ -89180,7 +92319,7 @@ Object { } `; -exports[`ecma-features fixtures/newTarget/invalid-unknown-property.src 1`] = ` +exports[`javascript fixtures/newTarget/invalid-unknown-property.src 1`] = ` Object { "body": Array [ Object { @@ -89587,7 +92726,7 @@ Object { } `; -exports[`ecma-features fixtures/newTarget/simple-new-target.src 1`] = ` +exports[`javascript fixtures/newTarget/simple-new-target.src 1`] = ` Object { "body": Array [ Object { @@ -90012,7 +93151,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` +exports[`javascript fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` Object { "body": Array [ Object { @@ -90361,7 +93500,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` Object { "body": Array [ Object { @@ -90789,7 +93928,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` Object { "body": Array [ Object { @@ -91218,7 +94357,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` Object { "body": Array [ Object { @@ -91870,7 +95009,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` Object { "body": Array [ Object { @@ -92225,7 +95364,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` Object { "body": Array [ Object { @@ -92579,11 +95718,11 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; +exports[`javascript fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; -exports[`ecma-features fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; +exports[`javascript fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; -exports[`ecma-features fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` Object { "body": Array [ Object { @@ -92882,7 +96021,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` Object { "body": Array [ Object { @@ -93255,7 +96394,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` Object { "body": Array [ Object { @@ -93647,7 +96786,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` Object { "body": Array [ Object { @@ -94347,7 +97486,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` Object { "body": Array [ Object { @@ -95049,7 +98188,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` Object { "body": Array [ Object { @@ -95570,7 +98709,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` Object { "body": Array [ Object { @@ -96093,9 +99232,9 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; +exports[`javascript fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` Object { "body": Array [ Object { @@ -96561,7 +99700,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` Object { "body": Array [ Object { @@ -96952,7 +100091,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` Object { "body": Array [ Object { @@ -97343,7 +100482,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` Object { "body": Array [ Object { @@ -97734,7 +100873,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` Object { "body": Array [ Object { @@ -98162,7 +101301,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` Object { "body": Array [ Object { @@ -98554,7 +101693,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` Object { "body": Array [ Object { @@ -99021,7 +102160,7 @@ Object { } `; -exports[`ecma-features fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` Object { "body": Array [ Object { @@ -99743,9 +102882,9 @@ Object { } `; -exports[`ecma-features fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; +exports[`javascript fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; -exports[`ecma-features fixtures/octalLiterals/lowercase.src 1`] = ` +exports[`javascript fixtures/octalLiterals/lowercase.src 1`] = ` Object { "body": Array [ Object { @@ -99842,7 +102981,7 @@ Object { } `; -exports[`ecma-features fixtures/octalLiterals/strict-uppercase.src 1`] = ` +exports[`javascript fixtures/octalLiterals/strict-uppercase.src 1`] = ` Object { "body": Array [ Object { @@ -100011,7 +103150,7 @@ Object { } `; -exports[`ecma-features fixtures/octalLiterals/uppercase.src 1`] = ` +exports[`javascript fixtures/octalLiterals/uppercase.src 1`] = ` Object { "body": Array [ Object { @@ -100108,7 +103247,7 @@ Object { } `; -exports[`ecma-features fixtures/regex/regexp-simple.src 1`] = ` +exports[`javascript fixtures/regex/regexp-simple.src 1`] = ` Object { "body": Array [ Object { @@ -100305,7 +103444,7 @@ Object { } `; -exports[`ecma-features fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` +exports[`javascript fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` Object { "body": Array [ Object { @@ -100502,7 +103641,7 @@ Object { } `; -exports[`ecma-features fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` +exports[`javascript fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` Object { "body": Array [ Object { @@ -100699,7 +103838,7 @@ Object { } `; -exports[`ecma-features fixtures/regexUFlag/regex-u-simple.src 1`] = ` +exports[`javascript fixtures/regexUFlag/regex-u-simple.src 1`] = ` Object { "body": Array [ Object { @@ -100896,7 +104035,7 @@ Object { } `; -exports[`ecma-features fixtures/regexYFlag/regexp-y-simple.src 1`] = ` +exports[`javascript fixtures/regexYFlag/regexp-y-simple.src 1`] = ` Object { "body": Array [ Object { @@ -101093,7 +104232,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/basic-rest.src 1`] = ` +exports[`javascript fixtures/restParams/basic-rest.src 1`] = ` Object { "body": Array [ Object { @@ -101444,7 +104583,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/class-constructor.src 1`] = ` +exports[`javascript fixtures/restParams/class-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -101836,7 +104975,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/class-method.src 1`] = ` +exports[`javascript fixtures/restParams/class-method.src 1`] = ` Object { "body": Array [ Object { @@ -102228,7 +105367,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/error-no-default.src 1`] = ` +exports[`javascript fixtures/restParams/error-no-default.src 1`] = ` Object { "body": Array [ Object { @@ -102545,7 +105684,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/error-not-last.src 1`] = ` +exports[`javascript fixtures/restParams/error-not-last.src 1`] = ` Object { "body": Array [ Object { @@ -102880,7 +106019,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/func-expression.src 1`] = ` +exports[`javascript fixtures/restParams/func-expression.src 1`] = ` Object { "body": Array [ Object { @@ -103234,7 +106373,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/func-expression-multi.src 1`] = ` +exports[`javascript fixtures/restParams/func-expression-multi.src 1`] = ` Object { "body": Array [ Object { @@ -103642,7 +106781,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/invalid-rest-param.src 1`] = ` +exports[`javascript fixtures/restParams/invalid-rest-param.src 1`] = ` Object { "body": Array [ Object { @@ -104033,7 +107172,7 @@ Object { } `; -exports[`ecma-features fixtures/restParams/single-rest.src 1`] = ` +exports[`javascript fixtures/restParams/single-rest.src 1`] = ` Object { "body": Array [ Object { @@ -104330,11 +107469,11 @@ Object { } `; -exports[`ecma-features fixtures/spread/error-invalid-if.src 1`] = `"Expression expected."`; +exports[`javascript fixtures/spread/error-invalid-if.src 1`] = `"Expression expected."`; -exports[`ecma-features fixtures/spread/error-invalid-sequence.src 1`] = `"Expression expected."`; +exports[`javascript fixtures/spread/error-invalid-sequence.src 1`] = `"Expression expected."`; -exports[`ecma-features fixtures/spread/multi-function-call.src 1`] = ` +exports[`javascript fixtures/spread/multi-function-call.src 1`] = ` Object { "body": Array [ Object { @@ -104610,7 +107749,7 @@ Object { } `; -exports[`ecma-features fixtures/spread/not-final-param.src 1`] = ` +exports[`javascript fixtures/spread/not-final-param.src 1`] = ` Object { "body": Array [ Object { @@ -104886,7 +108025,7 @@ Object { } `; -exports[`ecma-features fixtures/spread/simple-function-call.src 1`] = ` +exports[`javascript fixtures/spread/simple-function-call.src 1`] = ` Object { "body": Array [ Object { @@ -105108,7 +108247,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/deeply-nested.src 1`] = ` +exports[`javascript fixtures/templateStrings/deeply-nested.src 1`] = ` Object { "body": Array [ Object { @@ -105573,7 +108712,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/error-octal-literal.src 1`] = ` +exports[`javascript fixtures/templateStrings/error-octal-literal.src 1`] = ` Object { "body": Array [ Object { @@ -105693,7 +108832,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/escape-characters.src 1`] = ` +exports[`javascript fixtures/templateStrings/escape-characters.src 1`] = ` Object { "body": Array [ Object { @@ -105907,7 +109046,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/expressions.src 1`] = ` +exports[`javascript fixtures/templateStrings/expressions.src 1`] = ` Object { "body": Array [ Object { @@ -106581,7 +109720,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/multi-line-template-string.src 1`] = ` +exports[`javascript fixtures/templateStrings/multi-line-template-string.src 1`] = ` Object { "body": Array [ Object { @@ -106716,7 +109855,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/simple-template-string.src 1`] = ` +exports[`javascript fixtures/templateStrings/simple-template-string.src 1`] = ` Object { "body": Array [ Object { @@ -106836,7 +109975,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/single-dollar-sign.src 1`] = ` +exports[`javascript fixtures/templateStrings/single-dollar-sign.src 1`] = ` Object { "body": Array [ Object { @@ -107048,7 +110187,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/tagged-no-placeholders.src 1`] = ` +exports[`javascript fixtures/templateStrings/tagged-no-placeholders.src 1`] = ` Object { "body": Array [ Object { @@ -107221,7 +110360,7 @@ Object { } `; -exports[`ecma-features fixtures/templateStrings/tagged-template-string.src 1`] = ` +exports[`javascript fixtures/templateStrings/tagged-template-string.src 1`] = ` Object { "body": Array [ Object { @@ -107947,7 +111086,7 @@ Object { } `; -exports[`ecma-features fixtures/unicodeCodePointEscapes/basic-string-literal.src 1`] = ` +exports[`javascript fixtures/unicodeCodePointEscapes/basic-string-literal.src 1`] = ` Object { "body": Array [ Object { @@ -108044,7 +111183,7 @@ Object { } `; -exports[`ecma-features fixtures/unicodeCodePointEscapes/complex-string-literal.src 1`] = ` +exports[`javascript fixtures/unicodeCodePointEscapes/complex-string-literal.src 1`] = ` Object { "body": Array [ Object { @@ -108141,6 +111280,6 @@ Object { } `; -exports[`ecma-features fixtures/unicodeCodePointEscapes/invalid-empty-escape.src 1`] = `"Hexadecimal digit expected."`; +exports[`javascript fixtures/unicodeCodePointEscapes/invalid-empty-escape.src 1`] = `"Hexadecimal digit expected."`; -exports[`ecma-features fixtures/unicodeCodePointEscapes/invalid-too-large-escape.src 1`] = `"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."`; +exports[`javascript fixtures/unicodeCodePointEscapes/invalid-too-large-escape.src 1`] = `"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."`; diff --git a/packages/typescript-estree/tests/lib/basics.ts b/packages/typescript-estree/tests/lib/basics.ts deleted file mode 100644 index 364d3bb036f4..000000000000 --- a/packages/typescript-estree/tests/lib/basics.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Tests for basic expressions - * @author Nicholas C. Zakas - * @author James Henry - * @copyright jQuery Foundation and other contributors, https://jquery.org/ - * MIT License - */ -import path from 'path'; -import shelljs from 'shelljs'; -import { ParserOptions } from '../../src/temp-types-based-on-js-source'; -import { createSnapshotTestBlock } from '../../tools/test-utils'; - -//------------------------------------------------------------------------------ -// Setup -//------------------------------------------------------------------------------ - -const FIXTURES_DIR = './tests/fixtures/basics'; - -const testFiles = shelljs - .find(FIXTURES_DIR) - .filter(filename => filename.indexOf('.src.js') > -1) - // strip off ".src.js" - .map(filename => - filename.substring(FIXTURES_DIR.length - 1, filename.length - 7) - ); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -describe('basics', () => { - testFiles.forEach(filename => { - const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); - const config = { - loc: true, - range: true, - tokens: true, - errorOnUnknownASTType: true - }; - it( - `fixtures/${filename}.src`, - createSnapshotTestBlock(code, config as ParserOptions) - ); - }); -}); diff --git a/packages/typescript-estree/tests/lib/ecma-features.ts b/packages/typescript-estree/tests/lib/javascript.ts similarity index 93% rename from packages/typescript-estree/tests/lib/ecma-features.ts rename to packages/typescript-estree/tests/lib/javascript.ts index e2a3b9804f6e..6635ae72f8a6 100644 --- a/packages/typescript-estree/tests/lib/ecma-features.ts +++ b/packages/typescript-estree/tests/lib/javascript.ts @@ -14,7 +14,7 @@ import { createSnapshotTestBlock } from '../../tools/test-utils'; // Setup //------------------------------------------------------------------------------ -const FIXTURES_DIR = './tests/fixtures/ecma-features'; +const FIXTURES_DIR = './tests/fixtures/javascript'; const testFiles = shelljs .find(FIXTURES_DIR) @@ -28,7 +28,7 @@ const testFiles = shelljs // Tests //------------------------------------------------------------------------------ -describe('ecma-features', () => { +describe('javascript', () => { testFiles.forEach(filename => { const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`), config = { From 22f5fb34adbf90b9f9eac89f60d8277c80a51d8b Mon Sep 17 00:00:00 2001 From: Benjamin Lichtman Date: Wed, 21 Nov 2018 16:39:45 -0800 Subject: [PATCH 15/84] feat: offer semantic services alongside AST (#24) --- packages/typescript-estree/package.json | 1 + .../typescript-estree/src/ast-converter.ts | 24 +- packages/typescript-estree/src/convert.ts | 130 +- packages/typescript-estree/src/node-utils.ts | 95 +- packages/typescript-estree/src/parser.ts | 195 ++- .../src/temp-types-based-on-js-source.ts | 5 + .../typescript-estree/src/tsconfig-parser.ts | 149 +++ .../fixtures/semanticInfo/badTSConfig/app.ts | 0 .../semanticInfo/badTSConfig/tsconfig.json | 9 + .../fixtures/semanticInfo/export-file.src.ts | 1 + .../fixtures/semanticInfo/import-file.src.ts | 2 + .../semanticInfo/isolated-file.src.ts | 1 + .../tests/fixtures/semanticInfo/tsconfig.json | 8 + .../lib/__snapshots__/semanticInfo.ts.snap | 1136 +++++++++++++++++ .../tests/lib/semanticInfo.ts | 195 +++ .../typescript-estree/tools/test-utils.ts | 19 +- 16 files changed, 1849 insertions(+), 121 deletions(-) create mode 100644 packages/typescript-estree/src/tsconfig-parser.ts create mode 100644 packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/app.ts create mode 100644 packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json create mode 100644 packages/typescript-estree/tests/fixtures/semanticInfo/export-file.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/semanticInfo/import-file.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/semanticInfo/isolated-file.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap create mode 100644 packages/typescript-estree/tests/lib/semanticInfo.ts diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 93f53d697baa..a1ba511c294f 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -25,6 +25,7 @@ "@types/jest": "^23.3.9", "@types/lodash.isplainobject": "^4.0.4", "@types/lodash.unescape": "^4.0.4", + "@types/node": "^10.12.2", "@types/semver": "^5.5.0", "@types/shelljs": "^0.8.0", "babel-code-frame": "6.26.0", diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index f46ca74ee6b0..04df089ba410 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -5,9 +5,10 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ -import { convert } from './convert'; +import convert, { getASTMaps, resetASTMaps } from './convert'; import { convertComments } from './convert-comments'; import nodeUtils from './node-utils'; +import ts from 'typescript'; import { Extra } from './temp-types-based-on-js-source'; /** @@ -23,13 +24,17 @@ function convertError(error: any) { ); } -export default (ast: any, extra: Extra) => { +export default ( + ast: ts.SourceFile, + extra: Extra, + shouldProvideParserServices: boolean +) => { /** * The TypeScript compiler produced fundamental parse errors when parsing the * source. */ - if (ast.parseDiagnostics.length) { - throw convertError(ast.parseDiagnostics[0]); + if ((ast as any).parseDiagnostics.length) { + throw convertError((ast as any).parseDiagnostics[0]); } /** @@ -41,7 +46,8 @@ export default (ast: any, extra: Extra) => { ast, additionalOptions: { errorOnUnknownASTType: extra.errorOnUnknownASTType || false, - useJSXTextNode: extra.useJSXTextNode || false + useJSXTextNode: extra.useJSXTextNode || false, + shouldProvideParserServices } }); @@ -59,5 +65,11 @@ export default (ast: any, extra: Extra) => { estree.comments = convertComments(ast, extra.code); } - return estree; + let astMaps = undefined; + if (shouldProvideParserServices) { + astMaps = getASTMaps(); + resetASTMaps(); + } + + return { estree, astMaps }; }; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 13ead9d341a9..ce612fdb9c35 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -12,6 +12,31 @@ import { ESTreeNode } from './temp-types-based-on-js-source'; const SyntaxKind = ts.SyntaxKind; +let esTreeNodeToTSNodeMap = new WeakMap(); +let tsNodeToESTreeNodeMap = new WeakMap(); + +export function resetASTMaps() { + esTreeNodeToTSNodeMap = new WeakMap(); + tsNodeToESTreeNodeMap = new WeakMap(); +} + +export function getASTMaps() { + return { esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap }; +} + +interface ConvertAdditionalOptions { + errorOnUnknownASTType: boolean; + useJSXTextNode: boolean; + shouldProvideParserServices: boolean; +} + +interface ConvertConfig { + node: ts.Node; + parent?: ts.Node | null; + ast: ts.SourceFile; + additionalOptions: ConvertAdditionalOptions; +} + /** * Converts a TypeScript node into an ESTree node * @param {Object} config configuration options for the conversion @@ -21,7 +46,7 @@ const SyntaxKind = ts.SyntaxKind; * @param {Object} config.additionalOptions additional options for the conversion * @returns {ESTreeNode|null} the converted ESTreeNode */ -export function convert(config: any): ESTreeNode | null { +export default function convert(config: ConvertConfig): ESTreeNode | null { const node = config.node as ts.Node; const parent = config.parent; const ast = config.ast; @@ -39,7 +64,7 @@ export function convert(config: any): ESTreeNode | null { */ let result: Partial = { type: '', - range: [node.getStart(), node.end], + range: [node.getStart(ast), node.end], loc: nodeUtils.getLoc(node, ast) }; @@ -108,8 +133,12 @@ export function convert(config: any): ESTreeNode | null { typeArgumentsParent.kind === SyntaxKind.TypeReference) ) { const lastTypeArgument = typeArguments[typeArguments.length - 1]; - const greaterThanToken = nodeUtils.findNextToken(lastTypeArgument, ast); - end = greaterThanToken.end; + const greaterThanToken = nodeUtils.findNextToken( + lastTypeArgument, + ast, + ast + ); + end = greaterThanToken!.end; } } return { @@ -120,7 +149,7 @@ export function convert(config: any): ESTreeNode | null { if (nodeUtils.isTypeKeyword(typeArgument.kind)) { return { type: AST_NODE_TYPES[`TS${SyntaxKind[typeArgument.kind]}`], - range: [typeArgument.getStart(), typeArgument.getEnd()], + range: [typeArgument.getStart(ast), typeArgument.getEnd()], loc: nodeUtils.getLoc(typeArgument, ast) }; } @@ -134,7 +163,7 @@ export function convert(config: any): ESTreeNode | null { } return { type: AST_NODE_TYPES.TSTypeReference, - range: [typeArgument.getStart(), typeArgument.getEnd()], + range: [typeArgument.getStart(ast), typeArgument.getEnd()], loc: nodeUtils.getLoc(typeArgument, ast), typeName: convertChild(typeArgument.typeName || typeArgument), typeParameters: typeArgument.typeArguments @@ -156,14 +185,18 @@ export function convert(config: any): ESTreeNode | null { const firstTypeParameter = typeParameters[0]; const lastTypeParameter = typeParameters[typeParameters.length - 1]; - const greaterThanToken = nodeUtils.findNextToken(lastTypeParameter, ast); + const greaterThanToken = nodeUtils.findNextToken( + lastTypeParameter, + ast, + ast + ); return { type: AST_NODE_TYPES.TSTypeParameterDeclaration, - range: [firstTypeParameter.pos - 1, greaterThanToken.end], + range: [firstTypeParameter.pos - 1, greaterThanToken!.end], loc: nodeUtils.getLocFor( firstTypeParameter.pos - 1, - greaterThanToken.end, + greaterThanToken!.end, ast ), params: typeParameters.map(typeParameter => { @@ -189,7 +222,7 @@ export function convert(config: any): ESTreeNode | null { return { type: AST_NODE_TYPES.TSTypeParameter, - range: [typeParameter.getStart(), typeParameter.getEnd()], + range: [typeParameter.getStart(ast), typeParameter.getEnd()], loc: nodeUtils.getLoc(typeParameter, ast), name, constraint, @@ -258,7 +291,7 @@ export function convert(config: any): ESTreeNode | null { const expression = convertChild(decorator.expression); return { type: AST_NODE_TYPES.Decorator, - range: [decorator.getStart(), decorator.end], + range: [decorator.getStart(ast), decorator.end], loc: nodeUtils.getLoc(decorator, ast), expression }; @@ -336,8 +369,10 @@ export function convert(config: any): ESTreeNode | null { (result as any)[key] = (node as any)[key].map(convertChild); } else if ( (node as any)[key] && - typeof (node as any)[key] === 'object' + typeof (node as any)[key] === 'object' && + (node as any)[key].kind ) { + // need to check node[key].kind to ensure we don't try to convert a symbol (result as any)[key] = convertChild((node as any)[key]); } else { (result as any)[key] = (node as any)[key]; @@ -475,7 +510,7 @@ export function convert(config: any): ESTreeNode | null { (result as any).range[1] = (node as any).endOfFileToken.end; result.loc = nodeUtils.getLocFor( - node.getStart(), + node.getStart(ast), (result as any).range[1], ast ); @@ -873,7 +908,7 @@ export function convert(config: any): ESTreeNode | null { } case SyntaxKind.ComputedPropertyName: - if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + if (parent!.kind === SyntaxKind.ObjectLiteralExpression) { Object.assign(result, { type: AST_NODE_TYPES.Property, key: convertChild((node as any).name), @@ -949,11 +984,12 @@ export function convert(config: any): ESTreeNode | null { return false; } return nodeUtils.getTextForTokenKind(token.kind) === '('; - } + }, + ast ); const methodLoc = ast.getLineAndCharacterOfPosition( - (openingParen as any).getStart() + (openingParen as any).getStart(ast) ), nodeIsMethod = node.kind === SyntaxKind.MethodDeclaration, method = { @@ -977,7 +1013,7 @@ export function convert(config: any): ESTreeNode | null { (method as any).returnType = convertTypeAnnotation((node as any).type); } - if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + if (parent!.kind === SyntaxKind.ObjectLiteralExpression) { (method as any).params = (node as any).parameters.map(convertChild); Object.assign(result, { @@ -1063,7 +1099,7 @@ export function convert(config: any): ESTreeNode | null { node ), firstConstructorToken = constructorIsStatic - ? nodeUtils.findNextToken((node as any).getFirstToken(), ast) + ? nodeUtils.findNextToken((node as any).getFirstToken(), ast, ast) : node.getFirstToken(), constructorLoc = ast.getLineAndCharacterOfPosition( (node as any).parameters.pos - 1 @@ -1087,10 +1123,10 @@ export function convert(config: any): ESTreeNode | null { }; const constructorIdentifierLocStart = ast.getLineAndCharacterOfPosition( - (firstConstructorToken as any).getStart() + (firstConstructorToken as any).getStart(ast) ), constructorIdentifierLocEnd = ast.getLineAndCharacterOfPosition( - (firstConstructorToken as any).getEnd() + (firstConstructorToken as any).getEnd(ast) ), constructorIsComputed = !!(node as any).name && @@ -1104,7 +1140,7 @@ export function convert(config: any): ESTreeNode | null { value: 'constructor', raw: (node as any).name.getText(), range: [ - (firstConstructorToken as any).getStart(), + (firstConstructorToken as any).getStart(ast), (firstConstructorToken as any).end ], loc: { @@ -1123,7 +1159,7 @@ export function convert(config: any): ESTreeNode | null { type: AST_NODE_TYPES.Identifier, name: 'constructor', range: [ - (firstConstructorToken as any).getStart(), + (firstConstructorToken as any).getStart(ast), (firstConstructorToken as any).end ], loc: { @@ -1210,7 +1246,7 @@ export function convert(config: any): ESTreeNode | null { break; case SyntaxKind.BindingElement: - if (parent.kind === SyntaxKind.ArrayBindingPattern) { + if (parent!.kind === SyntaxKind.ArrayBindingPattern) { const arrayItem = convert({ node: (node as any).name, parent, @@ -1232,7 +1268,7 @@ export function convert(config: any): ESTreeNode | null { } else { return arrayItem; } - } else if (parent.kind === SyntaxKind.ObjectBindingPattern) { + } else if (parent!.kind === SyntaxKind.ObjectBindingPattern) { if ((node as any).dotDotDotToken) { Object.assign(result, { type: AST_NODE_TYPES.RestElement, @@ -1262,11 +1298,11 @@ export function convert(config: any): ESTreeNode | null { left: convertChild((node as any).name), right: convertChild((node as any).initializer), range: [ - (node as any).name.getStart(), + (node as any).name.getStart(ast), (node as any).initializer.end ], loc: nodeUtils.getLocFor( - (node as any).name.getStart(), + (node as any).name.getStart(ast), (node as any).initializer.end, ast ) @@ -1323,7 +1359,7 @@ export function convert(config: any): ESTreeNode | null { { type: AST_NODE_TYPES.TemplateElement, value: { - raw: ast.text.slice(node.getStart() + 1, node.end - 1), + raw: ast.text.slice(node.getStart(ast) + 1, node.end - 1), cooked: (node as any).text }, tail: true, @@ -1366,7 +1402,10 @@ export function convert(config: any): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.TemplateElement, value: { - raw: ast.text.slice(node.getStart() + 1, node.end - (tail ? 1 : 2)), + raw: ast.text.slice( + node.getStart(ast) + 1, + node.end - (tail ? 1 : 2) + ), cooked: (node as any).text }, tail @@ -1459,7 +1498,7 @@ export function convert(config: any): ESTreeNode | null { if (node.modifiers) { return { type: AST_NODE_TYPES.TSParameterProperty, - range: [node.getStart(), node.end], + range: [node.getStart(ast), node.end], loc: nodeUtils.getLoc(node, ast), accessibility: nodeUtils.getTSNodeAccessibility(node) || undefined, readonly: @@ -1493,7 +1532,7 @@ export function convert(config: any): ESTreeNode | null { ]; if (!lastClassToken || lastTypeParameter.pos > lastClassToken.pos) { - lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast); + lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast, ast); } result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( (node as any).typeParameters @@ -1517,14 +1556,14 @@ export function convert(config: any): ESTreeNode | null { const lastModifier = node.modifiers[node.modifiers.length - 1]; if (!lastClassToken || lastModifier.pos > lastClassToken.pos) { - lastClassToken = nodeUtils.findNextToken(lastModifier, ast); + lastClassToken = nodeUtils.findNextToken(lastModifier, ast, ast); } } else if (!lastClassToken) { // no name lastClassToken = node.getFirstToken(); } - const openBrace = nodeUtils.findNextToken(lastClassToken, ast); + const openBrace = nodeUtils.findNextToken(lastClassToken, ast, ast)!; const superClass = heritageClauses.find( (clause: any) => clause.token === SyntaxKind.ExtendsKeyword ); @@ -1557,8 +1596,8 @@ export function convert(config: any): ESTreeNode | null { body: [], // TODO: Fix location info - range: [openBrace.getStart(), (result as any).range[1]], - loc: nodeUtils.getLocFor(openBrace.getStart(), node.end, ast) + range: [openBrace.getStart(ast), (result as any).range[1]], + loc: nodeUtils.getLocFor(openBrace.getStart(ast), node.end, ast) }, superClass: superClass && superClass.types[0] @@ -1849,7 +1888,7 @@ export function convert(config: any): ESTreeNode | null { break; case SyntaxKind.PropertyAccessExpression: - if (nodeUtils.isJSXToken(parent)) { + if (nodeUtils.isJSXToken(parent!)) { const jsxMemberExpression = { type: AST_NODE_TYPES.MemberExpression, object: convertChild((node as any).expression), @@ -1948,7 +1987,7 @@ export function convert(config: any): ESTreeNode | null { type: AST_NODE_TYPES.Literal, raw: ast.text.slice((result as any).range[0], (result as any).range[1]) }); - if (parent.name && parent.name === node) { + if ((parent as any).name && (parent as any).name === node) { (result as any).value = (node as any).text; } else { (result as any).value = nodeUtils.unescapeStringLiteralText( @@ -2216,7 +2255,7 @@ export function convert(config: any): ESTreeNode | null { type: AST_NODE_TYPES.VariableDeclarator, id: convertChild((node as any).name), init: convertChild((node as any).type), - range: [(node as any).name.getStart(), (node as any).end] + range: [(node as any).name.getStart(ast), (node as any).end] }; (typeAliasDeclarator as any).loc = nodeUtils.getLocFor( @@ -2359,6 +2398,7 @@ export function convert(config: any): ESTreeNode | null { ) { interfaceLastClassToken = nodeUtils.findNextToken( interfaceLastTypeParameter, + ast, ast ); } @@ -2374,14 +2414,19 @@ export function convert(config: any): ESTreeNode | null { ); const interfaceOpenBrace = nodeUtils.findNextToken( interfaceLastClassToken, + ast, ast - ); + )!; const interfaceBody = { type: AST_NODE_TYPES.TSInterfaceBody, body: (node as any).members.map((member: any) => convertChild(member)), - range: [interfaceOpenBrace.getStart(), (result as any).range[1]], - loc: nodeUtils.getLocFor(interfaceOpenBrace.getStart(), node.end, ast) + range: [interfaceOpenBrace.getStart(ast), (result as any).range[1]], + loc: nodeUtils.getLocFor( + interfaceOpenBrace.getStart(ast), + node.end, + ast + ) }; Object.assign(result, { @@ -2492,5 +2537,10 @@ export function convert(config: any): ESTreeNode | null { deeplyCopy(); } + if (additionalOptions.shouldProvideParserServices) { + tsNodeToESTreeNodeMap.set(node, result); + esTreeNodeToTSNodeMap.set(result, node); + } + return result as any; } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 89618cd65069..873db9c8534c 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -160,7 +160,8 @@ export default { isTypeKeyword, isComment, isJSDocComment, - createError + createError, + firstDefined }; /** @@ -296,7 +297,7 @@ function getLoc( nodeOrToken: ts.Node | ts.Token, ast: ts.SourceFile ): ESTreeNodeLoc { - return getLocFor(nodeOrToken.getStart(), nodeOrToken.end, ast); + return getLocFor(nodeOrToken.getStart(ast), nodeOrToken.end, ast); } /** @@ -406,18 +407,35 @@ function hasStaticModifierFlag(node: ts.Node): boolean { /** * Finds the next token based on the previous one and its parent - * @param {ts.Token} previousToken The previous ts.Token - * @param {ts.Node} parent The parent ts.Node + * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren + * @param {ts.Token} previousToken The previous TSToken + * @param {ts.Node} parent The parent TSNode + * @param {ts.SourceFile} ast The TS AST * @returns {ts.Token} the next TSToken */ function findNextToken( previousToken: ts.Token, - parent: ts.Node -): ts.Token { - /** - * TODO: Remove dependency on private TypeScript method - */ - return (ts as any).findNextToken(previousToken, parent); + parent: ts.Node, + ast: ts.SourceFile +): ts.Token | undefined { + return find(parent); + + function find(n: ts.Node): ts.Token | undefined { + if (ts.isToken(n) && n.pos === previousToken.end) { + // this is token that starts at the end of previous token - return it + return n; + } + return firstDefined(n.getChildren(ast), (child: ts.Node) => { + const shouldDiveInChildNode = + // previous token is enclosed somewhere in the child + (child.pos <= previousToken.pos && child.end > previousToken.end) || + // previous token ends exactly at the beginning of child + child.pos === previousToken.end; + return shouldDiveInChildNode && nodeHasTokens(child, ast) + ? find(child) + : undefined; + }); + } } /** @@ -425,18 +443,20 @@ function findNextToken( * @param {ts.Token} previousToken The previous ts.Token * @param {ts.Node} parent The parent ts.Node * @param {Function} predicate The predicate function to apply to each checked token + * @param {ts.SourceFile} ast The TS AST * @returns {ts.Token|undefined} a matching ts.Token */ function findFirstMatchingToken( - previousToken: ts.Token, + previousToken: ts.Token | undefined, parent: ts.Node, - predicate: (node: ts.Node) => boolean + predicate: (node: ts.Node) => boolean, + ast: ts.SourceFile ): ts.Token | undefined { while (previousToken) { if (predicate(previousToken)) { return previousToken; } - previousToken = findNextToken(previousToken, parent); + previousToken = findNextToken(previousToken, parent, ast); } return undefined; } @@ -555,9 +575,9 @@ function fixExports( lastModifier = node.modifiers[node.modifiers.length - 1], declarationIsDefault = nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword, - varToken = findNextToken(lastModifier, ast); + varToken = findNextToken(lastModifier, ast, ast); - result.range[0] = varToken.getStart(); + result.range[0] = varToken!.getStart(ast); result.loc = getLocFor(result.range[0], result.range[1], ast); const declarationType = declarationIsDefault @@ -567,8 +587,8 @@ function fixExports( const newResult: any = { type: declarationType, declaration: result, - range: [exportKeyword.getStart(), result.range[1]], - loc: getLocFor(exportKeyword.getStart(), result.range[1], ast) + range: [exportKeyword.getStart(ast), result.range[1]], + loc: getLocFor(exportKeyword.getStart(ast), result.range[1], ast) }; if (!declarationIsDefault) { @@ -699,7 +719,7 @@ function convertToken(token: ts.Token, ast: ts.SourceFile): ESTreeToken { const start = token.kind === SyntaxKind.JsxText ? token.getFullStart() - : token.getStart(), + : token.getStart(ast), end = token.getEnd(), value = ast.text.slice(start, end), newToken: any = { @@ -744,7 +764,7 @@ function convertTokens(ast: ts.SourceFile): ESTreeToken[] { result.push(converted); } } else { - node.getChildren().forEach(walk); + node.getChildren(ast).forEach(walk); } } walk(ast); @@ -802,3 +822,40 @@ function createError(ast: ts.SourceFile, start: number, message: string) { message }; } + +/** + * @param {ts.Node} n the TSNode + * @param {ts.SourceFile} ast the TS AST + */ +function nodeHasTokens(n: ts.Node, ast: ts.SourceFile) { + // If we have a token or node that has a non-zero width, it must have tokens. + // Note: getWidth() does not take trivia into account. + return n.kind === SyntaxKind.EndOfFileToken + ? !!(n as any).jsDoc + : n.getWidth(ast) !== 0; +} + +/** + * Like `forEach`, but suitable for use with numbers and strings (which may be falsy). + * @template T + * @template U + * @param {ReadonlyArray|undefined} array + * @param {(element: T, index: number) => (U|undefined)} callback + * @returns {U|undefined} + */ +function firstDefined( + array: ReadonlyArray | undefined, + callback: (element: T, index: number) => U | undefined +): U | undefined { + if (array === undefined) { + return undefined; + } + + for (let i = 0; i < array.length; i++) { + const result = callback(array[i], i); + if (result !== undefined) { + return result; + } + } + return undefined; +} diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 3d7c5d048e8f..1a48475c08f9 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -5,9 +5,11 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ +import calculateProjectParserOptions from './tsconfig-parser'; import semver from 'semver'; import ts from 'typescript'; import convert from './ast-converter'; +import util from './node-utils'; import { Extra, ParserOptions } from './temp-types-based-on-js-source'; const packageJSON = require('../package.json'); @@ -37,11 +39,104 @@ function resetExtra(): void { jsx: false, useJSXTextNode: false, log: console.log, + projects: [], errorOnUnknownASTType: false, - code: '' + code: '', + tsconfigRootDir: process.cwd() }; } +/** + * @param {string} code The code of the file being linted + * @param {Object} options The config object + * @returns {{ast: ts.SourceFile, program: ts.Program} | undefined} If found, returns the source file corresponding to the code and the containing program + */ +function getASTFromProject(code: string, options: ParserOptions) { + return util.firstDefined( + calculateProjectParserOptions(code, options.filePath, extra), + (currentProgram: ts.Program) => { + const ast = currentProgram.getSourceFile(options.filePath); + return ast && { ast, program: currentProgram }; + } + ); +} + +/** + * @param {string} code The code of the file being linted + * @returns {{ast: ts.SourceFile, program: ts.Program}} Returns a new source file and program corresponding to the linted code + */ +function createNewProgram(code: string) { + // Even if jsx option is set in typescript compiler, filename still has to + // contain .tsx file extension + const FILENAME = extra.jsx ? 'estree.tsx' : 'estree.ts'; + + const compilerHost = { + fileExists() { + return true; + }, + getCanonicalFileName() { + return FILENAME; + }, + getCurrentDirectory() { + return ''; + }, + getDirectories() { + return []; + }, + getDefaultLibFileName() { + return 'lib.d.ts'; + }, + + // TODO: Support Windows CRLF + getNewLine() { + return '\n'; + }, + getSourceFile(filename: string) { + return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true); + }, + readFile() { + return undefined; + }, + useCaseSensitiveFileNames() { + return true; + }, + writeFile() { + return null; + } + }; + + const program = ts.createProgram( + [FILENAME], + { + noResolve: true, + target: ts.ScriptTarget.Latest, + jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined + }, + compilerHost + ); + + const ast = program.getSourceFile(FILENAME)!; + + return { ast, program }; +} + +/** + * @param {string} code The code of the file being linted + * @param {Object} options The config object + * @param {boolean} shouldProvideParserServices True iff the program should be attempted to be calculated from provided tsconfig files + * @returns {{ast: ts.SourceFile, program: ts.Program}} Returns a source file and program corresponding to the linted code + */ +function getProgramAndAST( + code: string, + options: ParserOptions, + shouldProvideParserServices: boolean +) { + return ( + (shouldProvideParserServices && getASTFromProject(code, options)) || + createNewProgram(code) + ); +} + //------------------------------------------------------------------------------ // Parser //------------------------------------------------------------------------------ @@ -49,10 +144,15 @@ function resetExtra(): void { /** * Parses the given source code to produce a valid AST * @param {string} code TypeScript code + * @param {boolean} shouldGenerateServices Flag determining whether to generate ast maps and program or not * @param {ParserOptions} options configuration object for the parser * @returns {Object} the AST */ -function generateAST(code: string, options: ParserOptions): any { +function generateAST( + code: string, + options: ParserOptions, + shouldGenerateServices = false +): any { const toString = String; if (typeof code !== 'string' && !((code as any) instanceof String)) { @@ -101,6 +201,19 @@ function generateAST(code: string, options: ParserOptions): any { } else if (options.loggerFn === false) { extra.log = Function.prototype; } + + if (typeof options.project === 'string') { + extra.projects = [options.project]; + } else if ( + Array.isArray(options.project) && + options.project.every(projectPath => typeof projectPath === 'string') + ) { + extra.projects = options.project; + } + + if (typeof options.tsconfigRootDir === 'string') { + extra.tsconfigRootDir = options.tsconfigRootDir; + } } if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { @@ -118,59 +231,23 @@ function generateAST(code: string, options: ParserOptions): any { warnedAboutTSVersion = true; } - // Even if jsx option is set in typescript compiler, filename still has to - // contain .tsx file extension - const FILENAME = extra.jsx ? 'estree.tsx' : 'estree.ts'; - - const compilerHost = { - fileExists() { - return true; - }, - getCanonicalFileName() { - return FILENAME; - }, - getCurrentDirectory() { - return ''; - }, - getDefaultLibFileName() { - return 'lib.d.ts'; - }, - - // TODO: Support Windows CRLF - getNewLine() { - return '\n'; - }, - getSourceFile(filename: string) { - return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest, true); - }, - readFile() { - return undefined; - }, - useCaseSensitiveFileNames() { - return true; - }, - writeFile() { - return null; - }, - getDirectories() { - return []; - } - }; - - const program = ts.createProgram( - [FILENAME], - { - noResolve: true, - target: ts.ScriptTarget.Latest, - jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined - }, - compilerHost + const shouldProvideParserServices = + shouldGenerateServices && extra.projects && extra.projects.length > 0; + const { ast, program } = getProgramAndAST( + code, + options, + shouldProvideParserServices ); - const ast = program.getSourceFile(FILENAME); - extra.code = code; - return convert(ast, extra); + const { estree, astMaps } = convert(ast, extra, shouldProvideParserServices); + return { + estree, + program: shouldProvideParserServices ? program : undefined, + astMaps: shouldProvideParserServices + ? astMaps + : { esTreeNodeToTSNodeMap: undefined, tsNodeToESTreeNodeMap: undefined } + }; } //------------------------------------------------------------------------------ @@ -183,5 +260,17 @@ export { version }; const version = packageJSON.version; export function parse(code: string, options: ParserOptions) { - return generateAST(code, options); + return generateAST(code, options).estree; +} + +export function parseAndGenerateServices(code: string, options: ParserOptions) { + const result = generateAST(code, options, /*shouldGenerateServices*/ true); + return { + ast: result.estree, + services: { + program: result.program, + esTreeNodeToTSNodeMap: result.astMaps.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: result.astMaps.tsNodeToESTreeNodeMap + } + }; } diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index 9fe32a5195f8..f1afe55fb576 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -66,6 +66,8 @@ export interface Extra { strict: boolean; jsx: boolean; log: Function; + projects: string[]; + tsconfigRootDir: string; } export interface ParserOptions { @@ -77,4 +79,7 @@ export interface ParserOptions { errorOnUnknownASTType: boolean; useJSXTextNode: boolean; loggerFn: Function | false; + project: string | string[]; + filePath: string; + tsconfigRootDir: string; } diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts new file mode 100644 index 000000000000..63d472f526d5 --- /dev/null +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -0,0 +1,149 @@ +'use strict'; + +import path from 'path'; +import ts from 'typescript'; +import { Extra } from './temp-types-based-on-js-source'; + +//------------------------------------------------------------------------------ +// Environment calculation +//------------------------------------------------------------------------------ + +/** + * Maps tsconfig paths to their corresponding file contents and resulting watches + * @type {Map>} + */ +const knownWatchProgramMap = new Map< + string, + ts.WatchOfConfigFile +>(); + +/** + * Maps file paths to their set of corresponding watch callbacks + * There may be more than one per file if a file is shared between projects + * @type {Map} + */ +const watchCallbackTrackingMap = new Map(); + +/** + * Holds information about the file currently being linted + * @type {{code: string, filePath: string}} + */ +const currentLintOperationState = { + code: '', + filePath: '' +}; + +/** + * Appropriately report issues found when reading a config file + * @param {ts.Diagnostic} diagnostic The diagnostic raised when creating a program + * @returns {void} + */ +function diagnosticReporter(diagnostic: ts.Diagnostic): void { + throw new Error( + ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine) + ); +} + +const noopFileWatcher = { close: () => {} }; + +/** + * Calculate project environments using options provided by consumer and paths from config + * @param {string} code The code being linted + * @param {string} filePath The path of the file being parsed + * @param {string} extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param {string[]} extra.project Provided tsconfig paths + * @returns {ts.Program[]} The programs corresponding to the supplied tsconfig paths + */ +export default function calculateProjectParserOptions( + code: string, + filePath: string, + extra: Extra +): ts.Program[] { + const results = []; + const tsconfigRootDir = extra.tsconfigRootDir; + + // preserve reference to code and file being linted + currentLintOperationState.code = code; + currentLintOperationState.filePath = filePath; + + // Update file version if necessary + // TODO: only update when necessary, currently marks as changed on every lint + const watchCallback = watchCallbackTrackingMap.get(filePath); + if (typeof watchCallback !== 'undefined') { + watchCallback(filePath, ts.FileWatcherEventKind.Changed); + } + + for (let tsconfigPath of extra.projects) { + // if absolute paths aren't provided, make relative to tsconfigRootDir + if (!path.isAbsolute(tsconfigPath)) { + tsconfigPath = path.join(tsconfigRootDir, tsconfigPath); + } + + const existingWatch = knownWatchProgramMap.get(tsconfigPath); + + if (typeof existingWatch !== 'undefined') { + // get new program (updated if necessary) + results.push(existingWatch.getProgram().getProgram()); + continue; + } + + // create compiler host + const watchCompilerHost = ts.createWatchCompilerHost( + tsconfigPath, + /*optionsToExtend*/ undefined, + ts.sys, + ts.createSemanticDiagnosticsBuilderProgram, + diagnosticReporter, + /*reportWatchStatus*/ () => {} + ); + + // ensure readFile reads the code being linted instead of the copy on disk + const oldReadFile = watchCompilerHost.readFile; + watchCompilerHost.readFile = (filePath, encoding) => + path.normalize(filePath) === + path.normalize(currentLintOperationState.filePath) + ? currentLintOperationState.code + : oldReadFile(filePath, encoding); + + // ensure process reports error on failure instead of exiting process immediately + watchCompilerHost.onUnRecoverableConfigFileDiagnostic = diagnosticReporter; + + // ensure process doesn't emit programs + watchCompilerHost.afterProgramCreate = program => { + // report error if there are any errors in the config file + const configFileDiagnostics = program + .getConfigFileParsingDiagnostics() + .filter( + diag => + diag.category === ts.DiagnosticCategory.Error && diag.code !== 18003 + ); + if (configFileDiagnostics.length > 0) { + diagnosticReporter(configFileDiagnostics[0]); + } + }; + + // register callbacks to trigger program updates without using fileWatchers + watchCompilerHost.watchFile = (fileName, callback) => { + const normalizedFileName = path.normalize(fileName); + watchCallbackTrackingMap.set(normalizedFileName, callback); + return { + close: () => { + watchCallbackTrackingMap.delete(normalizedFileName); + } + }; + }; + + // ensure fileWatchers aren't created for directories + watchCompilerHost.watchDirectory = () => noopFileWatcher; + + // create program + const programWatch = ts.createWatchProgram(watchCompilerHost); + const program = programWatch.getProgram().getProgram(); + + // cache watch program and return current program + knownWatchProgramMap.set(tsconfigPath, programWatch); + results.push(program); + } + + return results; +} diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/app.ts b/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/app.ts new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json b/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json new file mode 100644 index 000000000000..134439a183c6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compileOnSave": "hello", + "compilerOptions": { + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "strict": true, /* Enable all strict type-checking options. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + } + } \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/export-file.src.ts b/packages/typescript-estree/tests/fixtures/semanticInfo/export-file.src.ts new file mode 100644 index 000000000000..8bb4cb89d7c7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/export-file.src.ts @@ -0,0 +1 @@ +export default [3, 4, 5]; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/import-file.src.ts b/packages/typescript-estree/tests/fixtures/semanticInfo/import-file.src.ts new file mode 100644 index 000000000000..da5d2023648a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/import-file.src.ts @@ -0,0 +1,2 @@ +import arr from "./export-file.src"; +arr.push(6, 7); \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/isolated-file.src.ts b/packages/typescript-estree/tests/fixtures/semanticInfo/isolated-file.src.ts new file mode 100644 index 000000000000..ca04667e6218 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/isolated-file.src.ts @@ -0,0 +1 @@ +const x = [3, 4, 5]; \ No newline at end of file diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json b/packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json new file mode 100644 index 000000000000..3caa8722332a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "strict": true, + "esModuleInterop": true + } +} \ No newline at end of file diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap new file mode 100644 index 000000000000..5af1b41ba261 --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.ts.snap @@ -0,0 +1,1136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`semanticInfo fixtures/export-file.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 24, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`semanticInfo fixtures/import-file.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 35, + ], + "raw": "\\"./export-file.src\\"", + "type": "Literal", + "value": "./export-file.src", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "arr", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 10, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "raw": "6", + "type": "Literal", + "value": 6, + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "raw": "7", + "type": "Literal", + "value": 7, + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "arr", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "push", + "range": Array [ + 41, + 45, + ], + "type": "Identifier", + }, + "range": Array [ + 37, + 45, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 37, + 51, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 37, + 52, + ], + "type": "ExpressionStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "arr", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 35, + ], + "type": "String", + "value": "\\"./export-file.src\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + "value": "arr", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "Identifier", + "value": "push", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Numeric", + "value": "6", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Numeric", + "value": "7", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`semanticInfo fixtures/isolated-file.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 19, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`semanticInfo malformed project file 1`] = `"Compiler option 'compileOnSave' requires a value of type boolean."`; diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts new file mode 100644 index 000000000000..5dafc92d9841 --- /dev/null +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -0,0 +1,195 @@ +/** + * @fileoverview Tests for semantic information + * @author Benjamin Lichtman + */ + +'use strict'; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import path from 'path'; +import shelljs from 'shelljs'; +import { + parseCodeAndGenerateServices, + createSnapshotTestBlock +} from '../../tools/test-utils'; +import ts from 'typescript'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +const FIXTURES_DIR = './tests/fixtures/semanticInfo'; + +const testFiles = shelljs + .find(FIXTURES_DIR) + .filter(filename => filename.indexOf('.src.ts') > -1) + // strip off ".src.ts" + .map(filename => + filename.substring(FIXTURES_DIR.length - 1, filename.length - 7) + ); + +function createOptions(fileName: string): ParserOptions & { cwd?: string } { + return { + loc: true, + range: true, + tokens: true, + comment: true, + jsx: false, + useJSXTextNode: false, + errorOnUnknownASTType: true, + filePath: fileName, + tsconfigRootDir: path.join(process.cwd(), FIXTURES_DIR), + project: './tsconfig.json', + loggerFn: false + }; +} + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe('semanticInfo', () => { + // test all AST snapshots + testFiles.forEach(filename => { + // Uncomment and fill in filename to focus on a single file + // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; + const fullFileName = `${path.resolve(FIXTURES_DIR, filename)}.src.ts`; + const code = shelljs.cat(fullFileName); + test( + `fixtures/${filename}.src`, + createSnapshotTestBlock( + code, + createOptions(fullFileName), + /*generateServices*/ true + ) + ); + }); + + // case-specific tests + test('isolated-file tests', () => { + const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts'); + const parseResult = parseCodeAndGenerateServices( + shelljs.cat(fileName), + createOptions(fileName) + ); + + // get type checker + expect(parseResult).toHaveProperty('services.program.getTypeChecker'); + const checker = parseResult.services.program.getTypeChecker(); + + // get number node (ast shape validated by snapshot) + const arrayMember = + parseResult.ast.body[0].declarations[0].init.elements[0]; + expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); + + // get corresponding TS node + const tsArrayMember = parseResult.services.esTreeNodeToTSNodeMap.get( + arrayMember + ); + expect(tsArrayMember).toBeDefined(); + expect(tsArrayMember.kind).toBe(ts.SyntaxKind.NumericLiteral); + expect(tsArrayMember.text).toBe('3'); + + // get type of TS node + const arrayMemberType = checker.getTypeAtLocation(tsArrayMember); + expect(arrayMemberType.flags).toBe(ts.TypeFlags.NumberLiteral); + expect(arrayMemberType.value).toBe(3); + + // make sure it maps back to original ESTree node + expect(parseResult).toHaveProperty('services.tsNodeToESTreeNodeMap'); + expect(parseResult.services.tsNodeToESTreeNodeMap.get(tsArrayMember)).toBe( + arrayMember + ); + + // get bound name + const boundName = parseResult.ast.body[0].declarations[0].id; + expect(boundName.name).toBe('x'); + + const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap.get( + boundName + ); + expect(tsBoundName).toBeDefined(); + + checkNumberArrayType(checker, tsBoundName); + + expect(parseResult.services.tsNodeToESTreeNodeMap.get(tsBoundName)).toBe( + boundName + ); + }); + + test('imported-file tests', () => { + const fileName = path.resolve(FIXTURES_DIR, 'import-file.src.ts'); + const parseResult = parseCodeAndGenerateServices( + shelljs.cat(fileName), + createOptions(fileName) + ); + + // get type checker + expect(parseResult).toHaveProperty('services.program.getTypeChecker'); + const checker = parseResult.services.program.getTypeChecker(); + + // get array node (ast shape validated by snapshot) + // node is defined in other file than the parsed one + const arrayBoundName = parseResult.ast.body[1].expression.callee.object; + expect(arrayBoundName.name).toBe('arr'); + + expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); + const tsArrayBoundName = parseResult.services.esTreeNodeToTSNodeMap.get( + arrayBoundName + ); + expect(tsArrayBoundName).toBeDefined(); + checkNumberArrayType(checker, tsArrayBoundName); + + expect( + parseResult.services.tsNodeToESTreeNodeMap.get(tsArrayBoundName) + ).toBe(arrayBoundName); + }); + + test('non-existent project file', () => { + const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts'); + const badConfig = createOptions(fileName); + badConfig.project = './tsconfigs.json'; + expect(() => + parseCodeAndGenerateServices(shelljs.cat(fileName), badConfig) + ).toThrowError(/File .+tsconfigs\.json' not found/); + }); + + test('fail to read project file', () => { + const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts'); + const badConfig = createOptions(fileName); + badConfig.project = '.'; + expect(() => + parseCodeAndGenerateServices(shelljs.cat(fileName), badConfig) + ).toThrowError(/File .+semanticInfo' not found/); + }); + + test('malformed project file', () => { + const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts'); + const badConfig = createOptions(fileName); + badConfig.project = './badTSConfig/tsconfig.json'; + expect(() => + parseCodeAndGenerateServices(shelljs.cat(fileName), badConfig) + ).toThrowErrorMatchingSnapshot(); + }); +}); + +/** + * Verifies that the type of a TS node is number[] as expected + * @param {ts.TypeChecker} checker + * @param {ts.Node} tsNode + */ +function checkNumberArrayType(checker: ts.TypeChecker, tsNode: ts.Node) { + const nodeType = checker.getTypeAtLocation(tsNode); + expect(nodeType.flags).toBe(ts.TypeFlags.Object); + expect((nodeType as ts.ObjectType).objectFlags).toBe( + ts.ObjectFlags.Reference + ); + expect((nodeType as ts.TypeReference).typeArguments).toHaveLength(1); + expect((nodeType as ts.TypeReference).typeArguments![0].flags).toBe( + ts.TypeFlags.Number + ); +} diff --git a/packages/typescript-estree/tools/test-utils.ts b/packages/typescript-estree/tools/test-utils.ts index 453a8db50f1d..d167d496babb 100644 --- a/packages/typescript-estree/tools/test-utils.ts +++ b/packages/typescript-estree/tools/test-utils.ts @@ -24,19 +24,32 @@ export function getRaw(ast: any) { ); } +export function parseCodeAndGenerateServices( + code: string, + config: ParserOptions +) { + return parser.parseAndGenerateServices(code, config); +} + /** * Returns a function which can be used as the callback of a Jest test() block, * and which performs an assertion on the snapshot for the given code and config. * @param {string} code The source code to parse * @param {ParserOptions} config the parser configuration - * @returns {Function} callback for Jest it() block + * @returns {jest.ProvidesCallback} callback for Jest it() block */ -export function createSnapshotTestBlock(code: string, config: ParserOptions) { +export function createSnapshotTestBlock( + code: string, + config: ParserOptions, + generateServices?: true +) { /** * @returns {Object} the AST object */ function parse() { - const ast = parser.parse(code, config); + const ast = generateServices + ? parser.parseAndGenerateServices(code, config).ast + : parser.parse(code, config); return getRaw(ast); } From f0548060299ea6a16bdec4d2af9a0032dac02034 Mon Sep 17 00:00:00 2001 From: Ika Date: Mon, 26 Nov 2018 06:37:12 +0800 Subject: [PATCH 16/84] fix: correct JSXFragment fields (#34) --- packages/typescript-estree/src/convert.ts | 7 +- .../tests/ast-alignment/fixtures-to-test.ts | 6 -- .../tests/lib/__snapshots__/jsx.ts.snap | 72 +++++++++++++++++-- 3 files changed, 71 insertions(+), 14 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index ce612fdb9c35..04e81fc58844 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2089,8 +2089,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.JsxFragment: Object.assign(result, { type: AST_NODE_TYPES.JSXFragment, - openingElement: convertChild((node as any).openingElement), - closingElement: convertChild((node as any).closingElement), + openingFragment: convertChild((node as ts.JsxFragment).openingFragment), + closingFragment: convertChild((node as ts.JsxFragment).closingFragment), children: (node as any).children.map(convertChild) }); break; @@ -2136,8 +2136,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.JsxOpeningFragment: Object.assign(result, { - type: AST_NODE_TYPES.JSXOpeningFragment, - selfClosing: false + type: AST_NODE_TYPES.JSXOpeningFragment }); break; case SyntaxKind.JsxClosingFragment: diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index b6349bea04d0..831f81d3dce0 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -35,12 +35,6 @@ const jsxFilesWithKnownIssues = jsxKnownIssues.map(f => f.replace('jsx/', '')); */ jsxFilesWithKnownIssues.push('invalid-no-tag-name'); -/** - * JSX shorthand fragments are not supported by Babylon - */ -jsxFilesWithKnownIssues.push('shorthand-fragment'); -jsxFilesWithKnownIssues.push('shorthand-fragment-with-child'); - /** * Globally track which fixtures need to be parsed with sourceType: "module" * so that they can be added with the correct FixturePatternConfig diff --git a/packages/typescript-estree/tests/lib/__snapshots__/jsx.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/jsx.ts.snap index 0372f0f62fd3..1da61ddcac7e 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/jsx.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/jsx.ts.snap @@ -6832,7 +6832,23 @@ Object { Object { "expression": Object { "children": Array [], - "closingElement": null, + "closingFragment": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 5, + ], + "type": "JSXClosingFragment", + }, "loc": Object { "end": Object { "column": 5, @@ -6843,7 +6859,23 @@ Object { "line": 1, }, }, - "openingElement": null, + "openingFragment": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "JSXOpeningFragment", + }, "range": Array [ 0, 5, @@ -7041,7 +7073,23 @@ Object { "type": "JSXElement", }, ], - "closingElement": null, + "closingFragment": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "JSXClosingFragment", + }, "loc": Object { "end": Object { "column": 12, @@ -7052,7 +7100,23 @@ Object { "line": 1, }, }, - "openingElement": null, + "openingFragment": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "JSXOpeningFragment", + }, "range": Array [ 0, 12, From 0842d9bf31034de639a07502665c4d2d2df0a415 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 25 Nov 2018 18:25:39 -0500 Subject: [PATCH 17/84] test: ast alignment tests did not account for javascript rename (#36) --- .../tests/ast-alignment/fixtures-to-test.ts | 105 ++++++++---------- packages/typescript-estree/yarn.lock | 4 + 2 files changed, 50 insertions(+), 59 deletions(-) diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 831f81d3dce0..1285ce1b6325 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -113,11 +113,11 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/templateStrings', { + createFixturePatternConfigFor('javascript/templateStrings', { ignore: ['**/*'] }), - createFixturePatternConfigFor('ecma-features/experimentalObjectRestSpread', { + createFixturePatternConfigFor('javascript/experimentalObjectRestSpread', { ignore: [ /** * Trailing comma is not permitted after a "RestElement" in Babylon @@ -126,7 +126,7 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/arrowFunctions', { + createFixturePatternConfigFor('javascript/arrowFunctions', { ignore: [ /** * Expected babylon parse errors - all of these files below produce parse errors in espree @@ -141,10 +141,10 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/binaryLiterals'), - createFixturePatternConfigFor('ecma-features/blockBindings'), + createFixturePatternConfigFor('javascript/binaryLiterals'), + createFixturePatternConfigFor('javascript/blockBindings'), - createFixturePatternConfigFor('ecma-features/classes', { + createFixturePatternConfigFor('javascript/classes', { ignore: [ /** * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. @@ -160,9 +160,9 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/defaultParams'), + createFixturePatternConfigFor('javascript/defaultParams'), - createFixturePatternConfigFor('ecma-features/destructuring', { + createFixturePatternConfigFor('javascript/destructuring', { ignore: [ /** * Expected babylon parse errors - all of these files below produce parse errors in espree @@ -173,18 +173,12 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor( - 'ecma-features/destructuring-and-arrowFunctions' - ), - createFixturePatternConfigFor( - 'ecma-features/destructuring-and-blockBindings' - ), - createFixturePatternConfigFor( - 'ecma-features/destructuring-and-defaultParams' - ), - createFixturePatternConfigFor('ecma-features/destructuring-and-forOf'), - - createFixturePatternConfigFor('ecma-features/destructuring-and-spread', { + createFixturePatternConfigFor('javascript/destructuring-and-arrowFunctions'), + createFixturePatternConfigFor('javascript/destructuring-and-blockBindings'), + createFixturePatternConfigFor('javascript/destructuring-and-defaultParams'), + createFixturePatternConfigFor('javascript/destructuring-and-forOf'), + + createFixturePatternConfigFor('javascript/destructuring-and-spread', { ignore: [ /** * Expected babylon parse errors - all of these files below produce parse errors in espree @@ -195,11 +189,11 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/experimentalAsyncIteration'), - createFixturePatternConfigFor('ecma-features/experimentalDynamicImport'), - createFixturePatternConfigFor('ecma-features/exponentiationOperators'), + createFixturePatternConfigFor('javascript/experimentalAsyncIteration'), + createFixturePatternConfigFor('javascript/experimentalDynamicImport'), + createFixturePatternConfigFor('javascript/exponentiationOperators'), - createFixturePatternConfigFor('ecma-features/forOf', { + createFixturePatternConfigFor('javascript/forOf', { ignore: [ /** * TypeScript, espree and acorn parse this fine - esprima, flow and babylon do not... @@ -208,10 +202,10 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/generators'), - createFixturePatternConfigFor('ecma-features/globalReturn'), + createFixturePatternConfigFor('javascript/generators'), + createFixturePatternConfigFor('javascript/globalReturn'), - createFixturePatternConfigFor('ecma-features/modules', { + createFixturePatternConfigFor('javascript/modules', { ignore: [ /** * TypeScript, flow and babylon parse this fine - esprima, espree and acorn do not... @@ -282,7 +276,7 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/newTarget', { + createFixturePatternConfigFor('javascript/newTarget', { ignore: [ /** * Expected babylon parse errors - all of these files below produce parse errors in espree @@ -294,35 +288,28 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor( - 'ecma-features/objectLiteralComputedProperties' - ), - - createFixturePatternConfigFor( - 'ecma-features/objectLiteralDuplicateProperties', - { - ignore: [ - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'error-proto-property', // babylon parse errors - 'error-proto-string-property' // babylon parse errors - ] - } - ), - - createFixturePatternConfigFor('ecma-features/objectLiteralShorthandMethods'), - createFixturePatternConfigFor( - 'ecma-features/objectLiteralShorthandProperties' - ), - createFixturePatternConfigFor('ecma-features/octalLiterals'), - createFixturePatternConfigFor('ecma-features/regex'), - createFixturePatternConfigFor('ecma-features/regexUFlag'), - createFixturePatternConfigFor('ecma-features/regexYFlag'), - - createFixturePatternConfigFor('ecma-features/restParams', { + createFixturePatternConfigFor('javascript/objectLiteralComputedProperties'), + + createFixturePatternConfigFor('javascript/objectLiteralDuplicateProperties', { + ignore: [ + /** + * Expected babylon parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-proto-property', // babylon parse errors + 'error-proto-string-property' // babylon parse errors + ] + }), + + createFixturePatternConfigFor('javascript/objectLiteralShorthandMethods'), + createFixturePatternConfigFor('javascript/objectLiteralShorthandProperties'), + createFixturePatternConfigFor('javascript/octalLiterals'), + createFixturePatternConfigFor('javascript/regex'), + createFixturePatternConfigFor('javascript/regexUFlag'), + createFixturePatternConfigFor('javascript/regexYFlag'), + + createFixturePatternConfigFor('javascript/restParams', { ignore: [ /** * Expected babylon parse errors - all of these files below produce parse errors in espree @@ -334,8 +321,8 @@ let fixturePatternConfigsToTest = [ ] }), - createFixturePatternConfigFor('ecma-features/spread'), - createFixturePatternConfigFor('ecma-features/unicodeCodePointEscapes'), + createFixturePatternConfigFor('javascript/spread'), + createFixturePatternConfigFor('javascript/unicodeCodePointEscapes'), createFixturePatternConfigFor('jsx', { ignore: jsxFilesWithKnownIssues }), createFixturePatternConfigFor('jsx-useJSXTextNode'), diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 2be682c9d5a7..39a2805fde86 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -847,6 +847,10 @@ version "10.12.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.2.tgz#d77f9faa027cadad9c912cd47f4f8b07b0fb0864" +"@types/node@^10.12.2": + version "10.12.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.10.tgz#4fa76e6598b7de3f0cb6ec3abacc4f59e5b3a2ce" + "@types/semver@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" From 39b9c901050800466a636050d80b75165c781927 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Mon, 26 Nov 2018 10:21:57 +0800 Subject: [PATCH 18/84] feat: typed parser return value (#33) --- packages/typescript-estree/src/parser.ts | 63 ++++++++++++++++--- .../src/temp-types-based-on-js-source.ts | 22 +++---- .../tests/lib/semanticInfo.ts | 27 ++++---- 3 files changed, 78 insertions(+), 34 deletions(-) diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 1a48475c08f9..41135b85dce8 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -9,8 +9,14 @@ import calculateProjectParserOptions from './tsconfig-parser'; import semver from 'semver'; import ts from 'typescript'; import convert from './ast-converter'; +import { + Extra, + ParserOptions, + ESTreeToken, + ESTreeComment +} from './temp-types-based-on-js-source'; +import { Program } from './estree/spec'; import util from './node-utils'; -import { Extra, ParserOptions } from './temp-types-based-on-js-source'; const packageJSON = require('../package.json'); @@ -24,6 +30,15 @@ const isRunningSupportedTypeScriptVersion = semver.satisfies( let extra: Extra; let warnedAboutTSVersion = false; +/** + * Compute the filename based on the parser options + * + * @param options Parser options + */ +function getFileName({ jsx }: { jsx?: boolean }) { + return jsx ? 'estree.tsx' : 'estree.ts'; +} + /** * Resets the extra config object * @returns {void} @@ -53,9 +68,15 @@ function resetExtra(): void { */ function getASTFromProject(code: string, options: ParserOptions) { return util.firstDefined( - calculateProjectParserOptions(code, options.filePath, extra), + calculateProjectParserOptions( + code, + options.filePath || getFileName(options), + extra + ), (currentProgram: ts.Program) => { - const ast = currentProgram.getSourceFile(options.filePath); + const ast = currentProgram.getSourceFile( + options.filePath || getFileName(options) + ); return ast && { ast, program: currentProgram }; } ); @@ -68,7 +89,7 @@ function getASTFromProject(code: string, options: ParserOptions) { function createNewProgram(code: string) { // Even if jsx option is set in typescript compiler, filename still has to // contain .tsx file extension - const FILENAME = extra.jsx ? 'estree.tsx' : 'estree.ts'; + const FILENAME = getFileName(extra); const compilerHost = { fileExists() { @@ -141,6 +162,11 @@ function getProgramAndAST( // Parser //------------------------------------------------------------------------------ +type AST = Program & + (T['range'] extends true ? { range: [number, number] } : {}) & + (T['tokens'] extends true ? { tokens: ESTreeToken[] } : {}) & + (T['comment'] extends true ? { comments: ESTreeComment[] } : {}); + /** * Parses the given source code to produce a valid AST * @param {string} code TypeScript code @@ -148,11 +174,25 @@ function getProgramAndAST( * @param {ParserOptions} options configuration object for the parser * @returns {Object} the AST */ -function generateAST( +function generateAST( code: string, - options: ParserOptions, + options: T = {} as T, shouldGenerateServices = false -): any { +): { + estree: AST; + program: typeof shouldGenerateServices extends true + ? ts.Program + : (ts.Program | undefined); + astMaps: typeof shouldGenerateServices extends true + ? { + esTreeNodeToTSNodeMap: WeakMap; + tsNodeToESTreeNodeMap: WeakMap; + } + : { + esTreeNodeToTSNodeMap?: WeakMap; + tsNodeToESTreeNodeMap?: WeakMap; + }; +} { const toString = String; if (typeof code !== 'string' && !((code as any) instanceof String)) { @@ -245,7 +285,7 @@ function generateAST( estree, program: shouldProvideParserServices ? program : undefined, astMaps: shouldProvideParserServices - ? astMaps + ? astMaps! : { esTreeNodeToTSNodeMap: undefined, tsNodeToESTreeNodeMap: undefined } }; } @@ -259,8 +299,11 @@ export { version }; const version = packageJSON.version; -export function parse(code: string, options: ParserOptions) { - return generateAST(code, options).estree; +export function parse( + code: string, + options?: T +) { + return generateAST(code, options).estree; } export function parseAndGenerateServices(code: string, options: ParserOptions) { diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index f1afe55fb576..b5db5cb2a514 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -71,15 +71,15 @@ export interface Extra { } export interface ParserOptions { - range: boolean; - loc: boolean; - tokens: boolean; - comment: boolean; - jsx: boolean; - errorOnUnknownASTType: boolean; - useJSXTextNode: boolean; - loggerFn: Function | false; - project: string | string[]; - filePath: string; - tsconfigRootDir: string; + range?: boolean; + loc?: boolean; + tokens?: boolean; + comment?: boolean; + jsx?: boolean; + errorOnUnknownASTType?: boolean; + useJSXTextNode?: boolean; + loggerFn?: Function | false; + project?: string | string[]; + filePath?: string; + tsconfigRootDir?: string; } diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 5dafc92d9841..d0c1f3742bf5 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -79,15 +79,15 @@ describe('semanticInfo', () => { // get type checker expect(parseResult).toHaveProperty('services.program.getTypeChecker'); - const checker = parseResult.services.program.getTypeChecker(); + const checker = parseResult.services.program!.getTypeChecker(); // get number node (ast shape validated by snapshot) - const arrayMember = - parseResult.ast.body[0].declarations[0].init.elements[0]; + const arrayMember = (parseResult.ast as any).body[0].declarations[0].init + .elements[0]; expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); // get corresponding TS node - const tsArrayMember = parseResult.services.esTreeNodeToTSNodeMap.get( + const tsArrayMember = parseResult.services.esTreeNodeToTSNodeMap!.get( arrayMember ); expect(tsArrayMember).toBeDefined(); @@ -95,28 +95,28 @@ describe('semanticInfo', () => { expect(tsArrayMember.text).toBe('3'); // get type of TS node - const arrayMemberType = checker.getTypeAtLocation(tsArrayMember); + const arrayMemberType: any = checker.getTypeAtLocation(tsArrayMember); expect(arrayMemberType.flags).toBe(ts.TypeFlags.NumberLiteral); expect(arrayMemberType.value).toBe(3); // make sure it maps back to original ESTree node expect(parseResult).toHaveProperty('services.tsNodeToESTreeNodeMap'); - expect(parseResult.services.tsNodeToESTreeNodeMap.get(tsArrayMember)).toBe( + expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsArrayMember)).toBe( arrayMember ); // get bound name - const boundName = parseResult.ast.body[0].declarations[0].id; + const boundName = (parseResult.ast as any).body[0].declarations[0].id; expect(boundName.name).toBe('x'); - const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap.get( + const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap!.get( boundName ); expect(tsBoundName).toBeDefined(); checkNumberArrayType(checker, tsBoundName); - expect(parseResult.services.tsNodeToESTreeNodeMap.get(tsBoundName)).toBe( + expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsBoundName)).toBe( boundName ); }); @@ -130,22 +130,23 @@ describe('semanticInfo', () => { // get type checker expect(parseResult).toHaveProperty('services.program.getTypeChecker'); - const checker = parseResult.services.program.getTypeChecker(); + const checker = parseResult.services.program!.getTypeChecker(); // get array node (ast shape validated by snapshot) // node is defined in other file than the parsed one - const arrayBoundName = parseResult.ast.body[1].expression.callee.object; + const arrayBoundName = (parseResult.ast as any).body[1].expression.callee + .object; expect(arrayBoundName.name).toBe('arr'); expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); - const tsArrayBoundName = parseResult.services.esTreeNodeToTSNodeMap.get( + const tsArrayBoundName = parseResult.services.esTreeNodeToTSNodeMap!.get( arrayBoundName ); expect(tsArrayBoundName).toBeDefined(); checkNumberArrayType(checker, tsArrayBoundName); expect( - parseResult.services.tsNodeToESTreeNodeMap.get(tsArrayBoundName) + parseResult.services.tsNodeToESTreeNodeMap!.get(tsArrayBoundName) ).toBe(arrayBoundName); }); From 1c5025fb0d73bd5671d411a30d5c2c7aab8fba1a Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 30 Nov 2018 01:59:29 +0100 Subject: [PATCH 19/84] feat: add optional global flag to TSModuleDeclaration for global augmentations (#38) --- packages/typescript-estree/src/convert.ts | 3 + .../src/temp-types-based-on-js-source.ts | 1 + .../global-module-declaration.src.ts | 8 + .../lib/__snapshots__/typescript.ts.snap | 441 ++++++++++++++++++ 4 files changed, 453 insertions(+) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 04e81fc58844..22042334a5a0 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2527,6 +2527,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } // apply modifiers first... applyModifiersToResult((node as any).modifiers); + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + result.global = true; + } // ...then check for exports result = nodeUtils.fixExports(node, result as any, ast); break; diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index b5db5cb2a514..3a37c3fe708b 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -32,6 +32,7 @@ export interface ESTreeNode { decorators?: any; const?: boolean; declare?: boolean; + global?: boolean; modifiers?: any; body?: any; params?: any; diff --git a/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts new file mode 100644 index 000000000000..3c761080cd05 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts @@ -0,0 +1,8 @@ +declare global { + declare module global { + + } + declare namespace global { + + } +} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 927477cfaa87..1829ec57932b 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -66645,6 +66645,447 @@ Object { } `; +exports[`typescript fixtures/namespaces-and-modules/global-module-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 43, + 51, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "global", + "range": Array [ + 36, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 51, + ], + "type": "TSModuleDeclaration", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 29, + "line": 5, + }, + }, + "range": Array [ + 81, + 89, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "name": "global", + "range": Array [ + 74, + 80, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 56, + 89, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 91, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "global": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "global", + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 91, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 92, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Keyword", + "value": "global", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "Keyword", + "value": "global", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 56, + 63, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 64, + 73, + ], + "type": "Identifier", + "value": "namespace", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 74, + 80, + ], + "type": "Keyword", + "value": "global", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 5, + }, + "start": Object { + "column": 29, + "line": 5, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` Object { "body": Array [ From 193bfc43c95103e6a3d922ac2cc65c553c0fe4ce Mon Sep 17 00:00:00 2001 From: James Henry Date: Thu, 29 Nov 2018 20:08:51 -0500 Subject: [PATCH 20/84] fix: trigger publish --- packages/typescript-estree/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index 7b39ea01555f..a389fcda6c56 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -76,7 +76,7 @@ Example usage: ```javascript const parser = require('typescript-estree'); -const code = "const hello: string = 'world';"; +const code = `const hello: string = 'world';`; const ast = parser.parse(code, { range: true, loc: true From c961ac15b0509b352753f193278fd5d40d3f4313 Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 30 Nov 2018 21:09:23 -0500 Subject: [PATCH 21/84] feat: ts 3.2 support (#35) (#37) BREAKING CHANGE: Supported TypeScript version is now 3.2 --- packages/typescript-estree/README.md | 2 +- packages/typescript-estree/package.json | 4 +- .../typescript-estree/src/ast-node-types.ts | 1 + packages/typescript-estree/src/convert.ts | 14 + .../tests/ast-alignment/fixtures-to-test.ts | 1 + .../tests/ast-alignment/parse.ts | 7 +- .../tests/ast-alignment/utils.ts | 4 + .../javascript/bigIntLiterals/binary.src.js | 1 + .../javascript/bigIntLiterals/decimal.src.js | 1 + .../javascript/bigIntLiterals/hex.src.js | 1 + .../javascript/bigIntLiterals/octal.src.js | 1 + .../lib/__snapshots__/javascript.ts.snap | 388 ++++++++++++++++++ packages/typescript-estree/yarn.lock | 14 +- 13 files changed, 426 insertions(+), 13 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/binary.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/decimal.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/hex.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/octal.src.js diff --git a/packages/typescript-estree/README.md b/packages/typescript-estree/README.md index a389fcda6c56..922a49f766bc 100644 --- a/packages/typescript-estree/README.md +++ b/packages/typescript-estree/README.md @@ -109,7 +109,7 @@ const astNodeTypes = parser.AST_NODE_TYPES; We will always endeavor to support the latest stable version of TypeScript. -The version of TypeScript currently supported by this parser is `~3.1.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. +The version of TypeScript currently supported by this parser is `~3.2.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. If you use a non-supported version of TypeScript, the parser will log a warning to the console. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index a1ba511c294f..0bd664011175 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -18,6 +18,7 @@ }, "license": "BSD-2-Clause", "devDependencies": { + "@babel/parser": "7.1.6", "@commitlint/cli": "^7.1.2", "@commitlint/config-conventional": "^7.1.2", "@commitlint/travis-cli": "^7.1.2", @@ -29,7 +30,6 @@ "@types/semver": "^5.5.0", "@types/shelljs": "^0.8.0", "babel-code-frame": "6.26.0", - "babylon": "7.0.0-beta.39", "cz-conventional-changelog": "2.1.0", "glob": "7.1.2", "husky": "0.14.3", @@ -41,7 +41,7 @@ "shelljs": "0.8.2", "travis-deploy-once": "^5.0.8", "ts-jest": "^23.10.4", - "typescript": "~3.1.1" + "typescript": "~3.2.1" }, "keywords": [ "ast", diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index ea3ce8d24bc4..35a086fb6ea4 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -12,6 +12,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { AssignmentExpression: 'AssignmentExpression', AssignmentPattern: 'AssignmentPattern', AwaitExpression: 'AwaitExpression', + BigIntLiteral: 'BigIntLiteral', BinaryExpression: 'BinaryExpression', BlockStatement: 'BlockStatement', BreakStatement: 'BreakStatement', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 22042334a5a0..efa2ab7a67e4 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2004,6 +2004,20 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); break; + case SyntaxKind.BigIntLiteral: { + const raw = ast.text.slice( + (result as any).range[0], + (result as any).range[1] + ); + const value = raw.slice(0, -1); // remove suffix `n` + Object.assign(result, { + type: AST_NODE_TYPES.BigIntLiteral, + raw, + value + }); + break; + } + case SyntaxKind.RegularExpressionLiteral: { const pattern = (node as any).text.slice( 1, diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 1285ce1b6325..37ebcf34eb09 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -141,6 +141,7 @@ let fixturePatternConfigsToTest = [ ] }), + createFixturePatternConfigFor('javascript/bigIntLiterals'), createFixturePatternConfigFor('javascript/binaryLiterals'), createFixturePatternConfigFor('javascript/blockBindings'), diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index d875556fa460..b3d7b477fc44 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -15,7 +15,7 @@ function createError(message: string, line: number, column: number) { function parseWithBabylonPluginTypescript(text: string, parserOptions?: any) { parserOptions = parserOptions || {}; - const babylon = require('babylon'); + const babylon = require('@babel/parser'); return babylon.parse( text, Object.assign( @@ -28,11 +28,12 @@ function parseWithBabylonPluginTypescript(text: string, parserOptions?: any) { 'jsx', 'typescript', 'objectRestSpread', - 'decorators', + 'decorators-legacy', 'classProperties', 'asyncGenerators', 'dynamicImport', - 'estree' + 'estree', + 'bigInt' ] }, parserOptions diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 0d1b1caa6543..95fb1f906303 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -126,6 +126,10 @@ export function preprocessBabylonAST(ast: any): any { { key: 'guardedHandlers', predicate: always + }, + { + key: 'interpreter', + predicate: always } ]); } diff --git a/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/binary.src.js b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/binary.src.js new file mode 100644 index 000000000000..2b138015de5e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/binary.src.js @@ -0,0 +1 @@ +0b1n; diff --git a/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/decimal.src.js b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/decimal.src.js new file mode 100644 index 000000000000..fe03424dbb56 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/decimal.src.js @@ -0,0 +1 @@ +1n; diff --git a/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/hex.src.js b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/hex.src.js new file mode 100644 index 000000000000..204f239e3696 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/hex.src.js @@ -0,0 +1 @@ +0x1n; diff --git a/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/octal.src.js b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/octal.src.js new file mode 100644 index 000000000000..f2ce84fefe08 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/bigIntLiterals/octal.src.js @@ -0,0 +1 @@ +0o1n; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 35c0cb478abb..399dd2942866 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -12803,6 +12803,394 @@ Object { } `; +exports[`javascript fixtures/bigIntLiterals/binary.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0b1n", + "type": "BigIntLiteral", + "value": "0b1", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "0b1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/bigIntLiterals/decimal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "raw": "1n", + "type": "BigIntLiteral", + "value": "1", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + "value": "1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/bigIntLiterals/hex.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0x1n", + "type": "BigIntLiteral", + "value": "0x1", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "0x1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/bigIntLiterals/octal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0o1n", + "type": "BigIntLiteral", + "value": "0o1", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "0o1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`javascript fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; exports[`javascript fixtures/binaryLiterals/lowercase.src 1`] = ` diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 39a2805fde86..19af772326fc 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -203,6 +203,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/parser@7.1.6": + version "7.1.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.6.tgz#16e97aca1ec1062324a01c5a6a7d0df8dd189854" + "@babel/parser@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.0.tgz#a7cd42cb3c12aec52e24375189a47b39759b783e" @@ -1270,10 +1274,6 @@ babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: lodash "^4.17.4" to-fast-properties "^1.0.3" -babylon@7.0.0-beta.39: - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.39.tgz#512833ea788f6570c6db026d743a7565e58d3aeb" - babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -6765,9 +6765,9 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.1.tgz#3362ba9dd1e482ebb2355b02dfe8bcd19a2c7c96" +typescript@~3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.1.tgz#0b7a04b8cf3868188de914d9568bd030f0c56192" uglify-js@^2.6: version "2.8.29" From 6bd1fc5c601705f1c82f9b5afc484d32eac6b9c9 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 1 Dec 2018 03:47:45 +0100 Subject: [PATCH 22/84] test: replace babylon(beta) with babel/parser (#40) --- packages/typescript-estree/.gitignore | 3 ++- packages/typescript-estree/package.json | 2 +- .../tests/ast-alignment/fixtures-to-test.ts | 27 ++++++++++--------- .../tests/ast-alignment/parse.ts | 16 ++++++----- .../tests/ast-alignment/spec.ts | 22 +++++++-------- packages/typescript-estree/yarn.lock | 5 ++-- 6 files changed, 41 insertions(+), 34 deletions(-) diff --git a/packages/typescript-estree/.gitignore b/packages/typescript-estree/.gitignore index 557d485a3734..fcbaa8ef1018 100644 --- a/packages/typescript-estree/.gitignore +++ b/packages/typescript-estree/.gitignore @@ -5,4 +5,5 @@ npm-debug.log _test.js .DS_Store .vscode -dist \ No newline at end of file +.idea +dist diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 0bd664011175..219988558f32 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -18,6 +18,7 @@ }, "license": "BSD-2-Clause", "devDependencies": { + "@babel/code-frame": "7.0.0", "@babel/parser": "7.1.6", "@commitlint/cli": "^7.1.2", "@commitlint/config-conventional": "^7.1.2", @@ -29,7 +30,6 @@ "@types/node": "^10.12.2", "@types/semver": "^5.5.0", "@types/shelljs": "^0.8.0", - "babel-code-frame": "6.26.0", "cz-conventional-changelog": "2.1.0", "glob": "7.1.2", "husky": "0.14.3", diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 37ebcf34eb09..3e2206155b7c 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -1,6 +1,8 @@ import glob from 'glob'; import path from 'path'; import jsxKnownIssues from '../jsx-known-issues'; +import { ParserOptions as BabelParserOptions } from '@babel/parser'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; interface Fixture { filename: string; @@ -10,8 +12,8 @@ interface Fixture { interface FixturePatternConfig { pattern: string; config?: { - babylonParserOptions?: any; - typeScriptESTreeOptions?: any; + babelParserOptions?: BabelParserOptions; + typeScriptESTreeOptions?: ParserOptions; }; } @@ -77,16 +79,17 @@ function createFixturePatternConfigFor( config.ignore, config.parseWithSourceTypeModule ); - fixturesRequiringSourceTypeModule = ([] as FixturePatternConfig[]).concat( - fixturesRequiringSourceTypeModule, - config.parseWithSourceTypeModule.map(fixture => ({ + for (const fixture of config.parseWithSourceTypeModule) { + fixturesRequiringSourceTypeModule.push({ // It needs to be the full path from within fixtures/ for the pattern - pattern: `${fixturesSubPath}/${fixture}.src.${ - (config as CreateFixturePatternConfig).fileType - }`, - config: { babylonParserOptions: { sourceType: 'module' } } - })) - ); + pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, + config: { + babelParserOptions: { + sourceType: 'module' + } + } + }); + } } return { pattern: `${fixturesSubPath}/!(${config.ignore.join('|')}).src.${ @@ -370,8 +373,6 @@ let fixturePatternConfigsToTest = [ 'interface-with-all-property-types', // babylon parse errors 'interface-with-construct-signature-with-parameter-accessibility', // babylon parse errors 'class-with-implements-and-extends', // babylon parse errors - 'var-with-definite-assignment', // babylon parse errors - 'class-with-definite-assignment', // babylon parse errors /** * typescript-estree erroring, but babylon not. */ diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index b3d7b477fc44..85e53bdf6165 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -1,7 +1,8 @@ import codeFrame from 'babel-code-frame'; import * as parser from '../../src/parser'; -import { ParserOptions } from '../../src/temp-types-based-on-js-source'; import * as parseUtils from './utils'; +import { ParserOptions as BabelParserOptions } from '@babel/parser'; +import { ParserOptions } from '../../src/temp-types-based-on-js-source'; function createError(message: string, line: number, column: number) { // Construct an error similar to the ones thrown by Babylon. @@ -13,7 +14,10 @@ function createError(message: string, line: number, column: number) { return error; } -function parseWithBabylonPluginTypescript(text: string, parserOptions?: any) { +function parseWithBabelParser( + text: string, + parserOptions?: BabelParserOptions +) { parserOptions = parserOptions || {}; const babylon = require('@babel/parser'); return babylon.parse( @@ -67,7 +71,7 @@ function parseWithTypeScriptESTree( interface ASTComparisonParseOptions { parser: string; typeScriptESTreeOptions?: ParserOptions; - babylonParserOptions?: any; + babelParserOptions?: BabelParserOptions; } export function parse(text: string, opts: ASTComparisonParseOptions) { @@ -87,14 +91,14 @@ export function parse(text: string, opts: ASTComparisonParseOptions) { parseWithTypeScriptESTree(text, opts.typeScriptESTreeOptions) ); break; - case 'babylon-plugin-typescript': + case '@babel/parser': result.ast = parseUtils.normalizeNodeTypes( - parseWithBabylonPluginTypescript(text, opts.babylonParserOptions) + parseWithBabelParser(text, opts.babelParserOptions) ); break; default: throw new Error( - 'Please provide a valid parser: either "typescript-estree" or "babylon-plugin-typescript"' + 'Please provide a valid parser: either "typescript-estree" or "@babel/parser"' ); } } catch (error) { diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index bf1359af5c79..378ed9ef83ac 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -21,25 +21,25 @@ fixturesToTest.forEach(fixture => { /** * Parse the source with babylon typescript-plugin */ - const babylonTypeScriptPluginResult = parse(source, { - parser: 'babylon-plugin-typescript', - babylonParserOptions: - fixture.config && fixture.config.babylonParserOptions - ? fixture.config.babylonParserOptions + const babelParserResult = parse(source, { + parser: '@babel/parser', + babelParserOptions: + fixture.config && fixture.config.babelParserOptions + ? fixture.config.babelParserOptions : null }); /** * If babylon fails to parse the source, ensure that typescript-estree has the same fundamental issue */ - if (babylonTypeScriptPluginResult.parseError) { + if (babelParserResult.parseError) { /** * FAIL: babylon errored but typescript-estree did not */ if (!typeScriptESTreeResult.parseError) { it(`TEST FAIL [BABYLON ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { expect(typeScriptESTreeResult.parseError).toEqual( - babylonTypeScriptPluginResult.parseError + babelParserResult.parseError ); }); return; @@ -48,7 +48,7 @@ fixturesToTest.forEach(fixture => { * Both parsers errored - this is OK as long as the errors are of the same "type" */ it(`[Both parsers error as expected] - ${filename}`, () => { - expect(babylonTypeScriptPluginResult.parseError.name).toEqual( + expect(babelParserResult.parseError.name).toEqual( typeScriptESTreeResult.parseError.name ); }); @@ -60,7 +60,7 @@ fixturesToTest.forEach(fixture => { */ if (typeScriptESTreeResult.parseError) { it(`TEST FAIL [TSEP ERRORED, BUT BABYLON DID NOT] - ${filename}`, () => { - expect(babylonTypeScriptPluginResult.parseError).toEqual( + expect(babelParserResult.parseError).toEqual( typeScriptESTreeResult.parseError ); }); @@ -71,14 +71,14 @@ fixturesToTest.forEach(fixture => { * No errors, assert the two ASTs match */ it(`${filename}`, () => { - expect(babylonTypeScriptPluginResult.ast).toBeTruthy(); + expect(babelParserResult.ast).toBeTruthy(); expect(typeScriptESTreeResult.ast).toBeTruthy(); /** * Perform some extra formatting steps on the babylon AST before comparing */ expect( parseUtils.removeLocationDataFromProgramNode( - parseUtils.preprocessBabylonAST(babylonTypeScriptPluginResult.ast) + parseUtils.preprocessBabylonAST(babelParserResult.ast) ) ).toEqual( parseUtils.removeLocationDataFromProgramNode(typeScriptESTreeResult.ast) diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 19af772326fc..130bd0dee186 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -2,9 +2,10 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": +"@babel/code-frame@7.0.0", "@babel/code-frame@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== dependencies: "@babel/highlight" "^7.0.0" @@ -1125,7 +1126,7 @@ aws4@^1.6.0, aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" -babel-code-frame@6.26.0, babel-code-frame@^6.26.0: +babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: From 9c64642d5b03d9eb57400e0903c06b621ad4970e Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 5 Dec 2018 02:04:08 +0100 Subject: [PATCH 23/84] chore: regenerate yarn-lock to fix vulnerabilities (#41) --- packages/typescript-estree/yarn.lock | 2780 +++++++++++++++++--------- 1 file changed, 1867 insertions(+), 913 deletions(-) diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 130bd0dee186..25ccc125d945 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -2,43 +2,39 @@ # yarn lockfile v1 -"@babel/code-frame@7.0.0", "@babel/code-frame@^7.0.0": +"@babel/code-frame@7.0.0", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.35": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== dependencies: "@babel/highlight" "^7.0.0" -"@babel/code-frame@^7.0.0-beta.35": - version "7.0.0-beta.56" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.56.tgz#09f76300673ac085d3b90e02aafa0ffc2c96846a" - dependencies: - "@babel/highlight" "7.0.0-beta.56" - "@babel/core@^7.0.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.0.tgz#08958f1371179f62df6966d8a614003d11faeb04" + version "7.1.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.6.tgz#3733cbee4317429bc87c62b29cf8587dba7baeb3" + integrity sha512-Hz6PJT6e44iUNpAn8AoyAs6B3bl60g7MJQaI0rZEar6ECzh6+srYO1xlIdssio34mPaUtAb1y+XlkkSJzok3yw== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.0.0" - "@babel/helpers" "^7.1.0" - "@babel/parser" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/generator" "^7.1.6" + "@babel/helpers" "^7.1.5" + "@babel/parser" "^7.1.6" + "@babel/template" "^7.1.2" + "@babel/traverse" "^7.1.6" + "@babel/types" "^7.1.6" convert-source-map "^1.1.0" - debug "^3.1.0" - json5 "^0.5.0" + debug "^4.1.0" + json5 "^2.1.0" lodash "^4.17.10" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0.tgz#1efd58bffa951dc846449e58ce3a1d7f02d393aa" +"@babel/generator@^7.1.6": + version "7.1.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.1.6.tgz#001303cf87a5b9d093494a4bf251d7b5d03d3999" + integrity sha512-brwPBtVvdYdGxtenbQgfCdDPmtkmUBZPjUoK5SXJEBuHaA5BCubh9ly65fzXz7R6o5rA76Rs22ES8Z+HCc0YIQ== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.1.6" jsesc "^2.5.1" lodash "^4.17.10" source-map "^0.5.0" @@ -47,12 +43,14 @@ "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" + integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== dependencies: "@babel/types" "^7.0.0" "@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" + integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== dependencies: "@babel/helper-explode-assignable-expression" "^7.1.0" "@babel/types" "^7.0.0" @@ -60,6 +58,7 @@ "@babel/helper-call-delegate@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz#6a957f105f37755e8645343d3038a22e1449cc4a" + integrity sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ== dependencies: "@babel/helper-hoist-variables" "^7.0.0" "@babel/traverse" "^7.1.0" @@ -68,6 +67,7 @@ "@babel/helper-define-map@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz#3b74caec329b3c80c116290887c0dd9ae468c20c" + integrity sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/types" "^7.0.0" @@ -76,6 +76,7 @@ "@babel/helper-explode-assignable-expression@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" + integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== dependencies: "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" @@ -83,6 +84,7 @@ "@babel/helper-function-name@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== dependencies: "@babel/helper-get-function-arity" "^7.0.0" "@babel/template" "^7.1.0" @@ -91,30 +93,35 @@ "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== dependencies: "@babel/types" "^7.0.0" "@babel/helper-hoist-variables@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz#46adc4c5e758645ae7a45deb92bab0918c23bb88" + integrity sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w== dependencies: "@babel/types" "^7.0.0" "@babel/helper-member-expression-to-functions@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" + integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== dependencies: "@babel/types" "^7.0.0" "@babel/helper-module-imports@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" + integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== dependencies: "@babel/types" "^7.0.0" "@babel/helper-module-transforms@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.1.0.tgz#470d4f9676d9fad50b324cdcce5fbabbc3da5787" + integrity sha512-0JZRd2yhawo79Rcm4w0LwSMILFmFXjugG3yqf+P/UsKsRS1mJCmMwwlHDlMg7Avr9LrvSpp4ZSULO9r8jpCzcw== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" @@ -126,22 +133,26 @@ "@babel/helper-optimise-call-expression@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" + integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== dependencies: "@babel/types" "^7.0.0" "@babel/helper-plugin-utils@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== "@babel/helper-regex@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0.tgz#2c1718923b57f9bbe64705ffe5640ac64d9bdb27" + integrity sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg== dependencies: lodash "^4.17.10" "@babel/helper-remap-async-to-generator@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" + integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-wrap-function" "^7.1.0" @@ -152,6 +163,7 @@ "@babel/helper-replace-supers@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.1.0.tgz#5fc31de522ec0ef0899dc9b3e7cf6a5dd655f362" + integrity sha512-BvcDWYZRWVuDeXTYZWxekQNO5D4kO55aArwZOTFXw6rlLQA8ZaDicJR1sO47h+HrnCiDFiww0fSPV0d713KBGQ== dependencies: "@babel/helper-member-expression-to-functions" "^7.0.0" "@babel/helper-optimise-call-expression" "^7.0.0" @@ -161,6 +173,7 @@ "@babel/helper-simple-access@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" + integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== dependencies: "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" @@ -168,53 +181,47 @@ "@babel/helper-split-export-declaration@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" + integrity sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag== dependencies: "@babel/types" "^7.0.0" "@babel/helper-wrap-function@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz#8cf54e9190706067f016af8f75cb3df829cc8c66" + integrity sha512-R6HU3dete+rwsdAfrOzTlE9Mcpk4RjU3aX3gi9grtmugQY0u79X7eogUvfXA5sI81Mfq1cn6AgxihfN33STjJA== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/template" "^7.1.0" "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helpers@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.1.0.tgz#429bf0f0020be56a4242883432084e3d70a8a141" +"@babel/helpers@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.1.5.tgz#68bfc1895d685f2b8f1995e788dbfe1f6ccb1996" + integrity sha512-2jkcdL02ywNBry1YNFAH/fViq4fXG0vdckHqeJk+75fpQ2OH+Az6076tX/M0835zA45E0Cqa6pV5Kiv9YOqjEg== dependencies: - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/highlight@7.0.0-beta.56": - version "7.0.0-beta.56" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.56.tgz#f8b0fc8c5c2de53bb2c12f9001ad3d99e573696d" - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" + "@babel/template" "^7.1.2" + "@babel/traverse" "^7.1.5" + "@babel/types" "^7.1.5" "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@7.1.6": +"@babel/parser@7.1.6", "@babel/parser@^7.1.2", "@babel/parser@^7.1.6": version "7.1.6" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.6.tgz#16e97aca1ec1062324a01c5a6a7d0df8dd189854" - -"@babel/parser@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.0.tgz#a7cd42cb3c12aec52e24375189a47b39759b783e" + integrity sha512-dWP6LJm9nKT6ALaa+bnL247GHHMWir3vSlZ2+IHgHgktZQx0L3Uvq2uAWcuzIe+fujRsYWBW2q622C5UvGK9iQ== "@babel/plugin-proposal-async-generator-functions@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.1.0.tgz#41c1a702e10081456e23a7b74d891922dd1bb6ce" + integrity sha512-Fq803F3Jcxo20MXUSDdmZZXrPe6BWyGcWBPPNB/M7WaUYESKDeKMOGIxEzQOjGSmW/NWb6UaPZrtTB2ekhB/ew== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-remap-async-to-generator" "^7.1.0" @@ -223,6 +230,7 @@ "@babel/plugin-proposal-json-strings@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.0.0.tgz#3b4d7b5cf51e1f2e70f52351d28d44fc2970d01e" + integrity sha512-kfVdUkIAGJIVmHmtS/40i/fg/AGnw/rsZBCaapY5yjeO5RA9m165Xbw9KMOu2nqXP5dTFjEjHdfNdoVcHv133Q== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-json-strings" "^7.0.0" @@ -230,6 +238,7 @@ "@babel/plugin-proposal-object-rest-spread@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0.tgz#9a17b547f64d0676b6c9cecd4edf74a82ab85e7e" + integrity sha512-14fhfoPcNu7itSen7Py1iGN0gEm87hX/B+8nZPqkdmANyyYWYMY2pjA3r8WXbWVKMzfnSNS0xY8GVS0IjXi/iw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.0.0" @@ -237,6 +246,7 @@ "@babel/plugin-proposal-optional-catch-binding@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0.tgz#b610d928fe551ff7117d42c8bb410eec312a6425" + integrity sha512-JPqAvLG1s13B/AuoBjdBYvn38RqW6n1TzrQO839/sIpqLpbnXKacsAgpZHzLD83Sm8SDXMkkrAvEnJ25+0yIpw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" @@ -244,6 +254,7 @@ "@babel/plugin-proposal-unicode-property-regex@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz#498b39cd72536cd7c4b26177d030226eba08cd33" + integrity sha512-tM3icA6GhC3ch2SkmSxv7J/hCWKISzwycub6eGsDrFDgukD4dZ/I+x81XgW0YslS6mzNuQ1Cbzh5osjIMgepPQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" @@ -252,36 +263,42 @@ "@babel/plugin-syntax-async-generators@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0.tgz#bf0891dcdbf59558359d0c626fdc9490e20bc13c" + integrity sha512-im7ged00ddGKAjcZgewXmp1vxSZQQywuQXe2B1A7kajjZmDeY/ekMPmWr9zJgveSaQH0k7BcGrojQhcK06l0zA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-json-strings@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.0.0.tgz#0d259a68090e15b383ce3710e01d5b23f3770cbd" + integrity sha512-UlSfNydC+XLj4bw7ijpldc1uZ/HB84vw+U6BTuqMdIEmz/LDe63w/GHtpQMdXWdqQZFeAI9PjnHe/vDhwirhKA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz#37d8fbcaf216bd658ea1aebbeb8b75e88ebc549b" + integrity sha512-5A0n4p6bIiVe5OvQPxBnesezsgFJdHhSs3uFSvaPdMqtsovajLZ+G2vZyvNe10EzJBWWo3AcHGKhAFUxqwp2dw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-optional-catch-binding@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0.tgz#886f72008b3a8b185977f7cb70713b45e51ee475" + integrity sha512-Wc+HVvwjcq5qBg1w5RG9o9RVzmCaAg/Vp0erHCKpAYV8La6I94o4GQAmFYNmkzoMO6gzoOSulpKeSSz6mPEoZw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-arrow-functions@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz#a6c14875848c68a3b4b3163a486535ef25c7e749" + integrity sha512-2EZDBl1WIO/q4DIkIp4s86sdp4ZifL51MoIviLY/gG/mLSuOIEg7J8o6mhbxOTvUJkaN50n+8u41FVsr5KLy/w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-async-to-generator@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.1.0.tgz#109e036496c51dd65857e16acab3bafdf3c57811" + integrity sha512-rNmcmoQ78IrvNCIt/R9U+cixUHeYAzgusTFgIAv+wQb9HJU4szhpDD6e5GCACmj/JP5KxuCwM96bX3L9v4ZN/g== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -290,12 +307,14 @@ "@babel/plugin-transform-block-scoped-functions@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0.tgz#482b3f75103927e37288b3b67b65f848e2aa0d07" + integrity sha512-AOBiyUp7vYTqz2Jibe1UaAWL0Hl9JUXEgjFvvvcSc9MVDItv46ViXFw2F7SVt1B5k+KWjl44eeXOAk3UDEaJjQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0.tgz#1745075edffd7cdaf69fab2fb6f9694424b7e9bc" +"@babel/plugin-transform-block-scoping@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.1.5.tgz#3e8e0bc9a5104519923302a24f748f72f2f61f37" + integrity sha512-jlYcDrz+5ayWC7mxgpn1Wj8zj0mmjCT2w0mPIMSwO926eXBRxpEgoN/uQVRBfjtr8ayjcmS+xk2G1jaP8JjMJQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.10" @@ -303,6 +322,7 @@ "@babel/plugin-transform-classes@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.1.0.tgz#ab3f8a564361800cbc8ab1ca6f21108038432249" + integrity sha512-rNaqoD+4OCBZjM7VaskladgqnZ1LO6o2UxuWSDzljzW21pN1KXkB7BstAVweZdxQkHAujps5QMNOTWesBciKFg== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-define-map" "^7.1.0" @@ -316,18 +336,21 @@ "@babel/plugin-transform-computed-properties@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0.tgz#2fbb8900cd3e8258f2a2ede909b90e7556185e31" + integrity sha512-ubouZdChNAv4AAWAgU7QKbB93NU5sHwInEWfp+/OzJKA02E6Woh9RVoX4sZrbRwtybky/d7baTUqwFx+HgbvMA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-destructuring@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0.tgz#68e911e1935dda2f06b6ccbbf184ffb024e9d43a" + version "7.1.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.1.3.tgz#e69ff50ca01fac6cb72863c544e516c2b193012f" + integrity sha512-Mb9M4DGIOspH1ExHOUnn2UUXFOyVTiX84fXCd+6B5iWrQg/QMeeRmSwpZ9lnjYLSXtZwiw80ytVMr3zue0ucYw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-dotall-regex@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0.tgz#73a24da69bc3c370251f43a3d048198546115e58" + integrity sha512-00THs8eJxOJUFVx1w8i1MBF4XH4PsAjKjQ1eqN/uCH3YKwP21GCKfrn6YZFZswbOk9+0cw1zGQPHVc1KBlSxig== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" @@ -336,12 +359,14 @@ "@babel/plugin-transform-duplicate-keys@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0.tgz#a0601e580991e7cace080e4cf919cfd58da74e86" + integrity sha512-w2vfPkMqRkdxx+C71ATLJG30PpwtTpW7DDdLqYt2acXU7YjztzeWW2Jk1T6hKqCLYCcEA5UQM/+xTAm+QCSnuQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-exponentiation-operator@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.1.0.tgz#9c34c2ee7fd77e02779cfa37e403a2e1003ccc73" + integrity sha512-uZt9kD1Pp/JubkukOGQml9tqAeI8NkE98oZnHZ2qHRElmeKCodbTZgOEUtujSCSLhHSBWbzNiFSDIMC4/RBTLQ== dependencies: "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -349,12 +374,14 @@ "@babel/plugin-transform-for-of@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz#f2ba4eadb83bd17dc3c7e9b30f4707365e1c3e39" + integrity sha512-TlxKecN20X2tt2UEr2LNE6aqA0oPeMT1Y3cgz8k4Dn1j5ObT8M3nl9aA37LLklx0PBZKETC9ZAf9n/6SujTuXA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-function-name@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.1.0.tgz#29c5550d5c46208e7f730516d41eeddd4affadbb" + integrity sha512-VxOa1TMlFMtqPW2IDYZQaHsFrq/dDoIjgN098NowhexhZcz3UGlvPgZXuE1jEvNygyWyxRacqDpCZt+par1FNg== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -362,12 +389,14 @@ "@babel/plugin-transform-literals@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0.tgz#2aec1d29cdd24c407359c930cdd89e914ee8ff86" + integrity sha512-1NTDBWkeNXgpUcyoVFxbr9hS57EpZYXpje92zv0SUzjdu3enaRwF/l3cmyRnXLtIdyJASyiS6PtybK+CgKf7jA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-modules-amd@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.1.0.tgz#f9e0a7072c12e296079b5a59f408ff5b97bf86a8" + integrity sha512-wt8P+xQ85rrnGNr2x1iV3DW32W8zrB6ctuBkYBbf5/ZzJY99Ob4MFgsZDFgczNU76iy9PWsy4EuxOliDjdKw6A== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -375,14 +404,16 @@ "@babel/plugin-transform-modules-commonjs@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.1.0.tgz#0a9d86451cbbfb29bd15186306897c67f6f9a05c" + integrity sha512-wtNwtMjn1XGwM0AXPspQgvmE6msSJP15CX2RVfpTSTNPLhKhaOjaIfBaVfj4iUZ/VrFSodcFedwtPg/NxwQlPA== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" "@babel/plugin-transform-modules-systemjs@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0.tgz#8873d876d4fee23209decc4d1feab8f198cf2df4" + version "7.1.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.1.3.tgz#2119a3e3db612fd74a19d88652efbfe9613a5db0" + integrity sha512-PvTxgjxQAq4pvVUZF3mD5gEtVDuId8NtWkJsZLEJZMZAW3TvgQl1pmydLLN1bM8huHFVVU43lf0uvjQj9FRkKw== dependencies: "@babel/helper-hoist-variables" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -390,6 +421,7 @@ "@babel/plugin-transform-modules-umd@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.1.0.tgz#a29a7d85d6f28c3561c33964442257cc6a21f2a8" + integrity sha512-enrRtn5TfRhMmbRwm7F8qOj0qEYByqUvTttPEGimcBH4CJHphjyK1Vg7sdU7JjeEmgSpM890IT/efS2nMHwYig== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -397,12 +429,14 @@ "@babel/plugin-transform-new-target@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz#ae8fbd89517fa7892d20e6564e641e8770c3aa4a" + integrity sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-object-super@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.1.0.tgz#b1ae194a054b826d8d4ba7ca91486d4ada0f91bb" + integrity sha512-/O02Je1CRTSk2SSJaq0xjwQ8hG4zhZGNjE8psTsSNPXyLRCODv7/PBozqT5AmQMzp7MI3ndvMhGdqp9c96tTEw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-replace-supers" "^7.1.0" @@ -410,6 +444,7 @@ "@babel/plugin-transform-parameters@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.1.0.tgz#44f492f9d618c9124026e62301c296bf606a7aed" + integrity sha512-vHV7oxkEJ8IHxTfRr3hNGzV446GAb+0hgbA7o/0Jd76s+YzccdWuTU296FOCOl/xweU4t/Ya4g41yWz80RFCRw== dependencies: "@babel/helper-call-delegate" "^7.1.0" "@babel/helper-get-function-arity" "^7.0.0" @@ -418,24 +453,28 @@ "@babel/plugin-transform-regenerator@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz#5b41686b4ed40bef874d7ed6a84bdd849c13e0c1" + integrity sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw== dependencies: regenerator-transform "^0.13.3" "@babel/plugin-transform-shorthand-properties@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0.tgz#85f8af592dcc07647541a0350e8c95c7bf419d15" + integrity sha512-g/99LI4vm5iOf5r1Gdxq5Xmu91zvjhEG5+yZDJW268AZELAu4J1EiFLnkSG3yuUsZyOipVOVUKoGPYwfsTymhw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-spread@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0.tgz#93583ce48dd8c85e53f3a46056c856e4af30b49b" + integrity sha512-L702YFy2EvirrR4shTj0g2xQp7aNwZoWNCkNu2mcoU0uyzMl0XRwDSwzB/xp6DSUFiBmEXuyAyEN16LsgVqGGQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-sticky-regex@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0.tgz#30a9d64ac2ab46eec087b8530535becd90e73366" + integrity sha512-LFUToxiyS/WD+XEWpkx/XJBrUXKewSZpzX68s+yEOtIbdnsRjpryDw9U06gYc6klYEij/+KQVRnD3nz3AoKmjw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" @@ -443,6 +482,7 @@ "@babel/plugin-transform-template-literals@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0.tgz#084f1952efe5b153ddae69eb8945f882c7a97c65" + integrity sha512-vA6rkTCabRZu7Nbl9DfLZE1imj4tzdWcg5vtdQGvj+OH9itNNB6hxuRMHuIY8SGnEt1T9g5foqs9LnrHzsqEFg== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -450,12 +490,14 @@ "@babel/plugin-transform-typeof-symbol@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0.tgz#4dcf1e52e943e5267b7313bff347fdbe0f81cec9" + integrity sha512-1r1X5DO78WnaAIvs5uC48t41LLckxsYklJrZjNKcevyz83sF2l4RHbw29qrCPr/6ksFsdfRpT/ZgxNWHXRnffg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-unicode-regex@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz#c6780e5b1863a76fe792d90eded9fcd5b51d68fc" + integrity sha512-uJBrJhBOEa3D033P95nPHu3nbFwFE9ZgXsfEitzoIXIwqAZWk7uXcg06yFKXz9FSxBH5ucgU/cYdX0IV8ldHKw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" @@ -464,13 +506,15 @@ "@babel/polyfill@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.0.0.tgz#c8ff65c9ec3be6a1ba10113ebd40e8750fb90bff" + integrity sha512-dnrMRkyyr74CRelJwvgnnSUDh2ge2NCTyHVwpOdvRMHtJUyxLtMAfhBN3s64pY41zdw0kgiLPh6S20eb1NcX6Q== dependencies: core-js "^2.5.7" regenerator-runtime "^0.11.1" "@babel/preset-env@^7.0.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.0.tgz#e67ea5b0441cfeab1d6f41e9b5c79798800e8d11" + version "7.1.6" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.6.tgz#a0bf4b96b6bfcf6e000afc5b72b4abe7cc13ae97" + integrity sha512-YIBfpJNQMBkb6MCkjz/A9J76SNCSuGVamOVBgoUkLzpJD/z8ghHi9I42LQ4pulVX68N/MmImz6ZTixt7Azgexw== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -485,7 +529,7 @@ "@babel/plugin-transform-arrow-functions" "^7.0.0" "@babel/plugin-transform-async-to-generator" "^7.1.0" "@babel/plugin-transform-block-scoped-functions" "^7.0.0" - "@babel/plugin-transform-block-scoping" "^7.0.0" + "@babel/plugin-transform-block-scoping" "^7.1.5" "@babel/plugin-transform-classes" "^7.1.0" "@babel/plugin-transform-computed-properties" "^7.0.0" "@babel/plugin-transform-destructuring" "^7.0.0" @@ -517,6 +561,7 @@ "@babel/register@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0.tgz#fa634bae1bfa429f60615b754fc1f1d745edd827" + integrity sha512-f/+CRmaCe7rVEvcvPvxeA8j5aJhHC3aJie7YuqcMDhUOuyWLA7J/aNrTaHIzoWPEhpHA54mec4Mm8fv8KBlv3g== dependencies: core-js "^2.5.7" find-cache-dir "^1.0.0" @@ -526,43 +571,47 @@ pirates "^4.0.0" source-map-support "^0.5.9" -"@babel/template@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.0.tgz#58cc9572e1bfe24fe1537fdf99d839d53e517e22" +"@babel/template@^7.1.0", "@babel/template@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.2.tgz#090484a574fef5a2d2d7726a674eceda5c5b5644" + integrity sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.1.2" + "@babel/types" "^7.1.2" -"@babel/traverse@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.0.tgz#503ec6669387efd182c3888c4eec07bcc45d91b2" +"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.1.6": + version "7.1.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.6.tgz#c8db9963ab4ce5b894222435482bd8ea854b7b5c" + integrity sha512-CXedit6GpISz3sC2k2FsGCUpOhUqKdyL0lqNrImQojagnUMXf8hex4AxYFRuMkNGcvJX5QAFGzB5WJQmSv8SiQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.0.0" + "@babel/generator" "^7.1.6" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - debug "^3.1.0" + "@babel/parser" "^7.1.6" + "@babel/types" "^7.1.6" + debug "^4.1.0" globals "^11.1.0" lodash "^4.17.10" -"@babel/types@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0.tgz#6e191793d3c854d19c6749989e3bc55f0e962118" +"@babel/types@^7.0.0", "@babel/types@^7.1.2", "@babel/types@^7.1.5", "@babel/types@^7.1.6": + version "7.1.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.1.6.tgz#0adb330c3a281348a190263aceb540e10f04bcce" + integrity sha512-DMiUzlY9DSjVsOylJssxLHSgj6tWM9PRFJOGW/RaOglVOK9nzTxoOMfTfRQXGUCUQ/HmlG2efwC+XqUEJ5ay4w== dependencies: esutils "^2.0.2" lodash "^4.17.10" to-fast-properties "^2.0.0" -"@commitlint/cli@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-7.1.2.tgz#9ad1b4703679e18e3b1972c4abf0441255219e78" +"@commitlint/cli@^7.1.2", "@commitlint/cli@^7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-7.2.1.tgz#dbb9eeb1f5015a129bb0801fbc1115eb1dcd513b" + integrity sha512-PUHWGoQOx8m6ZSpZPSHb+YISFAvW7jiWvCJOQiViKHZC8CLKu4bjyc/AwP8gBte0RsTGAu1ekiitp5Q0NcLGcA== dependencies: - "@commitlint/format" "^7.1.2" - "@commitlint/lint" "^7.1.2" - "@commitlint/load" "^7.1.2" + "@commitlint/format" "^7.2.1" + "@commitlint/lint" "^7.2.1" + "@commitlint/load" "^7.2.1" "@commitlint/read" "^7.1.2" babel-polyfill "6.26.0" chalk "2.3.1" @@ -570,14 +619,18 @@ lodash.merge "4.6.1" lodash.pick "4.4.0" meow "5.0.0" + resolve-from "^4.0.0" + resolve-global "^0.1.0" "@commitlint/config-conventional@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-7.1.2.tgz#5b5e45924c9abd8f9a8d83eb1f66e24e5f66916f" + integrity sha512-DmA4ixkpv03qA1TVs1Bl25QsVym2bPL6pKapesALWIVggG3OpwqGZ55vN75Tx8xZoG7LFKrVyrt7kwhA7X8njQ== -"@commitlint/ensure@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-7.1.2.tgz#30d74bf0062ac6d917037f20dbf27bb63a4ae7c1" +"@commitlint/ensure@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-7.2.0.tgz#03cfab7135f57f62b73698f441a516886a84a1f6" + integrity sha512-j2AJE4eDeLP6O/Z1CdPwEXAzcrRRoeeHLuvW8bldQ4J2nHiX9hzmSe87H87Ob8Avm+zIegsqVPGaBAtRmbODYw== dependencies: lodash.camelcase "4.3.0" lodash.kebabcase "4.1.1" @@ -588,35 +641,40 @@ "@commitlint/execute-rule@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-7.1.2.tgz#b504e800c5f7c0fbfa24a261b04c549aa2726254" + integrity sha512-EP/SqX2U2L4AQHglZ2vGM1pvHJOh3sbYtHn1QhtllqEpsdmhuNpVPSGHP/r9OD2h4i90vtnWgZQoskt2MkbknA== dependencies: babel-runtime "6.26.0" -"@commitlint/format@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-7.1.2.tgz#0f601d572d97d7cca59ef6f3da0cde0d10de3de2" +"@commitlint/format@^7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-7.2.1.tgz#7d8b25002792d6481f0f8f9614736e43106749c1" + integrity sha512-1YcL+ZWB8V52oDFQBhSBJjiJOZDt4Vl06O5TkG70BMpre3EQru5KYIN16eEPqfihNw0bj8gSIWcf87Gvh3OrOw== dependencies: babel-runtime "^6.23.0" chalk "^2.0.1" -"@commitlint/is-ignored@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-7.1.2.tgz#1168ef48883e86446dd2930f23300ec0e038dddc" +"@commitlint/is-ignored@^7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-7.2.1.tgz#624b3703ca88a4b6573176439b1126b7eb3708d4" + integrity sha512-3DsEEKRnj8Bv9qImsxWcGf9BwerDnk5Vs+oK6ELzIwkndHaAZLHyATjmaz/rsc+U+DWiVjgKrrw3xvd/UsoazA== dependencies: - semver "5.5.0" + semver "5.6.0" -"@commitlint/lint@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-7.1.2.tgz#7166a9ba71e75c2f981f531a2386739ef28b21a3" +"@commitlint/lint@^7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-7.2.1.tgz#4511a9acada6870042ca3244417b401ad1043d46" + integrity sha512-rM7nUyNUJyuKw1MTwJG/wk4twB5YCAG2wzJMn5NqVpGD/qmLOzlZoBl0+CYmuOsbIRAA2rlEV6KZHBk9tTfAdQ== dependencies: - "@commitlint/is-ignored" "^7.1.2" + "@commitlint/is-ignored" "^7.2.1" "@commitlint/parse" "^7.1.2" - "@commitlint/rules" "^7.1.2" + "@commitlint/rules" "^7.2.0" babel-runtime "^6.23.0" lodash.topairs "4.3.0" -"@commitlint/load@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-7.1.2.tgz#91fc756f63477d19299cd1ed79be2d36aaa8c33d" +"@commitlint/load@^7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-7.2.1.tgz#f1a49cb2ecf53e235e4f3523f75a553f5b481f5c" + integrity sha512-FnfmfhPGJqGwILVRznduBejOicNey6p/byfcyxtcBkN2+X96gDuNtqcnGcngCrzPIAgaIrQQcTQDA1/KMtW21A== dependencies: "@commitlint/execute-rule" "^7.1.2" "@commitlint/resolve-extends" "^7.1.2" @@ -631,10 +689,12 @@ "@commitlint/message@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-7.1.2.tgz#b8e7ed3914896f8490b5897c4f6b8923105b55fd" + integrity sha512-6FQeK5LAs1Bde6W/jULg+I/XZhj3gbqCWlS2Q11A2JbaTRpRJZzm7WdD9nK3I0+De41EOqW2t4mBnrpio3o1Zg== "@commitlint/parse@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-7.1.2.tgz#d63b246cebd5a2cf326b0356421f9ec5f227a2d4" + integrity sha512-wrdLwJZL3cs89MfgPtnbbKByijUo3Wrug55aTke5k/F0XNxGaDaNJyH4QXgidgXk57r2t4NJVAKwjnY4wjfNwg== dependencies: conventional-changelog-angular "^1.3.3" conventional-commits-parser "^2.1.0" @@ -642,6 +702,7 @@ "@commitlint/read@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-7.1.2.tgz#6a1fcb192e54e311eee280e5070627981d8d7bf3" + integrity sha512-sarYQgfTay2Eu7onHz53EYyRw7pI5QmLE7tP5Ri9op6eu4LadjSoA/4dfc+VE7avsq21J2ewSbz+9f0uvhDxgg== dependencies: "@commitlint/top-level" "^7.1.2" "@marionebl/sander" "^0.6.0" @@ -651,6 +712,7 @@ "@commitlint/resolve-extends@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-7.1.2.tgz#886f589f1c2ce87c42f2786696b68fac7e356978" + integrity sha512-zwbifMB9DeHP4sYQdrkx+XJh5Q1lyP/OdlErUCC34NV4Lkxw/XxXF4St3e+y1X28/SgrEc2XSOS6n/vQQfUlLA== dependencies: babel-runtime "6.26.0" lodash.merge "4.6.1" @@ -659,11 +721,12 @@ resolve-from "^4.0.0" resolve-global "^0.1.0" -"@commitlint/rules@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-7.1.2.tgz#ba241dc3dbb6c05ce4a186a7cdf85c170345778c" +"@commitlint/rules@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-7.2.0.tgz#44ab5dadead1668f6a2790fbdfe70e456346866c" + integrity sha512-c15Q9H5iYE9fnncLnFnMuvPLYA/i0pve5moV0uxJJGr4GgJoBKyldd4CCDhoE80C1k8ABuqr2o2qsopzVEp3Ww== dependencies: - "@commitlint/ensure" "^7.1.2" + "@commitlint/ensure" "^7.2.0" "@commitlint/message" "^7.1.2" "@commitlint/to-lines" "^7.1.2" babel-runtime "^6.23.0" @@ -671,24 +734,28 @@ "@commitlint/to-lines@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-7.1.2.tgz#2277347e50eac2a8d38ab6ab2c70f01b84c5f115" + integrity sha512-Nz3qZwrIEYiN9v/ThJqXAwu4X5+hvT9H8yRPHfjc538R8WhwEfhvym7/4YznDHSvWrQgwqtNPdrb6b2OSBsHmg== "@commitlint/top-level@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-7.1.2.tgz#58f78043546bce0c1bfba36291bc4a812b6426b3" + integrity sha512-YKugOAKy3hgM/ITezPp7Ns51U3xoJfuOsVnMGW4oDcHLhuQ/Qd58ROv/Hgedtk8HugKX3DdZ8XoEnRG70RDGqQ== dependencies: find-up "^2.1.0" "@commitlint/travis-cli@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-7.1.2.tgz#7de0ed9cc420e0f231119e3ba8fcf73fb7d2a7e9" + version "7.2.1" + resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-7.2.1.tgz#ce637a2c6adc1d9eb6f22369d58429fa332e7b1b" + integrity sha512-ePNYSDCALqMq9lu8QqR6Lcn46Llhj7S8PN3YqbSKw5vE3f8ZYAmi5wEfZrxfvPcek3qVFW9b4XsZ0QidRdUpQQ== dependencies: - "@commitlint/cli" "^7.1.2" + "@commitlint/cli" "^7.2.1" babel-runtime "6.26.0" execa "0.9.0" "@marionebl/sander@^0.6.0": version "0.6.1" resolved "https://registry.yarnpkg.com/@marionebl/sander/-/sander-0.6.1.tgz#1958965874f24bc51be48875feb50d642fc41f7b" + integrity sha1-GViWWHTyS8Ub5Ih1/rUNZC/EH3s= dependencies: graceful-fs "^4.1.3" mkdirp "^0.5.1" @@ -697,37 +764,63 @@ "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== dependencies: call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@nodelib/fs.stat@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz#54c5a964462be3d4d78af631363c18d6fa91ac26" +"@nodelib/fs.stat@^1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" + integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== -"@octokit/rest@^15.2.0": - version "15.12.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-15.12.0.tgz#458efa0466ce3b257726bffff869a06da026e954" +"@octokit/endpoint@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-3.1.0.tgz#ec60152d018d75d4eed5d8a5fd68c9a1e99f3b50" + integrity sha512-ANAOhyEY40qzOjQPEYXqg3GDGLYTjLDjqQqcG1wgqRoE7qFLnvx5a0upzxpes83UK/YHUu6qTymZl/yTu4GvKg== + dependencies: + deepmerge "2.2.1" + is-plain-object "^2.0.4" + universal-user-agent "^2.0.1" + url-template "^2.0.8" + +"@octokit/request@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-2.2.0.tgz#f4b2d1ad7c4c8a0b148193610c912046961f8be5" + integrity sha512-4P9EbwKZ4xfyupVMb3KVuHmM+aO2fye3nufjGKz/qDssvdJj9Rlx44O0FdFvUp4kIzToy3AHLTOulEIDAL+dpg== + dependencies: + "@octokit/endpoint" "^3.0.0" + is-plain-object "^2.0.4" + node-fetch "^2.3.0" + universal-user-agent "^2.0.1" + +"@octokit/rest@^16.0.1": + version "16.1.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.1.0.tgz#43bee0f58821b6c6a4c9d63e14919a1fb67a71b5" + integrity sha512-/D1XokSycOE+prxxI2r9cxssiLMqcr+BsEUjdruC67puEEjNJjJoRIkuA1b20jOkX5Ue3Rz99Mu9rTnNmjetUA== dependencies: - before-after-hook "^1.1.0" + "@octokit/request" "2.2.0" + before-after-hook "^1.2.0" btoa-lite "^1.0.0" - debug "^3.1.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.0" - lodash "^4.17.4" - node-fetch "^2.1.1" + lodash.get "^4.4.2" + lodash.pick "^4.4.0" + lodash.set "^4.3.2" + lodash.uniq "^4.5.0" + octokit-pagination-methods "^1.1.0" universal-user-agent "^2.0.0" url-template "^2.0.8" "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" + integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== dependencies: any-observable "^0.3.0" -"@semantic-release/commit-analyzer@^6.0.0": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@semantic-release/commit-analyzer/-/commit-analyzer-6.0.1.tgz#5acd015130d60e279b6ed2de56b8e0d06169cd3f" +"@semantic-release/commit-analyzer@^6.1.0": + version "6.1.0" + resolved "https://registry.yarnpkg.com/@semantic-release/commit-analyzer/-/commit-analyzer-6.1.0.tgz#32bbe3c23da86e23edf072fbb276fa2f383fcb17" + integrity sha512-2lb+t6muGenI86mYGpZYOgITx9L3oZYF697tJoqXeQEk0uw0fm+OkkOuDTBA3Oax9ftoNIrCKv9bwgYvxrbM6w== dependencies: conventional-changelog-angular "^5.0.0" conventional-commits-filter "^2.0.0" @@ -739,12 +832,14 @@ "@semantic-release/error@^2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-2.2.0.tgz#ee9d5a09c9969eade1ec864776aeda5c5cddbbf0" + integrity sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg== -"@semantic-release/github@^5.0.0": - version "5.0.5" - resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-5.0.5.tgz#9149b4fd9232f63ee38039c540a800a00a4d9e55" +"@semantic-release/github@^5.1.0": + version "5.2.5" + resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-5.2.5.tgz#14e53d99f1e84c76b5674b7506f235a7a4cae302" + integrity sha512-myO00q84CyfyzaEZ4OdA7GOMCQKd+juZd5g2Cloh4jV6CyiMyWflZ629RH99wjAVUiwMKnvX2SQ5XPFvO1+FCw== dependencies: - "@octokit/rest" "^15.2.0" + "@octokit/rest" "^16.0.1" "@semantic-release/error" "^2.2.0" aggregate-error "^1.0.0" bottleneck "^2.0.1" @@ -762,28 +857,27 @@ parse-github-url "^1.0.1" url-join "^4.0.0" -"@semantic-release/npm@^5.0.1": - version "5.0.4" - resolved "https://registry.yarnpkg.com/@semantic-release/npm/-/npm-5.0.4.tgz#bef4ff31c9a70cc6db7583e08d2d29741b32d2f8" +"@semantic-release/npm@^5.0.5": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@semantic-release/npm/-/npm-5.1.1.tgz#f05d50ad174b7b90d71367799780e6dedb7797d8" + integrity sha512-5OnV0od1HKp2QjToXxQufvHNG8n+IQlp7h3FjqmZYH7DAHzAGx4NCf/R4p3RhyX5YJEfQl4ZflX9219JVNsuJg== dependencies: "@semantic-release/error" "^2.2.0" aggregate-error "^1.0.0" - detect-indent "^5.0.0" - detect-newline "^2.1.0" execa "^1.0.0" fs-extra "^7.0.0" lodash "^4.17.4" nerf-dart "^1.0.0" - normalize-url "^3.0.0" + normalize-url "^4.0.0" npm "^6.3.0" - parse-json "^4.0.0" rc "^1.2.8" read-pkg "^4.0.0" registry-auth-token "^3.3.1" -"@semantic-release/release-notes-generator@^7.0.0": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@semantic-release/release-notes-generator/-/release-notes-generator-7.0.2.tgz#67f15c53c4f8e68106a74f0364bfb1326ade3e63" +"@semantic-release/release-notes-generator@^7.1.2": + version "7.1.4" + resolved "https://registry.yarnpkg.com/@semantic-release/release-notes-generator/-/release-notes-generator-7.1.4.tgz#8f4f752c5a8385abdaac1256127cef05988bc2ad" + integrity sha512-pWPouZujddgb6t61t9iA9G3yIfp3TeQ7bPbV1ixYSeP6L7gI1+Du82fY/OHfEwyifpymLUQW0XnIKgKct5IMMw== dependencies: conventional-changelog-angular "^5.0.0" conventional-changelog-writer "^4.0.0" @@ -791,223 +885,246 @@ conventional-commits-parser "^3.0.0" debug "^4.0.0" get-stream "^4.0.0" - git-url-parse "^10.0.1" import-from "^2.1.0" - into-stream "^3.1.0" + into-stream "^4.0.0" lodash "^4.17.4" -"@sindresorhus/is@^0.11.0": - version "0.11.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.11.0.tgz#a65970040a5b55c4713452666703b92a6c331fdb" +"@sindresorhus/is@^0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.12.0.tgz#55c37409c809e802efea25911a579731adfc6e07" + integrity sha512-9ve22cGrAKlSRvi8Vb2JIjzcaaQg79531yQHnF+hi/kOpsSj3Om8AyR1wcHrgl0u7U3vYQ7gmF5erZzOp4+51Q== dependencies: symbol-observable "^1.2.0" "@szmarczak/http-timer@^1.1.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.1.tgz#6402258dfe467532b26649ef076b4d11f74fb612" + integrity sha512-WljfOGkmSJe8SUkl+4TPvN2ec0dpUGVyfTBQLoXJUiILs+wBSc4Kvp2N3aAWE4VwwDSLGdmD3/bufS5BgZpVSQ== dependencies: defer-to-connect "^1.0.1" "@types/babel-code-frame@^6.20.1": version "6.20.1" resolved "https://registry.yarnpkg.com/@types/babel-code-frame/-/babel-code-frame-6.20.1.tgz#e79a40ea81435034df7b46b5e32e8ed638aea4dd" + integrity sha1-55pA6oFDUDTfe0a14y6O1jiupN0= "@types/events@*": version "1.2.0" - resolved "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" + resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" + integrity sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA== "@types/glob@*": version "7.1.1" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== dependencies: "@types/events" "*" "@types/minimatch" "*" "@types/node" "*" "@types/jest@^23.3.9": - version "23.3.9" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.9.tgz#c16b55186ee73ae65e001fbee69d392c51337ad1" + version "23.3.10" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.10.tgz#4897974cc317bf99d4fe6af1efa15957fa9c94de" + integrity sha512-DC8xTuW/6TYgvEg3HEXS7cu9OijFqprVDXXiOcdOKZCU/5PJNLZU37VVvmZHdtMiGOa8wAA/We+JzbdxFzQTRQ== "@types/lodash.isplainobject@^4.0.4": version "4.0.4" resolved "https://registry.yarnpkg.com/@types/lodash.isplainobject/-/lodash.isplainobject-4.0.4.tgz#ac28008a145ea19ac9f6dc46045aa92e11a09322" + integrity sha512-FSXjsYFgJQA42YudKpfSbp9WfKcOdC6xJ62tdFFQJqj2XMvqj+9qLEXBeKZzD55LzngXD/DyQbU2gDMNqMASGw== dependencies: "@types/lodash" "*" "@types/lodash.unescape@^4.0.4": version "4.0.4" resolved "https://registry.yarnpkg.com/@types/lodash.unescape/-/lodash.unescape-4.0.4.tgz#b8eec58cdd642d3a52adc13fbdee1ef0e878a132" + integrity sha512-nLcg2100hVhVubEyFXui5xoSLBS9q9u3Khn03rTTtTV7Q5ABVZOIpF9F3O6vynGNS/dky5vRks6WhrfcvKfedw== dependencies: "@types/lodash" "*" "@types/lodash@*": - version "4.14.117" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.117.tgz#695a7f514182771a1e0f4345d189052ee33c8778" + version "4.14.118" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.118.tgz#247bab39bfcc6d910d4927c6e06cbc70ec376f27" + integrity sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw== "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*": - version "10.12.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.2.tgz#d77f9faa027cadad9c912cd47f4f8b07b0fb0864" - -"@types/node@^10.12.2": - version "10.12.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.10.tgz#4fa76e6598b7de3f0cb6ec3abacc4f59e5b3a2ce" +"@types/node@*", "@types/node@^10.12.2": + version "10.12.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.11.tgz#715c476c99a5f6898a1ae61caf9825e43c03912e" + integrity sha512-3iIOhNiPGTdcUNVCv9e5G7GotfvJJe2pc9w2UgDXlUwnxSZ3RgcUocIU+xYm+rTU54jIKih998QE4dMOyMN1NQ== "@types/semver@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" + integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== "@types/shelljs@^0.8.0": version "0.8.0" resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.0.tgz#0caa56b68baae4f68f44e0dd666ab30b098e3632" + integrity sha512-vs1hCC8RxLHRu2bwumNyYRNrU3o8BtZhLysH5A4I98iYmA2APl6R3uNQb5ihl+WiwH0xdC9LLO+vRrXLs/Kyxg== dependencies: "@types/glob" "*" "@types/node" "*" JSONStream@^1.0.4, JSONStream@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.4.tgz#615bb2adb0cd34c8f4c447b5f6512fa1d8f16a2e" + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== dependencies: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" - abab@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== abbrev@1, abbrev@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== acorn-globals@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + version "4.3.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103" + integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw== dependencies: - acorn "^5.0.0" + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== -acorn@^5.0.0, acorn@^5.5.3: - version "5.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1: + version "6.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754" + integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg== agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== dependencies: es6-promisify "^5.0.0" agentkeepalive@^3.4.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.1.tgz#4eba75cf2ad258fc09efd506cdb8d8c2971d35a4" + version "3.5.2" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.2.tgz#a113924dd3fa24a0bc3b78108c450c2abee00f67" + integrity sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ== dependencies: humanize-ms "^1.2.1" aggregate-error@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-1.0.0.tgz#888344dad0220a72e3af50906117f48771925fac" + integrity sha1-iINE2tAiCnLjr1CQYRf0h3GSX6w= dependencies: clean-stack "^1.0.0" indent-string "^3.0.0" -ajv@^5.1.0, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" +ajv@^6.5.5: + version "6.6.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.1.tgz#6360f5ed0d80f232cc2b294c362d5dc2e538dd61" + integrity sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww== dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" + fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" ansi-align@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= dependencies: string-width "^2.0.0" -ansi-escapes@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - ansi-escapes@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansicolors@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" + integrity sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk= ansistyles@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/ansistyles/-/ansistyles-0.1.3.tgz#5de60415bda071bb37127854c864f41b23254539" + integrity sha1-XeYEFb2gcbs3EnhUyGT0GyMlRTk= any-observable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" + integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: micromatch "^3.1.4" normalize-path "^2.1.1" -append-transform@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + integrity sha1-126/jKlNJ24keja61EpLdKthGZE= dependencies: - default-require-extensions "^2.0.0" + default-require-extensions "^1.0.0" aproba@^1.0.3, aproba@^1.1.1, aproba@^1.1.2, aproba@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== "aproba@^1.1.2 || 2": version "2.0.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== archy@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= are-we-there-yet@~1.1.2: version "1.1.5" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" @@ -1015,120 +1132,147 @@ are-we-there-yet@~1.1.2: argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" argv-formatter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/argv-formatter/-/argv-formatter-1.0.0.tgz#a0ca0cbc29a5b73e836eebe1cbf6c5e0e4eb82f9" + integrity sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk= arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= dependencies: arr-flatten "^1.0.1" arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" -array-uniq@^1.0.0, array-uniq@^1.0.1: +array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= + +array-uniq@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-2.0.0.tgz#0009e30306e37a6dd2e2e2480db5316fdade1583" + integrity sha512-O3QZEr+3wDj7otzF7PjNGs6CA3qmYMLvt5xGkjY/V0VxS+ovvqVo/5wKM/OVOAyuX4DTh9H31zE/yKtO66hTkg== array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= asap@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== dependencies: safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - -async@^1.4.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== async@^2.1.4, async@^2.5.0: version "2.6.1" resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== dependencies: lodash "^4.17.10" asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= -aws4@^1.6.0, aws4@^1.8.0: +aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= dependencies: chalk "^1.1.3" esutils "^2.0.2" @@ -1137,6 +1281,7 @@ babel-code-frame@^6.26.0: babel-core@^6.0.0, babel-core@^6.26.0: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== dependencies: babel-code-frame "^6.26.0" babel-generator "^6.26.0" @@ -1161,6 +1306,7 @@ babel-core@^6.0.0, babel-core@^6.26.0: babel-generator@^6.18.0, babel-generator@^6.26.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== dependencies: babel-messages "^6.23.0" babel-runtime "^6.26.0" @@ -1174,13 +1320,15 @@ babel-generator@^6.18.0, babel-generator@^6.26.0: babel-helpers@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.4.2.tgz#f276de67798a5d68f2d6e87ff518c2f6e1609877" +babel-jest@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.6.0.tgz#a644232366557a2240a0c083da6b25786185a2f1" + integrity sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew== dependencies: babel-plugin-istanbul "^4.1.6" babel-preset-jest "^23.2.0" @@ -1188,12 +1336,14 @@ babel-jest@^23.4.2: babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= dependencies: babel-runtime "^6.22.0" babel-plugin-istanbul@^4.1.6: version "4.1.6" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + integrity sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ== dependencies: babel-plugin-syntax-object-rest-spread "^6.13.0" find-up "^2.1.0" @@ -1203,14 +1353,17 @@ babel-plugin-istanbul@^4.1.6: babel-plugin-jest-hoist@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" + integrity sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc= babel-plugin-syntax-object-rest-spread@^6.13.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= babel-polyfill@6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= dependencies: babel-runtime "^6.26.0" core-js "^2.5.0" @@ -1219,6 +1372,7 @@ babel-polyfill@6.26.0: babel-preset-jest@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" + integrity sha1-jsegOhOPABoaj7HoETZSvxpV2kY= dependencies: babel-plugin-jest-hoist "^23.2.0" babel-plugin-syntax-object-rest-spread "^6.13.0" @@ -1226,6 +1380,7 @@ babel-preset-jest@^23.2.0: babel-register@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= dependencies: babel-core "^6.26.0" babel-runtime "^6.26.0" @@ -1238,6 +1393,7 @@ babel-register@^6.26.0: babel-runtime@6.26.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" @@ -1245,6 +1401,7 @@ babel-runtime@6.26.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0, babel-runtim babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= dependencies: babel-runtime "^6.26.0" babel-traverse "^6.26.0" @@ -1255,6 +1412,7 @@ babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= dependencies: babel-code-frame "^6.26.0" babel-messages "^6.23.0" @@ -1269,6 +1427,7 @@ babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= dependencies: babel-runtime "^6.26.0" esutils "^2.0.2" @@ -1278,14 +1437,17 @@ babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" @@ -1298,16 +1460,19 @@ base@^0.11.1: bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" -before-after-hook@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.1.0.tgz#83165e15a59460d13702cb8febd6a1807896db5a" +before-after-hook@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.2.0.tgz#1079c10312cd4d4ad0d1676d37951ef8bfc3a563" + integrity sha512-wI3QtdLppHNkmM1VgRVLCrlWCKk/YexlPicYbXPs4eYdd1InrUCTFsx5bX1iUQzzMsoRXXPpM1r+p7JEJJydag== bin-links@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-1.1.2.tgz#fb74bd54bae6b7befc6c6221f25322ac830d9757" + integrity sha512-8eEHVgYP03nILphilltWjeIjMbKyJo3wvp9K816pHbhP301ismzw15mxAAEVQ/USUwcP++1uNrbERbp8lOA6Fg== dependencies: bluebird "^3.5.0" cmd-shim "^2.0.2" @@ -1318,20 +1483,24 @@ bin-links@^1.1.2: block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= dependencies: inherits "~2.0.0" bluebird@^3.5.0, bluebird@^3.5.1, bluebird@~3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.2.tgz#1be0908e054a751754549c270489c1505d4ab15a" + version "3.5.3" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" + integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== bottleneck@^2.0.1: - version "2.11.0" - resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.11.0.tgz#d91e194ef071ddb88312f13454405e52067ea9cc" + version "2.13.0" + resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.13.0.tgz#875df17df9e62c76bea42b62af3a45c73a995c4f" + integrity sha512-9YmZ0aiKta2OAxTujKCS/INjGWCIGWK4Ff1nQpgHnR4CTjlk9jcnpaHOjPnMZPtqRXkqwKdtxZgvJ9udsXylaw== boxen@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== dependencies: ansi-align "^2.0.0" camelcase "^4.0.0" @@ -1344,6 +1513,7 @@ boxen@^1.2.1: brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -1351,6 +1521,7 @@ brace-expansion@^1.1.7: braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -1359,6 +1530,7 @@ braces@^1.8.2: braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" @@ -1372,62 +1544,74 @@ braces@^2.3.1: to-regex "^3.0.1" browser-process-hrtime@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== browser-resolve@^1.11.3: version "1.11.3" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== dependencies: resolve "1.1.7" browserslist@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.1.1.tgz#328eb4ff1215b12df6589e9ab82f8adaa4fc8cd6" + version "4.3.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.3.4.tgz#4477b737db6a1b07077275b24791e680d4300425" + integrity sha512-u5iz+ijIMUlmV8blX82VGFrB9ecnUg5qEt55CMZ/YJEhha+d8qpBfOFuutJ6F/VKRXjZoD33b6uvarpPxcl3RA== dependencies: - caniuse-lite "^1.0.30000884" - electron-to-chromium "^1.3.62" - node-releases "^1.0.0-alpha.11" + caniuse-lite "^1.0.30000899" + electron-to-chromium "^1.3.82" + node-releases "^1.0.1" bs-logger@0.x: - version "0.2.5" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.5.tgz#1d82f0cf88864e1341cd9262237f8d0748a49b22" + version "0.2.6" + resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== dependencies: - fast-json-stable-stringify "^2.0.0" + fast-json-stable-stringify "2.x" bser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= dependencies: node-int64 "^0.4.0" btoa-lite@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" + integrity sha1-M3dm2hWAEhD92VbCLpxokaudAzc= buffer-from@1.x, buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= byline@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" + integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= byte-size@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.3.tgz#b7c095efc68eadf82985fccd9a2df43a74fa2ccd" + version "4.0.4" + resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.4.tgz#29d381709f41aae0d89c631f1c81aec88cd40b23" + integrity sha512-82RPeneC6nqCdSwCX2hZUz3JPOvN5at/nTEw/CMf05Smu3Hrpo9Psb7LjN+k+XndNArG1EY8L4+BM3aTM4BCvw== cacache@^10.0.4: version "10.0.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460" + integrity sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA== dependencies: bluebird "^3.5.1" chownr "^1.0.1" @@ -1444,8 +1628,9 @@ cacache@^10.0.4: y18n "^4.0.0" cacache@^11.0.1, cacache@^11.0.2, cacache@^11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.2.0.tgz#617bdc0b02844af56310e411c0878941d5739965" + version "11.3.1" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.1.tgz#d09d25f6c4aca7a6d305d141ae332613aa1d515f" + integrity sha512-2PEw4cRRDu+iQvBTTuttQifacYjLPhET+SYO/gEFMy8uhi+jlJREDAjSF5FWSdV/Aw5h18caHA7vMTw2c+wDzA== dependencies: bluebird "^3.5.1" chownr "^1.0.1" @@ -1465,6 +1650,7 @@ cacache@^11.0.1, cacache@^11.0.2, cacache@^11.2.0: cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" @@ -1476,9 +1662,10 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -cacheable-request@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-5.0.0.tgz#7ce347741c48d85c76bc41b78f6bf13e2907056d" +cacheable-request@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-5.2.0.tgz#00c87097835af4caf92a97390660ecadce51187d" + integrity sha512-h1n0vjpFaByTvU6PiyTKk2kx4OnuV1aVUynCUd/FiKl4icpPSceowk3rHczwFEBuZvz+E1EU4KExR0MCPeQfaQ== dependencies: clone-response "^1.0.2" get-stream "^4.0.0" @@ -1491,58 +1678,84 @@ cacheable-request@^5.0.0: call-limit@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/call-limit/-/call-limit-1.1.0.tgz#6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea" + integrity sha1-b9YbA/PaQqLNDsK2DwK9DnGZH+o= call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= + +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= + dependencies: + callsites "^2.0.0" caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= dependencies: callsites "^0.2.0" +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= + dependencies: + caller-callsite "^2.0.0" + callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= camelcase-keys@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" + integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= dependencies: camelcase "^4.1.0" map-obj "^2.0.0" quick-lru "^1.0.0" -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= -caniuse-lite@^1.0.30000884: - version "1.0.30000886" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000886.tgz#2127186c4f57da10d3ba26fc3e87dce4a5ddd3ae" +camelcase@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" + integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA== + +caniuse-lite@^1.0.30000899: + version "1.0.30000912" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000912.tgz#08e650d4090a9c0ab06bfd2b46b7d3ad6dcaea28" + integrity sha512-M3zAtV36U+xw5mMROlTXpAHClmPAor6GPKAMD5Yi7glCB5sbMPFtnQ3rGpk4XqPdUrrTIaVYSJZxREZWNy8QJg== capture-exit@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" + integrity sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28= dependencies: rsvp "^3.3.3" capture-stack-trace@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" + integrity sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw== cardinal@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-2.1.1.tgz#7cc1055d822d212954d07b085dea251cc7bc5505" + integrity sha1-fMEFXYItISlU0HsIXeolHMe8VQU= dependencies: ansicolors "~0.3.2" redeyed "~2.1.0" @@ -1550,17 +1763,12 @@ cardinal@^2.1.1: caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= chalk@2.3.1: version "2.3.1" - resolved "http://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + integrity sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g== dependencies: ansi-styles "^3.2.0" escape-string-regexp "^1.0.5" @@ -1569,6 +1777,7 @@ chalk@2.3.1: chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -1579,32 +1788,38 @@ chalk@^1.0.0, chalk@^1.1.3: chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chownr@^1.0.1, chownr@~1.0.1: +chownr@^1.0.1, chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +chownr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + integrity sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE= -ci-info@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" - -ci-info@^1.4.0: +ci-info@^1.4.0, ci-info@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" + integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== cidr-regex@^2.0.10: version "2.0.10" resolved "https://registry.yarnpkg.com/cidr-regex/-/cidr-regex-2.0.10.tgz#af13878bd4ad704de77d6dc800799358b3afa70d" + integrity sha512-sB3ogMQXWvreNPbJUZMRApxuRYd+KoIo4RGQ81VatjmMW6WJPo+IJZ2846FGItr9VzKo5w7DXzijPLGtSd0N3Q== dependencies: ip-regex "^2.1.0" class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" @@ -1614,27 +1829,32 @@ class-utils@^0.3.5: clean-stack@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" + integrity sha1-noIVAa6XmYbEax1m0tQy2y/UrjE= cli-boxes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= cli-columns@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/cli-columns/-/cli-columns-3.1.2.tgz#6732d972979efc2ae444a1f08e08fa139c96a18e" + integrity sha1-ZzLZcpee/CrkRKHwjgj6E5yWoY4= dependencies: string-width "^2.0.0" strip-ansi "^3.0.1" -cli-cursor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" +cli-cursor@^2.0.0, cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: - restore-cursor "^1.0.1" + restore-cursor "^2.0.0" cli-table3@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" + integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw== dependencies: object-assign "^4.1.0" string-width "^2.1.1" @@ -1644,27 +1864,22 @@ cli-table3@^0.5.0: cli-table@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" + integrity sha1-9TsFJmqLGguTSz0IIebi3FkUriM= dependencies: colors "1.0.3" cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= dependencies: slice-ansi "0.0.4" string-width "^1.0.1" -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - cliui@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== dependencies: string-width "^2.1.1" strip-ansi "^4.0.0" @@ -1673,16 +1888,19 @@ cliui@^4.0.0: clone-response@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= dependencies: mimic-response "^1.0.0" clone@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= cmd-shim@^2.0.2, cmd-shim@~2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" + integrity sha1-b8vamUg6j9FdfTChlspp1oii79s= dependencies: graceful-fs "^4.1.2" mkdirp "~0.5.0" @@ -1690,89 +1908,95 @@ cmd-shim@^2.0.2, cmd-shim@~2.0.2: co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" color-convert@^1.9.0: - version "1.9.2" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: - color-name "1.1.1" + color-name "1.1.3" -color-name@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= colors@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" + integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= colors@^1.1.2: version "1.3.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" + integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== columnify@~1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" + integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= dependencies: strip-ansi "^3.0.0" wcwidth "^1.0.0" -combined-stream@1.0.6, combined-stream@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - dependencies: - delayed-stream "~1.0.0" - -combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== dependencies: delayed-stream "~1.0.0" commander@^2.14.1, commander@^2.9.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== commander@~2.17.1: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" + integrity sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg= dependencies: array-ify "^1.0.0" dot-prop "^3.0.0" -compare-versions@^3.1.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.3.0.tgz#af93ea705a96943f622ab309578b9b90586f39c3" - component-emitter@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= concat-stream@^1.5.0, concat-stream@^1.5.2: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" @@ -1782,6 +2006,7 @@ concat-stream@^1.5.0, concat-stream@^1.5.2: config-chain@~1.1.11: version "1.1.12" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" + integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== dependencies: ini "^1.3.4" proto-list "~1.2.1" @@ -1789,6 +2014,7 @@ config-chain@~1.1.11: configstore@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" + integrity sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw== dependencies: dot-prop "^4.1.0" graceful-fs "^4.1.2" @@ -1800,27 +2026,31 @@ configstore@^3.0.0: console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= conventional-changelog-angular@^1.3.3: version "1.6.6" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz#b27f2b315c16d0a1f23eb181309d0e6a4698ea0f" + integrity sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg== dependencies: compare-func "^1.3.1" q "^1.5.1" conventional-changelog-angular@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.1.tgz#f96431b76de453333a909decd02b15cb5bd2d364" + version "5.0.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.2.tgz#39d945635e03b6d0c9d4078b1df74e06163dc66a" + integrity sha512-yx7m7lVrXmt4nKWQgWZqxSALEiAKZhOAcbxdUaU9575mB0CzXVbgrgpfSnSP7OqWDUTYGD0YVJ0MSRdyOPgAwA== dependencies: compare-func "^1.3.1" q "^1.5.1" conventional-changelog-writer@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.0.tgz#3ed983c8ef6a3aa51fe44e82c9c75e86f1b5aa42" + version "4.0.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.2.tgz#eb493ed84269e7a663da36e49af51c54639c9a67" + integrity sha512-d8/FQY/fix2xXEBUhOo8u3DCbyEw3UOQgYHxLsPDw+wHUDma/GQGAGsGtoH876WyNs32fViHmTOUrgRKVLvBug== dependencies: compare-func "^1.3.1" - conventional-commits-filter "^2.0.0" + conventional-commits-filter "^2.0.1" dateformat "^3.0.0" handlebars "^4.0.2" json-stringify-safe "^5.0.1" @@ -1833,10 +2063,12 @@ conventional-changelog-writer@^4.0.0: conventional-commit-types@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz#5db95739d6c212acbe7b6f656a11b940baa68946" + integrity sha1-XblXOdbCEqy+e29lahG5QLqmiUY= -conventional-commits-filter@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.0.tgz#a0ce1d1ff7a1dd7fab36bee8e8256d348d135651" +conventional-commits-filter@^2.0.0, conventional-commits-filter@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.1.tgz#55a135de1802f6510b6758e0a6aa9e0b28618db3" + integrity sha512-92OU8pz/977udhBjgPEbg3sbYzIxMDFTlQT97w7KdhR9igNqdJvy8smmedAAgn4tPiqseFloKkrVfbXCVd+E7A== dependencies: is-subset "^0.1.1" modify-values "^1.0.0" @@ -1844,6 +2076,7 @@ conventional-commits-filter@^2.0.0: conventional-commits-parser@^2.1.0: version "2.1.7" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz#eca45ed6140d72ba9722ee4132674d639e644e8e" + integrity sha512-BoMaddIEJ6B4QVMSDu9IkVImlGOSGA1I2BQyOZHeLQ6qVOJLcLKn97+fL6dGbzWEiqDzfH4OkcveULmeq2MHFQ== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.0" @@ -1854,8 +2087,9 @@ conventional-commits-parser@^2.1.0: trim-off-newlines "^1.0.0" conventional-commits-parser@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.0.tgz#7f604549a50bd8f60443fbe515484b1c2f06a5c4" + version "3.0.1" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.1.tgz#fe1c49753df3f98edb2285a5e485e11ffa7f2e4c" + integrity sha512-P6U5UOvDeidUJ8ebHVDIoXzI7gMlQ1OF/id6oUvp8cnZvOXMt1n8nYl74Ey9YMn0uVQtxmCtjPQawpsssBWtGg== dependencies: JSONStream "^1.0.4" is-text-path "^1.0.0" @@ -1865,19 +2099,17 @@ conventional-commits-parser@^3.0.0: through2 "^2.0.0" trim-off-newlines "^1.0.0" -convert-source-map@^1.1.0: +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.1: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== dependencies: safe-buffer "~5.1.1" -convert-source-map@^1.4.0, convert-source-map@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" - copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== dependencies: aproba "^1.1.1" fs-write-stream-atomic "^1.0.8" @@ -1889,18 +2121,22 @@ copy-concurrently@^1.0.0: copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.7: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" + integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= cosmiconfig@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" + integrity sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ== dependencies: is-directory "^0.3.1" js-yaml "^3.9.0" @@ -1908,9 +2144,11 @@ cosmiconfig@^4.0.0: require-from-string "^2.0.1" cosmiconfig@^5.0.1, cosmiconfig@^5.0.2: - version "5.0.6" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" + version "5.0.7" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.7.tgz#39826b292ee0d78eda137dfa3173bd1c21a43b04" + integrity sha512-PcLqxTKiDmNT6pSpy4N6KtuPwb53W+2tzNvwOZw0WH9N6O0vLIBq0x8aj8Oj75ere4YcGi48bDFCL+3fRJdlNA== dependencies: + import-fresh "^2.0.0" is-directory "^0.3.1" js-yaml "^3.9.0" parse-json "^4.0.0" @@ -1918,12 +2156,14 @@ cosmiconfig@^5.0.1, cosmiconfig@^5.0.2: create-error-class@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + integrity sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= dependencies: capture-stack-trace "^1.0.0" cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= dependencies: lru-cache "^4.0.1" shebang-command "^1.2.0" @@ -1932,6 +2172,7 @@ cross-spawn@^5.0.1: cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== dependencies: nice-try "^1.0.4" path-key "^2.0.1" @@ -1942,30 +2183,36 @@ cross-spawn@^6.0.0: crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" + integrity sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog== cssstyle@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.0.0.tgz#79b16d51ec5591faec60e688891f15d2a5705129" + version "1.1.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.1.1.tgz#18b038a9c44d65f7a8e428a653b9f6fe42faf5fb" + integrity sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog== dependencies: cssom "0.3.x" currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= dependencies: array-find-index "^1.0.1" cyclist@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= cz-conventional-changelog@2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-2.1.0.tgz#2f4bc7390e3244e4df293e6ba351e4c740a7c764" + integrity sha1-L0vHOQ4yROTfKT5ro1Hkx0Cnx2Q= dependencies: conventional-commit-types "^2.0.0" lodash.map "^4.5.1" @@ -1976,130 +2223,158 @@ cz-conventional-changelog@2.1.0: dargs@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" + integrity sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc= dependencies: number-is-nan "^1.0.0" dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= dependencies: assert-plus "^1.0.0" data-urls@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.0.0.tgz#24802de4e81c298ea8a9388bb0d8e461c774684f" + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== dependencies: - abab "^1.0.4" - whatwg-mimetype "^2.0.0" - whatwg-url "^6.4.0" + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" date-fns@^1.27.2: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" + integrity sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw== dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" + integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@3.1.0, debug@^3.1.0: +debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.0.1.tgz#f9bb36d439b8d1f0dd52d8fb6b46e4ebb8c1cd5b" +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.0, debug@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" + integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== dependencies: ms "^2.1.1" -debuglog@^1.0.1: +debuglog@*, debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" + integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= decamelize-keys@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" + integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= dependencies: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1: +decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -decamelize@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" - dependencies: - xregexp "4.0.0" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= dependencies: mimic-response "^1.0.0" dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -default-require-extensions@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" +deepmerge@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" + integrity sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA== + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + integrity sha1-836hXT4T/9m0N9M+GnW1+5eHTLg= dependencies: - strip-bom "^3.0.0" + strip-bom "^2.0.0" defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= dependencies: clone "^1.0.2" defer-to-connect@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.0.1.tgz#41ec1dd670dc4c6dcbe7e54c9e44d784d025fe63" + integrity sha512-2e0FJesseUqQj671gvZWfUyxpnFx/5n4xleamlpCD3U6Fm5dh5qzmmLNxNhtmHF06+SYVHH8QU6FACffYTnj0Q== define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" + object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" @@ -2107,32 +2382,39 @@ define-property@^2.0.2: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= dependencies: repeating "^2.0.0" -detect-indent@^5.0.0, detect-indent@~5.0.0: +detect-indent@~5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= detect-newline@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= dezalgo@^1.0.0, dezalgo@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" + integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY= dependencies: asap "^2.0.0" wrappy "1" @@ -2140,10 +2422,12 @@ dezalgo@^1.0.0, dezalgo@~1.0.3: diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== dir-glob@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" + integrity sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag== dependencies: arrify "^1.0.1" path-type "^3.0.0" @@ -2151,38 +2435,45 @@ dir-glob@^2.0.0: domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== dependencies: webidl-conversions "^4.0.2" dot-prop@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" + integrity sha1-G3CK8JSknJoOfbyteQq6U52sEXc= dependencies: is-obj "^1.0.0" dot-prop@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== dependencies: is-obj "^1.0.0" dotenv@^5.0.1: version "5.0.1" - resolved "http://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" + integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow== duplexer2@~0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + integrity sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= dependencies: readable-stream "^2.0.2" duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= duplexify@^3.4.2, duplexify@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.6.0.tgz#592903f5d80b38d037220541264d69a198fb3410" + version "3.6.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.6.1.tgz#b1a7a29c4abfd639585efaecce80d666b1e34125" + integrity sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA== dependencies: end-of-stream "^1.0.0" inherits "^2.0.1" @@ -2192,6 +2483,7 @@ duplexify@^3.4.2, duplexify@^3.6.0: ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" safer-buffer "^2.1.0" @@ -2199,30 +2491,36 @@ ecc-jsbn@~0.1.1: editor@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742" + integrity sha1-YMf4e9YrzGqJT6jM1q+3gjok90I= -electron-to-chromium@^1.3.62: - version "1.3.70" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.70.tgz#ded377256d92d81b4257d36c65aa890274afcfd2" +electron-to-chromium@^1.3.82: + version "1.3.86" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.86.tgz#a45ea01da5b26500d12bca5e0f194ebb3e1fd14e" + integrity sha512-BcmXOu37FCPxrrh0wyKgKi5dAjIu2ohxN5ptapkLPKRC3IBK2NeIwh9n1x/8HzSRQiEKamJkDce1ZgOGgEX9iw== elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= dependencies: iconv-lite "~0.4.13" end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== dependencies: once "^1.4.0" env-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/env-ci/-/env-ci-3.0.0.tgz#16f022753562dee387e0bdca3dd629a497ed67b5" + version "3.1.2" + resolved "https://registry.yarnpkg.com/env-ci/-/env-ci-3.1.2.tgz#ee3c78cd24f61ee12aca8b69ecdf0a97ca3ceb5b" + integrity sha512-qJ+ug5OEHEK6HyjhEB0z2tPJCmdvemQE3WUUYEe7qj7teZIJGjZK9elWB4kxE8qRdVHWl4aBvyVmX0Y5xlMbBw== dependencies: execa "^1.0.0" java-properties "^0.2.9" @@ -2230,22 +2528,26 @@ env-ci@^3.0.0: err-code@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" + integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= errno@~0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== dependencies: prr "~1.0.1" error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" es-abstract@^1.5.1: version "1.12.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + integrity sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA== dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -2254,30 +2556,35 @@ es-abstract@^1.5.1: is-regex "^1.0.4" es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== dependencies: - is-callable "^1.1.1" + is-callable "^1.1.4" is-date-object "^1.0.1" - is-symbol "^1.0.1" + is-symbol "^1.0.2" es6-promise@^4.0.3: version "4.2.5" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== es6-promisify@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= dependencies: es6-promise "^4.0.3" escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@^1.9.1: version "1.11.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" + integrity sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw== dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -2289,28 +2596,34 @@ escodegen@^1.9.1: esprima@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= esprima@^4.0.0, esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= exec-sh@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" + integrity sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw== dependencies: merge "^1.2.0" execa@0.9.0, execa@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" + integrity sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA== dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -2323,6 +2636,7 @@ execa@0.9.0, execa@^0.9.0: execa@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" + integrity sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw== dependencies: cross-spawn "^6.0.0" get-stream "^3.0.0" @@ -2335,6 +2649,7 @@ execa@^0.10.0: execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -2347,6 +2662,7 @@ execa@^0.7.0: execa@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== dependencies: cross-spawn "^6.0.0" get-stream "^4.0.0" @@ -2356,23 +2672,22 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= dependencies: is-posix-bracket "^0.1.0" expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -2385,46 +2700,53 @@ expand-brackets@^2.1.4: expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= dependencies: fill-range "^2.1.0" -expect@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-23.4.0.tgz#6da4ecc99c1471253e7288338983ad1ebadb60c3" +expect@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.6.0.tgz#1e0c8d3ba9a581c87bd71fb9bc8862d443425f98" + integrity sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w== dependencies: ansi-styles "^3.2.0" - jest-diff "^23.2.0" + jest-diff "^23.6.0" jest-get-type "^22.1.0" - jest-matcher-utils "^23.2.0" + jest-matcher-utils "^23.6.0" jest-message-util "^23.4.0" jest-regex-util "^23.3.0" extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.1, extend@~3.0.2: +extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= dependencies: is-extglob "^1.0.0" extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" @@ -2438,47 +2760,56 @@ extglob@^2.0.4: extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= fast-glob@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.2.tgz#71723338ac9b4e0e2fff1d6748a2a13d5ed352bf" + version "2.2.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.4.tgz#e54f4b66d378040e0e4d6a68ec36bbc5b04363c0" + integrity sha512-FjK2nCGI/McyzgNtTESqaWP3trPvHyRyoyY70hxjc3oKPNmDe8taohLZpoVKoUjW85tbU5txaYUZCNtVzygl1g== dependencies: "@mrmlnc/readdir-enhanced" "^2.2.1" - "@nodelib/fs.stat" "^1.0.1" + "@nodelib/fs.stat" "^1.1.2" glob-parent "^3.1.0" is-glob "^4.0.0" - merge2 "^1.2.1" + merge2 "^1.2.3" micromatch "^3.1.10" fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fb-watchman@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= dependencies: bser "^2.0.0" figgy-pudding@^3.0.0, figgy-pudding@^3.1.0, figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" @@ -2486,16 +2817,19 @@ figures@^1.7.0: figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= fileset@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + integrity sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA= dependencies: glob "^7.0.3" minimatch "^3.0.3" @@ -2503,6 +2837,7 @@ fileset@^2.0.2: fill-range@^2.1.0: version "2.2.4" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== dependencies: is-number "^2.1.0" isobject "^2.0.0" @@ -2513,6 +2848,7 @@ fill-range@^2.1.0: fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" @@ -2522,6 +2858,7 @@ fill-range@^4.0.0: find-cache-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" + integrity sha1-kojj6ePMN0hxfTnq3hfPcfww7m8= dependencies: commondir "^1.0.1" make-dir "^1.0.0" @@ -2530,14 +2867,17 @@ find-cache-dir@^1.0.0: find-npm-prefix@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz#8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf" + integrity sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA== find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" @@ -2545,25 +2885,29 @@ find-up@^1.0.0: find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: locate-path "^3.0.0" -find-versions@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-2.0.0.tgz#2ad90d490f6828c1aa40292cf709ac3318210c3c" +find-versions@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.0.0.tgz#2c05a86e839c249101910100b354196785a2c065" + integrity sha512-IUvtItVFNmTtKoB0PRfbkR0zR9XMG5rWNO3qI1S8L0zdv+v2gqzM0pAunloxqbqAfT8w7bg8n/5gHzTXte8H5A== dependencies: - array-uniq "^1.0.0" - semver-regex "^1.0.0" + array-uniq "^2.0.0" + semver-regex "^2.0.0" flush-write-stream@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" + integrity sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw== dependencies: inherits "^2.0.1" readable-stream "^2.0.4" @@ -2571,38 +2915,40 @@ flush-write-stream@^1.0.0: for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= dependencies: for-in "^1.0.1" -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -form-data@~2.3.1, form-data@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== dependencies: asynckit "^0.4.0" - combined-stream "1.0.6" + combined-stream "^1.0.6" mime-types "^2.1.12" fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" from2@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-1.3.0.tgz#88413baaa5f9a597cfde9221d86986cd3c061dfd" + integrity sha1-iEE7qqX5pZfP3pIh2GmGzTwGHf0= dependencies: inherits "~2.0.1" readable-stream "~1.1.10" @@ -2610,13 +2956,15 @@ from2@^1.3.0: from2@^2.1.0, from2@^2.1.1: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= dependencies: inherits "^2.0.1" readable-stream "^2.0.0" fs-extra@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.0.tgz#8cc3f47ce07ef7b3593a11b9fb245f7e34c041d6" + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" @@ -2625,12 +2973,14 @@ fs-extra@^7.0.0: fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== dependencies: minipass "^2.2.1" fs-vacuum@^1.2.10, fs-vacuum@~1.2.10: version "1.2.10" resolved "https://registry.yarnpkg.com/fs-vacuum/-/fs-vacuum-1.2.10.tgz#b7629bec07a4031a2548fdf99f5ecf1cc8b31e36" + integrity sha1-t2Kb7AekAxolSP35n17PHMizHjY= dependencies: graceful-fs "^4.1.2" path-is-inside "^1.0.1" @@ -2639,6 +2989,7 @@ fs-vacuum@^1.2.10, fs-vacuum@~1.2.10: fs-write-stream-atomic@^1.0.8, fs-write-stream-atomic@~1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= dependencies: graceful-fs "^4.1.2" iferr "^0.1.5" @@ -2648,10 +2999,12 @@ fs-write-stream-atomic@^1.0.8, fs-write-stream-atomic@~1.0.10: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" @@ -2659,6 +3012,7 @@ fsevents@^1.2.3: fstream@^1.0.0, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -2668,10 +3022,12 @@ fstream@^1.0.0, fstream@^1.0.2: function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -2682,13 +3038,15 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -genfun@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/genfun/-/genfun-4.0.1.tgz#ed10041f2e4a7f1b0a38466d17a5c3e27df1dfc1" +genfun@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" + integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== gentle-fs@^2.0.0, gentle-fs@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/gentle-fs/-/gentle-fs-2.0.1.tgz#585cfd612bfc5cd52471fdb42537f016a5ce3687" + integrity sha512-cEng5+3fuARewXktTEGbwsktcldA+YsnUEaXZwcK/3pjSE1X9ObnTs+/8rYf8s+RnIcQm2D5x3rwpN7Zom8Bew== dependencies: aproba "^1.1.2" fs-vacuum "^1.2.10" @@ -2702,38 +3060,46 @@ gentle-fs@^2.0.0, gentle-fs@^2.0.1: get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== -get-own-enumerable-property-symbols@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" + integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== get-stdin@5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + integrity sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g= get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= -get-stream@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.0.0.tgz#9e074cb898bd2b9ebabb445a1766d7f43576d977" +get-stream@^4.0.0, get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== dependencies: pump "^3.0.0" get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= dependencies: assert-plus "^1.0.0" git-log-parser@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/git-log-parser/-/git-log-parser-1.2.0.tgz#2e6a4c1b13fc00028207ba795a7ac31667b9fd4a" + integrity sha1-LmpMGxP8AAKCB7p5WnrDFme5/Uo= dependencies: argv-formatter "~1.0.0" spawn-error-forwarder "~1.0.0" @@ -2745,6 +3111,7 @@ git-log-parser@^1.2.0: git-raw-commits@^1.3.0: version "1.3.6" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.6.tgz#27c35a32a67777c1ecd412a239a6c19d71b95aff" + integrity sha512-svsK26tQ8vEKnMshTDatSIQSMDdz8CxIIqKsvPqbtV23Etmw6VNaFAitu8zwZ0VrOne7FztwPyRLxK7/DIUTQg== dependencies: dargs "^4.0.1" lodash.template "^4.0.2" @@ -2752,22 +3119,10 @@ git-raw-commits@^1.3.0: split2 "^2.0.0" through2 "^2.0.0" -git-up@^2.0.0: - version "2.0.10" - resolved "https://registry.yarnpkg.com/git-up/-/git-up-2.0.10.tgz#20fe6bafbef4384cae253dc4f463c49a0c3bd2ec" - dependencies: - is-ssh "^1.3.0" - parse-url "^1.3.0" - -git-url-parse@^10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-10.0.1.tgz#75f153b24ac7297447fc583cf9fac23a5ae687c1" - dependencies: - git-up "^2.0.0" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" @@ -2775,12 +3130,14 @@ glob-base@^0.3.0: glob-parent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= dependencies: is-glob "^2.0.0" glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" @@ -2788,10 +3145,12 @@ glob-parent@^3.1.0: glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= -glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: +glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -2800,9 +3159,10 @@ glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@~7.1.2: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.2: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -2814,20 +3174,24 @@ glob@~7.1.2: global-dirs@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= dependencies: ini "^1.3.4" globals@^11.1.0: - version "11.7.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" + version "11.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" + integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg== globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== globby@^8.0.0: version "8.0.1" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50" + integrity sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw== dependencies: array-union "^1.0.1" dir-glob "^2.0.0" @@ -2839,7 +3203,8 @@ globby@^8.0.0: got@^6.7.1: version "6.7.1" - resolved "http://registry.npmjs.org/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + integrity sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA= dependencies: create-error-class "^3.0.0" duplexer3 "^0.1.4" @@ -2854,31 +3219,36 @@ got@^6.7.1: url-parse-lax "^1.0.0" got@^9.1.0: - version "9.2.2" - resolved "https://registry.yarnpkg.com/got/-/got-9.2.2.tgz#d6cb73f40d4cb512864c2f66f275f258ab43aa25" + version "9.3.2" + resolved "https://registry.yarnpkg.com/got/-/got-9.3.2.tgz#f6e3bd063aa8f461ccd924afa2ba2b61deab3989" + integrity sha512-OyKOUg71IKvwb8Uj0KP6EN3+qVVvXmYsFznU1fnwUnKtDbZnwSlAi7muNlu4HhBfN9dImtlgg9e7H0g5qVdaeQ== dependencies: - "@sindresorhus/is" "^0.11.0" + "@sindresorhus/is" "^0.12.0" "@szmarczak/http-timer" "^1.1.0" - cacheable-request "^5.0.0" + cacheable-request "^5.1.0" decompress-response "^3.3.0" duplexer3 "^0.1.4" - get-stream "^4.0.0" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" mimic-response "^1.0.1" - p-cancelable "^0.5.0" + p-cancelable "^1.0.0" to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@~4.1.11: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -handlebars@^4.0.2: +handlebars@^4.0.2, handlebars@^4.0.3: version "4.0.12" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" + integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== dependencies: async "^2.5.0" optimist "^0.6.1" @@ -2886,55 +3256,50 @@ handlebars@^4.0.2: optionalDependencies: uglify-js "^3.1.4" -handlebars@^4.0.3: - version "4.0.11" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" - dependencies: - async "^1.4.0" - optimist "^0.6.1" - source-map "^0.4.4" - optionalDependencies: - uglify-js "^2.6" - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= har-validator@~5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== dependencies: - ajv "^5.3.0" + ajv "^6.5.5" har-schema "^2.0.0" has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= has-unicode@^2.0.0, has-unicode@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -2943,6 +3308,7 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -2951,10 +3317,12 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" @@ -2962,12 +3330,14 @@ has-values@^1.0.0: has@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.1" @@ -2975,32 +3345,39 @@ home-or-tmp@^2.0.0: home-or-tmp@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" + integrity sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs= hook-std@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hook-std/-/hook-std-1.1.0.tgz#7f76b74b6f96d3cd4106afb50a66bdb0af2d2a2d" + version "1.2.0" + resolved "https://registry.yarnpkg.com/hook-std/-/hook-std-1.2.0.tgz#b37d533ea5f40068fe368cb4d022ee1992588c27" + integrity sha512-yntre2dbOAjgQ5yoRykyON0D9T96BfshR8IuiL/r3celeHD8I/76w4qo8m3z99houR4Z678jakV3uXrQdSvW/w== hosted-git-info@^2.1.4, hosted-git-info@^2.6.0, hosted-git-info@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== html-encoding-sniffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== dependencies: whatwg-encoding "^1.0.1" http-cache-semantics@^3.8.1: version "3.8.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== http-cache-semantics@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#2d0069a73c36c80e3297bc3a0cadd669b78a69ce" + version "4.0.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#6c2ef57e22090b177828708a52eaeae9d1d63e1b" + integrity sha512-OO/9K7uFN30qwAKvslzmCTbimZ/uRjtdN5S50vvWLwUKqFuZj0n96XyCzF5tHRHEO/Q4JYC01hv41gkX06gmHA== http-proxy-agent@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== dependencies: agent-base "4" debug "3.1.0" @@ -3008,6 +3385,7 @@ http-proxy-agent@^2.1.0: http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -3016,6 +3394,7 @@ http-signature@~1.2.0: https-proxy-agent@^2.2.0, https-proxy-agent@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== dependencies: agent-base "^4.1.0" debug "^3.1.0" @@ -3023,79 +3402,90 @@ https-proxy-agent@^2.2.0, https-proxy-agent@^2.2.1: humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= dependencies: ms "^2.0.0" husky@0.14.3: version "0.14.3" resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" + integrity sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA== dependencies: is-ci "^1.0.10" normalize-path "^1.0.0" strip-indent "^2.0.0" -iconv-lite@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" - -iconv-lite@^0.4.4: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= iferr@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/iferr/-/iferr-1.0.2.tgz#e9fde49a9da06dc4a4194c6c9ed6d08305037a6d" + integrity sha512-9AfeLfji44r5TKInjhz3W9DyZI1zR1JAf2hVBMGhddAKPqBsupb89jGfbCTHIGZd6fGZl9WlHdn4AObygyMKwg== ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== dependencies: minimatch "^3.0.4" ignore@^3.3.5: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" import-from@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" + integrity sha1-M1238qev/VOqpHHUuAId7ja387E= dependencies: resolve-from "^3.0.0" import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= import-local@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + integrity sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== dependencies: pkg-dir "^2.0.0" resolve-cwd "^2.0.0" -imurmurhash@^0.1.4: +imurmurhash@*, imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= inflight@^1.0.4, inflight@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -3103,14 +3493,17 @@ inflight@^1.0.4, inflight@~1.0.6: inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== init-package-json@^1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-1.10.3.tgz#45ffe2f610a8ca134f2bd1db5637b235070f6cbe" + integrity sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw== dependencies: glob "^7.1.1" npm-package-arg "^4.0.0 || ^5.0.0 || ^6.0.0" @@ -3124,97 +3517,116 @@ init-package-json@^1.10.3: interpret@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + integrity sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ= -into-stream@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" +into-stream@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-4.0.0.tgz#ef10ee2ffb6f78af34c93194bbdc36c35f7d8a9d" + integrity sha512-i29KNyE5r0Y/UQzcQ0IbZO1MYJ53Jn0EcFRZPj5FzWKYH17kDFEOwuA+3jroymOI06SW1dEDnly9A1CAreC5dg== dependencies: from2 "^2.1.1" - p-is-promise "^1.1.0" + p-is-promise "^2.0.0" -invariant@^2.2.2: +invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= ip@^1.1.4, ip@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= dependencies: builtin-modules "^1.0.0" -is-callable@^1.1.1, is-callable@^1.1.3: +is-callable@^1.1.3, is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== is-ci@^1.0.10: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" + integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== dependencies: - ci-info "^1.0.0" + ci-info "^1.5.0" is-cidr@^2.0.6: version "2.0.7" resolved "https://registry.yarnpkg.com/is-cidr/-/is-cidr-2.0.7.tgz#0fd4b863c26b2eb2d157ed21060c4f3f8dd356ce" + integrity sha512-YfOm5liUO1RoYfFh+lhiGNYtbLzem7IXzFqvfjXh+zLCEuAiznTBlQ2QcMWxsgYeOFmjzljOxJfmZID4/cRBAQ== dependencies: cidr-regex "^2.0.10" is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" @@ -3223,6 +3635,7 @@ is-descriptor@^0.1.0: is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" @@ -3231,76 +3644,91 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= is-equal-shallow@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= dependencies: is-primitive "^2.0.0" is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-generator-fn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + integrity sha1-lp1J4bszKfa7fwkIm+JleLLd1Go= is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= dependencies: is-extglob "^1.0.0" is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= dependencies: is-extglob "^2.1.1" is-installed-globally@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" + integrity sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA= dependencies: global-dirs "^0.1.0" is-path-inside "^1.0.0" @@ -3308,144 +3736,170 @@ is-installed-globally@^0.1.0: is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= dependencies: kind-of "^3.0.2" is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" - resolved "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-observable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" + integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== dependencies: symbol-observable "^1.1.0" is-path-inside@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= dependencies: path-is-inside "^1.0.1" is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= is-redirect@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= dependencies: has "^1.0.1" is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= is-retry-allowed@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" - -is-ssh@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.0.tgz#ebea1169a2614da392a63740366c3ce049d8dff6" - dependencies: - protocols "^1.1.0" + integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-subset@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= -is-symbol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" is-text-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= dependencies: text-extensions "^1.0.0" is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= issue-parser@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/issue-parser/-/issue-parser-3.0.0.tgz#729d3fd5d6b86379cb0f513acc33b62f47ebd681" + version "3.0.1" + resolved "https://registry.yarnpkg.com/issue-parser/-/issue-parser-3.0.1.tgz#ee8dd677fdb5be64541f81fa5e7267baa271a7ee" + integrity sha512-5wdT3EE8Kq38x/hJD8QZCJ9scGoOZ5QnzwXyClkviSWTS+xOCE6hJ0qco3H5n5jCsFqpbofZCcMWqlXJzF72VQ== dependencies: lodash.capitalize "^4.2.1" lodash.escaperegexp "^4.1.2" @@ -3454,82 +3908,91 @@ issue-parser@^3.0.0: lodash.uniqby "^4.7.0" istanbul-api@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" + version "1.3.7" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.7.tgz#a86c770d2b03e11e3f778cd7aedd82d2722092aa" + integrity sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA== dependencies: async "^2.1.4" - compare-versions "^3.1.0" fileset "^2.0.2" - istanbul-lib-coverage "^1.2.0" - istanbul-lib-hook "^1.2.0" - istanbul-lib-instrument "^1.10.1" - istanbul-lib-report "^1.1.4" - istanbul-lib-source-maps "^1.2.4" - istanbul-reports "^1.3.0" + istanbul-lib-coverage "^1.2.1" + istanbul-lib-hook "^1.2.2" + istanbul-lib-instrument "^1.10.2" + istanbul-lib-report "^1.1.5" + istanbul-lib-source-maps "^1.2.6" + istanbul-reports "^1.5.1" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" - -istanbul-lib-hook@^1.2.0: +istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: version "1.2.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz#f614ec45287b2a8fc4f07f5660af787575601805" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" + integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== + +istanbul-lib-hook@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" + integrity sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw== dependencies: - append-transform "^1.0.0" + append-transform "^0.4.0" -istanbul-lib-instrument@^1.10.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" +istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" + integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.18.0" - istanbul-lib-coverage "^1.2.0" + istanbul-lib-coverage "^1.2.1" semver "^5.3.0" -istanbul-lib-report@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" +istanbul-lib-report@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" + integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== dependencies: - istanbul-lib-coverage "^1.2.0" + istanbul-lib-coverage "^1.2.1" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.2.4: - version "1.2.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz#ffe6be4e7ab86d3603e4290d54990b14506fc9b1" +istanbul-lib-source-maps@^1.2.4, istanbul-lib-source-maps@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz#37b9ff661580f8fca11232752ee42e08c6675d8f" + integrity sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg== dependencies: debug "^3.1.0" - istanbul-lib-coverage "^1.2.0" + istanbul-lib-coverage "^1.2.1" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" +istanbul-reports@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" + integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== dependencies: handlebars "^4.0.3" java-properties@^0.2.9: version "0.2.10" resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-0.2.10.tgz#2551560c25fa1ad94d998218178f233ad9b18f60" + integrity sha512-CpKJh9VRNhS+XqZtg1UMejETGEiqwCGDC/uwPEEQwc2nfdbSm73SIE29TplG2gLYuBOOTNDqxzG6A9NtEPLt0w== jest-changed-files@^23.4.2: version "23.4.2" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" + integrity sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA== dependencies: throat "^4.0.0" jest-cli@^23.1.0: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.4.2.tgz#49d56bcfe6cf01871bfcc4a0494e08edaf2b61d0" + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.6.0.tgz#61ab917744338f443ef2baa282ddffdd658a5da4" + integrity sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ== dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -3543,18 +4006,18 @@ jest-cli@^23.1.0: istanbul-lib-instrument "^1.10.1" istanbul-lib-source-maps "^1.2.4" jest-changed-files "^23.4.2" - jest-config "^23.4.2" + jest-config "^23.6.0" jest-environment-jsdom "^23.4.0" jest-get-type "^22.1.0" - jest-haste-map "^23.4.1" + jest-haste-map "^23.6.0" jest-message-util "^23.4.0" jest-regex-util "^23.3.0" - jest-resolve-dependencies "^23.4.2" - jest-runner "^23.4.2" - jest-runtime "^23.4.2" - jest-snapshot "^23.4.2" + jest-resolve-dependencies "^23.6.0" + jest-runner "^23.6.0" + jest-runtime "^23.6.0" + jest-snapshot "^23.6.0" jest-util "^23.4.0" - jest-validate "^23.4.0" + jest-validate "^23.6.0" jest-watcher "^23.4.0" jest-worker "^23.2.0" micromatch "^2.3.11" @@ -3568,49 +4031,55 @@ jest-cli@^23.1.0: which "^1.2.12" yargs "^11.0.0" -jest-config@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.4.2.tgz#62a105e14b8266458f2bf4d32403b2c44418fa77" +jest-config@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.6.0.tgz#f82546a90ade2d8c7026fbf6ac5207fc22f8eb1d" + integrity sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ== dependencies: babel-core "^6.0.0" - babel-jest "^23.4.2" + babel-jest "^23.6.0" chalk "^2.0.1" glob "^7.1.1" jest-environment-jsdom "^23.4.0" jest-environment-node "^23.4.0" jest-get-type "^22.1.0" - jest-jasmine2 "^23.4.2" + jest-jasmine2 "^23.6.0" jest-regex-util "^23.3.0" - jest-resolve "^23.4.1" + jest-resolve "^23.6.0" jest-util "^23.4.0" - jest-validate "^23.4.0" - pretty-format "^23.2.0" + jest-validate "^23.6.0" + micromatch "^2.3.11" + pretty-format "^23.6.0" -jest-diff@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.2.0.tgz#9f2cf4b51e12c791550200abc16b47130af1062a" +jest-diff@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.6.0.tgz#1500f3f16e850bb3d71233408089be099f610c7d" + integrity sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g== dependencies: chalk "^2.0.1" diff "^3.2.0" jest-get-type "^22.1.0" - pretty-format "^23.2.0" + pretty-format "^23.6.0" jest-docblock@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" + integrity sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c= dependencies: detect-newline "^2.1.0" -jest-each@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.4.0.tgz#2fa9edd89daa1a4edc9ff9bf6062a36b71345143" +jest-each@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.6.0.tgz#ba0c3a82a8054387016139c733a05242d3d71575" + integrity sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg== dependencies: chalk "^2.0.1" - pretty-format "^23.2.0" + pretty-format "^23.6.0" jest-environment-jsdom@^23.4.0: version "23.4.0" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" + integrity sha1-BWp5UrP+pROsYqFAosNox52eYCM= dependencies: jest-mock "^23.2.0" jest-util "^23.4.0" @@ -3619,6 +4088,7 @@ jest-environment-jsdom@^23.4.0: jest-environment-node@^23.4.0: version "23.4.0" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" + integrity sha1-V+gO0IQd6jAxZ8zozXlSHeuv3hA= dependencies: jest-mock "^23.2.0" jest-util "^23.4.0" @@ -3626,53 +4096,60 @@ jest-environment-node@^23.4.0: jest-get-type@^22.1.0: version "22.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== -jest-haste-map@^23.4.1: - version "23.4.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.4.1.tgz#43a174ba7ac079ae1dd74eaf5a5fe78989474dd2" +jest-haste-map@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.6.0.tgz#2e3eb997814ca696d62afdb3f2529f5bbc935e16" + integrity sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg== dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" + invariant "^2.2.4" jest-docblock "^23.2.0" jest-serializer "^23.0.1" jest-worker "^23.2.0" micromatch "^2.3.11" sane "^2.0.0" -jest-jasmine2@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.4.2.tgz#2fbf52f93e43ed4c5e7326a90bb1d785be4321ac" +jest-jasmine2@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz#840e937f848a6c8638df24360ab869cc718592e0" + integrity sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ== dependencies: babel-traverse "^6.0.0" chalk "^2.0.1" co "^4.6.0" - expect "^23.4.0" + expect "^23.6.0" is-generator-fn "^1.0.0" - jest-diff "^23.2.0" - jest-each "^23.4.0" - jest-matcher-utils "^23.2.0" + jest-diff "^23.6.0" + jest-each "^23.6.0" + jest-matcher-utils "^23.6.0" jest-message-util "^23.4.0" - jest-snapshot "^23.4.2" + jest-snapshot "^23.6.0" jest-util "^23.4.0" - pretty-format "^23.2.0" + pretty-format "^23.6.0" -jest-leak-detector@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.2.0.tgz#c289d961dc638f14357d4ef96e0431ecc1aa377d" +jest-leak-detector@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz#e4230fd42cf381a1a1971237ad56897de7e171de" + integrity sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg== dependencies: - pretty-format "^23.2.0" + pretty-format "^23.6.0" -jest-matcher-utils@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.2.0.tgz#4d4981f23213e939e3cedf23dc34c747b5ae1913" +jest-matcher-utils@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz#726bcea0c5294261a7417afb6da3186b4b8cac80" + integrity sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog== dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" - pretty-format "^23.2.0" + pretty-format "^23.6.0" jest-message-util@^23.4.0: version "23.4.0" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" + integrity sha1-F2EMUJQjSVCNAaPR4L2iwHkIap8= dependencies: "@babel/code-frame" "^7.0.0-beta.35" chalk "^2.0.1" @@ -3683,47 +4160,53 @@ jest-message-util@^23.4.0: jest-mock@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" + integrity sha1-rRxg8p6HGdR8JuETgJi20YsmETQ= jest-regex-util@^23.3.0: version "23.3.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" + integrity sha1-X4ZylUfCeFxAAs6qj4Sf6MpHG8U= -jest-resolve-dependencies@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.4.2.tgz#0675ba876a5b819deffc449ad72e9985c2592048" +jest-resolve-dependencies@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz#b4526af24c8540d9a3fab102c15081cf509b723d" + integrity sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA== dependencies: jest-regex-util "^23.3.0" - jest-snapshot "^23.4.2" + jest-snapshot "^23.6.0" -jest-resolve@^23.4.1: - version "23.4.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.4.1.tgz#7f3c17104732a2c0c940a01256025ed745814982" +jest-resolve@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.6.0.tgz#cf1d1a24ce7ee7b23d661c33ba2150f3aebfa0ae" + integrity sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA== dependencies: browser-resolve "^1.11.3" chalk "^2.0.1" realpath-native "^1.0.0" -jest-runner@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.4.2.tgz#579a88524ac52c846075b0129a21c7b483e75a7e" +jest-runner@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.6.0.tgz#3894bd219ffc3f3cb94dc48a4170a2e6f23a5a38" + integrity sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA== dependencies: exit "^0.1.2" graceful-fs "^4.1.11" - jest-config "^23.4.2" + jest-config "^23.6.0" jest-docblock "^23.2.0" - jest-haste-map "^23.4.1" - jest-jasmine2 "^23.4.2" - jest-leak-detector "^23.2.0" + jest-haste-map "^23.6.0" + jest-jasmine2 "^23.6.0" + jest-leak-detector "^23.6.0" jest-message-util "^23.4.0" - jest-runtime "^23.4.2" + jest-runtime "^23.6.0" jest-util "^23.4.0" jest-worker "^23.2.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.4.2.tgz#00c3bb8385253d401a394a27d1112d3615e5a65c" +jest-runtime@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.6.0.tgz#059e58c8ab445917cd0e0d84ac2ba68de8f23082" + integrity sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw== dependencies: babel-core "^6.0.0" babel-plugin-istanbul "^4.1.6" @@ -3732,14 +4215,14 @@ jest-runtime@^23.4.2: exit "^0.1.2" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.1.11" - jest-config "^23.4.2" - jest-haste-map "^23.4.1" + jest-config "^23.6.0" + jest-haste-map "^23.6.0" jest-message-util "^23.4.0" jest-regex-util "^23.3.0" - jest-resolve "^23.4.1" - jest-snapshot "^23.4.2" + jest-resolve "^23.6.0" + jest-snapshot "^23.6.0" jest-util "^23.4.0" - jest-validate "^23.4.0" + jest-validate "^23.6.0" micromatch "^2.3.11" realpath-native "^1.0.0" slash "^1.0.0" @@ -3750,25 +4233,28 @@ jest-runtime@^23.4.2: jest-serializer@^23.0.1: version "23.0.1" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" + integrity sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU= -jest-snapshot@^23.4.2: - version "23.4.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.4.2.tgz#8fa6130feb5a527dac73e5fa80d86f29f7c42ab6" +jest-snapshot@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.6.0.tgz#f9c2625d1b18acda01ec2d2b826c0ce58a5aa17a" + integrity sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg== dependencies: babel-types "^6.0.0" chalk "^2.0.1" - jest-diff "^23.2.0" - jest-matcher-utils "^23.2.0" + jest-diff "^23.6.0" + jest-matcher-utils "^23.6.0" jest-message-util "^23.4.0" - jest-resolve "^23.4.1" + jest-resolve "^23.6.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^23.2.0" + pretty-format "^23.6.0" semver "^5.5.0" jest-util@^23.4.0: version "23.4.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" + integrity sha1-TQY8uSe68KI4Mf9hvsLLv0l5NWE= dependencies: callsites "^2.0.0" chalk "^2.0.1" @@ -3779,18 +4265,10 @@ jest-util@^23.4.0: slash "^1.0.0" source-map "^0.6.0" -jest-validate@^23.4.0: - version "23.4.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.4.0.tgz#d96eede01ef03ac909c009e9c8e455197d48c201" - dependencies: - chalk "^2.0.1" - jest-get-type "^22.1.0" - leven "^2.1.0" - pretty-format "^23.2.0" - -jest-validate@^23.5.0: +jest-validate@^23.5.0, jest-validate@^23.6.0: version "23.6.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" + integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" @@ -3800,6 +4278,7 @@ jest-validate@^23.5.0: jest-watcher@^23.4.0: version "23.4.0" resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" + integrity sha1-0uKM50+NrWxq/JIrksq+9u0FyRw= dependencies: ansi-escapes "^3.0.0" chalk "^2.0.1" @@ -3808,31 +4287,37 @@ jest-watcher@^23.4.0: jest-worker@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" + integrity sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk= dependencies: merge-stream "^1.0.1" jest@23.1.0: version "23.1.0" resolved "https://registry.yarnpkg.com/jest/-/jest-23.1.0.tgz#bbb7f893100a11a742dd8bd0d047a54b0968ad1a" + integrity sha1-u7f4kxAKEadC3YvQ0EelSwlorRo= dependencies: import-local "^1.0.0" jest-cli "^23.1.0" js-levenshtein@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.3.tgz#3ef627df48ec8cf24bacf05c0f184ff30ef413c5" - -js-tokens@^3.0.0, js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + version "1.1.4" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.4.tgz#3a56e3cbf589ca0081eb22cd9ba0b1290a16d26e" + integrity sha512-PxfGzSs0ztShKrUYPIn5r0MtyAhYcCwmndozzpz8YObbPnD1jFxzlBGbRnX2mIu6Z13xN6+PTu05TQFnZFlzow== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= js-yaml@^3.7.0, js-yaml@^3.9.0: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -3840,10 +4325,12 @@ js-yaml@^3.7.0, js-yaml@^3.9.0: jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsdom@^11.5.1: version "11.12.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== dependencies: abab "^2.0.0" acorn "^5.5.3" @@ -3875,58 +4362,71 @@ jsdom@^11.5.1: jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= jsesc@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json-buffer@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@2.x: +json5@2.x, json5@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== dependencies: minimist "^1.2.0" -json5@^0.5.0, json5@^0.5.1: +json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= optionalDependencies: graceful-fs "^4.1.6" jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: assert-plus "1.0.0" extsprintf "1.3.0" @@ -3936,70 +4436,79 @@ jsprim@^1.2.2: keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== dependencies: json-buffer "3.0.0" kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== kleur@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.1.tgz#7cc64b0d188d0dcbc98bdcdfdda2cc10619ddce8" + version "2.0.2" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.2.tgz#b704f4944d95e255d038f0cb05fb8a602c55a300" + integrity sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ== latest-version@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + integrity sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU= dependencies: package-json "^4.0.0" -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - lazy-property@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazy-property/-/lazy-property-1.0.0.tgz#84ddc4b370679ba8bd4cdcfa4c06b43d57111147" + integrity sha1-hN3Es3Bnm6i9TNz6TAa0PVcREUc= lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= dependencies: invert-kv "^1.0.0" lcid@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== dependencies: invert-kv "^2.0.0" left-pad@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" @@ -4007,6 +4516,7 @@ levn@~0.3.0: libcipm@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/libcipm/-/libcipm-2.0.2.tgz#4f38c2b37acf2ec156936cef1cbf74636568fc7b" + integrity sha512-9uZ6/LAflVEijksTRq/RX0e+pGA4mr8tND9Cmk2JMg7j2fFUBrs8PpFX2DOAJR/XoxPzz+5h8bkWmtIYLunKAg== dependencies: bin-links "^1.1.2" bluebird "^3.5.1" @@ -4026,6 +4536,7 @@ libcipm@^2.0.2: libnpmhook@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/libnpmhook/-/libnpmhook-4.0.1.tgz#63641654de772cbeb96a88527a7fd5456ec3c2d7" + integrity sha512-3qqpfqvBD1712WA6iGe0stkG40WwAeoWcujA6BlC0Be1JArQbqwabnEnZ0CRcD05Tf1fPYJYdCbSfcfedEJCOg== dependencies: figgy-pudding "^3.1.0" npm-registry-fetch "^3.0.0" @@ -4033,6 +4544,7 @@ libnpmhook@^4.0.1: libnpx@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/libnpx/-/libnpx-10.2.0.tgz#1bf4a1c9f36081f64935eb014041da10855e3102" + integrity sha512-X28coei8/XRCt15cYStbLBph+KGhFra4VQhRBPuH/HHMkC5dxM8v24RVgUsvODKCrUZ0eTgiTqJp6zbl0sskQQ== dependencies: dotenv "^5.0.1" npm-package-arg "^6.0.0" @@ -4046,6 +4558,7 @@ libnpx@^10.2.0: lint-staged@7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.3.0.tgz#90ff33e5ca61ed3dbac35b6f6502dbefdc0db58d" + integrity sha512-AXk40M9DAiPi7f4tdJggwuKIViUplYtVj1os1MVEteW7qOkU50EOehayCfO9TsoGK24o/EsWb41yrEgfJDDjCw== dependencies: chalk "^2.3.1" commander "^2.14.1" @@ -4073,10 +4586,12 @@ lint-staged@7.3.0: listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= -listr-update-renderer@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" +listr-update-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" + integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -4084,35 +4599,38 @@ listr-update-renderer@^0.4.0: figures "^1.7.0" indent-string "^3.0.0" log-symbols "^1.0.2" - log-update "^1.0.2" + log-update "^2.3.0" strip-ansi "^3.0.1" -listr-verbose-renderer@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35" +listr-verbose-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" + integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== dependencies: - chalk "^1.1.3" - cli-cursor "^1.0.2" + chalk "^2.4.1" + cli-cursor "^2.1.0" date-fns "^1.27.2" - figures "^1.7.0" + figures "^2.0.0" listr@^0.14.1: - version "0.14.2" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.2.tgz#cbe44b021100a15376addfc2d79349ee430bfe14" + version "0.14.3" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" + integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== dependencies: "@samverschueren/stream-to-observable" "^0.3.0" is-observable "^1.1.0" is-promise "^2.1.0" is-stream "^1.1.0" listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.4.0" - listr-verbose-renderer "^0.4.0" - p-map "^1.1.1" - rxjs "^6.1.0" + listr-update-renderer "^0.5.0" + listr-verbose-renderer "^0.5.0" + p-map "^2.0.0" + rxjs "^6.3.3" load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -4123,6 +4641,7 @@ load-json-file@^1.0.0: load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= dependencies: graceful-fs "^4.1.2" parse-json "^4.0.0" @@ -4132,6 +4651,7 @@ load-json-file@^4.0.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -4139,6 +4659,7 @@ locate-path@^2.0.0: locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== dependencies: p-locate "^3.0.0" path-exists "^3.0.0" @@ -4146,6 +4667,7 @@ locate-path@^3.0.0: lock-verify@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lock-verify/-/lock-verify-2.0.2.tgz#148e4f85974915c9e3c34d694b7de9ecb18ee7a8" + integrity sha512-QNVwK0EGZBS4R3YQ7F1Ox8p41Po9VGl2QG/2GsuvTbkJZYSsPeWHKMbbH6iZMCHWSMww5nrJroZYnGzI4cePuw== dependencies: npm-package-arg "^5.1.2 || 6" semver "^5.4.1" @@ -4153,95 +4675,159 @@ lock-verify@^2.0.2: lockfile@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.4.tgz#07f819d25ae48f87e538e6578b6964a4981a5609" + integrity sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA== dependencies: signal-exit "^3.0.2" +lodash._baseindexof@*: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" + integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw= + lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" + integrity sha1-DrtE5FaBSveQXGIS+iybLVG4Qeg= dependencies: lodash._createset "~4.0.0" lodash._root "~3.0.0" +lodash._bindcallback@*: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" + integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4= + +lodash._cacheindexof@*: + version "3.0.2" + resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" + integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI= + +lodash._createcache@*: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" + integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM= + dependencies: + lodash._getnative "^3.0.0" + lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" + integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= + +lodash._getnative@*, lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= lodash._root@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= lodash.assign@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= lodash.camelcase@4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= lodash.capitalize@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9" + integrity sha1-+CbJtOKoUR2E46yinbBeGk87cqk= lodash.clonedeep@~4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= lodash.escaperegexp@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" + integrity sha1-ZHYsSGGAglGKw99Mz11YhtriA0c= + +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= lodash.isplainobject@4.0.6, lodash.isplainobject@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= lodash.isstring@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= lodash.kebabcase@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" + integrity sha1-hImxyw0p/4gZXM7KRI/21swpXDY= lodash.map@^4.5.1: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" + integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM= lodash.merge@4.6.1: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" + integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ== lodash.mergewith@4.6.1: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" + integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ== lodash.omit@4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60" + integrity sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA= -lodash.pick@4.4.0: +lodash.pick@4.4.0, lodash.pick@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM= + +lodash.restparam@*: + version "3.6.1" + resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" + integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= + +lodash.set@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" + integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= lodash.snakecase@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40= lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= lodash.startcase@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" + integrity sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg= lodash.template@^4.0.2: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= dependencies: lodash._reinterpolate "~3.0.0" lodash.templatesettings "^4.0.0" @@ -4249,81 +4835,94 @@ lodash.template@^4.0.2: lodash.templatesettings@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= dependencies: lodash._reinterpolate "~3.0.0" lodash.toarray@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561" + integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE= lodash.topairs@4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.topairs/-/lodash.topairs-4.3.0.tgz#3b6deaa37d60fb116713c46c5f17ea190ec48d64" + integrity sha1-O23qo31g+xFnE8RsXxfqGQ7EjWQ= lodash.unescape@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= lodash.union@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" + integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg= -lodash.uniq@~4.5.0: +lodash.uniq@^4.5.0, lodash.uniq@~4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= lodash.uniqby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" + integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= lodash.upperfirst@4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" + integrity sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984= lodash.without@~4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" + integrity sha1-PNRXSgC2e643OpS3SHcmQFB7eqw= -lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - -lodash@^4.17.5, lodash@^4.2.1: +lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= dependencies: chalk "^1.0.0" log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== dependencies: chalk "^2.0.1" -log-update@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" +log-update@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= dependencies: - ansi-escapes "^1.0.0" - cli-cursor "^1.0.2" + ansi-escapes "^3.0.0" + cli-cursor "^2.0.0" + wrap-ansi "^3.0.1" longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" loud-rejection@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= dependencies: currently-unhandled "^0.4.1" signal-exit "^3.0.0" @@ -4331,31 +4930,37 @@ loud-rejection@^1.0.0: lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== dependencies: pseudomap "^1.0.2" yallist "^2.1.2" -macos-release@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-1.1.0.tgz#831945e29365b470aa8724b0ab36c8f8959d10fb" +macos-release@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.0.0.tgz#7dddf4caf79001a851eb4fba7fb6034f251276ab" + integrity sha512-iCM3ZGeqIzlrH7KxYK+fphlJpCCczyHXc+HhRVbEu9uNTCrzYJjvvtefzeKTCVHd5AP/aD/fzC80JZ4ZP+dQ/A== make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== dependencies: pify "^3.0.0" make-error@1.x: version "1.3.5" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== "make-fetch-happen@^2.5.0 || 3 || 4", make-fetch-happen@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" + integrity sha512-7R5ivfy9ilRJ1EMKIOziwrns9fGeAD4bAha8EB7BIiBBLHm2KeTUGCrICFt2rbHfzheTLynv50GnNTK1zDTrcQ== dependencies: agentkeepalive "^3.4.1" cacache "^11.0.1" @@ -4372,6 +4977,7 @@ make-error@1.x: make-fetch-happen@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-3.0.0.tgz#7b661d2372fc4710ab5cc8e1fa3c290eea69a961" + integrity sha512-FmWY7gC0mL6Z4N86vE14+m719JKE4H0A+pyiOH18B025gF/C113pyfb4gHDDYP5cqnRMHOz06JGdmffC/SES+w== dependencies: agentkeepalive "^3.4.1" cacache "^10.0.4" @@ -4388,36 +4994,43 @@ make-fetch-happen@^3.0.0: makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= dependencies: tmpl "1.0.x" map-age-cleaner@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz#098fb15538fd3dbe461f12745b0ca8568d4e3f74" + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== dependencies: p-defer "^1.0.0" map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= map-obj@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" + integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" marked-terminal@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-3.1.1.tgz#1e726816ddc4552a83393228ff0952b6cd4e5e04" + integrity sha512-7UBFww1rdx0w9HehLMCVYa8/AxXaiDigDfMsJcj82/wgLQG9cj+oiMAVlJpeWD57VFJY2OYY+bKeEVIjIlxi+w== dependencies: cardinal "^2.1.1" chalk "^2.4.1" @@ -4426,26 +5039,31 @@ marked-terminal@^3.0.0: node-emoji "^1.4.1" marked@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.5.0.tgz#9e590bad31584a48ff405b33ab1c0dd25172288e" + version "0.5.2" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.5.2.tgz#3efdb27b1fd0ecec4f5aba362bddcd18120e5ba9" + integrity sha512-fdZvBa7/vSQIZCi4uuwo2N3q+7jJURpMVCcbaX0S1Mg65WZ5ilXvC67MviJAsdjqqgD+CEq4RKo5AYGgINkVAA== math-random@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= meant@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/meant/-/meant-1.0.1.tgz#66044fea2f23230ec806fb515efea29c44d2115d" + integrity sha512-UakVLFjKkbbUwNWJ2frVLnnAtbb7D7DsloxRd3s/gDpI8rdv8W5Hp3NaDb+POBI1fQdeussER6NB8vpcRURvlg== mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= dependencies: mimic-fn "^1.0.0" mem@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/mem/-/mem-4.0.0.tgz#6437690d9471678f6cc83659c00cbafcd6b0cdaf" + integrity sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA== dependencies: map-age-cleaner "^0.1.1" mimic-fn "^1.0.0" @@ -4454,6 +5072,7 @@ mem@^4.0.0: meow@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" + integrity sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== dependencies: camelcase-keys "^4.0.0" decamelize-keys "^1.0.0" @@ -4468,6 +5087,7 @@ meow@5.0.0: meow@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.1.tgz#d48598f6f4b1472f35bf6317a95945ace347f975" + integrity sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A== dependencies: camelcase-keys "^4.0.0" decamelize-keys "^1.0.0" @@ -4482,20 +5102,24 @@ meow@^4.0.0: merge-stream@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= dependencies: readable-stream "^2.0.1" -merge2@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.2.tgz#03212e3da8d86c4d8523cebd6318193414f94e34" +merge2@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" + integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== merge@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + version "1.2.1" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" + integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -4514,6 +5138,7 @@ micromatch@^2.3.11: micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -4529,47 +5154,44 @@ micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: snapdragon "^0.8.1" to-regex "^3.0.2" -mime-db@~1.35.0: - version "1.35.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" - -mime-db@~1.36.0: - version "1.36.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" - -mime-types@^2.1.12, mime-types@~2.1.17: - version "2.1.19" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" - dependencies: - mime-db "~1.35.0" +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== -mime-types@~2.1.19: - version "2.1.20" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== dependencies: - mime-db "~1.36.0" + mime-db "~1.37.0" mime@^2.0.3: - version "2.3.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" + version "2.4.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" + integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist-options@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" + integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== dependencies: arrify "^1.0.1" is-plain-obj "^1.1.0" @@ -4577,31 +5199,37 @@ minimist-options@^3.0.1: minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.2.1, minipass@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" +minipass@^2.2.1, minipass@^2.3.3, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" -minizlib@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" +minizlib@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42" + integrity sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg== dependencies: minipass "^2.2.1" mississippi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" + integrity sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw== dependencies: concat-stream "^1.5.0" duplexify "^3.4.2" @@ -4617,6 +5245,7 @@ mississippi@^2.0.0: mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== dependencies: concat-stream "^1.5.0" duplexify "^3.4.2" @@ -4632,6 +5261,7 @@ mississippi@^3.0.0: mixin-deep@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -4639,16 +5269,19 @@ mixin-deep@^1.2.0: mkdirp@0.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" modify-values@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" + integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= dependencies: aproba "^1.1.1" copy-concurrently "^1.0.0" @@ -4660,22 +5293,27 @@ move-concurrently@^1.0.1: ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.0.0, ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= nan@^2.9.2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + version "2.11.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" + integrity sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA== nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -4692,10 +5330,12 @@ nanomatch@^1.2.9: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= needle@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== dependencies: debug "^2.1.2" iconv-lite "^0.4.4" @@ -4704,32 +5344,38 @@ needle@^2.2.1: nerf-dart@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/nerf-dart/-/nerf-dart-1.0.0.tgz#e6dab7febf5ad816ea81cf5c629c5a0ebde72c1a" + integrity sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo= nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== node-emoji@^1.4.1: version "1.8.1" resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.8.1.tgz#6eec6bfb07421e2148c75c6bba72421f8530a826" + integrity sha512-+ktMAh1Jwas+TnGodfCfjUbJKoANqPaJFN0z0iqh41eqD8dvguNzcitVSBSVK1pidz0AqGbLKcoVuVLRVZ/aVg== dependencies: lodash.toarray "^4.4.0" node-fetch-npm@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7" + integrity sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw== dependencies: encoding "^0.1.11" json-parse-better-errors "^1.0.0" safe-buffer "^5.1.1" -node-fetch@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.0.tgz#4ee79bde909262f9775f731e3656d0db55ced5b5" +node-fetch@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" + integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== node-gyp@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" + integrity sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA== dependencies: fstream "^1.0.0" glob "^7.0.3" @@ -4747,23 +5393,27 @@ node-gyp@^3.8.0: node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= node-modules-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + version "5.3.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.3.0.tgz#c77a4a7b84038733d5fb351aafd8a268bfe19a01" + integrity sha512-AhENzCSGZnZJgBARsUjnQ7DnZbzyP+HxlVXuD0xqAnvL8q+OqtSX7lGg9e8nHzwXkMMXNdVeqq4E2M3EUAqX6Q== dependencies: growly "^1.3.0" - semver "^5.4.1" + semver "^5.5.0" shellwords "^0.1.1" which "^1.3.0" node-pre-gyp@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" @@ -4776,21 +5426,24 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-releases@^1.0.0-alpha.11: - version "1.0.0-alpha.11" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.0-alpha.11.tgz#73c810acc2e5b741a17ddfbb39dfca9ab9359d8a" +node-releases@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.5.tgz#a641adcc968b039a27345d92ef10b093e5cbd41d" + integrity sha512-Ky7q0BO1BBkG/rQz6PkEZ59rwo+aSfhczHP1wwq8IowoVdN/FpiP7qp0XW0P2+BVCWe5fQUBozdbVd54q1RbCQ== dependencies: semver "^5.3.0" "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= dependencies: abbrev "1" nopt@^4.0.1, nopt@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= dependencies: abbrev "1" osenv "^0.1.4" @@ -4798,6 +5451,7 @@ nopt@^4.0.1, nopt@~4.0.1: normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.4.0, "normalize-package-data@~1.0.1 || ^2.0.0", normalize-package-data@~2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -4807,41 +5461,54 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package- normalize-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + integrity sha1-MtDkcvkf80VwHBWoMRAY07CpA3k= normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" -normalize-url@^3.0.0, normalize-url@^3.1.0: +normalize-url@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" + integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== + +normalize-url@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.0.0.tgz#6c2214dde2fc8ea88509ec79774ccbd1d426c1ea" + integrity sha512-OrtNzJOeI9+UaF8KfvPoqh8ZVjLiun+fggtLzrpPsmdOU01eIp3vYXDfeFv4KwqJxcmmrW/ubNCN+9iIQRVtfw== npm-audit-report@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/npm-audit-report/-/npm-audit-report-1.3.1.tgz#e79ea1fcb5ffaf3031102b389d5222c2b0459632" + integrity sha512-SjTF8ZP4rOu3JiFrTMi4M1CmVo2tni2sP4TzhyCMHwnMGf6XkdGLZKt9cdZ12esKf0mbQqFyU9LtY0SoeahL7g== dependencies: cli-table3 "^0.5.0" console-control-strings "^1.1.0" npm-bundled@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + version "1.0.5" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== npm-cache-filename@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz#ded306c5b0bfc870a9e9faf823bc5f283e05ae11" + integrity sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE= npm-install-checks@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-3.0.0.tgz#d4aecdfd51a53e3723b7b2f93b2ee28e307bc0d7" + integrity sha1-1K7N/VGlPjcjt7L5Oy7ijjB7wNc= dependencies: semver "^2.3.0 || 3.x || 4 || 5" npm-lifecycle@^2.0.3, npm-lifecycle@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.1.0.tgz#1eda2eedb82db929e3a0c50341ab0aad140ed569" + integrity sha512-QbBfLlGBKsktwBZLj6AviHC6Q9Y3R/AY4a2PYSIRhSKSS0/CxRyD/PfxEX6tPeOCXQgMSNdwGeECacstgptc+g== dependencies: byline "^5.0.0" graceful-fs "^4.1.11" @@ -4855,10 +5522,12 @@ npm-lifecycle@^2.0.3, npm-lifecycle@^2.1.0: npm-logical-tree@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/npm-logical-tree/-/npm-logical-tree-1.2.1.tgz#44610141ca24664cad35d1e607176193fd8f5b88" + integrity sha512-AJI/qxDB2PWI4LG1CYN579AY1vCiNyWfkiquCsJWqntRu/WwimVrC8yXeILBFHDwxfOejxewlmnvW9XXjMlYIg== "npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^5.1.2 || 6", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" + integrity sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA== dependencies: hosted-git-info "^2.6.0" osenv "^0.1.5" @@ -4866,8 +5535,9 @@ npm-logical-tree@^1.2.1: validate-npm-package-name "^3.0.0" npm-packlist@^1.1.10, npm-packlist@^1.1.11, npm-packlist@^1.1.6: - version "1.1.11" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" + version "1.1.12" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a" + integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -4875,19 +5545,23 @@ npm-packlist@^1.1.10, npm-packlist@^1.1.11, npm-packlist@^1.1.6: npm-path@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" + integrity sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw== dependencies: which "^1.2.10" npm-pick-manifest@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.1.0.tgz#dc381bdd670c35d81655e1d5a94aa3dd4d87fce5" + version "2.2.3" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz#32111d2a9562638bb2c8f2bf27f7f3092c8fae40" + integrity sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA== dependencies: + figgy-pudding "^3.5.1" npm-package-arg "^6.0.0" semver "^5.4.1" npm-profile@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-3.0.2.tgz#58d568f1b56ef769602fd0aed8c43fa0e0de0f57" + integrity sha512-rEJOFR6PbwOvvhGa2YTNOJQKNuc6RovJ6T50xPU7pS9h/zKPNCJ+VHZY2OFXyZvEi+UQYtHRTp8O/YM3tUD20A== dependencies: aproba "^1.1.2 || 2" make-fetch-happen "^2.5.0 || 3 || 4" @@ -4895,6 +5569,7 @@ npm-profile@^3.0.2: npm-registry-client@^8.6.0: version "8.6.0" resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-8.6.0.tgz#7f1529f91450732e89f8518e0f21459deea3e4c4" + integrity sha512-Qs6P6nnopig+Y8gbzpeN/dkt+n7IyVd8f45NTMotGk6Qo7GfBmzwYx6jRLoOOgKiMnaQfYxsuyQlD8Mc3guBhg== dependencies: concat-stream "^1.5.2" graceful-fs "^4.1.6" @@ -4913,6 +5588,7 @@ npm-registry-client@^8.6.0: npm-registry-fetch@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-1.1.1.tgz#710bc5947d9ee2c549375072dab6d5d17baf2eb2" + integrity sha512-ev+zxOXsgAqRsR8Rk+ErjgWOlbrXcqGdme94/VNdjDo1q8TSy10Pp8xgDv/ZmMk2jG/KvGtXUNG4GS3+l6xbDw== dependencies: bluebird "^3.5.1" figgy-pudding "^3.0.0" @@ -4924,6 +5600,7 @@ npm-registry-fetch@^1.1.0: npm-registry-fetch@^3.0.0: version "3.8.0" resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.8.0.tgz#aa7d9a7c92aff94f48dba0984bdef4bd131c88cc" + integrity sha512-hrw8UMD+Nob3Kl3h8Z/YjmKamb1gf7D1ZZch2otrIXM3uFLB5vjEY6DhMlq80z/zZet6eETLbOXcuQudCB3Zpw== dependencies: JSONStream "^1.3.4" bluebird "^3.5.1" @@ -4935,16 +5612,19 @@ npm-registry-fetch@^3.0.0: npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" npm-user-validate@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-1.0.0.tgz#8ceca0f5cea04d4e93519ef72d0557a75122e951" + integrity sha1-jOyg9c6gTU6TUZ73LQVXp1Ei6VE= npm-which@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + integrity sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo= dependencies: commander "^2.9.0" npm-path "^2.0.2" @@ -4953,6 +5633,7 @@ npm-which@^3.0.1: npm@^6.3.0: version "6.4.1" resolved "https://registry.yarnpkg.com/npm/-/npm-6.4.1.tgz#4f39f9337b557a28faed4a771d5c8802d6b4288b" + integrity sha512-mXJL1NTVU136PtuopXCUQaNWuHlXCTp4McwlSW8S9/Aj8OEPAlSBgo8og7kJ01MjCDrkmqFQTvN5tTEhBMhXQg== dependencies: JSONStream "^1.3.4" abbrev "~1.1.1" @@ -5067,6 +5748,7 @@ npm@^6.3.0: "npmlog@0 || 1 || 2 || 3 || 4", "npmlog@2 || ^3.1.0 || ^4.0.0", npmlog@^4.0.2, npmlog@~4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" @@ -5076,44 +5758,48 @@ npm@^6.3.0: number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= nwsapi@^2.0.7: - version "2.0.8" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.8.tgz#e3603579b7e162b3dbedae4fb24e46f771d8fa24" - -oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + version "2.0.9" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.9.tgz#77ac0cdfdcad52b6a1151a84e73254edc33ed016" + integrity sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ== oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.8: +object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= dependencies: define-properties "^1.1.2" es-abstract "^1.5.1" @@ -5121,6 +5807,7 @@ object.getownpropertydescriptors@^2.0.3: object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= dependencies: for-own "^0.1.4" is-extendable "^0.1.1" @@ -5128,26 +5815,38 @@ object.omit@^2.0.0: object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" +octokit-pagination-methods@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" + integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== + once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0, once@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" opener@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" + integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA== optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= dependencies: minimist "~0.0.1" wordwrap "~0.0.2" @@ -5155,6 +5854,7 @@ optimist@^0.6.1: optionator@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.4" @@ -5166,10 +5866,12 @@ optionator@^0.8.1: os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== dependencies: execa "^0.7.0" lcid "^1.0.0" @@ -5178,100 +5880,129 @@ os-locale@^2.0.0: os-locale@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.0.1.tgz#3b014fbf01d87f60a1e5348d80fe870dc82c4620" + integrity sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw== dependencies: execa "^0.10.0" lcid "^2.0.0" mem "^4.0.0" -os-name@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/os-name/-/os-name-2.0.1.tgz#b9a386361c17ae3a21736ef0599405c9a8c5dc5e" +os-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.0.0.tgz#e1434dbfddb8e74b44c98b56797d951b7648a5d9" + integrity sha512-7c74tib2FsdFbQ3W+qj8Tyd1R3Z6tuVRNNxXjJcZ4NgjIEQU9N/prVMqcW29XZPXGACqaXN3jq58/6hoaoXH6g== dependencies: - macos-release "^1.0.0" - win-release "^1.0.0" + macos-release "^2.0.0" + windows-release "^3.1.0" os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= osenv@0, osenv@^0.1.4, osenv@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -p-cancelable@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.5.1.tgz#b797a33c43c645cd70d5a838b1d25352b9e29e75" +p-cancelable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.0.0.tgz#07e9c6d22c31f9c6784cb4f1e1454a79b6d9e2d6" + integrity sha512-USgPoaC6tkTGlS831CxsVdmZmyb8tR1D+hStI84MyckLOzfJlYQUweomrwE3D8T7u5u5GVuW064LT501wHTYYA== p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= p-filter@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-filter/-/p-filter-1.0.0.tgz#629d317150209c8fd508ba137713ef4bb920e9db" + integrity sha1-Yp0xcVAgnI/VCLoTdxPvS7kg6ds= dependencies: p-map "^1.0.0" p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-is-promise@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" + integrity sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4= + +p-is-promise@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.0.0.tgz#7554e3d572109a87e1f3f53f6a7d85d1b194f4c5" + integrity sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg== p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-limit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" + integrity sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A== dependencies: p-try "^2.0.0" p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== dependencies: p-limit "^2.0.0" p-map@^1.0.0, p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== + +p-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.0.0.tgz#be18c5a5adeb8e156460651421aceca56c213a50" + integrity sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w== p-reduce@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= p-retry@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-2.0.0.tgz#b97f1f4d6d81a3c065b2b40107b811e995c1bfba" + integrity sha512-ZbCuzAmiwJ45q4evp/IG9D+5MUllGSUeCWwPt3j/tdYSi1KPkSD+46uqmAA1LhccDhOXv8kYZKNb8x78VflzfA== dependencies: retry "^0.12.0" p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= p-try@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ== package-json@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + integrity sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0= dependencies: got "^6.7.1" registry-auth-token "^3.0.1" @@ -5281,6 +6012,7 @@ package-json@^4.0.0: pacote@^8.1.6: version "8.1.6" resolved "https://registry.yarnpkg.com/pacote/-/pacote-8.1.6.tgz#8e647564d38156367e7a9dc47a79ca1ab278d46e" + integrity sha512-wTOOfpaAQNEQNtPEx92x9Y9kRWVu45v583XT8x2oEV2xRB74+xdqMZIeGW4uFvAyZdmSBtye+wKdyyLaT8pcmw== dependencies: bluebird "^3.5.1" cacache "^11.0.2" @@ -5311,6 +6043,7 @@ pacote@^8.1.6: parallel-transform@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= dependencies: cyclist "~0.2.2" inherits "^2.0.3" @@ -5319,10 +6052,12 @@ parallel-transform@^1.1.0: parse-github-url@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395" + integrity sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw== parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= dependencies: glob-base "^0.3.0" is-dotfile "^1.0.0" @@ -5332,64 +6067,69 @@ parse-glob@^3.0.4: parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= dependencies: error-ex "^1.2.0" parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= dependencies: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" -parse-url@^1.3.0: - version "1.3.11" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-1.3.11.tgz#57c15428ab8a892b1f43869645c711d0e144b554" - dependencies: - is-ssh "^1.3.0" - protocols "^1.4.0" - parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= dependencies: pinkie-promise "^2.0.0" path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-is-inside@^1.0.1, path-is-inside@^1.0.2, path-is-inside@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= path-parse@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= dependencies: graceful-fs "^4.1.2" pify "^2.0.0" @@ -5398,40 +6138,48 @@ path-type@^1.0.0: path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== dependencies: pify "^3.0.0" performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pirates@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.0.tgz#850b18781b4ac6ec58a43c9ed9ec5fe6796addbd" + integrity sha512-8t5BsXy1LUIjn3WWOlOuFDuKswhQb/tkak641lvBgmPOBUQHXveORtlMCp6OdPV1dtuTaEahKA8VNz6uLfKBtA== dependencies: node-modules-regexp "^1.0.0" pkg-conf@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.1.0.tgz#2126514ca6f2abfebd168596df18ba57867f0058" + integrity sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg= dependencies: find-up "^2.0.0" load-json-file "^4.0.0" @@ -5439,53 +6187,56 @@ pkg-conf@^2.1.0: pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= dependencies: find-up "^2.1.0" please-upgrade-node@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" + integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== dependencies: semver-compare "^1.0.0" pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= prettier@^1.14.3: - version "1.14.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.3.tgz#90238dd4c0684b7edce5f83b0fb7328e48bd0895" - -pretty-format@^23.2.0: - version "23.2.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" + version "1.15.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.3.tgz#1feaac5bdd181237b54dbe65d874e02a1472786a" + integrity sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg== pretty-format@^23.6.0: version "23.6.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" + integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== dependencies: ansi-regex "^3.0.0" ansi-styles "^3.2.0" @@ -5493,18 +6244,22 @@ pretty-format@^23.6.0: private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== promise-inflight@^1.0.1, promise-inflight@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= promise-retry@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-1.1.1.tgz#6739e968e3051da20ce6497fb2b50f6911df3d6d" + integrity sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0= dependencies: err-code "^1.0.0" retry "^0.10.0" @@ -5512,6 +6267,7 @@ promise-retry@^1.1.1: prompts@^0.1.9: version "0.1.14" resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2" + integrity sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w== dependencies: kleur "^2.0.1" sisteransi "^0.1.1" @@ -5519,38 +6275,41 @@ prompts@^0.1.9: promzard@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" + integrity sha1-JqXW7ox97kyxIggwWs+5O6OCqe4= dependencies: read "1" proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" - -protocols@^1.1.0, protocols@^1.4.0: - version "1.4.6" - resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.6.tgz#f8bb263ea1b5fd7a7604d26b8be39bd77678bf8a" + integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= protoduck@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.0.tgz#752145e6be0ad834cb25716f670a713c860dce70" + version "5.0.1" + resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.1.tgz#03c3659ca18007b69a50fd82a7ebcc516261151f" + integrity sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg== dependencies: - genfun "^4.0.1" + genfun "^5.0.0" prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24: +psl@^1.1.24, psl@^1.1.28: version "1.1.29" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== pump@^2.0.0, pump@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== dependencies: end-of-stream "^1.1.0" once "^1.3.1" @@ -5558,6 +6317,7 @@ pump@^2.0.0, pump@^2.0.1: pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== dependencies: end-of-stream "^1.1.0" once "^1.3.1" @@ -5565,6 +6325,7 @@ pump@^3.0.0: pumpify@^1.3.3: version "1.5.1" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== dependencies: duplexify "^3.6.0" inherits "^2.0.3" @@ -5573,26 +6334,32 @@ pumpify@^1.3.3: punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= qrcode-terminal@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" + integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== -qs@~6.5.1, qs@~6.5.2: +qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== query-string@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.1.0.tgz#01e7d69f6a0940dac67a937d6c6325647aa4532a" + version "6.2.0" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.2.0.tgz#468edeb542b7e0538f9f9b1aeb26f034f19c86e1" + integrity sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA== dependencies: decode-uri-component "^0.2.0" strict-uri-encode "^2.0.0" @@ -5600,14 +6367,17 @@ query-string@^6.1.0: quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" + integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= qw@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/qw/-/qw-1.0.1.tgz#efbfdc740f9ad054304426acb183412cc8b996d4" + integrity sha1-77/cdA+a0FQwRCassYNBLMi5ltQ= randomatic@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== dependencies: is-number "^4.0.0" kind-of "^6.0.0" @@ -5616,6 +6386,7 @@ randomatic@^3.0.0: rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" ini "~1.3.0" @@ -5625,12 +6396,14 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7, rc@^1.2.8: read-cmd-shim@^1.0.1, read-cmd-shim@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" + integrity sha1-LV0Vd4ajfAVdIgd8MsU/gynpHHs= dependencies: graceful-fs "^4.1.2" read-installed@~4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" + integrity sha1-/5uLZ/GH0eTCm5/rMfayI6zRkGc= dependencies: debuglog "^1.0.1" read-package-json "^2.0.0" @@ -5644,6 +6417,7 @@ read-installed@~4.0.3: "read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.0.13.tgz#2e82ebd9f613baa6d2ebe3aa72cefe3f68e41f4a" + integrity sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg== dependencies: glob "^7.1.1" json-parse-better-errors "^1.0.1" @@ -5655,6 +6429,7 @@ read-installed@~4.0.3: read-package-tree@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.2.1.tgz#6218b187d6fac82289ce4387bbbaf8eef536ad63" + integrity sha512-2CNoRoh95LxY47LvqrehIAfUVda2JbuFE/HaGYs42bNrGG+ojbw1h3zOcPcQ+1GQ3+rkzNndZn85u1XyZ3UsIA== dependencies: debuglog "^1.0.1" dezalgo "^1.0.0" @@ -5665,6 +6440,7 @@ read-package-tree@^5.2.1: read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= dependencies: find-up "^1.0.0" read-pkg "^1.0.0" @@ -5672,6 +6448,7 @@ read-pkg-up@^1.0.1: read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= dependencies: find-up "^2.0.0" read-pkg "^3.0.0" @@ -5679,6 +6456,7 @@ read-pkg-up@^3.0.0: read-pkg-up@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== dependencies: find-up "^3.0.0" read-pkg "^3.0.0" @@ -5686,6 +6464,7 @@ read-pkg-up@^4.0.0: read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= dependencies: load-json-file "^1.0.0" normalize-package-data "^2.3.2" @@ -5694,6 +6473,7 @@ read-pkg@^1.0.0: read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= dependencies: load-json-file "^4.0.0" normalize-package-data "^2.3.2" @@ -5702,6 +6482,7 @@ read-pkg@^3.0.0: read-pkg@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" + integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= dependencies: normalize-package-data "^2.3.2" parse-json "^4.0.0" @@ -5710,12 +6491,14 @@ read-pkg@^4.0.0: read@1, read@~1.0.1, read@~1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -5727,16 +6510,18 @@ read@1, read@~1.0.1, read@~1.0.7: readable-stream@~1.1.10: version "1.1.14" - resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" isarray "0.0.1" string_decoder "~0.10.x" -readdir-scoped-modules@^1.0.0: +readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" + integrity sha1-n6+jfShr5dksuuve4DDcm19AZ0c= dependencies: debuglog "^1.0.1" dezalgo "^1.0.0" @@ -5744,20 +6529,23 @@ readdir-scoped-modules@^1.0.0: once "^1.3.0" realpath-native@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.1.tgz#07f40a0cce8f8261e2e8b7ebebf5c95965d7b633" + version "1.0.2" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.2.tgz#cd51ce089b513b45cf9b1516c82989b51ccc6560" + integrity sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g== dependencies: util.promisify "^1.0.0" rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= dependencies: resolve "^1.1.6" redent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" + integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= dependencies: indent-string "^3.0.0" strip-indent "^2.0.0" @@ -5765,42 +6553,50 @@ redent@^2.0.0: redeyed@~2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-2.1.1.tgz#8984b5815d99cb220469c99eeeffe38913e6cc0b" + integrity sha1-iYS1gV2ZyyIEacme7v/jiRPmzAs= dependencies: esprima "~4.0.0" regenerate-unicode-properties@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" + integrity sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw== dependencies: regenerate "^1.4.0" regenerate@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-transform@^0.13.3: version "0.13.3" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" + integrity sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA== dependencies: private "^0.1.6" regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== dependencies: is-equal-shallow "^0.1.3" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" @@ -5808,6 +6604,7 @@ regex-not@^1.0.0, regex-not@^1.0.2: regexpu-core@^4.1.3, regexpu-core@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" + integrity sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw== dependencies: regenerate "^1.4.0" regenerate-unicode-properties "^7.0.0" @@ -5819,6 +6616,7 @@ regexpu-core@^4.1.3, regexpu-core@^4.2.0: registry-auth-token@^3.0.1, registry-auth-token@^3.3.1: version "3.3.2" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" + integrity sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ== dependencies: rc "^1.1.6" safe-buffer "^5.0.1" @@ -5826,54 +6624,64 @@ registry-auth-token@^3.0.1, registry-auth-token@^3.3.1: registry-url@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= dependencies: rc "^1.0.1" regjsgen@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" + integrity sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA== regjsparser@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.3.0.tgz#3c326da7fcfd69fa0d332575a41c8c0cdf588c96" + integrity sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA== dependencies: jsesc "~0.5.0" remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= dependencies: is-finite "^1.0.0" request-promise-core@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= dependencies: lodash "^4.13.1" request-promise-native@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + integrity sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU= dependencies: request-promise-core "1.1.1" stealthy-require "^1.1.0" tough-cookie ">=2.3.3" -request@^2.74.0, request@^2.88.0: +request@^2.74.0, request@^2.87.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -5896,46 +6704,25 @@ request@^2.74.0, request@^2.88.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -request@^2.87.0: - version "2.87.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-from-string@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= dependencies: caller-path "^0.1.0" resolve-from "^1.0.0" @@ -5943,115 +6730,131 @@ require-uncached@^1.0.3: resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= dependencies: resolve-from "^3.0.0" resolve-from@4.0.0, resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= resolve-global@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-0.1.0.tgz#8fb02cfd5b7db20118e886311f15af95bd15fbd9" + integrity sha1-j7As/Vt9sgEY6IYxHxWvlb0V+9k= dependencies: global-dirs "^0.1.0" resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.6, resolve@^1.3.2: +resolve@1.x, resolve@^1.1.6, resolve@^1.3.2: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= dependencies: lowercase-keys "^1.0.0" -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" + onetime "^2.0.0" + signal-exit "^3.0.2" ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== retry@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" + integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" + integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= right-pad@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" + integrity sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA= rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== dependencies: glob "^7.0.5" rsvp@^3.3.3: version "3.6.2" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" + integrity sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw== run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= dependencies: aproba "^1.1.1" -rxjs@^6.1.0: - version "6.3.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.2.tgz#6a688b16c4e6e980e62ea805ec30648e1c60907f" +rxjs@^6.3.3: + version "6.3.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" + integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw== dependencies: tslib "^1.9.0" safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sane@^2.0.0: version "2.5.2" resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" + integrity sha1-tNwYYcIbQn6SlQej51HiosuKs/o= dependencies: anymatch "^2.0.0" capture-exit "^1.2.0" @@ -6067,26 +6870,27 @@ sane@^2.0.0: sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== semantic-release@^15.9.16: - version "15.9.16" - resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.9.16.tgz#70391ef6a9246253f54061ecd06634994e305b1e" + version "15.12.3" + resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.12.3.tgz#9f7c5a8ac55624a6418e0bf95bf53c2030487c12" + integrity sha512-3HCKD2ORxi6jItIoP9WeYJjjHsZqozSf6WUGcLClnRH553OVNKf4mLdOwo9UHJe6dVNSk5z7oDfGWKGwVy63BA== dependencies: - "@semantic-release/commit-analyzer" "^6.0.0" + "@semantic-release/commit-analyzer" "^6.1.0" "@semantic-release/error" "^2.2.0" - "@semantic-release/github" "^5.0.0" - "@semantic-release/npm" "^5.0.1" - "@semantic-release/release-notes-generator" "^7.0.0" + "@semantic-release/github" "^5.1.0" + "@semantic-release/npm" "^5.0.5" + "@semantic-release/release-notes-generator" "^7.1.2" aggregate-error "^1.0.0" cosmiconfig "^5.0.1" debug "^4.0.0" env-ci "^3.0.0" execa "^1.0.0" figures "^2.0.0" - find-versions "^2.0.0" + find-versions "^3.0.0" get-stream "^4.0.0" git-log-parser "^1.2.0" - git-url-parse "^10.0.1" hook-std "^1.1.0" hosted-git-info "^2.7.1" lodash "^4.17.4" @@ -6103,40 +6907,44 @@ semantic-release@^15.9.16: semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= dependencies: semver "^5.0.3" -semver-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-1.0.0.tgz#92a4969065f9c70c694753d55248fc68f8f652c9" +semver-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" + integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== -"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.1, semver@^5.0.3, semver@^5.1.0: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" +"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@5.6.0, "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== -"semver@2 || 3 || 4 || 5", semver@5.5.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: +semver@5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -semver@^5.5: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= set-value@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -6146,6 +6954,7 @@ set-value@^0.4.3: set-value@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -6155,6 +6964,7 @@ set-value@^2.0.0: sha@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/sha/-/sha-2.0.1.tgz#6030822fbd2c9823949f8f72ed6411ee5cf25aae" + integrity sha1-YDCCL70smCOUn49y7WQR7lzyWq4= dependencies: graceful-fs "^4.1.2" readable-stream "^2.0.2" @@ -6162,16 +6972,19 @@ sha@~2.0.1: shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= shelljs@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" + integrity sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ== dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -6180,14 +6993,17 @@ shelljs@0.8.2: shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= signale@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/signale/-/signale-1.3.0.tgz#1b4917c2c7a8691550adca0ad1da750a662b4497" + integrity sha512-TyFhsQ9wZDYDfsPqWMyjCxsDoMwfpsT0130Mce7wDiVCSDdtWSg83dOqoj8aGpGCs3n1YPcam6sT1OFPuGT/OQ== dependencies: chalk "^2.3.2" figures "^2.0.0" @@ -6196,30 +7012,37 @@ signale@^1.2.1: sisteransi@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" + integrity sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g== slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= slide@^1.1.3, slide@^1.1.6, slide@~1.1.3, slide@~1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= smart-buffer@^1.0.13: version "1.1.15" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" + integrity sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY= smart-buffer@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" + integrity sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg== snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" @@ -6228,12 +7051,14 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" @@ -6247,6 +7072,7 @@ snapdragon@^0.8.1: socks-proxy-agent@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz#2eae7cf8e2a82d34565761539a7f9718c5617659" + integrity sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA== dependencies: agent-base "^4.1.0" socks "^1.1.10" @@ -6254,6 +7080,7 @@ socks-proxy-agent@^3.0.1: socks-proxy-agent@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" + integrity sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw== dependencies: agent-base "~4.2.0" socks "~2.2.0" @@ -6261,13 +7088,15 @@ socks-proxy-agent@^4.0.0: socks@^1.1.10: version "1.1.10" resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a" + integrity sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o= dependencies: ip "^1.1.4" smart-buffer "^1.0.13" socks@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" + version "2.2.2" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.2.tgz#f061219fc2d4d332afb4af93e865c84d3fa26e2b" + integrity sha512-g6wjBnnMOZpE0ym6e0uHSddz9p3a+WsBaaYQaBaSCJYvrC4IXykQR9MNGjLQf38e9iIIhp3b1/Zk8YZI3KGJ0Q== dependencies: ip "^1.1.5" smart-buffer "^4.0.1" @@ -6275,10 +7104,12 @@ socks@~2.2.0: sorted-object@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/sorted-object/-/sorted-object-2.0.1.tgz#7d631f4bd3a798a24af1dffcfbfe83337a5df5fc" + integrity sha1-fWMfS9OnmKJK8d/8+/6DM3pd9fw= sorted-union-stream@~2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/sorted-union-stream/-/sorted-union-stream-2.1.3.tgz#c7794c7e077880052ff71a8d4a2dbb4a9a638ac7" + integrity sha1-x3lMfgd4gAUv9xqNSi27Sppjisc= dependencies: from2 "^1.3.0" stream-iterate "^1.1.0" @@ -6286,6 +7117,7 @@ sorted-union-stream@~2.1.3: source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== dependencies: atob "^2.1.1" decode-uri-component "^0.2.0" @@ -6296,19 +7128,14 @@ source-map-resolve@^0.5.0: source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== dependencies: source-map "^0.5.6" -source-map-support@^0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-support@^0.5.9: +source-map-support@^0.5.6, source-map-support@^0.5.9: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -6316,113 +7143,125 @@ source-map-support@^0.5.9: source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" - dependencies: - amdefine ">=0.0.4" - -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== spawn-error-forwarder@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/spawn-error-forwarder/-/spawn-error-forwarder-1.0.0.tgz#1afd94738e999b0346d7b9fc373be55e07577029" + integrity sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk= spdx-correct@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" + version "3.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" + integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== spdx-expression-parse@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" + version "3.0.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz#a59efc09784c2a5bada13cfeaf5c75dd214044d2" + integrity sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" split2@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" + integrity sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw== dependencies: through2 "^2.0.2" split2@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/split2/-/split2-1.0.0.tgz#52e2e221d88c75f9a73f90556e263ff96772b314" + integrity sha1-UuLiIdiMdfmnP5BVbiY/+WdysxQ= dependencies: through2 "~2.0.0" split@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" + integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== dependencies: through "2" sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: - version "1.14.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" + version "1.15.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.2.tgz#c946d6bd9b1a39d0e8635763f5242d6ed6dcb629" + integrity sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - safer-buffer "^2.0.2" - optionalDependencies: bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" ecc-jsbn "~0.1.1" + getpass "^0.1.1" jsbn "~0.1.0" + safer-buffer "^2.0.2" tweetnacl "~0.14.0" ssri@^5.2.4: version "5.3.0" resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.3.0.tgz#ba3872c9c6d33a0704a7d71ff045e5ec48999d06" + integrity sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ== dependencies: safe-buffer "^5.1.1" ssri@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== dependencies: figgy-pudding "^3.5.1" stack-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== staged-git-files@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" + integrity sha512-H89UNKr1rQJvI1c/PIR3kiAMBV23yvR7LItZiV74HWZwzt7f3YHuujJ9nJZlt58WlFox7XQsOahexwk7nTe69A== static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" @@ -6430,10 +7269,12 @@ static-extend@^0.1.1: stealthy-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= stream-combiner2@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + integrity sha1-+02KFCDqNidk4hrUeAOXvry0HL4= dependencies: duplexer2 "~0.1.0" readable-stream "^2.0.2" @@ -6441,6 +7282,7 @@ stream-combiner2@~1.1.1: stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== dependencies: end-of-stream "^1.1.0" stream-shift "^1.0.0" @@ -6448,6 +7290,7 @@ stream-each@^1.1.0: stream-iterate@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/stream-iterate/-/stream-iterate-1.2.0.tgz#2bd7c77296c1702a46488b8ad41f79865eecd4e1" + integrity sha1-K9fHcpbBcCpGSIuK1B95hl7s1OE= dependencies: readable-stream "^2.1.5" stream-shift "^1.0.0" @@ -6455,18 +7298,22 @@ stream-iterate@^1.1.0: stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= string-argv@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" + integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= string-length@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= dependencies: astral-regex "^1.0.0" strip-ansi "^4.0.0" @@ -6474,6 +7321,7 @@ string-length@^2.0.0: string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" @@ -6482,6 +7330,7 @@ string-width@^1.0.1: "string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" @@ -6489,105 +7338,117 @@ string-width@^1.0.1: string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" stringify-object@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== dependencies: - get-own-enumerable-property-symbols "^2.0.1" + get-own-enumerable-property-symbols "^3.0.0" is-obj "^1.0.1" is-regexp "^1.0.0" stringify-package@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.0.tgz#e02828089333d7d45cd8c287c30aa9a13375081b" + integrity sha512-JIQqiWmLiEozOC0b0BtxZ/AOUtdUZHCBPgqIZ2kSJJqGwgb9neo44XdTHUC4HZSGqi03hOeB7W/E8rAlKnGe9g== strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" strip-bom@3.0.0, strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= dependencies: is-utf8 "^0.2.0" strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= strip-indent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= supports-color@^3.1.2: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= dependencies: has-flag "^1.0.0" -supports-color@^5.2.0: +supports-color@^5.2.0, supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - dependencies: - has-flag "^3.0.0" - -supports-color@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" symbol-observable@^1.1.0, symbol-observable@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== symbol-tree@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= tar@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= dependencies: block-stream "*" fstream "^1.0.2" inherits "2" tar@^4, tar@^4.4.3, tar@^4.4.6: - version "4.4.6" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== dependencies: - chownr "^1.0.1" + chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.3.3" - minizlib "^1.1.0" + minipass "^2.3.4" + minizlib "^1.1.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" yallist "^3.0.2" @@ -6595,75 +7456,90 @@ tar@^4, tar@^4.4.3, tar@^4.4.6: term-size@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= dependencies: execa "^0.7.0" test-exclude@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" + version "4.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" + integrity sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA== dependencies: arrify "^1.0.1" - micromatch "^3.1.8" + micromatch "^2.3.11" object-assign "^4.1.0" read-pkg-up "^1.0.1" require-main-filename "^1.0.1" text-extensions@^1.0.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.8.0.tgz#6f343c62268843019b21a616a003557bdb952d2b" + version "1.9.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" + integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= throat@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= through2@^2.0.0, through2@^2.0.2, through2@~2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== dependencies: - readable-stream "^2.1.5" + readable-stream "~2.3.6" xtend "~4.0.1" through@2, "through@>=2.2.7 <3": version "2.3.8" - resolved "http://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= timed-out@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= tiny-relative-date@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" + integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-readable-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" @@ -6671,38 +7547,45 @@ to-regex-range@^2.1.0: to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@>=2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.4.3: +tough-cookie@>=2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== dependencies: psl "^1.1.24" punycode "^1.4.1" -tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - dependencies: - punycode "^1.4.1" - tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= dependencies: punycode "^2.1.0" traverse@~0.6.6: version "0.6.6" resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc= travis-deploy-once@^5.0.8: - version "5.0.8" - resolved "https://registry.yarnpkg.com/travis-deploy-once/-/travis-deploy-once-5.0.8.tgz#ba5aee81a20e4c56898f8a3dd9ae07ba8e3bf378" + version "5.0.9" + resolved "https://registry.yarnpkg.com/travis-deploy-once/-/travis-deploy-once-5.0.9.tgz#c5a2f639e17d8fd542f66d25ade126179d5e8acf" + integrity sha512-cyHFErzq0HTEGY29RAq1clqFdt/IkCrlcOmyM1cGoGnEyukrrFi1fpy6JH3Mlf+88XsFwvluqKVWzj2bdz3k8A== dependencies: "@babel/core" "^7.0.0" "@babel/polyfill" "^7.0.0" @@ -6720,18 +7603,22 @@ travis-deploy-once@^5.0.8: trim-newlines@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" + integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= trim-off-newlines@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" + integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= ts-jest@^23.10.4: - version "23.10.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.10.4.tgz#a7a953f55c9165bcaa90ff91014a178e87fe0df8" + version "23.10.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.10.5.tgz#cdb550df4466a30489bf70ba867615799f388dd5" + integrity sha512-MRCs9qnGoyKgFc8adDEntAOP64fWK1vZKnOYU1o2HxaqjdJvGqmkLCPCnVq1/If4zkUmEjKPnCiUisTrlX2p2A== dependencies: bs-logger "0.x" buffer-from "1.x" @@ -6739,72 +7626,71 @@ ts-jest@^23.10.4: json5 "2.x" make-error "1.x" mkdirp "0.x" + resolve "1.x" semver "^5.5" yargs-parser "10.x" tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@~3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.1.tgz#0b7a04b8cf3868188de914d9568bd030f0c56192" - -uglify-js@^2.6: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" + integrity sha512-jw7P2z/h6aPT4AENXDGjcfHTu5CSqzsbZc6YlUIebTyBAq8XaKp78x7VcSh30xwSCcsu5irZkYZUSFP1MrAMbg== uglify-js@^3.1.4: version "3.4.9" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" + integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== dependencies: commander "~2.17.1" source-map "~0.6.1" -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - uid-number@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + integrity sha1-DqEOgDXo61uOREnwbaHHMGY7qoE= umask@^1.1.0, umask@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" + integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== unicode-match-property-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== dependencies: unicode-canonical-property-names-ecmascript "^1.0.4" unicode-property-aliases-ecmascript "^1.0.4" @@ -6812,14 +7698,17 @@ unicode-match-property-ecmascript@^1.0.4: unicode-match-property-value-ecmascript@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" + integrity sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ== unicode-property-aliases-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" + integrity sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg== union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= dependencies: arr-union "^3.1.0" get-value "^2.0.6" @@ -6829,38 +7718,45 @@ union-value@^1.0.0: unique-filename@^1.1.0, unique-filename@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== dependencies: unique-slug "^2.0.0" unique-slug@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" + integrity sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg== dependencies: imurmurhash "^0.1.4" unique-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= dependencies: crypto-random-string "^1.0.0" -universal-user-agent@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.0.1.tgz#18e591ca52b1cb804f6b9cbc4c336cf8191f80e1" +universal-user-agent@^2.0.0, universal-user-agent@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.0.2.tgz#b0322da546100c658adcf4965110a56ed238aee6" + integrity sha512-nOwvHWLH3dBazyuzbECPA5uVFNd7AlgviXRHgR4yf48QqitIvpdncRrxMbZNMpPPEfgz30I9ubd1XmiJiqsTrg== dependencies: - os-name "^2.0.1" + os-name "^3.0.0" universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" @@ -6868,10 +7764,12 @@ unset-value@^1.0.0: unzip-response@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= update-notifier@^2.3.0, update-notifier@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" + integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== dependencies: boxen "^1.2.1" chalk "^2.0.1" @@ -6884,56 +7782,74 @@ update-notifier@^2.3.0, update-notifier@^2.5.0: semver-diff "^2.0.0" xdg-basedir "^3.0.0" +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= url-join@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.0.tgz#4d3340e807d3773bda9991f8305acdcc2a665d2a" + integrity sha1-TTNA6AfTdzvamZH4MFrNzCpmXSo= url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= dependencies: prepend-http "^1.0.1" url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= dependencies: prepend-http "^2.0.0" url-template@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" + integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util-extend@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f" + integrity sha1-p8IW0mdUUWljeztu3GypEZ4v+T8= util.promisify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== dependencies: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" -uuid@^3.1.0, uuid@^3.3.2: +uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" @@ -6941,12 +7857,14 @@ validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= dependencies: builtins "^1.0.3" verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -6955,18 +7873,21 @@ verror@1.10.0: w3c-hr-time@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= dependencies: browser-process-hrtime "^0.1.2" walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= dependencies: makeerror "1.0.x" watch@~0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + integrity sha1-KAlUdsbffJDJYxOJkMClQj60uYY= dependencies: exec-sh "^0.2.0" minimist "^1.2.0" @@ -6974,26 +7895,40 @@ watch@~0.18.0: wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= dependencies: defaults "^1.0.3" webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: - iconv-lite "0.4.19" + iconv-lite "0.4.24" -whatwg-mimetype@^2.0.0, whatwg-mimetype@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz#f0f21d76cbba72362eb609dbed2a30cd17fcc7d4" +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== -whatwg-url@^6.4.0, whatwg-url@^6.4.1: +whatwg-url@^6.4.1: version "6.5.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== dependencies: lodash.sortby "^4.7.0" tr46 "^1.0.1" @@ -7002,71 +7937,83 @@ whatwg-url@^6.4.0, whatwg-url@^6.4.1: which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= which@1, which@^1.2.10, which@^1.2.12, which@^1.2.9, which@^1.3.0, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" widest-line@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.0.tgz#0142a4e8a243f8882c0233aa0e0281aa76152273" + version "2.0.1" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" + integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== dependencies: string-width "^2.1.1" -win-release@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/win-release/-/win-release-1.1.1.tgz#5fa55e02be7ca934edfc12665632e849b72e5209" +windows-release@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/windows-release/-/windows-release-3.1.0.tgz#8d4a7e266cbf5a233f6c717dac19ce00af36e12e" + integrity sha512-hBb7m7acFgQPQc222uEQTmdcGLeBmQLNLFIh0rDk3CwFOBrfjefLzEfEfmpMq8Af/n/GnFf3eYf203FY1PmudA== dependencies: - semver "^5.0.1" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + execa "^0.10.0" word-wrap@^1.0.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= worker-farm@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" + integrity sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ== dependencies: errno "~0.1.7" wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" +wrap-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" + integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write-file-atomic@^2.0.0, write-file-atomic@^2.1.0, write-file-atomic@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + integrity sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA== dependencies: graceful-fs "^4.1.11" imurmurhash "^0.1.4" @@ -7075,56 +8022,71 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.1.0, write-file-atomic@^2.3.0: ws@^5.2.0: version "5.2.2" resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== dependencies: async-limiter "~1.0.0" xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" - -xregexp@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= "y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== -yargs-parser@10.x, yargs-parser@^10.0.0, yargs-parser@^10.1.0: +yargs-parser@10.x, yargs-parser@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== dependencies: camelcase "^4.1.0" +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^9.0.2: version "9.0.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= dependencies: camelcase "^4.1.0" yargs@^11.0.0: version "11.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== dependencies: cliui "^4.0.0" decamelize "^1.1.1" @@ -7140,11 +8102,12 @@ yargs@^11.0.0: yargs-parser "^9.0.2" yargs@^12.0.0, yargs@^12.0.1: - version "12.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.2.tgz#fe58234369392af33ecbef53819171eff0f5aadc" + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== dependencies: cliui "^4.0.0" - decamelize "^2.0.0" + decamelize "^1.2.0" find-up "^3.0.0" get-caller-file "^1.0.1" os-locale "^3.0.0" @@ -7154,13 +8117,4 @@ yargs@^12.0.0, yargs@^12.0.1: string-width "^2.0.0" which-module "^2.0.0" y18n "^3.2.1 || ^4.0.0" - yargs-parser "^10.1.0" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" + yargs-parser "^11.1.1" From 6c3d49eba15b12b49b6a0a2d8c62fef86e8e0f75 Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 13 Dec 2018 23:22:47 +0100 Subject: [PATCH 24/84] refactor: improve type checking in parser (#43) --- packages/typescript-estree/src/convert.ts | 721 +++++++++---------- packages/typescript-estree/src/node-utils.ts | 7 +- packages/typescript-estree/src/ts-nodes.ts | 178 +++++ 3 files changed, 532 insertions(+), 374 deletions(-) create mode 100644 packages/typescript-estree/src/ts-nodes.ts diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index efa2ab7a67e4..c40588629a24 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -9,6 +9,7 @@ import ts from 'typescript'; import nodeUtils from './node-utils'; import { AST_NODE_TYPES } from './ast-node-types'; import { ESTreeNode } from './temp-types-based-on-js-source'; +import { TSNode } from './ts-nodes'; const SyntaxKind = ts.SyntaxKind; @@ -40,14 +41,14 @@ interface ConvertConfig { /** * Converts a TypeScript node into an ESTree node * @param {Object} config configuration options for the conversion - * @param {ts.Node} config.node the ts.Node + * @param {TSNode} config.node the ts.Node * @param {ts.Node} config.parent the parent ts.Node * @param {ts.SourceFile} config.ast the full TypeScript AST * @param {Object} config.additionalOptions additional options for the conversion * @returns {ESTreeNode|null} the converted ESTreeNode */ export default function convert(config: ConvertConfig): ESTreeNode | null { - const node = config.node as ts.Node; + const node: TSNode = config.node as TSNode; const parent = config.parent; const ast = config.ast; const additionalOptions = config.additionalOptions || {}; @@ -62,7 +63,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Create a new ESTree node */ - let result: Partial = { + let result: ESTreeNode = { type: '', range: [node.getStart(ast), node.end], loc: nodeUtils.getLoc(node, ast) @@ -84,7 +85,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * @param {ts.Node} child the child ts.Node * @returns {ESTreeNode|null} the converted ESTree node */ - function convertChild(child: ts.Node): ESTreeNode | null { + function convertChild(child?: ts.Node): ESTreeNode | null { + if (!child) { + return null; + } return convert({ node: child, parent: node, ast, additionalOptions }); } @@ -108,7 +112,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Converts a ts.Node's typeArguments ts.NodeArray to a flow-like typeParameters node - * @param {ts.NodeArray} typeArguments ts.Node typeArguments + * @param {ts.NodeArray} typeArguments ts.Node typeArguments * @returns {ESTreeNode} TypeParameterInstantiation node */ function convertTypeArgumentsToTypeParameters( @@ -235,10 +239,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Converts a child into a class implements node. This creates an intermediary * ClassImplements node to match what Flow does. - * @param {ts.Node} child The TypeScript AST node to convert. + * @param {ts.ExpressionWithTypeArguments} child The TypeScript AST node to convert. * @returns {ESTreeNode} The type annotation node. */ - function convertClassImplements(child: any): ESTreeNode { + function convertClassImplements( + child: ts.ExpressionWithTypeArguments + ): ESTreeNode { const id = convertChild(child.expression) as ESTreeNode; const classImplementsNode: ESTreeNode = { type: AST_NODE_TYPES.ClassImplements, @@ -256,10 +262,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Converts a child into a interface heritage node. - * @param {ts.Node} child The TypeScript AST node to convert. + * @param {ts.ExpressionWithTypeArguments} child The TypeScript AST node to convert. * @returns {ESTreeNode} The type annotation node. */ - function convertInterfaceHeritageClause(child: any): ESTreeNode { + function convertInterfaceHeritageClause( + child: ts.ExpressionWithTypeArguments + ): ESTreeNode { const id = convertChild(child.expression) as ESTreeNode; const classImplementsNode: ESTreeNode = { type: AST_NODE_TYPES.TSInterfaceHeritage, @@ -303,7 +311,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * @param {ts.Node[]} parameters An array of ts.Node params to be converted * @returns {ESTreeNode[]} an array of converted ESTreeNode params */ - function convertParameters(parameters: ts.Node[]): ESTreeNode[] { + function convertParameters(parameters: ts.NodeArray): ESTreeNode[] { if (!parameters || !parameters.length) { return []; } @@ -328,7 +336,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const customType = `TS${SyntaxKind[node.kind]}`; /** * If the "errorOnUnknownASTType" option is set to true, throw an error, - * otherwise fallback to just inlcuding the unknown type as-is. + * otherwise fallback to just including the unknown type as-is. */ if ( additionalOptions.errorOnUnknownASTType && @@ -383,10 +391,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Converts a TypeScript JSX node.tagName into an ESTree node.name - * @param {Object} tagName the tagName object from a JSX ts.Node + * @param {ts.JsxTagNameExpression} tagName the tagName object from a JSX ts.Node * @returns {Object} the converted ESTree name object */ - function convertTypeScriptJSXTagNameToESTreeName(tagName: any): any { + function convertTypeScriptJSXTagNameToESTreeName( + tagName: ts.JsxTagNameExpression + ): ESTreeNode { const tagNameToken = nodeUtils.convertToken(tagName, ast); if (tagNameToken.type === AST_NODE_TYPES.JSXMemberExpression) { @@ -419,10 +429,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Applies the given TS modifiers to the given result object. - * @param {ts.Node[]} modifiers original ts.Nodes from the node.modifiers array + * @param {ts.ModifiersArray} modifiers original ts.Nodes from the node.modifiers array * @returns {void} (the current result object will be mutated) */ - function applyModifiersToResult(modifiers: ts.Node[]): void { + function applyModifiersToResult(modifiers?: ts.ModifiersArray): void { if (!modifiers || !modifiers.length) { return; } @@ -497,18 +507,19 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.Program, body: [], + // externalModuleIndicator is internal field in TSC sourceType: (node as any).externalModuleIndicator ? 'module' : 'script' }); // filter out unknown nodes for now - (node as any).statements.forEach((statement: any) => { + node.statements.forEach((statement: any) => { const convertedStatement = convertChild(statement); if (convertedStatement) { result.body.push(convertedStatement); } }); - (result as any).range[1] = (node as any).endOfFileToken.end; + (result as any).range[1] = node.endOfFileToken.end; result.loc = nodeUtils.getLocFor( node.getStart(ast), (result as any).range[1], @@ -519,22 +530,22 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.Block: Object.assign(result, { type: AST_NODE_TYPES.BlockStatement, - body: (node as any).statements.map(convertChild) + body: node.statements.map(convertChild) }); break; case SyntaxKind.Identifier: Object.assign(result, { type: AST_NODE_TYPES.Identifier, - name: (node as any).text + name: node.text }); break; case SyntaxKind.WithStatement: Object.assign(result, { type: AST_NODE_TYPES.WithStatement, - object: convertChild((node as any).expression), - body: convertChild((node as any).statement) + object: convertChild(node.expression), + body: convertChild(node.statement) }); break; @@ -543,15 +554,15 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ReturnStatement: Object.assign(result, { type: AST_NODE_TYPES.ReturnStatement, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; case SyntaxKind.LabeledStatement: Object.assign(result, { type: AST_NODE_TYPES.LabeledStatement, - label: convertChild((node as any).label), - body: convertChild((node as any).statement) + label: convertChild(node.label), + body: convertChild(node.statement) }); break; @@ -559,7 +570,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ContinueStatement: Object.assign(result, { type: SyntaxKind[node.kind], - label: convertChild((node as any).label) + label: convertChild(node.label) }); break; @@ -568,17 +579,17 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.IfStatement: Object.assign(result, { type: AST_NODE_TYPES.IfStatement, - test: convertChild((node as any).expression), - consequent: convertChild((node as any).thenStatement), - alternate: convertChild((node as any).elseStatement) + test: convertChild(node.expression), + consequent: convertChild(node.thenStatement), + alternate: convertChild(node.elseStatement) }); break; case SyntaxKind.SwitchStatement: Object.assign(result, { type: AST_NODE_TYPES.SwitchStatement, - discriminant: convertChild((node as any).expression), - cases: (node as any).caseBlock.clauses.map(convertChild) + discriminant: convertChild(node.expression), + cases: node.caseBlock.clauses.map(convertChild) }); break; @@ -586,8 +597,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.DefaultClause: Object.assign(result, { type: AST_NODE_TYPES.SwitchCase, - test: convertChild((node as any).expression), - consequent: (node as any).statements.map(convertChild) + // expression is present in case only + test: + node.kind === SyntaxKind.CaseClause + ? convertChild(node.expression) + : null, + consequent: node.statements.map(convertChild) }); break; @@ -596,7 +611,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ThrowStatement: Object.assign(result, { type: AST_NODE_TYPES.ThrowStatement, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; @@ -604,23 +619,23 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.TryStatement, block: convert({ - node: (node as any).tryBlock, + node: node.tryBlock, parent: null, ast, additionalOptions }), - handler: convertChild((node as any).catchClause), - finalizer: convertChild((node as any).finallyBlock) + handler: convertChild(node.catchClause), + finalizer: convertChild(node.finallyBlock) }); break; case SyntaxKind.CatchClause: Object.assign(result, { type: AST_NODE_TYPES.CatchClause, - param: (node as any).variableDeclaration - ? convertChild((node as any).variableDeclaration.name) + param: node.variableDeclaration + ? convertChild(node.variableDeclaration.name) : null, - body: convertChild((node as any).block) + body: convertChild(node.block) }); break; @@ -629,8 +644,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.WhileStatement: Object.assign(result, { type: AST_NODE_TYPES.WhileStatement, - test: convertChild((node as any).expression), - body: convertChild((node as any).statement) + test: convertChild(node.expression), + body: convertChild(node.statement) }); break; @@ -641,34 +656,37 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.DoStatement: Object.assign(result, { type: AST_NODE_TYPES.DoWhileStatement, - test: convertChild((node as any).expression), - body: convertChild((node as any).statement) + test: convertChild(node.expression), + body: convertChild(node.statement) }); break; case SyntaxKind.ForStatement: Object.assign(result, { type: AST_NODE_TYPES.ForStatement, - init: convertChild((node as any).initializer), - test: convertChild((node as any).condition), - update: convertChild((node as any).incrementor), - body: convertChild((node as any).statement) + init: convertChild(node.initializer), + test: convertChild(node.condition), + update: convertChild(node.incrementor), + body: convertChild(node.statement) }); break; case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: { - const isAwait = !!( - (node as any).awaitModifier && - (node as any).awaitModifier.kind === SyntaxKind.AwaitKeyword - ); Object.assign(result, { type: SyntaxKind[node.kind], - left: convertChild((node as any).initializer), - right: convertChild((node as any).expression), - body: convertChild((node as any).statement), - await: isAwait + left: convertChild(node.initializer), + right: convertChild(node.expression), + body: convertChild(node.statement) }); + + // await is only available in for of statement + if (node.kind === SyntaxKind.ForOfStatement) { + (result as any).await = Boolean( + node.awaitModifier && + node.awaitModifier.kind === SyntaxKind.AwaitKeyword + ); + } break; } @@ -689,23 +707,23 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: functionDeclarationType, - id: convertChild((node as any).name), - generator: !!(node as any).asteriskToken, + id: convertChild(node.name), + generator: !!node.asteriskToken, expression: false, async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - params: convertParameters((node as any).parameters), - body: convertChild((node as any).body) + params: convertParameters(node.parameters), + body: convertChild(node.body) }); // Process returnType - if ((node as any).type) { - (result as any).returnType = convertTypeAnnotation((node as any).type); + if (node.type) { + (result as any).returnType = convertTypeAnnotation(node.type); } // Process typeParameters - if ((node as any).typeParameters && (node as any).typeParameters.length) { + if (node.typeParameters && node.typeParameters.length) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } @@ -718,18 +736,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.VariableDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.VariableDeclarator, - id: convertChild((node as any).name), - init: convertChild((node as any).initializer) + id: convertChild(node.name), + init: convertChild(node.initializer) }); - if ((node as any).exclamationToken) { + if (node.exclamationToken) { (result as any).definite = true; } - if ((node as any).type) { - (result as any).id.typeAnnotation = convertTypeAnnotation( - (node as any).type - ); + if (node.type) { + (result as any).id.typeAnnotation = convertTypeAnnotation(node.type); fixTypeAnnotationParentLocation((result as any).id); } break; @@ -738,10 +754,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.VariableStatement: Object.assign(result, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: (node as any).declarationList.declarations.map( - convertChild - ), - kind: nodeUtils.getDeclarationKind((node as any).declarationList) + declarations: node.declarationList.declarations.map(convertChild), + kind: nodeUtils.getDeclarationKind(node.declarationList) }); // check for exports @@ -752,7 +766,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.VariableDeclarationList: Object.assign(result, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: (node as any).declarations.map(convertChild), + declarations: node.declarations.map(convertChild), kind: nodeUtils.getDeclarationKind(node) }); break; @@ -762,7 +776,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ExpressionStatement: Object.assign(result, { type: AST_NODE_TYPES.ExpressionStatement, - expression: convertChild((node as any).expression) + expression: convertChild(node.expression) }); break; @@ -806,12 +820,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (arrayIsInAssignment || arrayIsInForOf || arrayIsInForIn) { Object.assign(result, { type: AST_NODE_TYPES.ArrayPattern, - elements: (node as any).elements.map(convertChild) + elements: node.elements.map(convertChild) }); } else { Object.assign(result, { type: AST_NODE_TYPES.ArrayExpression, - elements: (node as any).elements.map(convertChild) + elements: node.elements.map(convertChild) }); } break; @@ -852,12 +866,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (objectIsInAssignment) { Object.assign(result, { type: AST_NODE_TYPES.ObjectPattern, - properties: (node as any).properties.map(convertChild) + properties: node.properties.map(convertChild) }); } else { Object.assign(result, { type: AST_NODE_TYPES.ObjectExpression, - properties: (node as any).properties.map(convertChild) + properties: node.properties.map(convertChild) }); } @@ -867,9 +881,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.PropertyAssignment: Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild((node as any).name), - value: convertChild((node as any).initializer), - computed: nodeUtils.isComputedProperty((node as any).name), + key: convertChild(node.name), + value: convertChild(node.initializer), + computed: nodeUtils.isComputedProperty(node.name), method: false, shorthand: false, kind: 'init' @@ -877,14 +891,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.ShorthandPropertyAssignment: { - if ((node as any).objectAssignmentInitializer) { + if (node.objectAssignmentInitializer) { Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild((node as any).name), + key: convertChild(node.name), value: { type: AST_NODE_TYPES.AssignmentPattern, - left: convertChild((node as any).name), - right: convertChild((node as any).objectAssignmentInitializer), + left: convertChild(node.name), + right: convertChild(node.objectAssignmentInitializer), loc: result.loc, range: result.range }, @@ -894,10 +908,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { kind: 'init' }); } else { + // TODO: this node has no initializer field Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild((node as any).name), - value: convertChild((node as any).initializer || (node as any).name), + key: convertChild(node.name), + value: convertChild((node as any).initializer || node.name), computed: false, method: false, shorthand: true, @@ -909,6 +924,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ComputedPropertyName: if (parent!.kind === SyntaxKind.ObjectLiteralExpression) { + // TODO: ComputedPropertyName has no name field Object.assign(result, { type: AST_NODE_TYPES.Property, key: convertChild((node as any).name), @@ -919,7 +935,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { kind: 'init' }); } else { - return convertChild((node as any).expression); + return convertChild(node.expression); } break; @@ -932,16 +948,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: isAbstract ? AST_NODE_TYPES.TSAbstractClassProperty : AST_NODE_TYPES.ClassProperty, - key: convertChild((node as any).name), - value: convertChild((node as any).initializer), - computed: nodeUtils.isComputedProperty((node as any).name), + key: convertChild(node.name), + value: convertChild(node.initializer), + computed: nodeUtils.isComputedProperty(node.name), static: nodeUtils.hasStaticModifierFlag(node), readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined }); - if ((node as any).type) { - result.typeAnnotation = convertTypeAnnotation((node as any).type); + if (node.type) { + result.typeAnnotation = convertTypeAnnotation(node.type); } if (node.decorators) { @@ -953,20 +969,17 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).accessibility = accessibility; } - if ( - (node as any).name.kind === SyntaxKind.Identifier && - (node as any).questionToken - ) { + if (node.name.kind === SyntaxKind.Identifier && node.questionToken) { (result as any).optional = true; } - if ((node as any).exclamationToken) { + if (node.exclamationToken) { (result as any).definite = true; } if ( (result as any).key.type === AST_NODE_TYPES.Literal && - (node as any).questionToken + node.questionToken ) { (result as any).optional = true; } @@ -977,7 +990,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.SetAccessor: case SyntaxKind.MethodDeclaration: { const openingParen = nodeUtils.findFirstMatchingToken( - (node as any).name, + node.name, ast, (token: any) => { if (!token || !token.kind) { @@ -995,11 +1008,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { method = { type: AST_NODE_TYPES.FunctionExpression, id: null, - generator: !!(node as any).asteriskToken, + generator: !!node.asteriskToken, expression: false, async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - body: convertChild((node as any).body), - range: [(node as any).parameters.pos - 1, (result as any).range[1]], + body: convertChild(node.body), + range: [node.parameters.pos - 1, (result as any).range[1]], loc: { start: { line: methodLoc.line + 1, @@ -1009,18 +1022,18 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } }; - if ((node as any).type) { - (method as any).returnType = convertTypeAnnotation((node as any).type); + if (node.type) { + (method as any).returnType = convertTypeAnnotation(node.type); } if (parent!.kind === SyntaxKind.ObjectLiteralExpression) { - (method as any).params = (node as any).parameters.map(convertChild); + (method as any).params = node.parameters.map(convertChild); Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild((node as any).name), + key: convertChild(node.name), value: method, - computed: nodeUtils.isComputedProperty((node as any).name), + computed: nodeUtils.isComputedProperty(node.name), method: nodeIsMethod, shorthand: false, kind: 'init' @@ -1031,7 +1044,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Unlike in object literal methods, class method params can have decorators */ - (method as any).params = convertParameters((node as any).parameters); + (method as any).params = convertParameters(node.parameters); /** * TypeScript class methods can be defined as "abstract" @@ -1045,9 +1058,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: methodDefinitionType, - key: convertChild((node as any).name), + key: convertChild(node.name), value: method, - computed: nodeUtils.isComputedProperty((node as any).name), + computed: nodeUtils.isComputedProperty(node.name), static: nodeUtils.hasStaticModifierFlag(node), kind: 'method' }); @@ -1064,7 +1077,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if ( (result as any).key.type === AST_NODE_TYPES.Identifier && - (node as any).questionToken + node.questionToken ) { (result as any).key.optional = true; } @@ -1075,16 +1088,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).kind = 'set'; } else if ( !(result as any).static && - (node as any).name.kind === SyntaxKind.StringLiteral && - (node as any).name.text === 'constructor' + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' ) { (result as any).kind = 'constructor'; } // Process typeParameters - if ((node as any).typeParameters && (node as any).typeParameters.length) { + if (node.typeParameters && node.typeParameters.length) { (method as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } @@ -1099,20 +1112,20 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { node ), firstConstructorToken = constructorIsStatic - ? nodeUtils.findNextToken((node as any).getFirstToken(), ast, ast) + ? nodeUtils.findNextToken(node.getFirstToken()!, ast, ast) : node.getFirstToken(), constructorLoc = ast.getLineAndCharacterOfPosition( - (node as any).parameters.pos - 1 + node.parameters.pos - 1 ), constructor = { type: AST_NODE_TYPES.FunctionExpression, id: null, - params: convertParameters((node as any).parameters), + params: convertParameters(node.parameters), generator: false, expression: false, async: false, - body: convertChild((node as any).body), - range: [(node as any).parameters.pos - 1, (result as any).range[1]], + body: convertChild(node.body), + range: [node.parameters.pos - 1, (result as any).range[1]], loc: { start: { line: constructorLoc.line + 1, @@ -1129,8 +1142,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (firstConstructorToken as any).getEnd(ast) ), constructorIsComputed = - !!(node as any).name && - nodeUtils.isComputedProperty((node as any).name); + !!node.name && nodeUtils.isComputedProperty(node.name); let constructorKey; @@ -1138,7 +1150,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { constructorKey = { type: AST_NODE_TYPES.Literal, value: 'constructor', - raw: (node as any).name.getText(), + raw: node.name!.getText(), range: [ (firstConstructorToken as any).getStart(ast), (firstConstructorToken as any).end @@ -1200,23 +1212,23 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.FunctionExpression: Object.assign(result, { type: AST_NODE_TYPES.FunctionExpression, - id: convertChild((node as any).name), - generator: !!(node as any).asteriskToken, - params: convertParameters((node as any).parameters), - body: convertChild((node as any).body), + id: convertChild(node.name), + generator: !!node.asteriskToken, + params: convertParameters(node.parameters), + body: convertChild(node.body), async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), expression: false }); // Process returnType - if ((node as any).type) { - (result as any).returnType = convertTypeAnnotation((node as any).type); + if (node.type) { + (result as any).returnType = convertTypeAnnotation(node.type); } // Process typeParameters - if ((node as any).typeParameters && (node as any).typeParameters.length) { + if (node.typeParameters && node.typeParameters.length) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } break; @@ -1230,7 +1242,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ArrayBindingPattern: Object.assign(result, { type: AST_NODE_TYPES.ArrayPattern, - elements: (node as any).elements.map(convertChild) + elements: node.elements.map(convertChild) }); break; @@ -1241,26 +1253,26 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ObjectBindingPattern: Object.assign(result, { type: AST_NODE_TYPES.ObjectPattern, - properties: (node as any).elements.map(convertChild) + properties: node.elements.map(convertChild) }); break; case SyntaxKind.BindingElement: if (parent!.kind === SyntaxKind.ArrayBindingPattern) { const arrayItem = convert({ - node: (node as any).name, + node: node.name, parent, ast, additionalOptions }); - if ((node as any).initializer) { + if (node.initializer) { Object.assign(result, { type: AST_NODE_TYPES.AssignmentPattern, left: arrayItem, - right: convertChild((node as any).initializer) + right: convertChild(node.initializer) }); - } else if ((node as any).dotDotDotToken) { + } else if (node.dotDotDotToken) { Object.assign(result, { type: AST_NODE_TYPES.RestElement, argument: arrayItem @@ -1269,41 +1281,35 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { return arrayItem; } } else if (parent!.kind === SyntaxKind.ObjectBindingPattern) { - if ((node as any).dotDotDotToken) { + if (node.dotDotDotToken) { Object.assign(result, { type: AST_NODE_TYPES.RestElement, - argument: convertChild( - (node as any).propertyName || (node as any).name - ) + argument: convertChild(node.propertyName || node.name) }); } else { Object.assign(result, { type: AST_NODE_TYPES.Property, - key: convertChild((node as any).propertyName || (node as any).name), - value: convertChild((node as any).name), + key: convertChild(node.propertyName || node.name), + value: convertChild(node.name), computed: Boolean( - (node as any).propertyName && - (node as any).propertyName.kind === - SyntaxKind.ComputedPropertyName + node.propertyName && + node.propertyName.kind === SyntaxKind.ComputedPropertyName ), method: false, - shorthand: !(node as any).propertyName, + shorthand: !node.propertyName, kind: 'init' }); } - if ((node as any).initializer) { + if (node.initializer) { (result as any).value = { type: AST_NODE_TYPES.AssignmentPattern, - left: convertChild((node as any).name), - right: convertChild((node as any).initializer), - range: [ - (node as any).name.getStart(ast), - (node as any).initializer.end - ], + left: convertChild(node.name), + right: convertChild(node.initializer), + range: [node.name.getStart(ast), node.initializer.end], loc: nodeUtils.getLocFor( - (node as any).name.getStart(ast), - (node as any).initializer.end, + node.name.getStart(ast), + node.initializer.end, ast ) }; @@ -1316,21 +1322,21 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.ArrowFunctionExpression, generator: false, id: null, - params: convertParameters((node as any).parameters), - body: convertChild((node as any).body), + params: convertParameters(node.parameters), + body: convertChild(node.body), async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), - expression: (node as any).body.kind !== SyntaxKind.Block + expression: node.body.kind !== SyntaxKind.Block }); // Process returnType - if ((node as any).type) { - (result as any).returnType = convertTypeAnnotation((node as any).type); + if (node.type) { + (result as any).returnType = convertTypeAnnotation(node.type); } // Process typeParameters - if ((node as any).typeParameters && (node as any).typeParameters.length) { + if (node.typeParameters && node.typeParameters.length) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } break; @@ -1338,15 +1344,15 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.YieldExpression: Object.assign(result, { type: AST_NODE_TYPES.YieldExpression, - delegate: !!(node as any).asteriskToken, - argument: convertChild((node as any).expression) + delegate: !!node.asteriskToken, + argument: convertChild(node.expression) }); break; case SyntaxKind.AwaitExpression: Object.assign(result, { type: AST_NODE_TYPES.AwaitExpression, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; @@ -1360,7 +1366,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.TemplateElement, value: { raw: ast.text.slice(node.getStart(ast) + 1, node.end - 1), - cooked: (node as any).text + cooked: node.text }, tail: true, range: result.range, @@ -1374,11 +1380,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.TemplateExpression: Object.assign(result, { type: AST_NODE_TYPES.TemplateLiteral, - quasis: [convertChild((node as any).head)], + quasis: [convertChild(node.head)], expressions: [] }); - (node as any).templateSpans.forEach((templateSpan: any) => { + node.templateSpans.forEach((templateSpan: any) => { (result as any).expressions.push(convertChild(templateSpan.expression)); (result as any).quasis.push(convertChild(templateSpan.literal)); }); @@ -1387,11 +1393,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.TaggedTemplateExpression: Object.assign(result, { type: AST_NODE_TYPES.TaggedTemplateExpression, - typeParameters: (node as any).typeArguments - ? convertTypeArgumentsToTypeParameters((node as any).typeArguments) + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) : undefined, - tag: convertChild((node as any).tag), - quasi: convertChild((node as any).template) + tag: convertChild(node.tag), + quasi: convertChild(node.template) }); break; @@ -1406,7 +1412,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { node.getStart(ast) + 1, node.end - (tail ? 1 : 2) ), - cooked: (node as any).text + cooked: node.text }, tail }); @@ -1423,16 +1429,18 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { node.parent.parent && node.parent.parent.kind === SyntaxKind.BinaryExpression ) { - if ((node as any).parent.parent.left === node.parent) { + if ((node.parent.parent as ts.BinaryExpression).left === node.parent) { type = AST_NODE_TYPES.RestElement; - } else if ((node as any).parent.parent.right === node.parent) { + } else if ( + (node.parent.parent as ts.BinaryExpression).right === node.parent + ) { type = AST_NODE_TYPES.SpreadElement; } } Object.assign(result, { type, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; } @@ -1444,16 +1452,18 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { node.parent.parent && node.parent.parent.kind === SyntaxKind.BinaryExpression ) { - if ((node as any).parent.parent.right === node.parent) { + if ((node.parent.parent as ts.BinaryExpression).right === node.parent) { type = AST_NODE_TYPES.SpreadElement; - } else if ((node as any).parent.parent.left === node.parent) { + } else if ( + (node.parent.parent as ts.BinaryExpression).left === node.parent + ) { type = AST_NODE_TYPES.RestElement; } } Object.assign(result, { type, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; } @@ -1461,22 +1471,22 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.Parameter: { let parameter; - if ((node as any).dotDotDotToken) { - parameter = convertChild((node as any).name); + if (node.dotDotDotToken) { + parameter = convertChild(node.name); Object.assign(result, { type: AST_NODE_TYPES.RestElement, argument: parameter }); - } else if ((node as any).initializer) { - parameter = convertChild((node as any).name); + } else if (node.initializer) { + parameter = convertChild(node.name); Object.assign(result, { type: AST_NODE_TYPES.AssignmentPattern, left: parameter, - right: convertChild((node as any).initializer) + right: convertChild(node.initializer) }); } else { parameter = convert({ - node: (node as any).name, + node: node.name, parent, ast, additionalOptions @@ -1484,14 +1494,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any) = parameter; } - if ((node as any).type) { - (parameter as any).typeAnnotation = convertTypeAnnotation( - (node as any).type - ); + if (node.type) { + (parameter as any).typeAnnotation = convertTypeAnnotation(node.type); fixTypeAnnotationParentLocation(parameter as any); } - if ((node as any).questionToken) { + if (node.questionToken) { (parameter as any).optional = true; } @@ -1519,23 +1527,22 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: { - const heritageClauses = (node as any).heritageClauses || []; + const heritageClauses = node.heritageClauses || []; let classNodeType = SyntaxKind[node.kind]; - let lastClassToken = heritageClauses.length + let lastClassToken: any = heritageClauses.length ? heritageClauses[heritageClauses.length - 1] - : (node as any).name; + : node.name; - if ((node as any).typeParameters && (node as any).typeParameters.length) { - const lastTypeParameter = (node as any).typeParameters[ - (node as any).typeParameters.length - 1 - ]; + if (node.typeParameters && node.typeParameters.length) { + const lastTypeParameter = + node.typeParameters[node.typeParameters.length - 1]; if (!lastClassToken || lastTypeParameter.pos > lastClassToken.pos) { lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast, ast); } result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } @@ -1553,7 +1560,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * We need check for modifiers, and use the last one, as there * could be multiple before the open brace */ - const lastModifier = node.modifiers[node.modifiers.length - 1]; + const lastModifier = node.modifiers![node.modifiers!.length - 1]; if (!lastClassToken || lastModifier.pos > lastClassToken.pos) { lastClassToken = nodeUtils.findNextToken(lastModifier, ast, ast); @@ -1590,7 +1597,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: classNodeType, - id: convertChild((node as any).name), + id: convertChild(node.name), body: { type: AST_NODE_TYPES.ClassBody, body: [], @@ -1615,7 +1622,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.decorators = convertDecorators(node.decorators); } - const filteredMembers = (node as any).members.filter( + const filteredMembers = node.members.filter( nodeUtils.isESTreeClassMember ); @@ -1633,37 +1640,32 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ModuleBlock: Object.assign(result, { type: AST_NODE_TYPES.TSModuleBlock, - body: (node as any).statements.map(convertChild) + body: node.statements.map(convertChild) }); break; case SyntaxKind.ImportDeclaration: Object.assign(result, { type: AST_NODE_TYPES.ImportDeclaration, - source: convertChild((node as any).moduleSpecifier), + source: convertChild(node.moduleSpecifier), specifiers: [] }); - if ((node as any).importClause) { - if ((node as any).importClause.name) { - (result as any).specifiers.push( - convertChild((node as any).importClause) - ); + if (node.importClause) { + if (node.importClause.name) { + (result as any).specifiers.push(convertChild(node.importClause)); } - if ((node as any).importClause.namedBindings) { + if (node.importClause.namedBindings) { if ( - (node as any).importClause.namedBindings.kind === - SyntaxKind.NamespaceImport + node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport ) { (result as any).specifiers.push( - convertChild((node as any).importClause.namedBindings) + convertChild(node.importClause.namedBindings) ); } else { result.specifiers = (result as any).specifiers.concat( - (node as any).importClause.namedBindings.elements.map( - convertChild - ) + node.importClause.namedBindings.elements.map(convertChild) ); } } @@ -1674,26 +1676,26 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.NamespaceImport: Object.assign(result, { type: AST_NODE_TYPES.ImportNamespaceSpecifier, - local: convertChild((node as any).name) + local: convertChild(node.name) }); break; case SyntaxKind.ImportSpecifier: Object.assign(result, { type: AST_NODE_TYPES.ImportSpecifier, - local: convertChild((node as any).name), - imported: convertChild((node as any).propertyName || (node as any).name) + local: convertChild(node.name), + imported: convertChild(node.propertyName || node.name) }); break; case SyntaxKind.ImportClause: Object.assign(result, { type: AST_NODE_TYPES.ImportDefaultSpecifier, - local: convertChild((node as any).name) + local: convertChild(node.name) }); // have to adjust location information due to tree differences - (result as any).range[1] = (node as any).name.end; + (result as any).range[1] = node.name!.end; result.loc = nodeUtils.getLocFor( (result as any).range[0], (result as any).range[1], @@ -1702,6 +1704,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.NamedImports: + // TODO: node has no name field Object.assign(result, { type: AST_NODE_TYPES.ImportDefaultSpecifier, local: convertChild((node as any).name) @@ -1709,17 +1712,17 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.ExportDeclaration: - if ((node as any).exportClause) { + if (node.exportClause) { Object.assign(result, { type: AST_NODE_TYPES.ExportNamedDeclaration, - source: convertChild((node as any).moduleSpecifier), - specifiers: (node as any).exportClause.elements.map(convertChild), + source: convertChild(node.moduleSpecifier), + specifiers: node.exportClause.elements.map(convertChild), declaration: null }); } else { Object.assign(result, { type: AST_NODE_TYPES.ExportAllDeclaration, - source: convertChild((node as any).moduleSpecifier) + source: convertChild(node.moduleSpecifier) }); } break; @@ -1727,21 +1730,21 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ExportSpecifier: Object.assign(result, { type: AST_NODE_TYPES.ExportSpecifier, - local: convertChild((node as any).propertyName || (node as any).name), - exported: convertChild((node as any).name) + local: convertChild(node.propertyName || node.name), + exported: convertChild(node.name) }); break; case SyntaxKind.ExportAssignment: - if ((node as any).isExportEquals) { + if (node.isExportEquals) { Object.assign(result, { type: AST_NODE_TYPES.TSExportAssignment, - expression: convertChild((node as any).expression) + expression: convertChild(node.expression) }); } else { Object.assign(result, { type: AST_NODE_TYPES.ExportDefaultDeclaration, - declaration: convertChild((node as any).expression) + declaration: convertChild(node.expression) }); } break; @@ -1750,7 +1753,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.PrefixUnaryExpression: case SyntaxKind.PostfixUnaryExpression: { - const operator = nodeUtils.getTextForTokenKind((node as any).operator); + const operator = nodeUtils.getTextForTokenKind(node.operator); Object.assign(result, { /** * ESTree uses UpdateExpression for ++/-- @@ -1760,7 +1763,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { : AST_NODE_TYPES.UnaryExpression, operator, prefix: node.kind === SyntaxKind.PrefixUnaryExpression, - argument: convertChild((node as any).operand) + argument: convertChild(node.operand) }); break; } @@ -1770,7 +1773,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.UnaryExpression, operator: 'delete', prefix: true, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; @@ -1779,7 +1782,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.UnaryExpression, operator: 'void', prefix: true, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; @@ -1788,15 +1791,15 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.UnaryExpression, operator: 'typeof', prefix: true, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; case SyntaxKind.TypeOperator: Object.assign(result, { type: AST_NODE_TYPES.TSTypeOperator, - operator: nodeUtils.getTextForTokenKind((node as any).operator), - typeAnnotation: convertChild((node as any).type) + operator: nodeUtils.getTextForTokenKind(node.operator), + typeAnnotation: convertChild(node.type) }); break; @@ -1804,14 +1807,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.BinaryExpression: // TypeScript uses BinaryExpression for sequences as well - if (nodeUtils.isComma((node as any).operatorToken)) { + if (nodeUtils.isComma(node.operatorToken)) { Object.assign(result, { type: AST_NODE_TYPES.SequenceExpression, expressions: [] }); - const left = convertChild((node as any).left), - right = convertChild((node as any).right); + const left = convertChild(node.left), + right = convertChild(node.right); if ((left as any).type === AST_NODE_TYPES.SequenceExpression) { (result as any).expressions = (result as any).expressions.concat( @@ -1829,26 +1832,21 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).expressions.push(right); } } else if ( - (node as any).operatorToken && - (node as any).operatorToken.kind === - SyntaxKind.AsteriskAsteriskEqualsToken + node.operatorToken && + node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken ) { Object.assign(result, { type: AST_NODE_TYPES.AssignmentExpression, - operator: nodeUtils.getTextForTokenKind( - (node as any).operatorToken.kind - ), - left: convertChild((node as any).left), - right: convertChild((node as any).right) + operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), + left: convertChild(node.left), + right: convertChild(node.right) }); } else { Object.assign(result, { - type: nodeUtils.getBinaryExpressionType((node as any).operatorToken), - operator: nodeUtils.getTextForTokenKind( - (node as any).operatorToken.kind - ), - left: convertChild((node as any).left), - right: convertChild((node as any).right) + type: nodeUtils.getBinaryExpressionType(node.operatorToken), + operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), + left: convertChild(node.left), + right: convertChild(node.right) }); // if the binary expression is in a destructured array, switch it @@ -1891,12 +1889,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (nodeUtils.isJSXToken(parent!)) { const jsxMemberExpression = { type: AST_NODE_TYPES.MemberExpression, - object: convertChild((node as any).expression), - property: convertChild((node as any).name) + object: convertChild(node.expression), + property: convertChild(node.name) }; const isNestedMemberExpression = - (node as any).expression.kind === SyntaxKind.PropertyAccessExpression; - if ((node as any).expression.kind === SyntaxKind.ThisKeyword) { + node.expression.kind === SyntaxKind.PropertyAccessExpression; + if (node.expression.kind === SyntaxKind.ThisKeyword) { (jsxMemberExpression as any).object.name = 'this'; } @@ -1909,8 +1907,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } else { Object.assign(result, { type: AST_NODE_TYPES.MemberExpression, - object: convertChild((node as any).expression), - property: convertChild((node as any).name), + object: convertChild(node.expression), + property: convertChild(node.name), computed: false }); } @@ -1919,8 +1917,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ElementAccessExpression: Object.assign(result, { type: AST_NODE_TYPES.MemberExpression, - object: convertChild((node as any).expression), - property: convertChild((node as any).argumentExpression), + object: convertChild(node.expression), + property: convertChild(node.argumentExpression), computed: true }); break; @@ -1928,21 +1926,21 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ConditionalExpression: Object.assign(result, { type: AST_NODE_TYPES.ConditionalExpression, - test: convertChild((node as any).condition), - consequent: convertChild((node as any).whenTrue), - alternate: convertChild((node as any).whenFalse) + test: convertChild(node.condition), + consequent: convertChild(node.whenTrue), + alternate: convertChild(node.whenFalse) }); break; case SyntaxKind.CallExpression: Object.assign(result, { type: AST_NODE_TYPES.CallExpression, - callee: convertChild((node as any).expression), - arguments: (node as any).arguments.map(convertChild) + callee: convertChild(node.expression), + arguments: node.arguments.map(convertChild) }); - if ((node as any).typeArguments && (node as any).typeArguments.length) { + if (node.typeArguments && node.typeArguments.length) { result.typeParameters = convertTypeArgumentsToTypeParameters( - (node as any).typeArguments + node.typeArguments ); } break; @@ -1950,32 +1948,27 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.NewExpression: Object.assign(result, { type: AST_NODE_TYPES.NewExpression, - callee: convertChild((node as any).expression), - arguments: (node as any).arguments - ? (node as any).arguments.map(convertChild) - : [] + callee: convertChild(node.expression), + arguments: node.arguments ? node.arguments.map(convertChild) : [] }); - if ((node as any).typeArguments && (node as any).typeArguments.length) { + if (node.typeArguments && node.typeArguments.length) { result.typeParameters = convertTypeArgumentsToTypeParameters( - (node as any).typeArguments + node.typeArguments ); } break; case SyntaxKind.MetaProperty: { - const newToken = nodeUtils.convertToken( - (node as any).getFirstToken(), - ast - ); + const newToken = nodeUtils.convertToken(node.getFirstToken()!, ast); Object.assign(result, { type: AST_NODE_TYPES.MetaProperty, meta: { type: AST_NODE_TYPES.Identifier, range: newToken.range, loc: newToken.loc, - name: nodeUtils.getTextForTokenKind((node as any).keywordToken) + name: nodeUtils.getTextForTokenKind(node.keywordToken) }, - property: convertChild((node as any).name) + property: convertChild(node.name) }); break; } @@ -1988,18 +1981,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { raw: ast.text.slice((result as any).range[0], (result as any).range[1]) }); if ((parent as any).name && (parent as any).name === node) { - (result as any).value = (node as any).text; + (result as any).value = node.text; } else { - (result as any).value = nodeUtils.unescapeStringLiteralText( - (node as any).text - ); + (result as any).value = nodeUtils.unescapeStringLiteralText(node.text); } break; case SyntaxKind.NumericLiteral: Object.assign(result, { type: AST_NODE_TYPES.Literal, - value: Number((node as any).text), + value: Number(node.text), raw: ast.text.slice((result as any).range[0], (result as any).range[1]) }); break; @@ -2019,13 +2010,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } case SyntaxKind.RegularExpressionLiteral: { - const pattern = (node as any).text.slice( - 1, - (node as any).text.lastIndexOf('/') - ); - const flags = (node as any).text.slice( - (node as any).text.lastIndexOf('/') + 1 - ); + const pattern = node.text.slice(1, node.text.lastIndexOf('/')); + const flags = node.text.slice(node.text.lastIndexOf('/') + 1); let regex = null; try { @@ -2037,7 +2023,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.Literal, value: regex, - raw: (node as any).text, + raw: node.text, regex: { pattern, flags @@ -2093,9 +2079,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.JsxElement: Object.assign(result, { type: AST_NODE_TYPES.JSXElement, - openingElement: convertChild((node as any).openingElement), - closingElement: convertChild((node as any).closingElement), - children: (node as any).children.map(convertChild) + openingElement: convertChild(node.openingElement), + closingElement: convertChild(node.closingElement), + children: node.children.map(convertChild) }); break; @@ -2105,7 +2091,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.JSXFragment, openingFragment: convertChild((node as ts.JsxFragment).openingFragment), closingFragment: convertChild((node as ts.JsxFragment).closingFragment), - children: (node as any).children.map(convertChild) + children: node.children.map(convertChild) }); break; @@ -2114,7 +2100,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, * TypeScript does not seem to have the idea of openingElement when tag is self-closing */ - node.kind = SyntaxKind.JsxOpeningElement; + (node as any).kind = SyntaxKind.JsxOpeningElement; const openingElement = convertChild(node); (openingElement as any).selfClosing = true; @@ -2132,19 +2118,19 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.JsxOpeningElement: Object.assign(result, { type: AST_NODE_TYPES.JSXOpeningElement, - typeParameters: (node as any).typeArguments - ? convertTypeArgumentsToTypeParameters((node as any).typeArguments) + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) : undefined, selfClosing: false, - name: convertTypeScriptJSXTagNameToESTreeName((node as any).tagName), - attributes: (node as any).attributes.properties.map(convertChild) + name: convertTypeScriptJSXTagNameToESTreeName(node.tagName), + attributes: node.attributes.properties.map(convertChild) }); break; case SyntaxKind.JsxClosingElement: Object.assign(result, { type: AST_NODE_TYPES.JSXClosingElement, - name: convertTypeScriptJSXTagNameToESTreeName((node as any).tagName) + name: convertTypeScriptJSXTagNameToESTreeName(node.tagName) }); break; @@ -2163,8 +2149,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const eloc = ast.getLineAndCharacterOfPosition( (result as any).range[0] + 1 ); - const expression = (node as any).expression - ? convertChild((node as any).expression) + const expression = node.expression + ? convertChild(node.expression) : { type: AST_NODE_TYPES.JSXEmptyExpression, loc: { @@ -2181,7 +2167,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }; Object.assign(result, { - type: (node as any).dotDotDotToken + type: node.dotDotDotToken ? AST_NODE_TYPES.JSXSpreadChild : AST_NODE_TYPES.JSXExpressionContainer, expression @@ -2191,7 +2177,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } case SyntaxKind.JsxAttribute: { - const attributeName = nodeUtils.convertToken((node as any).name, ast); + const attributeName = nodeUtils.convertToken(node.name, ast); attributeName.type = AST_NODE_TYPES.JSXIdentifier; attributeName.name = attributeName.value; delete attributeName.value; @@ -2199,7 +2185,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.JSXAttribute, name: attributeName, - value: convertChild((node as any).initializer) + value: convertChild(node.initializer) }); break; @@ -2234,7 +2220,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.JsxSpreadAttribute: Object.assign(result, { type: AST_NODE_TYPES.JSXSpreadAttribute, - argument: convertChild((node as any).expression) + argument: convertChild(node.expression) }); break; @@ -2242,8 +2228,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.FirstNode: { Object.assign(result, { type: AST_NODE_TYPES.TSQualifiedName, - left: convertChild((node as any).left), - right: convertChild((node as any).right) + left: convertChild(node.left), + right: convertChild(node.right) }); break; @@ -2253,7 +2239,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ParenthesizedExpression: return convert({ - node: (node as any).expression, + node: node.expression, parent, ast, additionalOptions @@ -2266,9 +2252,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.TypeAliasDeclaration: { const typeAliasDeclarator = { type: AST_NODE_TYPES.VariableDeclarator, - id: convertChild((node as any).name), - init: convertChild((node as any).type), - range: [(node as any).name.getStart(ast), (node as any).end] + id: convertChild(node.name), + init: convertChild(node.type), + range: [node.name.getStart(ast), node.end] }; (typeAliasDeclarator as any).loc = nodeUtils.getLocFor( @@ -2278,9 +2264,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ); // Process typeParameters - if ((node as any).typeParameters && (node as any).typeParameters.length) { + if (node.typeParameters && node.typeParameters.length) { (typeAliasDeclarator as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } @@ -2300,12 +2286,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.TSMethodSignature, optional: nodeUtils.isOptional(node), - computed: nodeUtils.isComputedProperty((node as any).name), - key: convertChild((node as any).name), - params: convertParameters((node as any).parameters), - typeAnnotation: (node as any).type - ? convertTypeAnnotation((node as any).type) - : null, + computed: nodeUtils.isComputedProperty(node.name), + key: convertChild(node.name), + params: convertParameters(node.parameters), + typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), @@ -2318,9 +2302,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).accessibility = accessibility; } - if ((node as any).typeParameters) { + if (node.typeParameters) { (result as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } @@ -2331,12 +2315,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.TSPropertySignature, optional: nodeUtils.isOptional(node) || undefined, - computed: nodeUtils.isComputedProperty((node as any).name), - key: convertChild((node as any).name), - typeAnnotation: (node as any).type - ? convertTypeAnnotation((node as any).type) + computed: nodeUtils.isComputedProperty(node.name), + key: convertChild(node.name), + typeAnnotation: node.type + ? convertTypeAnnotation(node.type) : undefined, - initializer: convertChild((node as any).initializer) || undefined, + initializer: convertChild(node.initializer) || undefined, readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: @@ -2356,10 +2340,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.IndexSignature: { Object.assign(result, { type: AST_NODE_TYPES.TSIndexSignature, - index: convertChild((node as any).parameters[0]), - typeAnnotation: (node as any).type - ? convertTypeAnnotation((node as any).type) - : null, + index: convertChild(node.parameters[0]), + typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), @@ -2378,15 +2360,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ConstructSignature: { Object.assign(result, { type: AST_NODE_TYPES.TSConstructSignature, - params: convertParameters((node as any).parameters), - typeAnnotation: (node as any).type - ? convertTypeAnnotation((node as any).type) - : null + params: convertParameters(node.parameters), + typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null }); - if ((node as any).typeParameters) { + if (node.typeParameters) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } @@ -2394,16 +2374,15 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } case SyntaxKind.InterfaceDeclaration: { - const interfaceHeritageClauses = (node as any).heritageClauses || []; + const interfaceHeritageClauses = node.heritageClauses || []; let interfaceLastClassToken = interfaceHeritageClauses.length ? interfaceHeritageClauses[interfaceHeritageClauses.length - 1] - : (node as any).name; + : node.name; - if ((node as any).typeParameters && (node as any).typeParameters.length) { - const interfaceLastTypeParameter = (node as any).typeParameters[ - (node as any).typeParameters.length - 1 - ]; + if (node.typeParameters && node.typeParameters.length) { + const interfaceLastTypeParameter = + node.typeParameters[node.typeParameters.length - 1]; if ( !interfaceLastClassToken || @@ -2413,10 +2392,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { interfaceLastTypeParameter, ast, ast - ); + ) as any; } result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( - (node as any).typeParameters + node.typeParameters ); } @@ -2433,7 +2412,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const interfaceBody = { type: AST_NODE_TYPES.TSInterfaceBody, - body: (node as any).members.map((member: any) => convertChild(member)), + body: node.members.map((member: any) => convertChild(member)), range: [interfaceOpenBrace.getStart(ast), (result as any).range[1]], loc: nodeUtils.getLocFor( interfaceOpenBrace.getStart(ast), @@ -2446,7 +2425,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { abstract: hasAbstractKeyword, type: AST_NODE_TYPES.TSInterfaceDeclaration, body: interfaceBody, - id: convertChild((node as any).name), + id: convertChild(node.name), heritage: hasImplementsClause ? interfaceHeritageClauses[0].types.map( convertInterfaceHeritageClause @@ -2470,8 +2449,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.FirstTypeNode: Object.assign(result, { type: AST_NODE_TYPES.TSTypePredicate, - parameterName: convertChild((node as any).parameterName), - typeAnnotation: convertTypeAnnotation((node as any).type) + parameterName: convertChild(node.parameterName), + typeAnnotation: convertTypeAnnotation(node.type) }); /** * Specific fix for type-guard location data @@ -2483,11 +2462,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ImportType: Object.assign(result, { type: AST_NODE_TYPES.TSImportType, - isTypeOf: !!(node as any).isTypeOf, - parameter: convertChild((node as any).argument), - qualifier: convertChild((node as any).qualifier), - typeParameters: (node as any).typeArguments - ? convertTypeArgumentsToTypeParameters((node as any).typeArguments) + isTypeOf: !!node.isTypeOf, + parameter: convertChild(node.argument), + qualifier: convertChild(node.qualifier), + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) : null }); break; @@ -2495,11 +2474,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.EnumDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.TSEnumDeclaration, - id: convertChild((node as any).name), - members: (node as any).members.map(convertChild) + id: convertChild(node.name), + members: node.members.map(convertChild) }); // apply modifiers first... - applyModifiersToResult((node as any).modifiers); + applyModifiersToResult(node.modifiers); // ...then check for exports result = nodeUtils.fixExports(node, result as any, ast); /** @@ -2516,10 +2495,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.EnumMember: { Object.assign(result, { type: AST_NODE_TYPES.TSEnumMember, - id: convertChild((node as any).name) + id: convertChild(node.name) }); - if ((node as any).initializer) { - (result as any).initializer = convertChild((node as any).initializer); + if (node.initializer) { + (result as any).initializer = convertChild(node.initializer); } break; } @@ -2534,13 +2513,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ModuleDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.TSModuleDeclaration, - id: convertChild((node as any).name) + id: convertChild(node.name) }); - if ((node as any).body) { - result.body = convertChild((node as any).body); + if (node.body) { + result.body = convertChild(node.body); } // apply modifiers first... - applyModifiersToResult((node as any).modifiers); + applyModifiersToResult(node.modifiers); if (node.flags & ts.NodeFlags.GlobalAugmentation) { result.global = true; } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 873db9c8534c..4563770c0037 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -11,6 +11,7 @@ import { ESTreeNode, ESTreeToken } from './temp-types-based-on-js-source'; +import { TSNode } from './ts-nodes'; const SyntaxKind = ts.SyntaxKind; @@ -289,12 +290,12 @@ function getLocFor( /** * Returns line and column data for the given ts.Node or ts.Token, * for the given AST - * @param {ts.Token|ts.Node} nodeOrToken the ts.Node or ts.Token + * @param {ts.Token|TSNode} nodeOrToken the ts.Node or ts.Token * @param {ts.SourceFile} ast the AST object * @returns {ESTreeLoc} the loc data */ function getLoc( - nodeOrToken: ts.Node | ts.Token, + nodeOrToken: TSNode | ts.Token, ast: ts.SourceFile ): ESTreeNodeLoc { return getLocFor(nodeOrToken.getStart(ast), nodeOrToken.end, ast); @@ -537,7 +538,7 @@ function isComputedProperty(node: ts.Node): boolean { * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is Optional */ -function isOptional(node: any): boolean { +function isOptional(node: { questionToken?: ts.QuestionToken }): boolean { return node.questionToken ? node.questionToken.kind === SyntaxKind.QuestionToken : false; diff --git a/packages/typescript-estree/src/ts-nodes.ts b/packages/typescript-estree/src/ts-nodes.ts new file mode 100644 index 000000000000..93d692fae544 --- /dev/null +++ b/packages/typescript-estree/src/ts-nodes.ts @@ -0,0 +1,178 @@ +import ts from 'typescript'; + +export type TSNode = ts.Node & + ( + | ts.Modifier + | ts.Identifier + | ts.QualifiedName + | ts.ComputedPropertyName + | ts.Decorator + | ts.TypeParameterDeclaration + // | ts.SignatureDeclarationBase -> CallSignatureDeclaration, ConstructSignatureDeclaration + | ts.CallSignatureDeclaration + | ts.ConstructSignatureDeclaration + | ts.VariableDeclaration + | ts.VariableDeclarationList + | ts.ParameterDeclaration + | ts.BindingElement + | ts.PropertySignature + | ts.PropertyDeclaration + | ts.PropertyAssignment + | ts.ShorthandPropertyAssignment + | ts.SpreadAssignment + | ts.ObjectBindingPattern + | ts.ArrayBindingPattern + | ts.FunctionDeclaration + | ts.MethodSignature + | ts.MethodDeclaration + | ts.ConstructorDeclaration + | ts.SemicolonClassElement + | ts.GetAccessorDeclaration + | ts.SetAccessorDeclaration + | ts.IndexSignatureDeclaration + | ts.KeywordTypeNode + | ts.ImportTypeNode + | ts.ThisTypeNode + // | ts.FunctionOrConstructorTypeNodeBase -> FunctionTypeNode, ConstructorTypeNode + | ts.ConstructorTypeNode + | ts.TypeReferenceNode + | ts.TypePredicateNode + | ts.TypeQueryNode + | ts.TypeLiteralNode + | ts.ArrayTypeNode + | ts.TupleTypeNode + | ts.OptionalTypeNode + | ts.RestTypeNode + | ts.UnionTypeNode + | ts.IntersectionTypeNode + | ts.ConditionalTypeNode + | ts.InferTypeNode + | ts.ParenthesizedTypeNode + | ts.TypeOperatorNode + | ts.IndexedAccessTypeNode + | ts.MappedTypeNode + | ts.LiteralTypeNode + | ts.StringLiteral + | ts.OmittedExpression + | ts.PartiallyEmittedExpression + | ts.PrefixUnaryExpression + | ts.PostfixUnaryExpression + | ts.NullLiteral + | ts.BooleanLiteral + | ts.ThisExpression + | ts.SuperExpression + | ts.ImportExpression + | ts.DeleteExpression + | ts.TypeOfExpression + | ts.VoidExpression + | ts.AwaitExpression + | ts.YieldExpression + | ts.SyntheticExpression + | ts.BinaryExpression + | ts.ConditionalExpression + | ts.FunctionExpression + | ts.ArrowFunction + | ts.RegularExpressionLiteral + | ts.NoSubstitutionTemplateLiteral + | ts.NumericLiteral + | ts.BigIntLiteral + | ts.TemplateHead + | ts.TemplateMiddle + | ts.TemplateTail + | ts.TemplateExpression + | ts.TemplateSpan + | ts.ParenthesizedExpression + | ts.ArrayLiteralExpression + | ts.SpreadElement + | ts.ObjectLiteralExpression + | ts.PropertyAccessExpression + | ts.ElementAccessExpression + | ts.CallExpression + | ts.ExpressionWithTypeArguments + | ts.NewExpression + | ts.TaggedTemplateExpression + | ts.AsExpression + | ts.TypeAssertion + | ts.NonNullExpression + | ts.MetaProperty + | ts.JsxElement + | ts.JsxOpeningElement + | ts.JsxSelfClosingElement + | ts.JsxFragment + | ts.JsxOpeningFragment + | ts.JsxClosingFragment + | ts.JsxAttribute + | ts.JsxSpreadAttribute + | ts.JsxClosingElement + | ts.JsxExpression + | ts.JsxText + | ts.NotEmittedStatement + | ts.CommaListExpression + | ts.EmptyStatement + | ts.DebuggerStatement + | ts.MissingDeclaration + | ts.Block + | ts.VariableStatement + | ts.ExpressionStatement + | ts.IfStatement + | ts.DoStatement + | ts.WhileStatement + | ts.ForStatement + | ts.ForInStatement + | ts.ForOfStatement + | ts.BreakStatement + | ts.ContinueStatement + | ts.ReturnStatement + | ts.WithStatement + | ts.SwitchStatement + | ts.CaseBlock + | ts.CaseClause + | ts.DefaultClause + | ts.LabeledStatement + | ts.ThrowStatement + | ts.TryStatement + | ts.CatchClause + // | ts.ClassLikeDeclarationBase -> ClassDeclaration | ClassExpression + | ts.ClassDeclaration + | ts.ClassExpression + | ts.InterfaceDeclaration + | ts.HeritageClause + | ts.TypeAliasDeclaration + | ts.EnumMember + | ts.EnumDeclaration + | ts.ModuleDeclaration + | ts.ModuleBlock + | ts.ImportEqualsDeclaration + | ts.ExternalModuleReference + | ts.ImportDeclaration + | ts.ImportClause + | ts.NamespaceImport + | ts.NamespaceExportDeclaration + | ts.ExportDeclaration + | ts.NamedImports + | ts.NamedExports + | ts.ImportSpecifier + | ts.ExportSpecifier + | ts.ExportAssignment + | ts.CommentRange + | ts.JSDocTypeExpression + | ts.JSDoc + | ts.JSDocUnknownTag + | ts.JSDocAugmentsTag + | ts.JSDocClassTag + | ts.JSDocEnumTag + | ts.JSDocThisTag + | ts.JSDocTemplateTag + | ts.JSDocReturnTag + | ts.JSDocTypeTag + | ts.JSDocTypedefTag + | ts.JSDocCallbackTag + | ts.JSDocSignature + | ts.JSDocPropertyTag + | ts.JSDocParameterTag + | ts.JSDocTypeLiteral + | ts.SourceFile + | ts.Bundle + | ts.InputFiles + | ts.UnparsedSource + | ts.JsonMinusNumericLiteral); From d5a1ff302df8c49e346d61716658322a69223a24 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 19 Dec 2018 03:03:46 +0100 Subject: [PATCH 25/84] feat: fix issues in AST (#42) changes: DeclareFunction to TSDeclareFunction changes: VariableDeclarator[kind='type'] to TSTypeAliasDeclaration makes abstract optional in interfaces BREAKING CHANGE: This changes the AST --- .../typescript-estree/src/ast-node-types.ts | 3 +- packages/typescript-estree/src/convert.ts | 66 +- packages/typescript-estree/src/node-utils.ts | 4 +- .../src/temp-types-based-on-js-source.ts | 1 + .../tests/ast-alignment/fixtures-to-test.ts | 38 +- .../typescript/declare/abstract-class.src.ts | 3 + .../fixtures/typescript/declare/class.src.ts | 3 + .../fixtures/typescript/declare/enum.src.ts | 4 + .../typescript/declare/function.src.ts | 1 + .../typescript/declare/interface.src.ts | 3 + .../fixtures/typescript/declare/module.src.ts | 3 + .../typescript/declare/namespace.src.ts | 3 + .../typescript/declare/type-alias.src.ts | 1 + .../typescript/declare/variable.src.ts | 1 + .../lib/__snapshots__/javascript.ts.snap | 2 - .../tests/lib/__snapshots__/tsx.ts.snap | 214 +- .../lib/__snapshots__/typescript.ts.snap | 5050 +++++++++++------ 17 files changed, 3450 insertions(+), 1950 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/abstract-class.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/class.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/enum.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/function.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/interface.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/module.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/namespace.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/type-alias.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/declare/variable.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index 35a086fb6ea4..58f6eea40ae9 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -26,7 +26,6 @@ export const AST_NODE_TYPES: { [key: string]: string } = { ConditionalExpression: 'ConditionalExpression', ContinueStatement: 'ContinueStatement', DebuggerStatement: 'DebuggerStatement', - DeclareFunction: 'DeclareFunction', Decorator: 'Decorator', DoWhileStatement: 'DoWhileStatement', EmptyStatement: 'EmptyStatement', @@ -100,6 +99,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSConstructorType: 'TSConstructorType', TSConstructSignature: 'TSConstructSignature', TSDeclareKeyword: 'TSDeclareKeyword', + TSDeclareFunction: 'TSDeclareFunction', TSEnumDeclaration: 'TSEnumDeclaration', TSEnumMember: 'TSEnumMember', TSExportAssignment: 'TSExportAssignment', @@ -132,6 +132,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSStringKeyword: 'TSStringKeyword', TSSymbolKeyword: 'TSSymbolKeyword', TSTypeAnnotation: 'TSTypeAnnotation', + TSTypeAliasDeclaration: 'TSTypeAliasDeclaration', TSTypeLiteral: 'TSTypeLiteral', TSTypeOperator: 'TSTypeOperator', TSTypeParameter: 'TSTypeParameter', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index c40588629a24..3dd82d52bc13 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -694,15 +694,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.FunctionDeclaration: { let functionDeclarationType = AST_NODE_TYPES.FunctionDeclaration; - - if (node.modifiers && node.modifiers.length) { - const isDeclareFunction = nodeUtils.hasModifier( - SyntaxKind.DeclareKeyword, - node - ); - if (isDeclareFunction) { - functionDeclarationType = AST_NODE_TYPES.DeclareFunction; - } + if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + functionDeclarationType = AST_NODE_TYPES.TSDeclareFunction; } Object.assign(result, { @@ -712,7 +705,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { expression: false, async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), params: convertParameters(node.parameters), - body: convertChild(node.body) + body: convertChild(node.body) || undefined }); // Process returnType @@ -720,6 +713,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).returnType = convertTypeAnnotation(node.type); } + if (functionDeclarationType === AST_NODE_TYPES.TSDeclareFunction) { + result.declare = true; + } + // Process typeParameters if (node.typeParameters && node.typeParameters.length) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( @@ -758,6 +755,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { kind: nodeUtils.getDeclarationKind(node.declarationList) }); + if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } + // check for exports result = nodeUtils.fixExports(node, result as any, ast); break; @@ -1618,6 +1619,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ); } + if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } + if (node.decorators) { result.decorators = convertDecorators(node.decorators); } @@ -2245,40 +2250,26 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { additionalOptions }); - /** - * Convert TypeAliasDeclaration node into VariableDeclaration - * to allow core rules such as "semi" to work automatically - */ case SyntaxKind.TypeAliasDeclaration: { - const typeAliasDeclarator = { - type: AST_NODE_TYPES.VariableDeclarator, + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeAliasDeclaration, id: convertChild(node.name), - init: convertChild(node.type), - range: [node.name.getStart(ast), node.end] - }; + typeAnnotation: convertChild(node.type) + }); - (typeAliasDeclarator as any).loc = nodeUtils.getLocFor( - typeAliasDeclarator.range[0], - typeAliasDeclarator.range[1], - ast - ); + if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } // Process typeParameters if (node.typeParameters && node.typeParameters.length) { - (typeAliasDeclarator as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + (result as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( node.typeParameters ); } - Object.assign(result, { - type: AST_NODE_TYPES.VariableDeclaration, - kind: nodeUtils.getDeclarationKind(node), - declarations: [typeAliasDeclarator] - }); - // check for exports result = nodeUtils.fixExports(node, result as any, ast); - break; } @@ -2400,10 +2391,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } const hasImplementsClause = interfaceHeritageClauses.length > 0; - const hasAbstractKeyword = nodeUtils.hasModifier( - SyntaxKind.AbstractKeyword, - node - ); const interfaceOpenBrace = nodeUtils.findNextToken( interfaceLastClassToken, ast, @@ -2422,7 +2409,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }; Object.assign(result, { - abstract: hasAbstractKeyword, type: AST_NODE_TYPES.TSInterfaceDeclaration, body: interfaceBody, id: convertChild(node.name), @@ -2440,6 +2426,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (node.decorators) { result.decorators = convertDecorators(node.decorators); } + if (nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)) { + result.abstract = true; + } + if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + result.declare = true; + } // check for exports result = nodeUtils.fixExports(node, result as any, ast); diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 4563770c0037..86301774235e 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -350,10 +350,8 @@ function isTypeKeyword(kind: number): boolean { * @param {ts.Node} node TypeScript AST node * @returns {string} declaration kind */ -function getDeclarationKind(node: ts.Node): string { +function getDeclarationKind(node: ts.Node): 'let' | 'const' | 'var' { switch (node.kind) { - case SyntaxKind.TypeAliasDeclaration: - return 'type'; case SyntaxKind.VariableDeclarationList: if (node.flags & ts.NodeFlags.Let) { return 'let'; diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index 3a37c3fe708b..9ce5dae0482f 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -41,6 +41,7 @@ export interface ESTreeNode { static?: boolean; export?: boolean; parameter?: any; + abstract?: boolean; } export interface ESTreeComment extends ESTreeNode {} diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 3e2206155b7c..cba6f1cf68b9 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -395,16 +395,6 @@ let fixturePatternConfigsToTest = [ 'class-with-implements-generic', 'class-with-implements', 'class-with-extends-and-implements', - /** - * Babylon: TSDeclareFunction + declare: true - * tsep: DeclareFunction - */ - 'declare-function', - /** - * Babylon: TSTypeReference + identifier - * tsep: TSUnknownKeyword - */ - 'unknown-type-annotation', /** * Other major AST differences (e.g. fundamentally different node types) */ @@ -418,15 +408,9 @@ let fixturePatternConfigsToTest = [ 'interface-with-jsdoc', 'interface-with-optional-properties', 'interface-without-type-annotation', - 'type-alias-declaration-with-constrained-type-parameter', - 'type-alias-declaration', - 'type-alias-object-without-annotation', 'typed-this', 'export-type-function-declaration', - 'export-type-class-declaration', 'abstract-interface', - 'export-type-alias-declaration', - 'unique-symbol', 'keyof-operator', /** * tsep bug - Program.body[0].expression.left.properties[0].value.right is currently showing up @@ -456,6 +440,8 @@ let fixturePatternConfigsToTest = [ parseWithSourceTypeModule: [ 'export-named-enum', 'export-assignment', + 'export-type-alias-declaration', + 'export-type-class-declaration', 'export-default-class-with-generic', 'export-default-class-with-multiple-generics', 'export-named-class-with-generic', @@ -483,7 +469,7 @@ let fixturePatternConfigsToTest = [ fileType: 'ts', ignore: [ /** - * currently babylon not supported + * there is difference in range between babel and tsep */ 'tagged-template-expression-type-arguments' ] @@ -508,6 +494,24 @@ let fixturePatternConfigsToTest = [ ] }), + createFixturePatternConfigFor('typescript/declare', { + fileType: 'ts', + ignore: [ + /** + * AST difference + * tsep: TSAbstractClassDeclaration + * babel: ClassDeclaration[abstract=true] + */ + 'interface', + /** + * AST difference + * tsep: heritage = [] + * babel: heritage = undefined + */ + 'abstract-class' + ] + }), + createFixturePatternConfigFor('typescript/namespaces-and-modules', { fileType: 'ts', ignore: [ diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/abstract-class.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/abstract-class.src.ts new file mode 100644 index 000000000000..4a9cfd07d2e7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/abstract-class.src.ts @@ -0,0 +1,3 @@ +declare abstract class Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/class.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/class.src.ts new file mode 100644 index 000000000000..2e769f6c9b78 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/class.src.ts @@ -0,0 +1,3 @@ +declare class Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/enum.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/enum.src.ts new file mode 100644 index 000000000000..0fde77274fd1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/enum.src.ts @@ -0,0 +1,4 @@ +declare enum Foo { + Bar, + Baz +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/function.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/function.src.ts new file mode 100644 index 000000000000..44407a370ab2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/function.src.ts @@ -0,0 +1 @@ +declare function foo(): void diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/interface.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/interface.src.ts new file mode 100644 index 000000000000..f9afeb14be49 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/interface.src.ts @@ -0,0 +1,3 @@ +declare interface Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/module.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/module.src.ts new file mode 100644 index 000000000000..13fa9986520a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/module.src.ts @@ -0,0 +1,3 @@ +declare module Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/namespace.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/namespace.src.ts new file mode 100644 index 000000000000..8caa74ce5dc0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/namespace.src.ts @@ -0,0 +1,3 @@ +declare namespace Foo { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/type-alias.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/type-alias.src.ts new file mode 100644 index 000000000000..d8346d016684 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/type-alias.src.ts @@ -0,0 +1 @@ +declare type Foo = string diff --git a/packages/typescript-estree/tests/fixtures/typescript/declare/variable.src.ts b/packages/typescript-estree/tests/fixtures/typescript/declare/variable.src.ts new file mode 100644 index 000000000000..cdb68e32b1fe --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/declare/variable.src.ts @@ -0,0 +1 @@ +declare var foo: any; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 399dd2942866..eaad453fa744 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -105760,7 +105760,6 @@ Object { "body": Array [ Object { "async": false, - "body": null, "expression": false, "generator": false, "id": Object { @@ -106077,7 +106076,6 @@ Object { "body": Array [ Object { "async": false, - "body": null, "expression": false, "generator": false, "id": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap index d78b679e7e0f..9f3a260699e0 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/tsx.ts.snap @@ -499,148 +499,128 @@ Object { "type": "ImportDeclaration", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Props", + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 31, + 63, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, }, + "name": "title", + "range": Array [ + 48, + 53, + ], + "type": "Identifier", }, - "name": "Props", - "range": Array [ - 36, - 41, - ], - "type": "Identifier", - }, - "init": Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 15, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 2, + "line": 3, }, }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "title", - "range": Array [ - 48, - 53, - ], - "type": "Identifier", + "range": Array [ + 48, + 61, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 53, + 61, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { "column": 15, "line": 3, }, "start": Object { - "column": 2, + "column": 9, "line": 3, }, }, "range": Array [ - 48, + 55, 61, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 53, - 61, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 55, - 61, - ], - "type": "TSStringKeyword", - }, - }, + "type": "TSStringKeyword", }, - ], - "range": Array [ - 44, - 63, - ], - "type": "TSTypeLiteral", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 2, }, }, - "range": Array [ - 36, - 63, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 2, - }, + ], + "range": Array [ + 44, + 63, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 31, - 63, - ], - "type": "VariableDeclaration", }, Object { "declaration": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 1829ec57932b..edcf3d40d527 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -10718,7 +10718,6 @@ Object { "type": "ClassDeclaration", }, Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -10773,254 +10772,234 @@ Object { "type": "TSInterfaceDeclaration", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 9, - }, - "start": Object { - "column": 5, - "line": 9, - }, - }, - "name": "Constructor", - "range": Array [ - 163, - 174, - ], - "type": "Identifier", + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, }, - "init": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 22, - "line": 9, - }, - }, - "parameters": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 30, - "line": 9, - }, - }, - "name": "args", - "range": Array [ - 188, - 199, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 34, - "line": 9, - }, - }, - "range": Array [ - 192, - 199, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 9, - }, - "start": Object { - "column": 36, - "line": 9, - }, - }, - "range": Array [ - 194, - 197, - ], - "type": "TSAnyKeyword", - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 36, - "line": 9, - }, - }, - "range": Array [ - 194, - 199, - ], - "type": "TSArrayType", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 27, - "line": 9, - }, - }, - "range": Array [ - 185, - 199, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 180, - 205, - ], - "type": "TSConstructorType", - "typeAnnotation": Object { + "start": Object { + "column": 5, + "line": 9, + }, + }, + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 158, + 206, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 22, + "line": 9, + }, + }, + "parameters": Array [ + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 47, + "column": 41, "line": 9, }, "start": Object { - "column": 44, + "column": 30, "line": 9, }, }, + "name": "args", "range": Array [ - 202, - 205, + 188, + 199, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 47, + "column": 41, "line": 9, }, "start": Object { - "column": 46, + "column": 34, "line": 9, }, }, "range": Array [ - 204, - 205, + 192, + 199, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 197, + ], + "type": "TSAnyKeyword", + }, "loc": Object { "end": Object { - "column": 47, + "column": 41, "line": 9, }, "start": Object { - "column": 46, + "column": 36, "line": 9, }, }, - "name": "T", "range": Array [ - 204, - 205, + 194, + 199, ], - "type": "Identifier", + "type": "TSArrayType", }, }, }, - "typeParameters": null, + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 27, + "line": 9, + }, + }, + "range": Array [ + 185, + 199, + ], + "type": "RestElement", }, + ], + "range": Array [ + 180, + 205, + ], + "type": "TSConstructorType", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 48, + "column": 47, "line": 9, }, "start": Object { - "column": 5, + "column": 44, "line": 9, }, }, "range": Array [ - 163, - 206, + 202, + 205, ], - "type": "VariableDeclarator", - "typeParameters": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, + "column": 47, "line": 9, }, "start": Object { - "column": 16, + "column": 46, "line": 9, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 9, - }, - "start": Object { - "column": 17, - "line": 9, - }, - }, - "name": "T", - "range": Array [ - 175, - 176, - ], - "type": "TSTypeParameter", - }, - ], "range": Array [ - 174, - 177, + 204, + 205, ], - "type": "TSTypeParameterDeclaration", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 46, + "line": 9, + }, + }, + "name": "T", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, }, }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 48, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, + "typeParameters": null, + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 174, + 177, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 158, - 206, - ], - "type": "VariableDeclaration", }, ], "loc": Object { @@ -20323,6 +20302,7 @@ Object { ], "type": "ClassBody", }, + "declare": true, "id": Object { "loc": Object { "end": Object { @@ -20601,7 +20581,7 @@ Object { "body": Array [ Object { "async": false, - "body": null, + "declare": true, "expression": false, "generator": false, "id": Object { @@ -20724,7 +20704,7 @@ Object { "type": "TSStringKeyword", }, }, - "type": "DeclareFunction", + "type": "TSDeclareFunction", }, ], "loc": Object { @@ -23006,112 +22986,92 @@ Object { "body": Array [ Object { "declaration": Object { - "declarations": Array [ - Object { - "id": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 40, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 39, + ], + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 21, + "column": 30, "line": 1, }, "start": Object { - "column": 12, + "column": 24, "line": 1, }, }, - "name": "TestAlias", "range": Array [ - 12, - 21, + 24, + 30, ], - "type": "Identifier", + "type": "TSStringKeyword", }, - "init": Object { + Object { "loc": Object { "end": Object { "column": 39, "line": 1, }, "start": Object { - "column": 24, + "column": 33, "line": 1, }, }, "range": Array [ - 24, + 33, 39, ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 30, - ], - "type": "TSStringKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 39, - ], - "type": "TSNumberKeyword", - }, - ], - }, - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "type": "TSNumberKeyword", }, - "range": Array [ - 12, - 40, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + ], }, - "range": Array [ - 7, - 40, - ], - "type": "VariableDeclaration", }, "loc": Object { "end": Object { @@ -23302,148 +23262,128 @@ Object { "body": Array [ Object { "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 51, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "name": "count", + "range": Array [ + 35, + 40, + ], + "type": "Identifier", }, - "name": "TestClassProps", - "range": Array [ - 12, - 26, - ], - "type": "Identifier", - }, - "init": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 2, }, }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "count", - "range": Array [ - 35, - 40, - ], - "type": "Identifier", + "range": Array [ + 35, + 48, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { "column": 17, "line": 2, }, "start": Object { - "column": 4, + "column": 11, "line": 2, }, }, "range": Array [ - 35, + 42, 48, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 40, - 48, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 42, - 48, - ], - "type": "TSNumberKeyword", - }, - }, + "type": "TSNumberKeyword", }, - ], - "range": Array [ - 29, - 50, - ], - "type": "TSTypeLiteral", - }, - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 1, }, }, - "range": Array [ - 12, - 51, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 1, - }, + ], + "range": Array [ + 29, + 50, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 7, - 51, - ], - "type": "VariableDeclaration", }, "loc": Object { "end": Object { @@ -23670,165 +23610,145 @@ Object { "body": Array [ Object { "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "TestCallback", - "range": Array [ - 12, - 24, - ], - "type": "Identifier", + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, }, - "init": Object { + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { - "column": 46, + "column": 37, "line": 1, }, "start": Object { - "column": 27, + "column": 28, "line": 1, }, }, - "parameters": Array [ - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 28, - 37, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 37, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 37, - ], - "type": "TSNumberKeyword", - }, - }, - }, - ], + "name": "a", "range": Array [ - 27, - 46, + 28, + 37, ], - "type": "TSFunctionType", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 46, + "column": 37, "line": 1, }, "start": Object { - "column": 40, + "column": 29, "line": 1, }, }, "range": Array [ - 40, - 46, + 29, + 37, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 46, + "column": 37, "line": 1, }, "start": Object { - "column": 42, + "column": 31, "line": 1, }, }, "range": Array [ - 42, - 46, + 31, + 37, ], - "type": "TSVoidKeyword", + "type": "TSNumberKeyword", }, }, - "typeParameters": null, }, + ], + "range": Array [ + 27, + 46, + ], + "type": "TSFunctionType", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 47, + "column": 46, "line": 1, }, "start": Object { - "column": 12, + "column": 40, "line": 1, }, }, "range": Array [ - 12, - 47, + 40, + 46, ], - "type": "VariableDeclarator", - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 47, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 46, + ], + "type": "TSVoidKeyword", + }, }, + "typeParameters": null, }, - "range": Array [ - 7, - 47, - ], - "type": "VariableDeclaration", }, "loc": Object { "end": Object { @@ -28778,296 +28698,256 @@ exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, - "init": Object { - "isTypeOf": true, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "isTypeOf": true, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "parameter": Object { + "literal": Object { "loc": Object { "end": Object { - "column": 27, + "column": 26, "line": 1, }, "start": Object { - "column": 9, + "column": 23, "line": 1, }, }, - "parameter": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 26, - ], - "raw": "'A'", - "type": "Literal", - "value": "A", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 26, - ], - "type": "TSLiteralType", - }, - "qualifier": null, "range": Array [ - 9, - 27, + 23, + 26, ], - "type": "TSImportType", - "typeParameters": null, + "raw": "'A'", + "type": "Literal", + "value": "A", }, "loc": Object { "end": Object { - "column": 28, + "column": 26, "line": 1, }, "start": Object { - "column": 5, + "column": 23, "line": 1, }, }, "range": Array [ - 5, - 28, + 23, + 26, ], - "type": "VariableDeclarator", + "type": "TSLiteralType", }, - ], - "kind": "type", + "qualifier": null, + "range": Array [ + 9, + 27, + ], + "type": "TSImportType", + "typeParameters": null, + }, + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "B", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 26, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 28, + 29, + 55, ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "isTypeOf": false, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "parameter": Object { + "literal": Object { "loc": Object { "end": Object { - "column": 6, + "column": 19, "line": 2, }, "start": Object { - "column": 5, + "column": 16, "line": 2, }, }, - "name": "B", "range": Array [ - 34, - 35, + 45, + 48, ], - "type": "Identifier", + "raw": "\\"B\\"", + "type": "Literal", + "value": "B", }, - "init": Object { - "isTypeOf": false, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, }, - "parameter": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 45, - 48, - ], - "raw": "\\"B\\"", - "type": "Literal", - "value": "B", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 45, - 48, - ], - "type": "TSLiteralType", + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "type": "TSLiteralType", + }, + "qualifier": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "X", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "range": Array [ + 38, + 54, + ], + "type": "TSImportType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, }, - "qualifier": Object { + "start": Object { + "column": 22, + "line": 2, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 22, + "column": 24, "line": 2, }, "start": Object { - "column": 21, + "column": 23, "line": 2, }, }, - "name": "X", "range": Array [ - 50, - 51, + 52, + 53, ], - "type": "Identifier", - }, - "range": Array [ - 38, - 54, - ], - "type": "TSImportType", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, }, - "range": Array [ - 52, - 53, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "name": "Y", - "range": Array [ - 52, - 53, - ], - "type": "Identifier", + "start": Object { + "column": 23, + "line": 2, }, }, - ], - "range": Array [ - 51, - 54, - ], - "type": "TSTypeParameterInstantiation", + "name": "Y", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, }, - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, + ], "range": Array [ - 34, - 55, + 51, + 54, ], - "type": "VariableDeclarator", - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, + "type": "TSTypeParameterInstantiation", }, }, - "range": Array [ - 29, - 55, - ], - "type": "VariableDeclaration", }, ], "loc": Object { @@ -29491,221 +29371,201 @@ exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-ref Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, }, - "name": "X", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, }, - "range": Array [ - 9, - 29, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "start": Object { + "column": 10, + "line": 1, }, - "typeParameters": Object { + }, + "params": Array [ + Object { + "isTypeOf": false, "loc": Object { "end": Object { - "column": 29, + "column": 28, "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, - "params": Array [ - Object { - "isTypeOf": false, + "parameter": Object { + "literal": Object { "loc": Object { "end": Object { - "column": 28, + "column": 20, "line": 1, }, "start": Object { - "column": 11, + "column": 18, "line": 1, }, }, - "parameter": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "raw": "\\"\\"", - "type": "Literal", - "value": "", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "TSLiteralType", - }, - "qualifier": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "B", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, "range": Array [ - 11, - 28, + 18, + 20, ], - "type": "TSImportType", - "typeParameters": Object { + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "TSLiteralType", + }, + "qualifier": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "range": Array [ + 11, + 28, + ], + "type": "TSImportType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 28, + "column": 27, "line": 1, }, "start": Object { - "column": 23, + "column": 24, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 27, - ], - "type": "TSAnyKeyword", - }, - ], "range": Array [ - 23, - 28, + 24, + 27, ], - "type": "TSTypeParameterInstantiation", + "type": "TSAnyKeyword", }, - }, - ], - "range": Array [ - 10, - 29, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, + ], + "range": Array [ + 23, + 28, + ], + "type": "TSTypeParameterInstantiation", + }, }, - }, + ], "range": Array [ - 5, - 30, + 10, + 29, ], - "type": "VariableDeclarator", - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "TSTypeParameterInstantiation", }, }, - "range": Array [ - 0, - 30, - ], - "type": "VariableDeclaration", }, ], "loc": Object { @@ -30021,7 +29881,6 @@ exports[`typescript fixtures/basics/interface-extends.src 1`] = ` Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -30245,7 +30104,6 @@ exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -30540,7 +30398,6 @@ exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -30783,7 +30640,6 @@ exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [ Object { @@ -34082,7 +33938,6 @@ exports[`typescript fixtures/basics/interface-with-construct-signature-with-para Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [ Object { @@ -34489,7 +34344,6 @@ exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1 Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -34912,7 +34766,6 @@ exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -35155,7 +35008,6 @@ exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [ Object { @@ -35457,7 +35309,6 @@ exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [ Object { @@ -36245,7 +36096,6 @@ exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [ Object { @@ -36470,97 +36320,24 @@ exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "operator": "keyof", - "range": Array [ - 9, - 18, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - }, + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "start": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 5, - 19, - ], - "type": "VariableDeclarator", }, - ], - "kind": "type", + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 19, @@ -36575,7 +36352,60 @@ Object { 0, 19, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "operator": "keyof", + "range": Array [ + 9, + 18, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + }, + }, }, ], "loc": Object { @@ -40505,30 +40335,60 @@ exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, }, - "init": Object { + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 37, + ], + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 37, + "column": 27, "line": 1, }, "start": Object { @@ -40538,206 +40398,156 @@ Object { }, "range": Array [ 17, - 37, + 27, ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, }, - "range": Array [ - 17, - 27, - ], - "type": "TSTypeReference", - "typeName": Object { + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 24, + "column": 26, "line": 1, }, "start": Object { - "column": 17, + "column": 25, "line": 1, }, }, - "name": "Success", "range": Array [ - 17, - 24, + 25, + 26, ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, }, - "range": Array [ - 25, - 26, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", + "start": Object { + "column": 25, + "line": 1, }, }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", + "name": "T", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, }, - "range": Array [ - 30, - 37, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "Failure", - "range": Array [ - 30, - 37, - ], - "type": "Identifier", + "start": Object { + "column": 30, + "line": 1, }, }, - ], - }, - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, + "name": "Failure", + "range": Array [ + 30, + 37, + ], + "type": "Identifier", }, }, - "range": Array [ - 5, - 37, - ], - "type": "VariableDeclarator", - "typeParameters": Object { + ], + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "TSTypeParameter", - }, - ], + "name": "T", "range": Array [ - 11, - 14, + 12, + 13, ], - "type": "TSTypeParameterDeclaration", + "type": "TSTypeParameter", }, - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 11, + 14, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 0, - 37, - ], - "type": "VariableDeclaration", }, ], "loc": Object { @@ -40981,30 +40791,60 @@ exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, }, - "init": Object { + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 48, + ], + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 48, + "column": 38, "line": 1, }, "start": Object { @@ -41014,224 +40854,174 @@ Object { }, "range": Array [ 28, - 48, + 38, ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, }, - "range": Array [ - 28, - 38, - ], - "type": "TSTypeReference", - "typeName": Object { + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 35, + "column": 37, "line": 1, }, "start": Object { - "column": 28, + "column": 36, "line": 1, }, }, - "name": "Success", "range": Array [ - 28, - 35, + 36, + 37, ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, }, - "range": Array [ - 36, - 37, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", + "start": Object { + "column": 36, + "line": 1, }, }, - ], - "range": Array [ - 35, - 38, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 48, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", }, - "name": "Failure", - "range": Array [ - 41, - 48, - ], - "type": "Identifier", }, - }, - ], - }, - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, + ], + "range": Array [ + 35, + 38, + ], + "type": "TSTypeParameterInstantiation", }, }, - "range": Array [ - 5, - 48, - ], - "type": "VariableDeclarator", - "typeParameters": Object { + Object { "loc": Object { "end": Object { - "column": 25, + "column": 48, "line": 1, }, "start": Object { - "column": 11, + "column": 41, "line": 1, }, }, - "params": Array [ - Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "members": Array [], - "range": Array [ - 22, - 24, - ], - "type": "TSTypeLiteral", + "range": Array [ + 41, + 48, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "start": Object { + "column": 41, + "line": 1, }, - "name": "T", - "range": Array [ - 12, - 24, - ], - "type": "TSTypeParameter", }, - ], + "name": "Failure", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + }, + }, + ], + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 22, + 24, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", "range": Array [ - 11, - 25, + 12, + 24, ], - "type": "TSTypeParameterDeclaration", + "type": "TSTypeParameter", }, - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 11, + 25, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 0, - 48, - ], - "type": "VariableDeclaration", }, ], "loc": Object { @@ -41529,184 +41319,164 @@ exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, }, + "name": "bar", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", }, - "name": "foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "init": Object { "loc": Object { "end": Object { - "column": 29, + "column": 24, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", + "range": Array [ + 12, + 24, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, }, + }, + "range": Array [ + 15, + 23, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 17, "line": 1, }, }, "range": Array [ - 12, - 24, + 17, + 23, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 23, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 23, - ], - "type": "TSStringKeyword", - }, - }, + "type": "TSStringKeyword", }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, + "start": Object { + "column": 25, + "line": 1, }, - "range": Array [ - 25, - 28, - ], - "type": "TSPropertySignature", }, - ], - "range": Array [ - 11, - 29, - ], - "type": "TSTypeLiteral", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, + "name": "baz", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", }, - "start": Object { - "column": 5, - "line": 1, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, }, + "range": Array [ + 25, + 28, + ], + "type": "TSPropertySignature", }, - "range": Array [ - 5, - 30, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "type", - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 11, + 29, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 0, - 30, - ], - "type": "VariableDeclaration", }, ], "loc": Object { @@ -43885,7 +43655,6 @@ exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [ Object { @@ -44665,79 +44434,24 @@ exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "operator": "unique", - "range": Array [ - 9, - 22, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 22, - ], - "type": "TSSymbolKeyword", - }, + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "start": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 5, - 23, - ], - "type": "VariableDeclarator", }, - ], - "kind": "type", + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 23, @@ -44752,7 +44466,42 @@ Object { 0, 23, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "operator": "unique", + "range": Array [ + 9, + 22, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "TSSymbolKeyword", + }, + }, }, ], "loc": Object { @@ -46261,45 +46010,1611 @@ Object { "type": "Literal", "value": "Bar", }, - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 53, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 30, + 54, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 55, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 28, + ], + "type": "String", + "value": "\\"Nicholas\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 48, + 53, + ], + "type": "String", + "value": "\\"Bar\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 21, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 21, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "TSStringKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/abstract-class.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "ClassBody", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "superClass": null, + "type": "TSAbstractClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 22, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/class.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "ClassBody", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/enum.src 1`] = ` +Object { + "body": Array [ + Object { + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "Bar", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "Baz", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 0, + 37, + ], + "type": "TSEnumDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 12, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + "value": "Baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/function.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "declare": true, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 28, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSDeclareFunction", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "Keyword", + "value": "void", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/interface.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "TSInterfaceBody", + }, + "declare": true, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 17, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/module.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 1, }, - "range": Array [ - 34, - 53, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 19, + 23, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 30, - 54, + 0, + 23, ], - "type": "VariableDeclaration", + "type": "TSModuleDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -46308,14 +47623,14 @@ Object { }, "range": Array [ 0, - 55, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { @@ -46325,64 +47640,179 @@ Object { }, "range": Array [ 0, - 3, + 7, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 8, "line": 1, }, }, "range": Array [ - 4, 8, + 14, ], "type": "Identifier", - "value": "name", + "value": "module", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, "range": Array [ - 8, - 9, + 15, + 18, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/namespace.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 0, "line": 1, }, }, "range": Array [ - 9, - 15, + 0, + 7, ], "type": "Identifier", - "value": "string", + "value": "declare", }, Object { "loc": Object { @@ -46391,21 +47821,21 @@ Object { "line": 1, }, "start": Object { - "column": 16, + "column": 8, "line": 1, }, }, "range": Array [ - 16, + 8, 17, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "namespace", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 21, "line": 1, }, "start": Object { @@ -46415,161 +47845,221 @@ Object { }, "range": Array [ 18, - 28, + 21, ], - "type": "String", - "value": "\\"Nicholas\\"", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 23, "line": 1, }, "start": Object { - "column": 28, + "column": 22, "line": 1, }, }, "range": Array [ - 28, - 29, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 3, }, }, "range": Array [ - 30, - 33, + 25, + 26, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/type-alias.src 1`] = ` +Object { + "body": Array [ Object { + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 34, - 37, + 0, + 25, ], - "type": "Identifier", - "value": "foo", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 7, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 37, - 38, + 0, + 7, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 39, - 45, + 8, + 12, ], "type": "Identifier", - "value": "string", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 46, - 47, + 13, + 16, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 48, - 53, + 17, + 18, ], - "type": "String", - "value": "\\"Bar\\"", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 53, - 54, + 19, + 25, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "string", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` +exports[`typescript fixtures/declare/variable.src 1`] = ` Object { "body": Array [ Object { @@ -46578,77 +48068,78 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 4, + "column": 12, "line": 1, }, }, - "name": "x", + "name": "foo", "range": Array [ - 4, - 21, + 12, + 20, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, "range": Array [ - 8, - 21, + 15, + 20, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 21, + 17, + 20, ], - "type": "TSStringKeyword", + "type": "TSAnyKeyword", }, }, }, "init": null, "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 4, + "column": 12, "line": 1, }, }, "range": Array [ - 4, - 21, + 12, + 20, ], "type": "VariableDeclarator", }, ], - "kind": "let", + "declare": true, + "kind": "var", "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { @@ -46658,15 +48149,15 @@ Object { }, "range": Array [ 0, - 22, + 21, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -46682,7 +48173,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { @@ -46692,43 +48183,61 @@ Object { }, "range": Array [ 0, - 3, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, ], "type": "Keyword", - "value": "let", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 15, "line": 1, }, "start": Object { - "column": 4, + "column": 12, "line": 1, }, }, "range": Array [ - 4, - 5, + 12, + 15, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, "range": Array [ - 8, - 9, + 15, + 16, ], "type": "Punctuator", "value": ":", @@ -46736,35 +48245,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 21, + 17, + 20, ], "type": "Identifier", - "value": "string", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { - "column": 21, + "column": 20, "line": 1, }, }, "range": Array [ + 20, 21, - 22, ], "type": "Punctuator", "value": ";", @@ -58688,7 +60197,6 @@ exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.sr Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -59643,7 +61151,6 @@ exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [], "loc": Object { @@ -59813,7 +61320,6 @@ exports[`typescript fixtures/errorRecovery/interface-property-modifiers.src 1`] Object { "body": Array [ Object { - "abstract": false, "body": Object { "body": Array [ Object { @@ -66032,7 +67538,6 @@ Object { Object { "declaration": Object { "async": false, - "body": null, "expression": false, "generator": false, "id": Object { @@ -68308,7 +69813,6 @@ Object { "body": Array [ Object { "declaration": Object { - "abstract": false, "body": Object { "body": Array [ Object { From 542372c0973141514282ea6d9ea6281ff6384784 Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 19 Dec 2018 03:16:11 +0100 Subject: [PATCH 26/84] refactor: mark AsteriskAsteriskEquals as assignment operator (#46) --- packages/typescript-estree/src/convert.ts | 12 +- packages/typescript-estree/src/node-utils.ts | 137 ++++++++++--------- 2 files changed, 71 insertions(+), 78 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 3dd82d52bc13..7ebf1c4a62d9 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1758,7 +1758,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.PrefixUnaryExpression: case SyntaxKind.PostfixUnaryExpression: { - const operator = nodeUtils.getTextForTokenKind(node.operator); + const operator = nodeUtils.getTextForTokenKind(node.operator) || ''; Object.assign(result, { /** * ESTree uses UpdateExpression for ++/-- @@ -1836,16 +1836,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } else { (result as any).expressions.push(right); } - } else if ( - node.operatorToken && - node.operatorToken.kind === SyntaxKind.AsteriskAsteriskEqualsToken - ) { - Object.assign(result, { - type: AST_NODE_TYPES.AssignmentExpression, - operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), - left: convertChild(node.left), - right: convertChild(node.right) - }); } else { Object.assign(result, { type: nodeUtils.getBinaryExpressionType(node.operatorToken), diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 86301774235e..1249a9217591 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -12,14 +12,16 @@ import { ESTreeToken } from './temp-types-based-on-js-source'; import { TSNode } from './ts-nodes'; +import { AST_NODE_TYPES } from './ast-node-types'; const SyntaxKind = ts.SyntaxKind; -const ASSIGNMENT_OPERATORS = [ +const ASSIGNMENT_OPERATORS: ts.AssignmentOperator[] = [ SyntaxKind.EqualsToken, SyntaxKind.PlusEqualsToken, SyntaxKind.MinusEqualsToken, SyntaxKind.AsteriskEqualsToken, + SyntaxKind.AsteriskAsteriskEqualsToken, SyntaxKind.SlashEqualsToken, SyntaxKind.PercentEqualsToken, SyntaxKind.LessThanLessThanEqualsToken, @@ -30,72 +32,73 @@ const ASSIGNMENT_OPERATORS = [ SyntaxKind.CaretEqualsToken ]; -const LOGICAL_OPERATORS = [ +const LOGICAL_OPERATORS: ts.LogicalOperator[] = [ SyntaxKind.BarBarToken, SyntaxKind.AmpersandAmpersandToken ]; -const TOKEN_TO_TEXT: { [key: number]: string } = {}; -TOKEN_TO_TEXT[SyntaxKind.OpenBraceToken] = '{'; -TOKEN_TO_TEXT[SyntaxKind.CloseBraceToken] = '}'; -TOKEN_TO_TEXT[SyntaxKind.OpenParenToken] = '('; -TOKEN_TO_TEXT[SyntaxKind.CloseParenToken] = ')'; -TOKEN_TO_TEXT[SyntaxKind.OpenBracketToken] = '['; -TOKEN_TO_TEXT[SyntaxKind.CloseBracketToken] = ']'; -TOKEN_TO_TEXT[SyntaxKind.DotToken] = '.'; -TOKEN_TO_TEXT[SyntaxKind.DotDotDotToken] = '...'; -TOKEN_TO_TEXT[SyntaxKind.SemicolonToken] = ';'; -TOKEN_TO_TEXT[SyntaxKind.CommaToken] = ','; -TOKEN_TO_TEXT[SyntaxKind.LessThanToken] = '<'; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanToken] = '>'; -TOKEN_TO_TEXT[SyntaxKind.LessThanEqualsToken] = '<='; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanEqualsToken] = '>='; -TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsToken] = '=='; -TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsToken] = '!='; -TOKEN_TO_TEXT[SyntaxKind.EqualsEqualsEqualsToken] = '==='; -TOKEN_TO_TEXT[SyntaxKind.InstanceOfKeyword] = 'instanceof'; -TOKEN_TO_TEXT[SyntaxKind.ExclamationEqualsEqualsToken] = '!=='; -TOKEN_TO_TEXT[SyntaxKind.EqualsGreaterThanToken] = '=>'; -TOKEN_TO_TEXT[SyntaxKind.PlusToken] = '+'; -TOKEN_TO_TEXT[SyntaxKind.MinusToken] = '-'; -TOKEN_TO_TEXT[SyntaxKind.AsteriskToken] = '*'; -TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskToken] = '**'; -TOKEN_TO_TEXT[SyntaxKind.SlashToken] = '/'; -TOKEN_TO_TEXT[SyntaxKind.PercentToken] = '%'; -TOKEN_TO_TEXT[SyntaxKind.PlusPlusToken] = '++'; -TOKEN_TO_TEXT[SyntaxKind.MinusMinusToken] = '--'; -TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanToken] = '<<'; -TOKEN_TO_TEXT[SyntaxKind.LessThanSlashToken] = '>'; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanToken] = '>>>'; -TOKEN_TO_TEXT[SyntaxKind.AmpersandToken] = '&'; -TOKEN_TO_TEXT[SyntaxKind.BarToken] = '|'; -TOKEN_TO_TEXT[SyntaxKind.CaretToken] = '^'; -TOKEN_TO_TEXT[SyntaxKind.ExclamationToken] = '!'; -TOKEN_TO_TEXT[SyntaxKind.TildeToken] = '~'; -TOKEN_TO_TEXT[SyntaxKind.AmpersandAmpersandToken] = '&&'; -TOKEN_TO_TEXT[SyntaxKind.BarBarToken] = '||'; -TOKEN_TO_TEXT[SyntaxKind.QuestionToken] = '?'; -TOKEN_TO_TEXT[SyntaxKind.ColonToken] = ':'; -TOKEN_TO_TEXT[SyntaxKind.EqualsToken] = '='; -TOKEN_TO_TEXT[SyntaxKind.PlusEqualsToken] = '+='; -TOKEN_TO_TEXT[SyntaxKind.MinusEqualsToken] = '-='; -TOKEN_TO_TEXT[SyntaxKind.AsteriskEqualsToken] = '*='; -TOKEN_TO_TEXT[SyntaxKind.AsteriskAsteriskEqualsToken] = '**='; -TOKEN_TO_TEXT[SyntaxKind.SlashEqualsToken] = '/='; -TOKEN_TO_TEXT[SyntaxKind.PercentEqualsToken] = '%='; -TOKEN_TO_TEXT[SyntaxKind.LessThanLessThanEqualsToken] = '<<='; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanEqualsToken] = '>>='; -TOKEN_TO_TEXT[SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken] = '>>>='; -TOKEN_TO_TEXT[SyntaxKind.AmpersandEqualsToken] = '&='; -TOKEN_TO_TEXT[SyntaxKind.BarEqualsToken] = '|='; -TOKEN_TO_TEXT[SyntaxKind.CaretEqualsToken] = '^='; -TOKEN_TO_TEXT[SyntaxKind.AtToken] = '@'; -TOKEN_TO_TEXT[SyntaxKind.InKeyword] = 'in'; -TOKEN_TO_TEXT[SyntaxKind.UniqueKeyword] = 'unique'; -TOKEN_TO_TEXT[SyntaxKind.KeyOfKeyword] = 'keyof'; -TOKEN_TO_TEXT[SyntaxKind.NewKeyword] = 'new'; -TOKEN_TO_TEXT[SyntaxKind.ImportKeyword] = 'import'; +const TOKEN_TO_TEXT: { readonly [P in ts.SyntaxKind]?: string } = { + [SyntaxKind.OpenBraceToken]: '{', + [SyntaxKind.CloseBraceToken]: '}', + [SyntaxKind.OpenParenToken]: '(', + [SyntaxKind.CloseParenToken]: ')', + [SyntaxKind.OpenBracketToken]: '[', + [SyntaxKind.CloseBracketToken]: ']', + [SyntaxKind.DotToken]: '.', + [SyntaxKind.DotDotDotToken]: '...', + [SyntaxKind.SemicolonToken]: ',', + [SyntaxKind.CommaToken]: ',', + [SyntaxKind.LessThanToken]: '<', + [SyntaxKind.GreaterThanToken]: '>', + [SyntaxKind.LessThanEqualsToken]: '<=', + [SyntaxKind.GreaterThanEqualsToken]: '>=', + [SyntaxKind.EqualsEqualsToken]: '==', + [SyntaxKind.ExclamationEqualsToken]: '!=', + [SyntaxKind.EqualsEqualsEqualsToken]: '===', + [SyntaxKind.InstanceOfKeyword]: 'instanceof', + [SyntaxKind.ExclamationEqualsEqualsToken]: '!==', + [SyntaxKind.EqualsGreaterThanToken]: '=>', + [SyntaxKind.PlusToken]: '+', + [SyntaxKind.MinusToken]: '-', + [SyntaxKind.AsteriskToken]: '*', + [SyntaxKind.AsteriskAsteriskToken]: '**', + [SyntaxKind.SlashToken]: '/', + [SyntaxKind.PercentToken]: '%', + [SyntaxKind.PlusPlusToken]: '++', + [SyntaxKind.MinusMinusToken]: '--', + [SyntaxKind.LessThanLessThanToken]: '<<', + [SyntaxKind.LessThanSlashToken]: '>', + [SyntaxKind.GreaterThanGreaterThanGreaterThanToken]: '>>>', + [SyntaxKind.AmpersandToken]: '&', + [SyntaxKind.BarToken]: '|', + [SyntaxKind.CaretToken]: '^', + [SyntaxKind.ExclamationToken]: '!', + [SyntaxKind.TildeToken]: '~', + [SyntaxKind.AmpersandAmpersandToken]: '&&', + [SyntaxKind.BarBarToken]: '||', + [SyntaxKind.QuestionToken]: '?', + [SyntaxKind.ColonToken]: ':', + [SyntaxKind.EqualsToken]: '=', + [SyntaxKind.PlusEqualsToken]: '+=', + [SyntaxKind.MinusEqualsToken]: '-=', + [SyntaxKind.AsteriskEqualsToken]: '*=', + [SyntaxKind.AsteriskAsteriskEqualsToken]: '**=', + [SyntaxKind.SlashEqualsToken]: '/=', + [SyntaxKind.PercentEqualsToken]: '%=', + [SyntaxKind.LessThanLessThanEqualsToken]: '<<=', + [SyntaxKind.GreaterThanGreaterThanEqualsToken]: '>>=', + [SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken]: '>>>=', + [SyntaxKind.AmpersandEqualsToken]: '&=', + [SyntaxKind.BarEqualsToken]: '|=', + [SyntaxKind.CaretEqualsToken]: '^=', + [SyntaxKind.AtToken]: '@', + [SyntaxKind.InKeyword]: 'in', + [SyntaxKind.UniqueKeyword]: 'unique', + [SyntaxKind.KeyOfKeyword]: 'keyof', + [SyntaxKind.NewKeyword]: 'new', + [SyntaxKind.ImportKeyword]: 'import' +}; /** * Find the first matching child based on the given sourceFile and predicate function. @@ -188,7 +191,7 @@ function isLogicalOperator(operator: ts.Token): boolean { * @param {number} kind the token's SyntaxKind * @returns {string} the token applicable token as a string */ -function getTextForTokenKind(kind: number): string { +function getTextForTokenKind(kind: ts.SyntaxKind): string | undefined { return TOKEN_TO_TEXT[kind]; } @@ -252,11 +255,11 @@ function isJSDocComment(node: ts.Node): boolean { */ function getBinaryExpressionType(operator: ts.Token): string { if (isAssignmentOperator(operator)) { - return 'AssignmentExpression'; + return AST_NODE_TYPES.AssignmentExpression; } else if (isLogicalOperator(operator)) { - return 'LogicalExpression'; + return AST_NODE_TYPES.LogicalExpression; } - return 'BinaryExpression'; + return AST_NODE_TYPES.BinaryExpression; } /** From 91d813f2a019b6622726de51d0c837d3b7500bee Mon Sep 17 00:00:00 2001 From: Armano Date: Wed, 19 Dec 2018 03:24:12 +0100 Subject: [PATCH 27/84] refactor: remove internal typescript method call with hasModifier (#48) --- packages/typescript-estree/src/convert.ts | 9 ++++++--- packages/typescript-estree/src/node-utils.ts | 21 +++++--------------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 7ebf1c4a62d9..747849bdae26 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -952,7 +952,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { key: convertChild(node.name), value: convertChild(node.initializer), computed: nodeUtils.isComputedProperty(node.name), - static: nodeUtils.hasStaticModifierFlag(node), + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined }); @@ -1062,7 +1062,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { key: convertChild(node.name), value: method, computed: nodeUtils.isComputedProperty(node.name), - static: nodeUtils.hasStaticModifierFlag(node), + static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), kind: 'method' }); @@ -1107,7 +1107,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // TypeScript uses this even for static methods named "constructor" case SyntaxKind.Constructor: { - const constructorIsStatic = nodeUtils.hasStaticModifierFlag(node), + const constructorIsStatic = nodeUtils.hasModifier( + SyntaxKind.StaticKeyword, + node + ), constructorIsAbstract = nodeUtils.hasModifier( SyntaxKind.AbstractKeyword, node diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 1249a9217591..fe6ef76093a6 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -145,7 +145,6 @@ export default { isJSXToken, getDeclarationKind, getTSNodeAccessibility, - hasStaticModifierFlag, findNextToken, findFirstMatchingToken, findChildOfKind, @@ -206,11 +205,14 @@ function isESTreeClassMember(node: ts.Node): boolean { /** * Checks if a ts.Node has a modifier - * @param {number} modifierKind TypeScript SyntaxKind modifier + * @param {ts.KeywordSyntaxKind} modifierKind TypeScript SyntaxKind modifier * @param {ts.Node} node TypeScript AST node * @returns {boolean} has the modifier specified */ -function hasModifier(modifierKind: number, node: ts.Node): boolean { +function hasModifier( + modifierKind: ts.KeywordSyntaxKind, + node: ts.Node +): boolean { return ( !!node.modifiers && !!node.modifiers.length && @@ -394,19 +396,6 @@ function getTSNodeAccessibility(node: ts.Node): string | null { return null; } -/** - * Returns true if the given ts.Node has the modifier flag set which corresponds - * to the static keyword. - * @param {ts.Node} node The ts.Node - * @returns {boolean} whether or not the static modifier flag is set - */ -function hasStaticModifierFlag(node: ts.Node): boolean { - /** - * TODO: Remove dependency on private TypeScript method - */ - return Boolean((ts as any).getModifierFlags(node) & ts.ModifierFlags.Static); -} - /** * Finds the next token based on the previous one and its parent * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren From 7511e0446e6812d4c5e6a64681867453f31f2aff Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 21 Dec 2018 20:39:02 +0100 Subject: [PATCH 28/84] chore: add editorconfig (#49) --- packages/typescript-estree/.editorconfig | 10 ++++++++++ packages/typescript-estree/.prettierrc | 3 --- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 packages/typescript-estree/.editorconfig delete mode 100644 packages/typescript-estree/.prettierrc diff --git a/packages/typescript-estree/.editorconfig b/packages/typescript-estree/.editorconfig new file mode 100644 index 000000000000..ed19d9c00fd4 --- /dev/null +++ b/packages/typescript-estree/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +quote_type = single diff --git a/packages/typescript-estree/.prettierrc b/packages/typescript-estree/.prettierrc deleted file mode 100644 index dc2fb828f039..000000000000 --- a/packages/typescript-estree/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "singleQuote": true -} \ No newline at end of file From 4edb5caccc7e5b37da9f7d0cd533909dcdeae4df Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 21 Dec 2018 20:47:32 +0100 Subject: [PATCH 29/84] refactor: improve types in node-utils (#47) --- packages/typescript-estree/src/convert.ts | 4 ++-- packages/typescript-estree/src/node-utils.ts | 6 ++++-- .../src/temp-types-based-on-js-source.ts | 4 ++-- .../tests/ast-alignment/fixtures-to-test.ts | 5 ++++- .../typescript-estree/tests/ast-alignment/spec.ts | 14 ++++++-------- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 747849bdae26..22a4ec6e0af8 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -95,10 +95,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Converts a child into a type annotation. This creates an intermediary * TypeAnnotation node to match what Flow does. - * @param {ts.Node} child The TypeScript AST node to convert. + * @param {ts.TypeNode} child The TypeScript AST node to convert. * @returns {ESTreeNode} The type annotation node. */ - function convertTypeAnnotation(child: ts.Node): ESTreeNode { + function convertTypeAnnotation(child: ts.TypeNode): ESTreeNode { const annotation = convertChild(child); const annotationStartCol = child.getFullStart() - 1; const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index fe6ef76093a6..bc352147e117 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -375,7 +375,9 @@ function getDeclarationKind(node: ts.Node): 'let' | 'const' | 'var' { * @param {ts.Node} node The ts.Node * @returns {string | null} accessibility "public", "protected", "private", or null */ -function getTSNodeAccessibility(node: ts.Node): string | null { +function getTSNodeAccessibility( + node: ts.Node +): 'public' | 'protected' | 'private' | null { const modifiers = node.modifiers; if (!modifiers) { return null; @@ -390,7 +392,7 @@ function getTSNodeAccessibility(node: ts.Node): string | null { case SyntaxKind.PrivateKeyword: return 'private'; default: - continue; + break; } } return null; diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index 9ce5dae0482f..af416e44e4e4 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -7,7 +7,7 @@ export interface ESTreeToken { type: string; value: string; - range: number[]; + range: [number, number]; loc: ESTreeNodeLoc; regex?: { pattern: string; @@ -26,7 +26,7 @@ export interface ESTreeNode { specifiers?: any[]; source?: any; typeAnnotation?: ESTreeNode | null; - typeParameters?: any; + typeParameters?: ESTreeNode | null; id?: ESTreeNode | null; expression?: ESTreeNode | null; decorators?: any; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index cba6f1cf68b9..ce914e11e4e4 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -6,7 +6,10 @@ import { ParserOptions } from '../../src/temp-types-based-on-js-source'; interface Fixture { filename: string; - config?: any; + config?: { + babelParserOptions?: BabelParserOptions; + typeScriptESTreeOptions?: ParserOptions; + }; } interface FixturePatternConfig { diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index 378ed9ef83ac..7ab17c774bb5 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -7,15 +7,16 @@ fixturesToTest.forEach(fixture => { const filename = fixture.filename; const source = fs.readFileSync(filename, 'utf8').replace(/\r\n/g, '\n'); + const config = fixture.config || {}; + config.typeScriptESTreeOptions = config.typeScriptESTreeOptions || {}; + config.babelParserOptions = config.babelParserOptions || {}; + /** * Parse with typescript-estree */ const typeScriptESTreeResult = parse(source, { parser: 'typescript-estree', - typeScriptESTreeOptions: - fixture.config && fixture.config.typeScriptESTreeOptions - ? fixture.config.typeScriptESTreeOptions - : null + typeScriptESTreeOptions: config.typeScriptESTreeOptions }); /** @@ -23,10 +24,7 @@ fixturesToTest.forEach(fixture => { */ const babelParserResult = parse(source, { parser: '@babel/parser', - babelParserOptions: - fixture.config && fixture.config.babelParserOptions - ? fixture.config.babelParserOptions - : null + babelParserOptions: config.babelParserOptions }); /** From cafa43a6c74c903d3f4905fee2a1e98f62bc6440 Mon Sep 17 00:00:00 2001 From: Benjamin Lichtman Date: Thu, 27 Dec 2018 06:08:17 -0800 Subject: [PATCH 30/84] fix: non-existent files and custom file extensions (#53) --- packages/typescript-estree/src/parser.ts | 30 ++++- .../src/temp-types-based-on-js-source.ts | 2 + .../typescript-estree/src/tsconfig-parser.ts | 79 +++++++++++- .../semanticInfo/extra-file-extension.vue | 1 + .../tests/lib/semanticInfo.ts | 117 ++++++++++++------ 5 files changed, 184 insertions(+), 45 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/semanticInfo/extra-file-extension.vue diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 41135b85dce8..64d6c88e7899 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -5,7 +5,10 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ -import calculateProjectParserOptions from './tsconfig-parser'; +import { + calculateProjectParserOptions, + createProgram +} from './tsconfig-parser'; import semver from 'semver'; import ts from 'typescript'; import convert from './ast-converter'; @@ -57,7 +60,8 @@ function resetExtra(): void { projects: [], errorOnUnknownASTType: false, code: '', - tsconfigRootDir: process.cwd() + tsconfigRootDir: process.cwd(), + extraFileExtensions: [] }; } @@ -73,7 +77,7 @@ function getASTFromProject(code: string, options: ParserOptions) { options.filePath || getFileName(options), extra ), - (currentProgram: ts.Program) => { + currentProgram => { const ast = currentProgram.getSourceFile( options.filePath || getFileName(options) ); @@ -82,6 +86,18 @@ function getASTFromProject(code: string, options: ParserOptions) { ); } +/** + * @param {string} code The code of the file being linted + * @param {Object} options The config object + * @returns {{ast: ts.SourceFile, program: ts.Program} | undefined} If found, returns the source file corresponding to the code and the containing program + */ +function getASTAndDefaultProject(code: string, options: ParserOptions) { + const fileName = options.filePath || getFileName(options); + const program = createProgram(code, fileName, extra); + const ast = program && program.getSourceFile(fileName); + return ast && { ast, program }; +} + /** * @param {string} code The code of the file being linted * @returns {{ast: ts.SourceFile, program: ts.Program}} Returns a new source file and program corresponding to the linted code @@ -154,6 +170,7 @@ function getProgramAndAST( ) { return ( (shouldProvideParserServices && getASTFromProject(code, options)) || + (shouldProvideParserServices && getASTAndDefaultProject(code, options)) || createNewProgram(code) ); } @@ -254,6 +271,13 @@ function generateAST( if (typeof options.tsconfigRootDir === 'string') { extra.tsconfigRootDir = options.tsconfigRootDir; } + + if ( + Array.isArray(options.extraFileExtensions) && + options.extraFileExtensions.every(ext => typeof ext === 'string') + ) { + extra.extraFileExtensions = options.extraFileExtensions; + } } if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index af416e44e4e4..c3819efc6f0d 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -70,6 +70,7 @@ export interface Extra { log: Function; projects: string[]; tsconfigRootDir: string; + extraFileExtensions: string[]; } export interface ParserOptions { @@ -84,4 +85,5 @@ export interface ParserOptions { project?: string | string[]; filePath?: string; tsconfigRootDir?: string; + extraFileExtensions?: string[]; } diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts index 63d472f526d5..9995327b48ef 100644 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -8,6 +8,15 @@ import { Extra } from './temp-types-based-on-js-source'; // Environment calculation //------------------------------------------------------------------------------ +/** + * Default compiler options for program generation from single root file + * @type {ts.CompilerOptions} + */ +const defaultCompilerOptions: ts.CompilerOptions = { + allowNonTsExtensions: true, + allowJs: true +}; + /** * Maps tsconfig paths to their corresponding file contents and resulting watches * @type {Map>} @@ -54,7 +63,7 @@ const noopFileWatcher = { close: () => {} }; * @param {string[]} extra.project Provided tsconfig paths * @returns {ts.Program[]} The programs corresponding to the supplied tsconfig paths */ -export default function calculateProjectParserOptions( +export function calculateProjectParserOptions( code: string, filePath: string, extra: Extra @@ -90,7 +99,7 @@ export default function calculateProjectParserOptions( // create compiler host const watchCompilerHost = ts.createWatchCompilerHost( tsconfigPath, - /*optionsToExtend*/ undefined, + /*optionsToExtend*/ { allowNonTsExtensions: true } as ts.CompilerOptions, ts.sys, ts.createSemanticDiagnosticsBuilderProgram, diagnosticReporter, @@ -136,6 +145,32 @@ export default function calculateProjectParserOptions( // ensure fileWatchers aren't created for directories watchCompilerHost.watchDirectory = () => noopFileWatcher; + // allow files with custom extensions to be included in program (uses internal ts api) + const oldOnDirectoryStructureHostCreate = (watchCompilerHost as any) + .onCachedDirectoryStructureHostCreate; + (watchCompilerHost as any).onCachedDirectoryStructureHostCreate = ( + host: any + ) => { + const oldReadDirectory = host.readDirectory; + host.readDirectory = ( + path: string, + extensions?: ReadonlyArray, + exclude?: ReadonlyArray, + include?: ReadonlyArray, + depth?: number + ) => + oldReadDirectory( + path, + !extensions + ? undefined + : extensions.concat(extra.extraFileExtensions), + exclude, + include, + depth + ); + oldOnDirectoryStructureHostCreate(host); + }; + // create program const programWatch = ts.createWatchProgram(watchCompilerHost); const program = programWatch.getProgram().getProgram(); @@ -147,3 +182,43 @@ export default function calculateProjectParserOptions( return results; } + +/** + * Create program from single root file. Requires a single tsconfig to be specified. + * @param code The code being linted + * @param filePath The file being linted + * @param {string} extra.tsconfigRootDir The root directory for relative tsconfig paths + * @param {string[]} extra.project Provided tsconfig paths + * @returns {ts.Program} The program containing just the file being linted and associated library files + */ +export function createProgram(code: string, filePath: string, extra: Extra) { + if (!extra.projects || extra.projects.length !== 1) { + return undefined; + } + + let tsconfigPath = extra.projects[0]; + + // if absolute paths aren't provided, make relative to tsconfigRootDir + if (!path.isAbsolute(tsconfigPath)) { + tsconfigPath = path.join(extra.tsconfigRootDir, tsconfigPath); + } + + const commandLine = ts.getParsedCommandLineOfConfigFile( + tsconfigPath, + defaultCompilerOptions, + { ...ts.sys, onUnRecoverableConfigFileDiagnostic: () => {} } + ); + + if (!commandLine) { + return undefined; + } + + const compilerHost = ts.createCompilerHost(commandLine.options); + const oldReadFile = compilerHost.readFile; + compilerHost.readFile = (fileName: string) => + path.normalize(fileName) === path.normalize(filePath) + ? code + : oldReadFile(fileName); + + return ts.createProgram([filePath], commandLine.options, compilerHost); +} diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/extra-file-extension.vue b/packages/typescript-estree/tests/fixtures/semanticInfo/extra-file-extension.vue new file mode 100644 index 000000000000..ca04667e6218 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/extra-file-extension.vue @@ -0,0 +1 @@ +const x = [3, 4, 5]; \ No newline at end of file diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index d0c1f3742bf5..6abda989da9c 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -77,48 +77,17 @@ describe('semanticInfo', () => { createOptions(fileName) ); - // get type checker - expect(parseResult).toHaveProperty('services.program.getTypeChecker'); - const checker = parseResult.services.program!.getTypeChecker(); - - // get number node (ast shape validated by snapshot) - const arrayMember = (parseResult.ast as any).body[0].declarations[0].init - .elements[0]; - expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); - - // get corresponding TS node - const tsArrayMember = parseResult.services.esTreeNodeToTSNodeMap!.get( - arrayMember - ); - expect(tsArrayMember).toBeDefined(); - expect(tsArrayMember.kind).toBe(ts.SyntaxKind.NumericLiteral); - expect(tsArrayMember.text).toBe('3'); - - // get type of TS node - const arrayMemberType: any = checker.getTypeAtLocation(tsArrayMember); - expect(arrayMemberType.flags).toBe(ts.TypeFlags.NumberLiteral); - expect(arrayMemberType.value).toBe(3); - - // make sure it maps back to original ESTree node - expect(parseResult).toHaveProperty('services.tsNodeToESTreeNodeMap'); - expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsArrayMember)).toBe( - arrayMember - ); - - // get bound name - const boundName = (parseResult.ast as any).body[0].declarations[0].id; - expect(boundName.name).toBe('x'); - - const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap!.get( - boundName - ); - expect(tsBoundName).toBeDefined(); + testIsolatedFile(parseResult); + }); - checkNumberArrayType(checker, tsBoundName); + test('isolated-vue-file tests', () => { + const fileName = path.resolve(FIXTURES_DIR, 'extra-file-extension.vue'); + const parseResult = parseCodeAndGenerateServices(shelljs.cat(fileName), { + ...createOptions(fileName), + extraFileExtensions: ['.vue'] + }); - expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsBoundName)).toBe( - boundName - ); + testIsolatedFile(parseResult); }); test('imported-file tests', () => { @@ -150,6 +119,32 @@ describe('semanticInfo', () => { ).toBe(arrayBoundName); }); + test('non-existent file tests', () => { + const parseResult = parseCodeAndGenerateServices( + `const x = [parseInt("5")];`, + createOptions('') + ); + + // get type checker + expect(parseResult).toHaveProperty('services.program.getTypeChecker'); + const checker = parseResult.services.program!.getTypeChecker(); + + // get bound name + const boundName = (parseResult.ast as any).body[0].declarations[0].id; + expect(boundName.name).toBe('x'); + + const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap!.get( + boundName + ); + expect(tsBoundName).toBeDefined(); + + checkNumberArrayType(checker, tsBoundName); + + expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsBoundName)).toBe( + boundName + ); + }); + test('non-existent project file', () => { const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts'); const badConfig = createOptions(fileName); @@ -178,6 +173,48 @@ describe('semanticInfo', () => { }); }); +function testIsolatedFile(parseResult: any) { + // get type checker + expect(parseResult).toHaveProperty('services.program.getTypeChecker'); + const checker = parseResult.services.program!.getTypeChecker(); + + // get number node (ast shape validated by snapshot) + const arrayMember = (parseResult.ast as any).body[0].declarations[0].init + .elements[0]; + expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); + + // get corresponding TS node + const tsArrayMember = parseResult.services.esTreeNodeToTSNodeMap!.get( + arrayMember + ); + expect(tsArrayMember).toBeDefined(); + expect(tsArrayMember.kind).toBe(ts.SyntaxKind.NumericLiteral); + expect((tsArrayMember as ts.NumericLiteral).text).toBe('3'); + + // get type of TS node + const arrayMemberType: any = checker.getTypeAtLocation(tsArrayMember); + expect(arrayMemberType.flags).toBe(ts.TypeFlags.NumberLiteral); + expect(arrayMemberType.value).toBe(3); + + // make sure it maps back to original ESTree node + expect(parseResult).toHaveProperty('services.tsNodeToESTreeNodeMap'); + expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsArrayMember)).toBe( + arrayMember + ); + + // get bound name + const boundName = (parseResult.ast as any).body[0].declarations[0].id; + expect(boundName.name).toBe('x'); + const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap!.get( + boundName + ); + expect(tsBoundName).toBeDefined(); + checkNumberArrayType(checker, tsBoundName); + expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsBoundName)).toBe( + boundName + ); +} + /** * Verifies that the type of a TS node is number[] as expected * @param {ts.TypeChecker} checker From 60f4f25e454925012d86381bb35ee2365a178d43 Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 28 Dec 2018 18:34:50 +0100 Subject: [PATCH 31/84] fix: many missing nodes and better babel alignment (#65) BREAKING CHANGE: We apologise for the lack of a granular changelog here. There are multiple changes to the AST in this large commit, please see the PR https://github.com/JamesHenry/typescript-estree/pull/65 for full details --- packages/typescript-estree/package.json | 2 +- .../typescript-estree/src/ast-node-types.ts | 27 +- packages/typescript-estree/src/convert.ts | 345 +- packages/typescript-estree/src/node-utils.ts | 66 +- packages/typescript-estree/src/ts-nodes.ts | 2 + .../tests/ast-alignment/fixtures-to-test.ts | 318 +- .../tests/ast-alignment/parse.ts | 6 +- .../tests/ast-alignment/spec.ts | 34 +- .../tests/ast-alignment/utils.ts | 13 +- .../defaults-object-assign.src.js | 1 + .../javascript/directives/block.src.js | 5 + .../directives/directive-in-class.src.js | 19 + .../directives/function-non-strict.src.js | 4 + .../directives/non-directive-string.src.js | 16 + .../directives/program-order.src.js | 3 + .../javascript/directives/program.src.js | 3 + .../fixtures/javascript/directives/raw.src.js | 1 + .../literal-float-negative.src.js | 1 + .../simple-literals/literal-float.src.js | 1 + .../simple-literals/literal-null.src.js | 1 + .../literal-number-negative.src.js | 1 + .../simple-literals/literal-number.src.js | 1 + .../simple-literals/literal-string.src.js | 1 + .../simple-literals/literal-undefined.src.js | 1 + .../basics/class-with-mixin-reference.src.ts | 2 + .../destructuring-assignment-nested.src.ts | 1 + .../destructuring-assignment-object.src.ts | 1 + .../destructuring-assignment-property.src.ts | 3 + .../basics/directive-in-module.src.ts | 5 + .../basics/directive-in-namespace.src.ts | 5 + .../basics/typed-keyword-bigint.src.ts | 1 + .../basics/typed-keyword-boolean.src.ts | 1 + .../basics/typed-keyword-false.src.ts | 1 + .../basics/typed-keyword-never.src.ts | 1 + .../basics/typed-keyword-null.src.ts | 1 + .../basics/typed-keyword-number.src.ts | 1 + .../basics/typed-keyword-object.src.ts | 1 + .../basics/typed-keyword-string.src.ts | 1 + .../basics/typed-keyword-symbol.src.ts | 1 + .../basics/typed-keyword-true.src.ts | 1 + .../basics/typed-keyword-undefined.src.ts | 1 + .../basics/typed-keyword-unknown.src.ts | 1 + .../basics/typed-keyword-void.src.ts | 1 + .../typescript/types/array-type.src.ts | 1 + .../types/conditional-with-null.src.ts | 1 + .../typescript/types/conditional.src.ts | 1 + .../fixtures/typescript/types/indexed.src.ts | 1 + .../typescript/types/intersection-type.src.ts | 1 + .../types/mapped-readonly-minus.src.ts | 1 + .../types/mapped-readonly-plus.src.ts | 1 + .../typescript/types/mapped-readonly.src.ts | 1 + .../fixtures/typescript/types/mapped.src.ts | 1 + .../typescript/types/nested-types.src.ts | 1 + .../types/parenthesized-type.src.ts | 1 + .../types/reference-generic-nested.src.ts | 1 + .../typescript/types/reference-generic.src.ts | 1 + .../typescript/types/reference.src.ts | 1 + .../typescript/types/tuple-empty.src.ts | 1 + .../typescript/types/tuple-optional.src.ts | 1 + .../typescript/types/tuple-rest.src.ts | 1 + .../typescript/types/tuple-type.src.ts | 1 + .../fixtures/typescript/types/tuple.src.ts | 1 + .../typescript/types/type-literal.src.ts | 1 + .../typescript/types/type-operator.src.ts | 2 + .../fixtures/typescript/types/typeof.src.ts | 1 + .../types/union-intersection.src.ts | 4 + .../typescript/types/union-type.src.ts | 1 + .../lib/__snapshots__/javascript.ts.snap | 44148 ++++++---- .../lib/__snapshots__/typescript.ts.snap | 73310 ++++++++++------ packages/typescript-estree/yarn.lock | 820 +- 70 files changed, 71075 insertions(+), 48133 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-assign.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/directives/block.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/directives/directive-in-class.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/directives/function-non-strict.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/directives/non-directive-string.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/directives/program-order.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/directives/program.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/directives/raw.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float-negative.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-null.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number-negative.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-string.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-undefined.src.js create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin-reference.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-nested.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-object.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-property.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-module.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-namespace.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-bigint.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-boolean.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-false.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-never.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-null.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-number.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-object.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-string.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-symbol.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-true.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-undefined.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-unknown.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-void.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/array-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/conditional-with-null.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/conditional.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/indexed.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/intersection-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-minus.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-plus.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/mapped.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/nested-types.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/parenthesized-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/reference-generic-nested.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/reference-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/reference.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/tuple-empty.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/tuple-optional.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/tuple-rest.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/tuple-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/tuple.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/type-literal.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/type-operator.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/typeof.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/union-intersection.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/union-type.src.ts diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 219988558f32..49b519e2065c 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -19,7 +19,7 @@ "license": "BSD-2-Clause", "devDependencies": { "@babel/code-frame": "7.0.0", - "@babel/parser": "7.1.6", + "@babel/parser": "7.2.3", "@commitlint/cli": "^7.1.2", "@commitlint/config-conventional": "^7.1.2", "@commitlint/travis-cli": "^7.1.2", diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index 58f6eea40ae9..59b684f79620 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -86,9 +86,17 @@ export const AST_NODE_TYPES: { [key: string]: string } = { ThisExpression: 'ThisExpression', ThrowStatement: 'ThrowStatement', TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression', /** * TS-prefixed nodes */ + TSAbstractClassDeclaration: 'TSAbstractClassDeclaration', TSAbstractClassProperty: 'TSAbstractClassProperty', TSAbstractKeyword: 'TSAbstractKeyword', TSAbstractMethodDefinition: 'TSAbstractMethodDefinition', @@ -96,6 +104,8 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSArrayType: 'TSArrayType', TSAsyncKeyword: 'TSAsyncKeyword', TSBooleanKeyword: 'TSBooleanKeyword', + TSBigIntKeyword: 'TSBigIntKeyword', + TSConditionalType: 'TSConditionalType', TSConstructorType: 'TSConstructorType', TSConstructSignature: 'TSConstructSignature', TSDeclareKeyword: 'TSDeclareKeyword', @@ -106,6 +116,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSExportKeyword: 'TSExportKeyword', TSImportType: 'TSImportType', TSLiteralType: 'TSLiteralType', + TSIndexedAccessType: 'TSIndexedAccessType', TSIndexSignature: 'TSIndexSignature', TSInterfaceBody: 'TSInterfaceBody', TSInterfaceDeclaration: 'TSInterfaceDeclaration', @@ -119,6 +130,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSNeverKeyword: 'TSNeverKeyword', TSNullKeyword: 'TSNullKeyword', TSNumberKeyword: 'TSNumberKeyword', + TSMappedType: 'TSMappedType', TSObjectKeyword: 'TSObjectKeyword', TSParameterProperty: 'TSParameterProperty', TSPrivateKeyword: 'TSPrivateKeyword', @@ -128,6 +140,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSQualifiedName: 'TSQualifiedName', TSQuestionToken: 'TSQuestionToken', TSReadonlyKeyword: 'TSReadonlyKeyword', + TSRestType: 'TSRestType', TSStaticKeyword: 'TSStaticKeyword', TSStringKeyword: 'TSStringKeyword', TSSymbolKeyword: 'TSSymbolKeyword', @@ -140,15 +153,13 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSTypeParameterInstantiation: 'TSTypeParameterInstantiation', TSTypePredicate: 'TSTypePredicate', TSTypeReference: 'TSTypeReference', + TSTypeQuery: 'TSTypeQuery', + TSIntersectionType: 'TSIntersectionType', + TSTupleType: 'TSTupleType', + TSOptionalType: 'TSOptionalType', + TSParenthesizedType: 'TSParenthesizedType', TSUnionType: 'TSUnionType', TSUndefinedKeyword: 'TSUndefinedKeyword', TSUnknownKeyword: 'TSUnknownKeyword', - TSVoidKeyword: 'TSVoidKeyword', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' + TSVoidKeyword: 'TSVoidKeyword' }; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 22a4ec6e0af8..5ccc6f4e9f5c 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -34,6 +34,7 @@ interface ConvertAdditionalOptions { interface ConvertConfig { node: ts.Node; parent?: ts.Node | null; + inTypeMode?: boolean; ast: ts.SourceFile; additionalOptions: ConvertAdditionalOptions; } @@ -69,14 +70,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { loc: nodeUtils.getLoc(node, ast) }; - /** - * Copies the result object into an ESTree node with just a type property. - * This is used only for leaf nodes that have no other properties. - * @returns {void} - */ - function simplyCopy(): void { - Object.assign(result, { - type: SyntaxKind[node.kind] + function converter(child?: ts.Node, inTypeMode?: boolean): ESTreeNode | null { + if (!child) { + return null; + } + return convert({ + node: child, + parent: node, + inTypeMode, + ast, + additionalOptions }); } @@ -86,10 +89,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * @returns {ESTreeNode|null} the converted ESTree node */ function convertChild(child?: ts.Node): ESTreeNode | null { - if (!child) { - return null; - } - return convert({ node: child, parent: node, ast, additionalOptions }); + return converter(child, config.inTypeMode); + } + + /** + * Converts a TypeScript node into an ESTree node. + * @param {ts.Node} child the child ts.Node + * @returns {ESTreeNode|null} the converted ESTree node + */ + function convertChildType(child?: ts.Node): ESTreeNode | null { + return converter(child, true); } /** @@ -99,7 +108,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * @returns {ESTreeNode} The type annotation node. */ function convertTypeAnnotation(child: ts.TypeNode): ESTreeNode { - const annotation = convertChild(child); + const annotation = convertChildType(child); const annotationStartCol = child.getFullStart() - 1; const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); return { @@ -110,6 +119,34 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }; } + /** + * Coverts body ExpressionStatements to directives + */ + function convertBodyExpressionsToDirectives() { + if (result.body && nodeUtils.canContainDirective(node)) { + const unique: string[] = []; + + // directives has to be unique, if directive is registered twice pick only first one + result.body + .filter( + (child: ESTreeNode) => + child.type === AST_NODE_TYPES.ExpressionStatement && + child.expression && + child.expression.type === AST_NODE_TYPES.Literal && + (child.expression as any).value && + typeof (child.expression as any).value === 'string' + ) + .forEach( + (child: { directive: string; expression: { raw: string } }) => { + if (!unique.includes((child.expression as any).raw)) { + child.directive = child.expression.raw.slice(1, -1); + unique.push(child.expression.raw); + } + } + ); + } + } + /** * Converts a ts.Node's typeArguments ts.NodeArray to a flow-like typeParameters node * @param {ts.NodeArray} typeArguments ts.Node typeArguments @@ -149,32 +186,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.TSTypeParameterInstantiation, range: [start, end], loc: nodeUtils.getLocFor(start, end, ast), - params: typeArguments.map(typeArgument => { - if (nodeUtils.isTypeKeyword(typeArgument.kind)) { - return { - type: AST_NODE_TYPES[`TS${SyntaxKind[typeArgument.kind]}`], - range: [typeArgument.getStart(ast), typeArgument.getEnd()], - loc: nodeUtils.getLoc(typeArgument, ast) - }; - } - if (typeArgument.kind === SyntaxKind.ImportType) { - return convert({ - node: typeArgument, - parent: null, - ast, - additionalOptions - }); - } - return { - type: AST_NODE_TYPES.TSTypeReference, - range: [typeArgument.getStart(ast), typeArgument.getEnd()], - loc: nodeUtils.getLoc(typeArgument, ast), - typeName: convertChild(typeArgument.typeName || typeArgument), - typeParameters: typeArgument.typeArguments - ? convertTypeArgumentsToTypeParameters(typeArgument.typeArguments) - : undefined - }; - }) + params: typeArguments.map(typeArgument => convertChildType(typeArgument)) }; } @@ -203,36 +215,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { greaterThanToken!.end, ast ), - params: typeParameters.map(typeParameter => { - const name = typeParameter.name.text; - - const constraint = typeParameter.constraint - ? convert({ - node: typeParameter.constraint, - parent: typeParameter, - ast, - additionalOptions - }) - : undefined; - - const defaultParameter = typeParameter.default - ? convert({ - node: typeParameter.default, - parent: typeParameter, - ast, - additionalOptions - }) - : typeParameter.default; - - return { - type: AST_NODE_TYPES.TSTypeParameter, - range: [typeParameter.getStart(ast), typeParameter.getEnd()], - loc: nodeUtils.getLoc(typeParameter, ast), - name, - constraint, - default: defaultParameter - }; - }) + params: typeParameters.map(typeParameter => + convertChildType(typeParameter) + ) }; } @@ -488,14 +473,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { function fixTypeAnnotationParentLocation( typeAnnotationParent: ESTreeNode ): void { - const end = (node as any).type.getEnd(); - typeAnnotationParent.range[1] = end; - const loc = nodeUtils.getLocFor( + typeAnnotationParent.range[1] = (node as any).type.getEnd(); + typeAnnotationParent.loc = nodeUtils.getLocFor( typeAnnotationParent.range[0], typeAnnotationParent.range[1], ast ); - typeAnnotationParent.loc = loc; } /** @@ -519,6 +502,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } }); + convertBodyExpressionsToDirectives(); + (result as any).range[1] = node.endOfFileToken.end; result.loc = nodeUtils.getLocFor( node.getStart(ast), @@ -532,6 +517,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.BlockStatement, body: node.statements.map(convertChild) }); + + convertBodyExpressionsToDirectives(); break; case SyntaxKind.Identifier: @@ -799,7 +786,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { let arrayIsInAssignment; if (arrayAssignNode) { - if (node.parent.kind === SyntaxKind.CallExpression) { + if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { + arrayIsInAssignment = false; + } else if (node.parent.kind === SyntaxKind.CallExpression) { arrayIsInAssignment = false; } else if ( nodeUtils.getBinaryExpressionType( @@ -849,7 +838,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { let objectIsInAssignment = false; if (objectAssignNode) { - if ((objectAssignNode as any).left === node) { + if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { + objectIsInAssignment = false; + } else if ((objectAssignNode as any).left === node) { objectIsInAssignment = true; } else if (node.parent.kind === SyntaxKind.CallExpression) { objectIsInAssignment = false; @@ -1576,7 +1567,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const openBrace = nodeUtils.findNextToken(lastClassToken, ast, ast)!; const superClass = heritageClauses.find( - (clause: any) => clause.token === SyntaxKind.ExtendsKeyword + clause => clause.token === SyntaxKind.ExtendsKeyword ); if (superClass) { @@ -1596,7 +1587,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } const implementsClause = heritageClauses.find( - (clause: any) => clause.token === SyntaxKind.ImplementsKeyword + clause => clause.token === SyntaxKind.ImplementsKeyword ); Object.assign(result, { @@ -1650,6 +1641,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.TSModuleBlock, body: node.statements.map(convertChild) }); + + convertBodyExpressionsToDirectives(); break; case SyntaxKind.ImportDeclaration: @@ -1849,16 +1842,18 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // if the binary expression is in a destructured array, switch it if (result.type === AST_NODE_TYPES.AssignmentExpression) { - const upperArrayNode = nodeUtils.findAncestorOfKind( - node, - SyntaxKind.ArrayLiteralExpression - ), - upperArrayAssignNode = - upperArrayNode && - nodeUtils.findAncestorOfKind( - upperArrayNode, - SyntaxKind.BinaryExpression - ); + const upperArrayNode = nodeUtils.findFirstMatchingAncestor( + node, + parent => + parent.kind === SyntaxKind.ArrayLiteralExpression || + parent.kind === SyntaxKind.ObjectLiteralExpression + ); + const upperArrayAssignNode = + upperArrayNode && + nodeUtils.findAncestorOfKind( + upperArrayNode, + SyntaxKind.BinaryExpression + ); let upperArrayIsInAssignment; @@ -2047,7 +2042,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.NullKeyword: { - if (nodeUtils.isWithinTypeAnnotation(node)) { + if (config.inTypeMode) { Object.assign(result, { type: AST_NODE_TYPES.TSNullKeyword }); @@ -2069,7 +2064,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.EmptyStatement: case SyntaxKind.DebuggerStatement: - simplyCopy(); + Object.assign(result, { + type: SyntaxKind[node.kind] + }); break; // JSX @@ -2235,6 +2232,130 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // TypeScript specific + case SyntaxKind.TypeReference: { + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeReference, + typeName: convertChildType(node.typeName), + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : undefined + }); + break; + } + + case SyntaxKind.TypeParameter: { + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeParameter, + name: node.name.text, + constraint: node.constraint + ? convertChildType(node.constraint) + : undefined, + default: node.default ? convertChildType(node.default) : undefined + }); + break; + } + + case SyntaxKind.AnyKeyword: + case SyntaxKind.BigIntKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.UnknownKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.UndefinedKeyword: { + Object.assign(result, { + type: `TS${SyntaxKind[node.kind]}` + }); + break; + } + + case SyntaxKind.NonNullExpression: { + Object.assign(result, { + type: AST_NODE_TYPES.TSNonNullExpression, + expression: convertChild(node.expression) + }); + break; + } + + case SyntaxKind.TypeLiteral: { + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeLiteral, + members: node.members.map(convertChild) + }); + break; + } + + case SyntaxKind.ArrayType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSArrayType, + elementType: convertChildType(node.elementType) + }); + break; + } + + case SyntaxKind.IndexedAccessType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSIndexedAccessType, + objectType: convertChildType(node.objectType), + indexType: convertChildType(node.indexType) + }); + break; + } + + case SyntaxKind.ConditionalType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSConditionalType, + checkType: convertChildType(node.checkType), + extendsType: convertChildType(node.extendsType), + trueType: convertChildType(node.trueType), + falseType: convertChildType(node.falseType) + }); + break; + } + + case SyntaxKind.TypeQuery: { + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeQuery, + exprName: convertChildType(node.exprName) + }); + break; + } + + case SyntaxKind.MappedType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSMappedType, + typeParameter: convertChildType(node.typeParameter) + }); + + if (node.readonlyToken) { + if (node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword) { + (result as any).readonly = true; + } else { + (result as any).readonly = nodeUtils.getTextForTokenKind( + node.readonlyToken.kind + ); + } + } + + if (node.questionToken) { + if (node.questionToken.kind === SyntaxKind.QuestionToken) { + (result as any).optional = true; + } else { + (result as any).optional = nodeUtils.getTextForTokenKind( + node.questionToken.kind + ); + } + } + + if (node.type) { + result.typeAnnotation = convertChildType(node.type); + } + break; + } + case SyntaxKind.ParenthesizedExpression: return convert({ node: node.expression, @@ -2247,7 +2368,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.TSTypeAliasDeclaration, id: convertChild(node.name), - typeAnnotation: convertChild(node.type) + typeAnnotation: convertChildType(node.type) }); if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { @@ -2513,6 +2634,50 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; } + // TypeScript specific types + case SyntaxKind.OptionalType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSOptionalType, + typeAnnotation: convertChildType(node.type) + }); + break; + } + case SyntaxKind.ParenthesizedType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSParenthesizedType, + typeAnnotation: convertChildType(node.type) + }); + break; + } + case SyntaxKind.TupleType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSTupleType, + elementTypes: node.elementTypes.map(convertChildType) + }); + break; + } + case SyntaxKind.UnionType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSUnionType, + types: node.types.map(convertChildType) + }); + break; + } + case SyntaxKind.IntersectionType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSIntersectionType, + types: node.types.map(convertChildType) + }); + break; + } + case SyntaxKind.RestType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSRestType, + typeAnnotation: convertChildType(node.type) + }); + break; + } + default: deeplyCopy(); } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index bc352147e117..4b016cdf4868 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -142,6 +142,7 @@ export default { getLocFor, getLoc, isToken, + canContainDirective, isJSXToken, getDeclarationKind, getTSNodeAccessibility, @@ -159,8 +160,6 @@ export default { convertToken, convertTokens, getNodeContainer, - isWithinTypeAnnotation, - isTypeKeyword, isComment, isJSDocComment, createError, @@ -292,6 +291,34 @@ function getLocFor( }; } +/** + * Check whatever node can contain directive + * @param {ts.Node} node + * @returns {boolean} returns true if node can contain directive + */ +function canContainDirective(node: ts.Node): boolean { + switch (node.kind) { + case ts.SyntaxKind.SourceFile: + case ts.SyntaxKind.ModuleBlock: + return true; + case ts.SyntaxKind.Block: + switch (node.parent.kind) { + case ts.SyntaxKind.Constructor: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.MethodDeclaration: + return true; + default: + return false; + } + default: + return false; + } +} + /** * Returns line and column data for the given ts.Node or ts.Token, * for the given AST @@ -328,28 +355,6 @@ function isJSXToken(node: ts.Node): boolean { ); } -/** - * Returns true if the given ts.Node.kind value corresponds to a type keyword - * @param {number} kind TypeScript SyntaxKind - * @returns {boolean} is a type keyword - */ -function isTypeKeyword(kind: number): boolean { - switch (kind) { - case SyntaxKind.AnyKeyword: - case SyntaxKind.BooleanKeyword: - case SyntaxKind.NeverKeyword: - case SyntaxKind.NumberKeyword: - case SyntaxKind.ObjectKeyword: - case SyntaxKind.StringKeyword: - case SyntaxKind.SymbolKeyword: - case SyntaxKind.UnknownKeyword: - case SyntaxKind.VoidKeyword: - return true; - default: - return false; - } -} - /** * Returns the declaration kind of the given ts.Node * @param {ts.Node} node TypeScript AST node @@ -536,19 +541,6 @@ function isOptional(node: { questionToken?: ts.QuestionToken }): boolean { : false; } -/** - * Returns true if the given ts.Node is within the context of a "typeAnnotation", - * which effectively means - is it coming from its parent's `type` or `types` property - * @param {ts.Node} node ts.Node to be checked - * @returns {boolean} is within "typeAnnotation context" - */ -function isWithinTypeAnnotation(node: any): boolean { - return ( - node.parent.type === node || - (node.parent.types && node.parent.types.indexOf(node) > -1) - ); -} - /** * Fixes the exports of the given ts.Node * @param {ts.Node} node the ts.Node diff --git a/packages/typescript-estree/src/ts-nodes.ts b/packages/typescript-estree/src/ts-nodes.ts index 93d692fae544..69682cb5291b 100644 --- a/packages/typescript-estree/src/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-nodes.ts @@ -50,6 +50,8 @@ export type TSNode = ts.Node & | ts.ParenthesizedTypeNode | ts.TypeOperatorNode | ts.IndexedAccessTypeNode + | ts.FunctionTypeNode + | ts.ConstructorTypeNode | ts.MappedTypeNode | ts.LiteralTypeNode | ts.StringLiteral diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index ce914e11e4e4..53175a95e14d 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -1,31 +1,27 @@ import glob from 'glob'; +import fs from 'fs'; import path from 'path'; + import jsxKnownIssues from '../jsx-known-issues'; -import { ParserOptions as BabelParserOptions } from '@babel/parser'; -import { ParserOptions } from '../../src/temp-types-based-on-js-source'; interface Fixture { filename: string; - config?: { - babelParserOptions?: BabelParserOptions; - typeScriptESTreeOptions?: ParserOptions; - }; + ignoreSourceType: boolean; } interface FixturePatternConfig { pattern: string; - config?: { - babelParserOptions?: BabelParserOptions; - typeScriptESTreeOptions?: ParserOptions; - }; + ignoreSourceType: boolean; } interface CreateFixturePatternConfig { ignore?: string[]; fileType?: string; - parseWithSourceTypeModule?: string[]; + ignoreSourceType?: string[]; } +const fixturesDirPath = path.join(__dirname, '../fixtures'); + /** * JSX fixtures which have known issues for typescript-estree */ @@ -34,9 +30,9 @@ const jsxFilesWithKnownIssues = jsxKnownIssues.map(f => f.replace('jsx/', '')); /** * Current random error difference on jsx/invalid-no-tag-name.src.js * TSEP - SyntaxError - * Babylon - RangeError + * Babel - RangeError * - * Reported here: https://github.com/babel/babylon/issues/674 + * Reported here: https://github.com/babel/babel/issues/6680 */ jsxFilesWithKnownIssues.push('invalid-no-tag-name'); @@ -63,41 +59,41 @@ function createFixturePatternConfigFor( 'fixtureSubPath was not provided for the current fixture pattern' ); } + if (!fs.existsSync(path.join(fixturesDirPath, fixturesSubPath))) { + throw new Error( + `Registered path '${path.join(__dirname, fixturesSubPath)}' was not found` + ); + } + config = config || ({} as CreateFixturePatternConfig); config.ignore = config.ignore || []; config.fileType = config.fileType || 'js'; - config.parseWithSourceTypeModule = config.parseWithSourceTypeModule || []; + config.ignoreSourceType = config.ignoreSourceType || []; /** * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". - * Babylon does not have an equivalent feature (although perhaps it might come in the future https://github.com/babel/babylon/issues/440), - * so we have to specify the "sourceType" we want to use. - * - * By default we have configured babylon to use "script", but for any fixtures specified in the parseWithSourceTypeModule array we need "module". + * Babel has similar feature sourceType='unambiguous' but its not perfect, and in some specific cases we sill have to enforce it. * * First merge the fixtures which need to be parsed with sourceType: "module" into the * ignore list, and then add their full config into the global array. */ - if (config.parseWithSourceTypeModule.length) { + if (config.ignoreSourceType.length) { config.ignore = ([] as string[]).concat( config.ignore, - config.parseWithSourceTypeModule + config.ignoreSourceType ); - for (const fixture of config.parseWithSourceTypeModule) { + for (const fixture of config.ignoreSourceType) { fixturesRequiringSourceTypeModule.push({ // It needs to be the full path from within fixtures/ for the pattern pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, - config: { - babelParserOptions: { - sourceType: 'module' - } - } + ignoreSourceType: true }); } } return { pattern: `${fixturesSubPath}/!(${config.ignore.join('|')}).src.${ config.fileType - }` + }`, + ignoreSourceType: false }; } @@ -105,14 +101,13 @@ function createFixturePatternConfigFor( * An array of FixturePatternConfigs */ let fixturePatternConfigsToTest = [ - createFixturePatternConfigFor('basics'), + createFixturePatternConfigFor('javascript/basics'), createFixturePatternConfigFor('comments', { ignore: [ - 'export-default-anonymous-class', // needs to be parsed with `sourceType: "module"` /** * Template strings seem to also be affected by the difference in opinion between different parsers in: - * https://github.com/babel/babylon/issues/673 + * https://github.com/babel/babel/issues/6681 */ 'no-comment-template', // Purely AST diffs 'template-string-block' // Purely AST diffs @@ -123,10 +118,14 @@ let fixturePatternConfigsToTest = [ ignore: ['**/*'] }), + createFixturePatternConfigFor('javascript/simple-literals'), + + createFixturePatternConfigFor('javascript/directives'), + createFixturePatternConfigFor('javascript/experimentalObjectRestSpread', { ignore: [ /** - * Trailing comma is not permitted after a "RestElement" in Babylon + * Trailing comma is not permitted after a "RestElement" in Babel */ 'invalid-rest-trailing-comma' ] @@ -135,15 +134,14 @@ let fixturePatternConfigsToTest = [ createFixturePatternConfigFor('javascript/arrowFunctions', { ignore: [ /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'error-dup-params', // babylon parse errors - 'error-dup-params', // babylon parse errors - 'error-strict-dup-params', // babylon parse errors - 'error-strict-octal', // babylon parse errors - 'error-two-lines' // babylon parse errors + 'error-dup-params', // babel parse errors + 'error-strict-dup-params', // babel parse errors + 'error-strict-octal', // babel parse errors + 'error-two-lines' // babel parse errors ] }), @@ -156,14 +154,14 @@ let fixturePatternConfigsToTest = [ /** * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. */ - 'class-one-method-super', // babylon parse errors + 'class-one-method-super', // babel parse errors /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'invalid-class-declaration', // babylon parse errors - 'invalid-class-setter-declaration' // babylon parse errors + 'invalid-class-declaration', // babel parse errors + 'invalid-class-setter-declaration' // babel parse errors ] }), @@ -172,11 +170,11 @@ let fixturePatternConfigsToTest = [ createFixturePatternConfigFor('javascript/destructuring', { ignore: [ /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'invalid-defaults-object-assign' // babylon parse errors + 'invalid-defaults-object-assign' // babel parse errors ] }), @@ -188,24 +186,25 @@ let fixturePatternConfigsToTest = [ createFixturePatternConfigFor('javascript/destructuring-and-spread', { ignore: [ /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'error-complex-destructured-spread-first' // babylon parse errors + 'error-complex-destructured-spread-first' // babel parse errors ] }), createFixturePatternConfigFor('javascript/experimentalAsyncIteration'), createFixturePatternConfigFor('javascript/experimentalDynamicImport'), createFixturePatternConfigFor('javascript/exponentiationOperators'), + createFixturePatternConfigFor('javascript/experimentalOptionalCatchBinding'), createFixturePatternConfigFor('javascript/forOf', { ignore: [ /** - * TypeScript, espree and acorn parse this fine - esprima, flow and babylon do not... + * TypeScript, espree and acorn parse this fine - esprima, flow and babel do not... */ - 'for-of-with-function-initializer' // babylon parse errors + 'for-of-with-function-initializer' // babel parse errors ] }), @@ -215,97 +214,41 @@ let fixturePatternConfigsToTest = [ createFixturePatternConfigFor('javascript/modules', { ignore: [ /** - * TypeScript, flow and babylon parse this fine - esprima, espree and acorn do not... - */ - 'invalid-export-default', // typescript-estree parse errors - /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'invalid-export-named-default', // babylon parse errors - 'invalid-import-default-module-specifier', // babylon parse errors - 'invalid-import-module-specifier', // babylon parse errors - /** - * Deleting local variable in strict mode - */ - 'error-delete', // babylon parse errors - /** - * 'with' in strict mode - */ - 'error-strict' // babylon parse errors + 'invalid-export-named-default', // babel parse errors + 'invalid-import-default-module-specifier', // babel parse errors + 'invalid-import-module-specifier' // babel parse errors ], - parseWithSourceTypeModule: [ - 'export-default-array', - 'export-default-class', - 'export-default-expression', - 'export-default-function', - 'export-default-named-class', - 'export-default-named-function', - 'export-default-number', - 'export-default-object', - 'export-default-value', - 'export-from-batch', - 'export-from-default', - 'export-from-named-as-default', - 'export-from-named-as-specifier', - 'export-from-named-as-specifiers', - 'export-from-specifier', - 'export-from-specifiers', - 'export-function', - 'export-named-as-default', - 'export-named-as-specifier', - 'export-named-as-specifiers', - 'export-named-class', - 'export-named-empty', - 'export-named-specifier', - 'export-named-specifiers-comma', - 'export-named-specifiers', - 'export-var-anonymous-function', - 'export-var-number', - 'export-var', - 'import-default-and-named-specifiers', - 'import-default-and-namespace-specifiers', - 'import-default-as', - 'import-default', - 'import-jquery', - 'import-module', - 'import-named-as-specifier', - 'import-named-as-specifiers', - 'import-named-empty', - 'import-named-specifier', - 'import-named-specifiers-comma', - 'import-named-specifiers', - 'import-namespace-specifier', - 'import-null-as-nil', - 'invalid-await', - 'invalid-class' - ] + ignoreSourceType: ['error-function', 'error-strict', 'error-delete'] }), createFixturePatternConfigFor('javascript/newTarget', { ignore: [ /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'invalid-new-target', // babylon parse errors - 'invalid-unknown-property' // babylon parse errors + 'invalid-new-target', // babel parse errors + 'invalid-unknown-property' // babel parse errors ] }), + createFixturePatternConfigFor('javascript/objectLiteral'), createFixturePatternConfigFor('javascript/objectLiteralComputedProperties'), createFixturePatternConfigFor('javascript/objectLiteralDuplicateProperties', { ignore: [ /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'error-proto-property', // babylon parse errors - 'error-proto-string-property' // babylon parse errors + 'error-proto-property', // babel parse errors + 'error-proto-string-property' // babel parse errors ] }), @@ -319,18 +262,23 @@ let fixturePatternConfigsToTest = [ createFixturePatternConfigFor('javascript/restParams', { ignore: [ /** - * Expected babylon parse errors - all of these files below produce parse errors in espree + * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'error-no-default', // babylon parse errors - 'error-not-last' // babylon parse errors + 'error-no-default', // babel parse errors + 'error-not-last' // babel parse errors ] }), createFixturePatternConfigFor('javascript/spread'), createFixturePatternConfigFor('javascript/unicodeCodePointEscapes'), - createFixturePatternConfigFor('jsx', { ignore: jsxFilesWithKnownIssues }), + + /* ================================================== */ + + createFixturePatternConfigFor('jsx', { + ignore: jsxFilesWithKnownIssues + }), createFixturePatternConfigFor('jsx-useJSXTextNode'), /* ================================================== */ @@ -340,17 +288,7 @@ let fixturePatternConfigsToTest = [ */ createFixturePatternConfigFor('tsx', { - fileType: 'tsx', - ignore: [ - /** - * AST difference - */ - 'react-typed-props', - /** - * currently babylon not supported - */ - 'generic-jsx-element' - ] + fileType: 'tsx' }), /* ================================================== */ @@ -367,31 +305,31 @@ let fixturePatternConfigsToTest = [ fileType: 'ts', ignore: [ /** - * Other babylon parse errors relating to invalid syntax. + * Other babel parse errors relating to invalid syntax. */ - 'abstract-class-with-abstract-constructor', // babylon parse errors - 'class-with-export-parameter-properties', // babylon parse errors - 'class-with-optional-methods', // babylon parse errors - 'class-with-static-parameter-properties', // babylon parse errors - 'interface-with-all-property-types', // babylon parse errors - 'interface-with-construct-signature-with-parameter-accessibility', // babylon parse errors - 'class-with-implements-and-extends', // babylon parse errors + 'abstract-class-with-abstract-constructor', // babel parse errors + 'class-with-export-parameter-properties', // babel parse errors + 'class-with-implements-and-extends', // babel parse errors + 'class-with-optional-methods', // babel parse errors + 'class-with-static-parameter-properties', // babel parse errors + 'interface-with-all-property-types', // babel parse errors + 'interface-with-construct-signature-with-parameter-accessibility', // babel parse errors /** - * typescript-estree erroring, but babylon not. + * typescript-estree erroring, but babel not. */ 'arrow-function-with-type-parameters', // typescript-estree parse errors /** - * Babylon: ClassDeclaration + abstract: true + * Babel: ClassDeclaration + abstract: true * tsep: TSAbstractClassDeclaration */ 'abstract-class-with-abstract-properties', /** - * Babylon: ClassProperty + abstract: true + * Babel: ClassProperty + abstract: true * tsep: TSAbstractClassProperty */ 'abstract-class-with-abstract-readonly-property', /** - * Babylon: TSExpressionWithTypeArguments + * Babel: TSExpressionWithTypeArguments * tsep: ClassImplements */ 'class-with-implements-generic-multiple', @@ -414,41 +352,56 @@ let fixturePatternConfigsToTest = [ 'typed-this', 'export-type-function-declaration', 'abstract-interface', - 'keyof-operator', - /** - * tsep bug - Program.body[0].expression.left.properties[0].value.right is currently showing up - * as `ArrayPattern`, babylon, acorn and espree say it should be `ArrayExpression` - * TODO: Fix this - */ - 'destructuring-assignment', /** - * Babylon bug for optional or abstract methods? + * Babel bug for optional or abstract methods? */ - 'abstract-class-with-abstract-method', // babylon parse errors - 'abstract-class-with-optional-method', // babylon parse errors - 'declare-class-with-optional-method', // babylon parse errors + 'abstract-class-with-abstract-method', // babel parse errors + 'abstract-class-with-optional-method', // babel parse errors + 'declare-class-with-optional-method', // babel parse errors /** - * Awaiting feedback on Babylon issue https://github.com/babel/babylon/issues/700 + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/6679 */ 'class-with-private-parameter-properties', 'class-with-protected-parameter-properties', 'class-with-public-parameter-properties', 'class-with-readonly-parameter-properties', /** - * Not yet supported in Babylon https://github.com/babel/babel/issues/7749 + * Not yet supported in Babel https://github.com/babel/babel/issues/7749 */ 'import-type', - 'import-type-with-type-parameters-in-type-reference' + 'import-type-with-type-parameters-in-type-reference', + /** + * babel is not supporting it yet https://github.com/babel/babel/pull/9230 + * Babel: TSTypeReference -> Identifier + * tsep: TSBigIntKeyword + */ + 'typed-keyword-bigint', + /** + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/9228 + * Babel: BooleanLiteral + * tsep: Literal + */ + 'typed-keyword-true', + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + * Babel: BooleanLiteral + * tsep: Literal + */ + 'typed-keyword-false', + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + * Directive field is not added to module and namespace + */ + 'directive-in-module', + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + * Directive field is not added to module and namespace + */ + 'directive-in-namespace' ], - parseWithSourceTypeModule: [ - 'export-named-enum', - 'export-assignment', - 'export-type-alias-declaration', - 'export-type-class-declaration', - 'export-default-class-with-generic', - 'export-default-class-with-multiple-generics', - 'export-named-class-with-generic', - 'export-named-class-with-multiple-generics' + ignoreSourceType: [ + // https://github.com/babel/babel/issues/9213 + 'export-assignment' ] }), @@ -486,30 +439,34 @@ let fixturePatternConfigsToTest = [ */ 'interface-empty-extends', /** - * TypeScript-specific tests taken from "errorRecovery". Babylon is not being as forgiving as the TypeScript compiler here. + * TypeScript-specific tests taken from "errorRecovery". Babel is not being as forgiving as the TypeScript compiler here. */ - 'class-empty-extends-implements', // babylon parse errors - 'class-empty-extends', // babylon parse errors - 'decorator-on-enum-declaration', // babylon parse errors - 'decorator-on-interface-declaration', // babylon parse errors - 'interface-property-modifiers', // babylon parse errors - 'enum-with-keywords' // babylon parse errors + 'class-empty-extends-implements', // babel parse errors + 'class-empty-extends', // babel parse errors + 'decorator-on-enum-declaration', // babel parse errors + 'decorator-on-interface-declaration', // babel parse errors + 'interface-property-modifiers', // babel parse errors + 'enum-with-keywords' // babel parse errors ] }), + createFixturePatternConfigFor('typescript/types', { + fileType: 'ts' + }), + createFixturePatternConfigFor('typescript/declare', { fileType: 'ts', ignore: [ /** * AST difference - * tsep: TSAbstractClassDeclaration - * babel: ClassDeclaration[abstract=true] + * tsep: heritage = [] + * babel: heritage = undefined */ 'interface', /** * AST difference - * tsep: heritage = [] - * babel: heritage = undefined + * tsep: TSAbstractClassDeclaration + * babel: ClassDeclaration[abstract=true] */ 'abstract-class' ] @@ -523,10 +480,14 @@ let fixturePatternConfigsToTest = [ */ 'nested-internal-module', /** - * Babylon: TSDeclareFunction + * Babel: TSDeclareFunction * tsep: TSNamespaceFunctionDeclaration */ 'declare-namespace-with-exported-function' + ], + ignoreSourceType: [ + 'module-with-default-exports', + 'ambient-module-declaration-with-import' ] }) ]; @@ -540,7 +501,6 @@ fixturePatternConfigsToTest = ([] as FixturePatternConfig[]).concat( ); const fixturesToTest: Fixture[] = []; -const fixturesDirPath = path.join(__dirname, '../fixtures'); /** * Resolve the glob patterns into actual Fixture files that we can run assertions for... @@ -556,7 +516,7 @@ fixturePatternConfigsToTest.forEach(fixturePatternConfig => { matchingFixtures.forEach(filename => { fixturesToTest.push({ filename, - config: fixturePatternConfig.config + ignoreSourceType: fixturePatternConfig.ignoreSourceType }); }); }); diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 85e53bdf6165..c5df1231339c 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -19,12 +19,12 @@ function parseWithBabelParser( parserOptions?: BabelParserOptions ) { parserOptions = parserOptions || {}; - const babylon = require('@babel/parser'); - return babylon.parse( + const babel = require('@babel/parser'); + return babel.parse( text, Object.assign( { - sourceType: 'script', + sourceType: 'unambiguous', allowImportExportEverywhere: true, allowReturnOutsideFunction: true, ranges: true, diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index 7ab17c774bb5..31814b96ac26 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -7,35 +7,29 @@ fixturesToTest.forEach(fixture => { const filename = fixture.filename; const source = fs.readFileSync(filename, 'utf8').replace(/\r\n/g, '\n'); - const config = fixture.config || {}; - config.typeScriptESTreeOptions = config.typeScriptESTreeOptions || {}; - config.babelParserOptions = config.babelParserOptions || {}; - /** * Parse with typescript-estree */ const typeScriptESTreeResult = parse(source, { - parser: 'typescript-estree', - typeScriptESTreeOptions: config.typeScriptESTreeOptions + parser: 'typescript-estree' }); /** - * Parse the source with babylon typescript-plugin + * Parse the source with @babel/parser typescript-plugin */ const babelParserResult = parse(source, { - parser: '@babel/parser', - babelParserOptions: config.babelParserOptions + parser: '@babel/parser' }); /** - * If babylon fails to parse the source, ensure that typescript-estree has the same fundamental issue + * If babel fails to parse the source, ensure that typescript-estree has the same fundamental issue */ if (babelParserResult.parseError) { /** - * FAIL: babylon errored but typescript-estree did not + * FAIL: babel errored but typescript-estree did not */ if (!typeScriptESTreeResult.parseError) { - it(`TEST FAIL [BABYLON ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { + it(`TEST FAIL [BABEL ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { expect(typeScriptESTreeResult.parseError).toEqual( babelParserResult.parseError ); @@ -54,10 +48,10 @@ fixturesToTest.forEach(fixture => { } /** - * FAIL: typescript-estree errored but babylon did not + * FAIL: typescript-estree errored but babel did not */ if (typeScriptESTreeResult.parseError) { - it(`TEST FAIL [TSEP ERRORED, BUT BABYLON DID NOT] - ${filename}`, () => { + it(`TEST FAIL [TSEP ERRORED, BUT BABEL DID NOT] - ${filename}`, () => { expect(babelParserResult.parseError).toEqual( typeScriptESTreeResult.parseError ); @@ -72,14 +66,18 @@ fixturesToTest.forEach(fixture => { expect(babelParserResult.ast).toBeTruthy(); expect(typeScriptESTreeResult.ast).toBeTruthy(); /** - * Perform some extra formatting steps on the babylon AST before comparing + * Perform some extra formatting steps on the babel AST before comparing */ expect( - parseUtils.removeLocationDataFromProgramNode( - parseUtils.preprocessBabylonAST(babelParserResult.ast) + parseUtils.removeLocationDataAndSourceTypeFromProgramNode( + parseUtils.preprocessBabylonAST(babelParserResult.ast), + fixture.ignoreSourceType ) ).toEqual( - parseUtils.removeLocationDataFromProgramNode(typeScriptESTreeResult.ast) + parseUtils.removeLocationDataAndSourceTypeFromProgramNode( + typeScriptESTreeResult.ast, + fixture.ignoreSourceType + ) ); }); }); diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 95fb1f906303..8dbf44128a4f 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -107,10 +107,6 @@ export function preprocessBabylonAST(ast: any): any { key: 'directives', predicate: always }, - { - key: 'directive', - predicate: always - }, { key: 'innerComments', predicate: always @@ -142,10 +138,17 @@ export function preprocessBabylonAST(ast: any): any { * See: https://github.com/babel/babylon/issues/673 * * @param {Object} ast the raw AST with a Program node at its top level + * @param {boolean} ignoreSourceType fix for issues with unambiguous type detection * @returns {Object} the ast with the location data removed from the Program node */ -export function removeLocationDataFromProgramNode(ast: any) { +export function removeLocationDataAndSourceTypeFromProgramNode( + ast: any, + ignoreSourceType: boolean +) { delete ast.loc; delete ast.range; + if (ignoreSourceType) { + delete ast.sourceType; + } return ast; } diff --git a/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-assign.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-assign.src.js new file mode 100644 index 000000000000..4f84af4a91ca --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/destructuring/defaults-object-assign.src.js @@ -0,0 +1 @@ +({ Object=0, String=0 } = {}) diff --git a/packages/typescript-estree/tests/fixtures/javascript/directives/block.src.js b/packages/typescript-estree/tests/fixtures/javascript/directives/block.src.js new file mode 100644 index 000000000000..8d54ee0f82b1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/directives/block.src.js @@ -0,0 +1,5 @@ +function foo() { + "use strict"; + var a = 1; + "use strict"; +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/directives/directive-in-class.src.js b/packages/typescript-estree/tests/fixtures/javascript/directives/directive-in-class.src.js new file mode 100644 index 000000000000..2d2f36d0aac3 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/directives/directive-in-class.src.js @@ -0,0 +1,19 @@ +"use strict"; + +class Foo { + constructor () { + "use strict"; + } + + get foo () { + "use strict"; + } + + set foo (value) { + "use strict"; + } + + method () { + "use strict"; + } +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/directives/function-non-strict.src.js b/packages/typescript-estree/tests/fixtures/javascript/directives/function-non-strict.src.js new file mode 100644 index 000000000000..783e003dd374 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/directives/function-non-strict.src.js @@ -0,0 +1,4 @@ +function foo () { + "use smth" + 1+1; +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/directives/non-directive-string.src.js b/packages/typescript-estree/tests/fixtures/javascript/directives/non-directive-string.src.js new file mode 100644 index 000000000000..51697ce0628b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/directives/non-directive-string.src.js @@ -0,0 +1,16 @@ +if (true) { + "use strict" +} + +switch (true) { + case false: { + "use strict" + } + default: { + "use strict" + } +} + +while (true) { + "use strict" +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/directives/program-order.src.js b/packages/typescript-estree/tests/fixtures/javascript/directives/program-order.src.js new file mode 100644 index 000000000000..43e689ef2a2c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/directives/program-order.src.js @@ -0,0 +1,3 @@ +"use strict"; +"use loose"; +var a; diff --git a/packages/typescript-estree/tests/fixtures/javascript/directives/program.src.js b/packages/typescript-estree/tests/fixtures/javascript/directives/program.src.js new file mode 100644 index 000000000000..6603b9c5c2c7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/directives/program.src.js @@ -0,0 +1,3 @@ +"use strict"; +var a = 1; +"use strict"; diff --git a/packages/typescript-estree/tests/fixtures/javascript/directives/raw.src.js b/packages/typescript-estree/tests/fixtures/javascript/directives/raw.src.js new file mode 100644 index 000000000000..10ecb3d5fa1d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/directives/raw.src.js @@ -0,0 +1 @@ +"use\x20strict"; diff --git a/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float-negative.src.js b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float-negative.src.js new file mode 100644 index 000000000000..32ebbd04dc40 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float-negative.src.js @@ -0,0 +1 @@ +const a = -1.5; diff --git a/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float.src.js b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float.src.js new file mode 100644 index 000000000000..0c12a9ee5f05 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-float.src.js @@ -0,0 +1 @@ +const a = 1.5; diff --git a/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-null.src.js b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-null.src.js new file mode 100644 index 000000000000..d6c4ab0750fa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-null.src.js @@ -0,0 +1 @@ +const a = null; diff --git a/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number-negative.src.js b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number-negative.src.js new file mode 100644 index 000000000000..143a6b39de5d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number-negative.src.js @@ -0,0 +1 @@ +const a = -1; diff --git a/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number.src.js b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number.src.js new file mode 100644 index 000000000000..54b82a09ad54 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-number.src.js @@ -0,0 +1 @@ +const a = 1; diff --git a/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-string.src.js b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-string.src.js new file mode 100644 index 000000000000..25b43319fe43 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-string.src.js @@ -0,0 +1 @@ +const a = 'a'; diff --git a/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-undefined.src.js b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-undefined.src.js new file mode 100644 index 000000000000..0257085abea6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/simple-literals/literal-undefined.src.js @@ -0,0 +1 @@ +const a = undefined; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin-reference.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin-reference.src.ts new file mode 100644 index 000000000000..9ba1bfd50b79 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-mixin-reference.src.ts @@ -0,0 +1,2 @@ +function M>(Base: T) { +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-nested.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-nested.src.ts new file mode 100644 index 000000000000..0c7c1bf3b430 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-nested.src.ts @@ -0,0 +1 @@ +({ foo: { bar: { baz: [a, { foo: [x] = [3] } = { foo: [2]}] = [] } = {} } = { } } = { foo: { bar: { baz: [2, { foo: [3] }] } }}); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-object.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-object.src.ts new file mode 100644 index 000000000000..29aaf2c65ec4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-object.src.ts @@ -0,0 +1 @@ +({ foo = {} } = bar); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-property.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-property.src.ts new file mode 100644 index 000000000000..2958638434f9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/destructuring-assignment-property.src.ts @@ -0,0 +1,3 @@ +function Foo({ foo = [] } = bar) { + +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-module.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-module.src.ts new file mode 100644 index 000000000000..2cb68abd0251 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-module.src.ts @@ -0,0 +1,5 @@ +module foo { + "use strict"; + var a = 1; + "use strict"; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-namespace.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-namespace.src.ts new file mode 100644 index 000000000000..80bc6c570cce --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/directive-in-namespace.src.ts @@ -0,0 +1,5 @@ +namespace foo { + "use strict"; + var a = 1; + "use strict"; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-bigint.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-bigint.src.ts new file mode 100644 index 000000000000..c02b862420db --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-bigint.src.ts @@ -0,0 +1 @@ +type Foo = bigint diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-boolean.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-boolean.src.ts new file mode 100644 index 000000000000..3d441e390935 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-boolean.src.ts @@ -0,0 +1 @@ +type Foo = boolean diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-false.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-false.src.ts new file mode 100644 index 000000000000..b9c63609f683 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-false.src.ts @@ -0,0 +1 @@ +type Foo = false diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-never.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-never.src.ts new file mode 100644 index 000000000000..1f2b3902148b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-never.src.ts @@ -0,0 +1 @@ +type Foo = never diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-null.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-null.src.ts new file mode 100644 index 000000000000..da97119b68bf --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-null.src.ts @@ -0,0 +1 @@ +type Foo = null diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-number.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-number.src.ts new file mode 100644 index 000000000000..9133270f2d83 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-number.src.ts @@ -0,0 +1 @@ +type Foo = number diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-object.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-object.src.ts new file mode 100644 index 000000000000..0a689a9cb5fd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-object.src.ts @@ -0,0 +1 @@ +type Foo = object diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-string.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-string.src.ts new file mode 100644 index 000000000000..d508231294cb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-string.src.ts @@ -0,0 +1 @@ +type Foo = string diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-symbol.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-symbol.src.ts new file mode 100644 index 000000000000..a5d3de140886 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-symbol.src.ts @@ -0,0 +1 @@ +type Foo = symbol diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-true.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-true.src.ts new file mode 100644 index 000000000000..690616093931 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-true.src.ts @@ -0,0 +1 @@ +type Foo = true diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-undefined.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-undefined.src.ts new file mode 100644 index 000000000000..588094c2dbb2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-undefined.src.ts @@ -0,0 +1 @@ +type Foo = undefined diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-unknown.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-unknown.src.ts new file mode 100644 index 000000000000..cbdeb162bef9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-unknown.src.ts @@ -0,0 +1 @@ +type Foo = unknown diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-void.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-void.src.ts new file mode 100644 index 000000000000..d62ee2c26edd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-keyword-void.src.ts @@ -0,0 +1 @@ +type Foo = void diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/array-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/array-type.src.ts new file mode 100644 index 000000000000..5d038fc71d95 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/array-type.src.ts @@ -0,0 +1 @@ +type Foo = string[] diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/conditional-with-null.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-with-null.src.ts new file mode 100644 index 000000000000..c77648689818 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-with-null.src.ts @@ -0,0 +1 @@ +let x: number extends string ? boolean : null; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/conditional.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/conditional.src.ts new file mode 100644 index 000000000000..da72fcb60124 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/conditional.src.ts @@ -0,0 +1 @@ +let x: number extends string ? boolean : string; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/indexed.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/indexed.src.ts new file mode 100644 index 000000000000..4a5809fdd554 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/indexed.src.ts @@ -0,0 +1 @@ +let x: T[K]; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/intersection-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/intersection-type.src.ts new file mode 100644 index 000000000000..93da9407e8c7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/intersection-type.src.ts @@ -0,0 +1 @@ +type LinkedList = T & { next: LinkedList }; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-minus.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-minus.src.ts new file mode 100644 index 000000000000..a7a1183dc9d5 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-minus.src.ts @@ -0,0 +1 @@ +let map: { -readonly [P in string]-?: number }; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-plus.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-plus.src.ts new file mode 100644 index 000000000000..854fb5dbb2a2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly-plus.src.ts @@ -0,0 +1 @@ +let map: { +readonly [P in string]+?: number; }; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly.src.ts new file mode 100644 index 000000000000..ef13a053bf27 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/mapped-readonly.src.ts @@ -0,0 +1 @@ +let map: { readonly [P in string]?: number; }; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/mapped.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/mapped.src.ts new file mode 100644 index 000000000000..aca2ba15b93c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/mapped.src.ts @@ -0,0 +1 @@ +let map: { [P in string]: number; }; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/nested-types.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/nested-types.src.ts new file mode 100644 index 000000000000..adaf9a3cf309 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/nested-types.src.ts @@ -0,0 +1 @@ +type Foo = [number, string?, boolean?] | [{}, [number?] | null & boolean[]] & {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/parenthesized-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/parenthesized-type.src.ts new file mode 100644 index 000000000000..5a03e27ee676 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/parenthesized-type.src.ts @@ -0,0 +1 @@ +type Foo = (string | number) diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/reference-generic-nested.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/reference-generic-nested.src.ts new file mode 100644 index 000000000000..e38dfca9d5dc --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/reference-generic-nested.src.ts @@ -0,0 +1 @@ +let x: Array>; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/reference-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/reference-generic.src.ts new file mode 100644 index 000000000000..4925bd4778cc --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/reference-generic.src.ts @@ -0,0 +1 @@ +let x: Array; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/reference.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/reference.src.ts new file mode 100644 index 000000000000..330fb1d2245d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/reference.src.ts @@ -0,0 +1 @@ +let x: T; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/tuple-empty.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-empty.src.ts new file mode 100644 index 000000000000..f7cd7b5a0e25 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-empty.src.ts @@ -0,0 +1 @@ +let x: []; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/tuple-optional.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-optional.src.ts new file mode 100644 index 000000000000..3b8d21ba958c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-optional.src.ts @@ -0,0 +1 @@ +let x: [string, number?, (string | number)?] diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/tuple-rest.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-rest.src.ts new file mode 100644 index 000000000000..d7719b2cb4e6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-rest.src.ts @@ -0,0 +1 @@ +let x: [string, ...number[]] diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/tuple-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-type.src.ts new file mode 100644 index 000000000000..75a6d8e39f36 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/tuple-type.src.ts @@ -0,0 +1 @@ +type Foo = [string, string?] diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/tuple.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/tuple.src.ts new file mode 100644 index 000000000000..53c8e72ec952 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/tuple.src.ts @@ -0,0 +1 @@ +let x: [number, number, number]; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/type-literal.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/type-literal.src.ts new file mode 100644 index 000000000000..4193f364788f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/type-literal.src.ts @@ -0,0 +1 @@ +let obj: { x: number }; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/type-operator.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/type-operator.src.ts new file mode 100644 index 000000000000..1d23f962ef05 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/type-operator.src.ts @@ -0,0 +1,2 @@ +let x: keyof T; +let y: unique symbol; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/typeof.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/typeof.src.ts new file mode 100644 index 000000000000..eebcd19b13a9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/typeof.src.ts @@ -0,0 +1 @@ +let x: typeof y.z; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/union-intersection.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/union-intersection.src.ts new file mode 100644 index 000000000000..93f391fdc414 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/union-intersection.src.ts @@ -0,0 +1,4 @@ +let union: number | null | undefined; +let intersection: number & string; +let precedence1: number | string & boolean; +let precedence2: number & string | boolean; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/union-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/union-type.src.ts new file mode 100644 index 000000000000..a2cfaf9af408 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/union-type.src.ts @@ -0,0 +1 @@ +type Foo = string & number diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index eaad453fa744..2e5e8458034d 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -2921,6 +2921,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-default-param-eval.src Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -3275,6 +3276,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-dup-params.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -3616,6 +3618,7 @@ Object { "body": Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -3947,6 +3950,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-eval-return.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -4211,6 +4215,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-octal.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -4493,6 +4498,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-param-arguments.src 1`] Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -4829,6 +4835,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-param-eval.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -5165,6 +5172,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-param-names.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -5501,6 +5509,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-param-no-paren-argument Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -5747,6 +5756,7 @@ exports[`javascript fixtures/arrowFunctions/error-strict-param-no-paren-eval.src Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -38903,163 +38913,254 @@ Object { } `; -exports[`javascript fixtures/destructuring/defaults-object-longform.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-assign.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "Object", + "range": Array [ + 3, + 9, + ], + "type": "Identifier", }, - "start": Object { - "column": 4, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, - "name": "x", + "name": "Object", "range": Array [ - 6, - 7, + 3, + 9, ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, - "method": false, "range": Array [ - 6, - 15, + 3, + 11, ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, }, + }, + "name": "String", + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { "loc": Object { "end": Object { - "column": 15, + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 13, "line": 1, }, }, + "name": "String", "range": Array [ - 9, - 15, + 13, + 19, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, }, - "range": Array [ - 13, - 15, - ], - "raw": "10", - "type": "Literal", - "value": 10, }, - "type": "AssignmentPattern", + "range": Array [ + 20, + 21, + ], + "raw": "0", + "type": "Literal", + "value": 0, }, - }, - ], - "range": Array [ - 4, - 17, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, + "type": "AssignmentPattern", }, }, - "name": "x", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", + ], + "range": Array [ + 1, + 23, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, }, + }, + "operator": "=", + "range": Array [ + 1, + 28, + ], + "right": Object { "loc": Object { "end": Object { - "column": 21, + "column": 28, "line": 1, }, "start": Object { - "column": 4, + "column": 26, "line": 1, }, }, + "properties": Array [], "range": Array [ - 4, - 21, + 26, + 28, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { - "column": 22, + "column": 29, "line": 1, }, "start": Object { @@ -39069,15 +39170,15 @@ Object { }, "range": Array [ 0, - 22, + 29, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -39086,14 +39187,14 @@ Object { }, "range": Array [ 0, - 22, + 30, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -39103,25 +39204,25 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, "line": 1, }, "start": Object { - "column": 4, + "column": 1, "line": 1, }, }, "range": Array [ - 4, - 5, + 1, + 2, ], "type": "Punctuator", "value": "{", @@ -39129,56 +39230,56 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, "range": Array [ - 6, - 7, + 3, + 9, ], "type": "Identifier", - "value": "x", + "value": "Object", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 8, + 9, + 10, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { @@ -39196,12 +39297,12 @@ Object { 12, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 19, "line": 1, }, "start": Object { @@ -39211,25 +39312,61 @@ Object { }, "range": Array [ 13, - 15, + 19, + ], + "type": "Identifier", + "value": "String", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, ], "type": "Numeric", - "value": "10", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { - "column": 16, + "column": 22, "line": 1, }, }, "range": Array [ - 16, - 17, + 22, + 23, ], "type": "Punctuator", "value": "}", @@ -39237,17 +39374,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 25, "line": 1, }, "start": Object { - "column": 18, + "column": 24, "line": 1, }, }, "range": Array [ - 18, - 19, + 24, + 25, ], "type": "Punctuator", "value": "=", @@ -39255,45 +39392,63 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 27, "line": 1, }, "start": Object { - "column": 20, + "column": 26, "line": 1, }, }, "range": Array [ - 20, - 21, + 26, + 27, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 28, "line": 1, }, "start": Object { - "column": 21, + "column": 27, "line": 1, }, }, "range": Array [ - 21, - 22, + 27, + 28, ], "type": "Punctuator", - "value": ";", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-object-longform-all.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object-longform.src 1`] = ` Object { "body": Array [ Object { @@ -39302,7 +39457,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 37, + "column": 17, "line": 1, }, "start": Object { @@ -39316,36 +39471,36 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "name": "x", "range": Array [ - 5, 6, + 7, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "method": false, "range": Array [ - 5, - 14, + 6, + 15, ], "shorthand": false, "type": "Property", @@ -39353,49 +39508,49 @@ Object { "left": Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "name": "x", "range": Array [ - 8, 9, + 10, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, - 14, + 9, + 15, ], "right": Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, - 14, + 13, + 15, ], "raw": "10", "type": "Literal", @@ -39404,34 +39559,424 @@ Object { "type": "AssignmentPattern", }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 16, + ], + "range": Array [ + 4, + 17, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-longform-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 14, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 16, "line": 1, }, }, @@ -64435,348 +64980,159 @@ Object { } `; -exports[`javascript fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` -Object { - "body": Array [ - Object { - "async": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 0, - 26, - ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 27, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Identifier", - "value": "async", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 14, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "*", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` +exports[`javascript fixtures/directives/block.src 1`] = ` Object { "body": Array [ Object { - "async": true, + "async": false, "body": Object { "body": Array [ Object { - "await": true, - "body": Object { - "body": Array [], + "directive": "use strict", + "expression": Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 14, + "line": 2, }, "start": Object { - "column": 36, + "column": 2, "line": 2, }, }, "range": Array [ - 59, - 67, + 19, + 31, ], - "type": "BlockStatement", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "left": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 19, + 32, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, }, - "name": "item", - "range": Array [ - 44, - 48, - ], - "type": "Identifier", }, - "init": null, + "name": "a", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "init": Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 21, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ + 43, 44, - 48, ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 25, - "line": 2, + "raw": "1", + "type": "Literal", + "value": 1, }, - "start": Object { - "column": 15, - "line": 2, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, }, + "range": Array [ + 39, + 44, + ], + "type": "VariableDeclarator", }, - "range": Array [ - 38, - 48, - ], - "type": "VariableDeclaration", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 12, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 27, - 67, + 35, + 45, ], - "right": Object { + "type": "VariableDeclaration", + }, + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 14, + "line": 4, }, "start": Object { - "column": 29, - "line": 2, + "column": 2, + "line": 4, }, }, - "name": "items", "range": Array [ - 52, - 57, + 48, + 60, ], - "type": "Identifier", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "type": "ForOfStatement", + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 48, + 61, + ], + "type": "ExpressionStatement", }, ], "loc": Object { @@ -64785,13 +65141,13 @@ Object { "line": 5, }, "start": Object { - "column": 21, + "column": 15, "line": 1, }, }, "range": Array [ - 21, - 69, + 15, + 63, ], "type": "BlockStatement", }, @@ -64800,18 +65156,18 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "name": "foo", "range": Array [ - 15, - 18, + 9, + 12, ], "type": "Identifier", }, @@ -64828,7 +65184,7 @@ Object { "params": Array [], "range": Array [ 0, - 69, + 63, ], "type": "FunctionDeclaration", }, @@ -64845,14 +65201,14 @@ Object { }, "range": Array [ 0, - 70, + 64, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -64862,25 +65218,7 @@ Object { }, "range": Array [ 0, - 5, - ], - "type": "Identifier", - "value": "async", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 14, + 8, ], "type": "Keyword", "value": "function", @@ -64888,17 +65226,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 18, + 9, + 12, ], "type": "Identifier", "value": "foo", @@ -64906,17 +65244,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 13, "line": 1, }, "start": Object { - "column": 18, + "column": 12, "line": 1, }, }, "range": Array [ - 18, - 19, + 12, + 13, ], "type": "Punctuator", "value": "(", @@ -64924,17 +65262,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 14, "line": 1, }, "start": Object { - "column": 19, + "column": 13, "line": 1, }, }, "range": Array [ - 19, - 20, + 13, + 14, ], "type": "Punctuator", "value": ")", @@ -64942,17 +65280,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 21, + "column": 15, "line": 1, }, }, "range": Array [ - 21, - 22, + 15, + 16, ], "type": "Punctuator", "value": "{", @@ -64960,38 +65298,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 27, - 30, - ], - "type": "Keyword", - "value": "for", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, + "column": 14, "line": 2, }, "start": Object { - "column": 8, + "column": 2, "line": 2, }, }, "range": Array [ + 19, 31, - 36, ], - "type": "Identifier", - "value": "await", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { @@ -65005,137 +65325,137 @@ Object { }, }, "range": Array [ - 37, - 38, + 31, + 32, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 5, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ + 35, 38, - 43, ], "type": "Keyword", - "value": "const", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 21, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ - 44, - 48, + 39, + 40, ], "type": "Identifier", - "value": "item", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 26, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 49, - 51, + 41, + 42, ], - "type": "Identifier", - "value": "of", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 29, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 52, - 57, + 43, + 44, ], - "type": "Identifier", - "value": "items", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 34, - "line": 2, + "column": 11, + "line": 3, }, }, "range": Array [ - 57, - 58, + 44, + 45, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 14, + "line": 4, }, "start": Object { - "column": 36, - "line": 2, + "column": 2, + "line": 4, }, }, "range": Array [ - 59, + 48, 60, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 15, "line": 4, }, "start": Object { - "column": 4, + "column": 14, "line": 4, }, }, "range": Array [ - 66, - 67, + 60, + 61, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { @@ -65149,8 +65469,8 @@ Object { }, }, "range": Array [ - 68, - 69, + 62, + 63, ], "type": "Punctuator", "value": "}", @@ -65160,207 +65480,601 @@ Object { } `; -exports[`javascript fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` +exports[`javascript fixtures/directives/directive-in-class.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { - "arguments": Array [ + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "constructor", + "range": Array [ + 31, + 42, + ], + "type": "Identifier", + }, + "kind": "constructor", "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 5, + "line": 6, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 4, }, }, - "name": "main", "range": Array [ - 19, - 23, + 31, + 75, ], - "type": "Identifier", + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 56, + 68, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 56, + 69, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 46, + 75, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 43, + 75, + ], + "type": "FunctionExpression", + }, }, - ], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "name": "foo", + "range": Array [ + 85, + 88, + ], + "type": "Identifier", }, - "start": Object { - "column": 0, - "line": 1, + "kind": "get", + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 8, + }, }, - }, - "object": Object { - "arguments": Array [ - Object { + "range": Array [ + 81, + 121, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 102, + 114, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 102, + 115, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 5, + "line": 10, }, "start": Object { - "column": 7, - "line": 1, + "column": 15, + "line": 8, }, }, "range": Array [ - 7, - 12, + 92, + 121, ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", + "type": "BlockStatement", }, - ], - "callee": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 10, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 8, }, }, + "params": Array [], "range": Array [ - 0, - 6, + 89, + 121, ], - "type": "Import", + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "name": "foo", + "range": Array [ + 131, + 134, + ], + "type": "Identifier", }, + "kind": "set", "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 5, + "line": 14, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 12, }, }, "range": Array [ - 0, - 13, + 127, + 172, ], - "type": "CallExpression", + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 153, + 165, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 153, + 166, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 20, + "line": 12, + }, + }, + "range": Array [ + 143, + 172, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 12, + "line": 12, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 12, + }, + "start": Object { + "column": 13, + "line": 12, + }, + }, + "name": "value", + "range": Array [ + 136, + 141, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 135, + 172, + ], + "type": "FunctionExpression", + }, }, - "property": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 16, + }, + "start": Object { + "column": 4, + "line": 16, + }, + }, + "name": "method", + "range": Array [ + 178, + 184, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 5, + "line": 18, }, "start": Object { - "column": 14, - "line": 1, + "column": 4, + "line": 16, }, }, - "name": "then", "range": Array [ - 14, - 18, + 178, + 217, ], - "type": "Identifier", - }, - "range": Array [ - 0, - 18, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 24, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 25, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 17, + }, + "start": Object { + "column": 8, + "line": 17, + }, + }, + "range": Array [ + 198, + 210, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 17, + }, + "start": Object { + "column": 8, + "line": 17, + }, + }, + "range": Array [ + 198, + 211, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 18, + }, + "start": Object { + "column": 14, + "line": 16, + }, + }, + "range": Array [ + 188, + 217, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 18, + }, + "start": Object { + "column": 11, + "line": 16, + }, + }, + "params": Array [], + "range": Array [ + 185, + 217, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 19, + }, + "start": Object { + "column": 10, + "line": 3, + }, }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 25, + 219, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, }, + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "import", - }, - Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 1, + "line": 19, }, "start": Object { - "column": 6, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 6, - 7, + 15, + 219, ], - "type": "Punctuator", - "value": "(", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 20, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 220, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { @@ -65368,16 +66082,16 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 0, "line": 1, }, }, "range": Array [ - 7, + 0, 12, ], "type": "String", - "value": "'foo'", + "value": "\\"use strict\\"", }, Object { "loc": Object { @@ -65395,822 +66109,382 @@ Object { 13, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 13, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 13, - 14, + 15, + 20, ], - "type": "Punctuator", - "value": ".", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 14, - 18, + 21, + 24, ], "type": "Identifier", - "value": "then", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 18, - 19, + 25, + 26, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 19, - 23, + 31, + 42, ], "type": "Identifier", - "value": "main", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 23, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 23, - 24, + 43, + 44, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 24, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 24, - 25, + 44, + 45, ], "type": "Punctuator", - "value": ";", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 24, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 20, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 19, + "line": 4, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 12, - 13, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 19, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 11, - 20, - ], - "type": "ObjectPattern", - }, - ], "range": Array [ - 0, - 24, + 46, + 47, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "{", }, - }, - "range": Array [ - 0, - 25, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 20, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 0, - 8, + 56, + 68, ], - "type": "Keyword", - "value": "function", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 21, + "line": 5, }, "start": Object { - "column": 9, - "line": 1, + "column": 20, + "line": 5, }, }, "range": Array [ - 9, - 10, + 68, + 69, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 5, + "line": 6, }, "start": Object { - "column": 10, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 10, - 11, + 74, + 75, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 7, + "line": 8, }, "start": Object { - "column": 11, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 11, - 12, + 81, + 84, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 11, + "line": 8, }, "start": Object { - "column": 12, - "line": 1, + "column": 8, + "line": 8, }, }, "range": Array [ - 12, - 13, + 85, + 88, ], "type": "Identifier", - "value": "a", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 13, + "line": 8, }, "start": Object { - "column": 13, - "line": 1, + "column": 12, + "line": 8, }, }, "range": Array [ - 13, - 14, + 89, + 90, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 8, }, }, "range": Array [ - 15, - 18, + 90, + 91, ], "type": "Punctuator", - "value": "...", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 16, + "line": 8, }, "start": Object { - "column": 18, - "line": 1, + "column": 15, + "line": 8, }, }, "range": Array [ - 18, - 19, + 92, + 93, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 20, - "line": 1, + "line": 9, }, "start": Object { - "column": 19, - "line": 1, + "column": 8, + "line": 9, }, }, "range": Array [ - 19, - 20, + 102, + 114, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { "column": 21, - "line": 1, + "line": 9, }, "start": Object { "column": 20, - "line": 1, + "line": 9, }, }, "range": Array [ - 20, - 21, + 114, + 115, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 5, + "line": 10, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 10, }, }, "range": Array [ - 22, - 23, + 120, + 121, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 7, + "line": 12, }, "start": Object { - "column": 23, - "line": 1, + "column": 4, + "line": 12, }, }, "range": Array [ - 23, - 24, + 127, + 130, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "set", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 3, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 9, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 1, - 10, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 1, - 22, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 14, - 15, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 21, - ], - "type": "SpreadElement", - }, - ], - "range": Array [ - 13, - 22, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentExpression", - }, "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 11, + "line": 12, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 12, }, }, "range": Array [ - 0, - 23, + 131, + 134, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "foo", }, - }, - "range": Array [ - 0, - 24, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 13, + "line": 12, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 12, }, }, "range": Array [ - 0, - 1, + 135, + 136, ], "type": "Punctuator", "value": "(", @@ -66218,107 +66492,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 18, + "line": 12, }, "start": Object { - "column": 1, - "line": 1, + "column": 13, + "line": 12, }, }, "range": Array [ - 1, - 2, + 136, + 141, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 19, + "line": 12, }, "start": Object { - "column": 2, - "line": 1, + "column": 18, + "line": 12, }, }, "range": Array [ - 2, - 3, + 141, + 142, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 21, + "line": 12, }, "start": Object { - "column": 3, - "line": 1, + "column": 20, + "line": 12, }, }, "range": Array [ - 3, - 4, + 143, + 144, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 20, + "line": 13, }, "start": Object { - "column": 5, - "line": 1, + "column": 8, + "line": 13, }, }, "range": Array [ - 5, - 8, + 153, + 165, ], - "type": "Punctuator", - "value": "...", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 21, + "line": 13, }, "start": Object { - "column": 8, - "line": 1, + "column": 20, + "line": 13, }, }, "range": Array [ - 8, - 9, + 165, + 166, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 5, + "line": 14, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 14, }, }, "range": Array [ - 9, - 10, + 171, + 172, ], "type": "Punctuator", "value": "}", @@ -66326,125 +66600,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 10, + "line": 16, }, "start": Object { - "column": 11, - "line": 1, + "column": 4, + "line": 16, }, }, "range": Array [ - 11, - 12, + 178, + 184, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "method", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 12, + "line": 16, }, "start": Object { - "column": 13, - "line": 1, + "column": 11, + "line": 16, }, }, "range": Array [ - 13, - 14, + 185, + 186, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 16, }, "start": Object { - "column": 14, - "line": 1, + "column": 12, + "line": 16, }, }, "range": Array [ - 14, - 15, + 186, + 187, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 15, + "line": 16, }, "start": Object { - "column": 15, - "line": 1, + "column": 14, + "line": 16, }, }, "range": Array [ - 15, - 16, + 188, + 189, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 20, - "line": 1, + "line": 17, }, "start": Object { - "column": 17, - "line": 1, + "column": 8, + "line": 17, }, }, "range": Array [ - 17, - 20, + 198, + 210, ], - "type": "Punctuator", - "value": "...", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { "column": 21, - "line": 1, + "line": 17, }, "start": Object { "column": 20, - "line": 1, + "line": 17, }, }, "range": Array [ - 20, - 21, + 210, + 211, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 5, + "line": 18, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 18, }, }, "range": Array [ - 21, - 22, + 216, + 217, ], "type": "Punctuator", "value": "}", @@ -66452,46 +66726,157 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 1, + "line": 19, }, "start": Object { - "column": 22, - "line": 1, + "column": 0, + "line": 19, }, }, "range": Array [ - 22, - 23, + 218, + 219, ], "type": "Punctuator", - "value": ")", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` +exports[`javascript fixtures/directives/function-non-strict.src 1`] = ` Object { "body": Array [ Object { "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, + "body": Array [ + Object { + "directive": "use smth", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 30, + ], + "raw": "\\"use smth\\"", + "type": "Literal", + "value": "use smth", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 30, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 33, + 36, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, "range": Array [ - 23, - 26, + 16, + 39, ], "type": "BlockStatement", }, @@ -66517,73 +66902,18 @@ Object { }, "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "properties": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 20, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 13, - 21, - ], - "type": "ObjectPattern", - }, - ], + "params": Array [], "range": Array [ 0, - 26, + 39, ], "type": "FunctionDeclaration", }, @@ -66591,7 +66921,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -66600,7 +66930,7 @@ Object { }, "range": Array [ 0, - 27, + 40, ], "sourceType": "script", "tokens": Array [ @@ -66643,17 +66973,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], "type": "Punctuator", "value": "(", @@ -66661,20 +66991,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 15, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { @@ -66683,103 +67013,121 @@ Object { "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, + 16, 17, ], "type": "Punctuator", - "value": "...", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 17, 20, + 30, ], - "type": "Identifier", - "value": "bar", + "type": "String", + "value": "\\"use smth\\"", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 20, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 20, - 21, + 33, + 34, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 3, + "line": 3, }, }, "range": Array [ - 21, - 22, + 34, + 35, ], "type": "Punctuator", - "value": ")", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 23, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 23, - 24, + 35, + 36, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 25, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 25, - 26, + 38, + 39, ], "type": "Punctuator", "value": "}", @@ -66789,239 +67137,403 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; - -exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` +exports[`javascript fixtures/directives/non-directive-string.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "alternate": null, + "consequent": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 28, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "range": Array [ + 16, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 30, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "IfStatement", + }, + Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 74, + 86, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 20, + "line": 7, }, "start": Object { - "column": 6, - "line": 1, + "column": 8, + "line": 7, }, }, - "name": "x", "range": Array [ - 6, - 7, + 74, + 86, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 8, }, - "method": false, - "range": Array [ - 6, - 7, - ], - "shorthand": true, - "type": "Property", - "value": Object { + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 64, + 92, + ], + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 52, + 92, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 57, + 62, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "type": "SwitchCase", + }, + Object { + "consequent": Array [ + Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 116, + 128, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 20, + "line": 10, }, "start": Object { - "column": 6, - "line": 1, + "column": 8, + "line": 10, }, }, - "name": "x", "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, + 116, + 128, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 11, }, - "method": false, - "range": Array [ - 9, - 10, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "start": Object { + "column": 13, + "line": 9, }, }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", + "range": Array [ + 106, + 134, + ], + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 97, + 134, + ], + "test": null, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 40, + 44, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 136, + ], + "type": "SwitchStatement", + }, + Object { + "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 15, }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "start": Object { + "column": 4, + "line": 15, }, - "range": Array [ - 12, - 16, - ], - "type": "RestElement", }, - ], - "range": Array [ - 4, - 19, - ], - "type": "ObjectPattern", - }, - "init": Object { + "range": Array [ + 157, + 169, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 15, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 15, }, }, - "name": "foo", "range": Array [ - 22, - 25, + 157, + 169, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 16, + }, + "start": Object { + "column": 13, + "line": 14, }, - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 151, + 171, + ], + "type": "BlockStatement", + }, "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 1, + "line": 16, }, "start": Object { "column": 0, - "line": 1, + "line": 14, }, }, "range": Array [ - 0, - 26, + 138, + 171, ], - "type": "VariableDeclaration", + "test": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 14, + }, + "start": Object { + "column": 7, + "line": 14, + }, + }, + "range": Array [ + 145, + 149, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "WhileStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 17, }, "start": Object { "column": 0, @@ -67030,14 +67542,14 @@ Object { }, "range": Array [ 0, - 27, + 172, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 2, "line": 1, }, "start": Object { @@ -67047,233 +67559,5093 @@ Object { }, "range": Array [ 0, - 3, + 2, ], "type": "Keyword", - "value": "var", + "value": "if", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { - "column": 4, + "column": 3, "line": 1, }, }, "range": Array [ + 3, 4, - 5, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 8, ], - "type": "Identifier", - "value": "x", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, 8, + 9, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 10, - 11, + 16, + 28, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 6, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Keyword", + "value": "switch", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, }, "start": Object { + "column": 7, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { "column": 12, - "line": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, }, }, "range": Array [ - 12, - 15, + 40, + 44, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 44, + 45, ], "type": "Punctuator", - "value": "...", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 52, + 56, + ], + "type": "Keyword", + "value": "case", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, }, "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 57, + 62, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { "column": 15, - "line": 1, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, }, }, "range": Array [ - 15, - 16, + 62, + 63, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 1, + "line": 6, }, "start": Object { "column": 16, - "line": 1, + "line": 6, }, }, "range": Array [ - 16, - 17, + 64, + 65, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 20, + "line": 7, }, "start": Object { - "column": 18, - "line": 1, + "column": 8, + "line": 7, }, }, "range": Array [ - 18, - 19, + 74, + 86, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 8, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 20, - 21, + 91, + 92, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 11, + "line": 9, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 9, }, }, "range": Array [ - 22, - 25, + 97, + 104, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 12, + "line": 9, }, "start": Object { - "column": 25, - "line": 1, + "column": 11, + "line": 9, }, }, "range": Array [ - 25, - 26, + 104, + 105, ], "type": "Punctuator", - "value": ";", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 9, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 116, + 128, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 133, + 134, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 12, + }, + }, + "range": Array [ + 135, + 136, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 14, + }, + }, + "range": Array [ + 138, + 143, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 14, + }, + "start": Object { + "column": 6, + "line": 14, + }, + }, + "range": Array [ + 144, + 145, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 14, + }, + "start": Object { + "column": 7, + "line": 14, + }, + }, + "range": Array [ + 145, + 149, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 14, + }, + "start": Object { + "column": 11, + "line": 14, + }, + }, + "range": Array [ + 149, + 150, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 14, + }, + "start": Object { + "column": 13, + "line": 14, + }, + }, + "range": Array [ + 151, + 152, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 15, + }, + "start": Object { + "column": 4, + "line": 15, + }, + }, + "range": Array [ + 157, + 169, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 16, + }, + "start": Object { + "column": 0, + "line": 16, + }, + }, + "range": Array [ + 170, + 171, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/directives/program.src 1`] = ` +Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 23, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 24, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 37, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 37, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/directives/program-order.src 1`] = ` +Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "directive": "use loose", + "expression": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "raw": "\\"use loose\\"", + "type": "Literal", + "value": "use loose", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 26, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "String", + "value": "\\"use loose\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/directives/raw.src 1`] = ` +Object { + "body": Array [ + Object { + "directive": "use\\\\x20strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "raw": "\\"use\\\\x20strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "String", + "value": "\\"use\\\\x20strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 26, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` +Object { + "body": Array [ + Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "await": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 59, + 67, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "item", + "range": Array [ + 44, + 48, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 38, + 48, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 27, + 67, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "name": "items", + "range": Array [ + 52, + 57, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 69, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 0, + 69, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 70, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 31, + 36, + ], + "type": "Identifier", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 38, + 43, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "Identifier", + "value": "item", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 49, + 51, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 52, + 57, + ], + "type": "Identifier", + "value": "items", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "main", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Import", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "CallExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "then", + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 18, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "'foo'", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + "value": "then", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + "value": "main", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 11, + 20, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 24, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 3, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 1, + 10, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 22, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 15, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 13, + 22, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 13, + 21, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 26, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; + +exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 9, + 10, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 16, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 4, + 19, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 9, + 10, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 16, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 4, + 18, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 23, + 27, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 29, + 33, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 35, + 39, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 41, + 45, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + }, + ], + "range": Array [ + 21, + 47, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` Object { "body": Array [ Object { @@ -67282,7 +72654,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 18, + "column": 7, "line": 1, }, "start": Object { @@ -67290,172 +72662,150 @@ Object { "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 6, - 7, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 9, - 10, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, + "start": Object { + "column": 4, + "line": 2, }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 16, - ], - "type": "RestElement", + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, }, + }, + "name": "set", + "range": Array [ + 22, + 25, ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", "range": Array [ - 4, - 18, + 32, + 33, ], - "type": "ObjectPattern", + "type": "Identifier", }, "init": Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, "start": Object { - "column": 21, - "line": 1, + "column": 8, + "line": 5, }, }, "properties": Array [ @@ -67464,115 +72814,56 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 23, - 27, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, + "column": 7, + "line": 6, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 6, }, }, - "name": "y", + "name": "foo", "range": Array [ - 29, - 30, + 42, + 45, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 6, }, }, "method": false, "range": Array [ - 29, - 33, + 42, + 50, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 32, - "line": 1, + "column": 9, + "line": 6, }, }, + "name": "foo", "range": Array [ - 32, - 33, + 47, + 50, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "Identifier", }, }, Object { @@ -67580,137 +72871,149 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 7, + "line": 7, }, "start": Object { - "column": 35, - "line": 1, + "column": 4, + "line": 7, }, }, - "name": "a", + "name": "get", "range": Array [ - 35, - 36, + 56, + 59, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 35, - "line": 1, + "column": 4, + "line": 7, }, }, "method": false, "range": Array [ - 35, - 39, + 56, + 64, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 38, - "line": 1, + "column": 9, + "line": 7, }, }, + "name": "get", "range": Array [ - 38, - 39, + 61, + 64, ], - "raw": "3", - "type": "Literal", - "value": 3, + "type": "Identifier", }, }, Object { - "computed": false, - "key": Object { + "argument": Object { + "computed": false, "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 41, - "line": 1, + "column": 7, + "line": 8, }, }, - "name": "b", + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "name": "foo", + "range": Array [ + 77, + 80, + ], + "type": "Identifier", + }, "range": Array [ - 41, - 42, + 73, + 80, ], - "type": "Identifier", + "type": "MemberExpression", }, - "kind": "init", "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 41, - "line": 1, + "column": 4, + "line": 8, }, }, - "method": false, "range": Array [ - 41, - 45, + 70, + 80, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 44, - "line": 1, - }, - }, - "range": Array [ - 44, - 45, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, + "type": "SpreadElement", }, ], "range": Array [ - 21, - 47, + 36, + 82, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "range": Array [ - 4, - 47, + 32, + 82, ], "type": "VariableDeclarator", }, @@ -67718,17 +73021,17 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 2, + "line": 9, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 48, + 28, + 83, ], "type": "VariableDeclaration", }, @@ -67736,7 +73039,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 10, }, "start": Object { "column": 0, @@ -67745,7 +73048,7 @@ Object { }, "range": Array [ 0, - 49, + 84, ], "sourceType": "script", "tokens": Array [ @@ -67770,7 +73073,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -67780,28 +73083,10 @@ Object { }, "range": Array [ 4, - 5, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, 7, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { @@ -67824,35 +73109,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 10, + 13, + 16, ], "type": "Identifier", - "value": "y", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 10, - 11, + 16, + 17, ], "type": "Punctuator", "value": ",", @@ -67860,377 +73145,341 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 15, - ], - "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 15, - 16, + 22, + 25, ], "type": "Identifier", - "value": "z", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 8, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 3, }, }, "range": Array [ - 17, - 18, + 25, + 26, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 19, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 19, - 20, + 28, + 31, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 5, + "line": 5, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 5, }, }, "range": Array [ - 21, - 22, + 32, + 33, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 23, - "line": 1, + "column": 6, + "line": 5, }, }, "range": Array [ - 23, - 24, + 34, + 35, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 24, - 25, + 36, + 37, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 7, + "line": 6, }, "start": Object { - "column": 26, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 26, - 27, + 42, + 45, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 8, + "line": 6, }, "start": Object { - "column": 27, - "line": 1, + "column": 7, + "line": 6, }, }, "range": Array [ - 27, - 28, + 45, + 46, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 29, - "line": 1, + "column": 9, + "line": 6, }, }, "range": Array [ - 29, - 30, + 47, + 50, ], "type": "Identifier", - "value": "y", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 13, + "line": 6, }, "start": Object { - "column": 30, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 30, - 31, + 50, + 51, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 7, + "line": 7, }, "start": Object { - "column": 32, - "line": 1, + "column": 4, + "line": 7, }, }, "range": Array [ - 32, - 33, + 56, + 59, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 8, + "line": 7, }, "start": Object { - "column": 33, - "line": 1, + "column": 7, + "line": 7, }, }, "range": Array [ - 33, - 34, + 59, + 60, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 35, - "line": 1, + "column": 9, + "line": 7, }, }, "range": Array [ - 35, - 36, + 61, + 64, ], "type": "Identifier", - "value": "a", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 13, + "line": 7, }, "start": Object { - "column": 36, - "line": 1, + "column": 12, + "line": 7, }, }, "range": Array [ - 36, - 37, + 64, + 65, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Numeric", - "value": "3", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 7, + "line": 8, }, "start": Object { - "column": 39, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 39, - 40, + 70, + 73, ], "type": "Punctuator", - "value": ",", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 10, + "line": 8, }, "start": Object { - "column": 41, - "line": 1, + "column": 7, + "line": 8, }, }, "range": Array [ - 41, - 42, + 73, + 76, ], "type": "Identifier", - "value": "b", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 11, + "line": 8, }, "start": Object { - "column": 42, - "line": 1, + "column": 10, + "line": 8, }, }, "range": Array [ - 42, - 43, + 76, + 77, ], "type": "Punctuator", - "value": ":", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 44, - "line": 1, + "column": 11, + "line": 8, }, }, "range": Array [ - 44, - 45, + 77, + 80, ], - "type": "Numeric", - "value": "4", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, "start": Object { - "column": 46, - "line": 1, + "column": 0, + "line": 9, }, }, "range": Array [ - 46, - 47, + 81, + 82, ], "type": "Punctuator", "value": "}", @@ -68238,17 +73487,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 2, + "line": 9, }, "start": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, }, "range": Array [ - 47, - 48, + 82, + 83, ], "type": "Punctuator", "value": ";", @@ -68258,401 +73507,298 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", + "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "start": Object { + "column": 1, + "line": 1, }, - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "name": "initialize", + "range": Array [ + 7, + 17, + ], + "type": "Identifier", }, - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "kind": "init", "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 4, }, "start": Object { "column": 4, - "line": 5, + "line": 2, }, }, - "name": "x", + "method": true, "range": Array [ - 32, - 33, + 7, + 104, ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "init", + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 5, + "line": 4, }, "start": Object { - "column": 4, - "line": 6, + "column": 48, + "line": 2, }, }, - "method": false, "range": Array [ - 42, - 50, + 51, + 104, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, + "type": "BlockStatement", }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 56, - 59, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, }, - "method": false, - "range": Array [ - 56, - 64, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", + "start": Object { + "column": 14, + "line": 2, }, }, - Object { - "argument": Object { - "computed": false, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 46, + "line": 2, }, "start": Object { - "column": 7, - "line": 8, + "column": 15, + "line": 2, }, }, - "object": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 8, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", }, - "start": Object { - "column": 7, - "line": 8, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 19, + 26, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", }, }, - "name": "set", - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 28, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 28, + 36, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 28, + 36, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "name": "options", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", }, - "start": Object { - "column": 11, - "line": 8, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, }, + "range": Array [ + 38, + 48, + ], + "type": "RestElement", }, - "name": "foo", - "range": Array [ - 77, - 80, - ], - "type": "Identifier", - }, + ], "range": Array [ - 73, - 80, + 18, + 49, ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, + "type": "ObjectPattern", }, - "range": Array [ - 70, - 80, - ], - "type": "SpreadElement", - }, - ], - "range": Array [ - 36, - 82, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 5, + ], + "range": Array [ + 17, + 104, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 32, - 82, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 106, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 83, + 0, + 108, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 6, }, "start": Object { "column": 0, @@ -68661,14 +73807,14 @@ Object { }, "range": Array [ 0, - 84, + 109, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -68678,51 +73824,33 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, + 1, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 2, "line": 1, }, "start": Object { - "column": 7, + "column": 1, "line": 1, }, }, "range": Array [ - 7, - 8, + 1, + 2, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 14, "line": 2, }, "start": Object { @@ -68731,386 +73859,278 @@ Object { }, }, "range": Array [ - 13, - 16, + 7, + 17, ], "type": "Identifier", - "value": "get", + "value": "initialize", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 2, }, "start": Object { - "column": 7, + "column": 14, "line": 2, }, }, "range": Array [ - 16, 17, + 18, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - "value": "set", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 16, + "line": 2, }, "start": Object { - "column": 7, - "line": 3, + "column": 15, + "line": 2, }, }, "range": Array [ - 25, - 26, + 18, + 19, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 28, - 31, - ], - "type": "Keyword", - "value": "var", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 23, + "line": 2, }, "start": Object { - "column": 4, - "line": 5, + "column": 16, + "line": 2, }, }, "range": Array [ - 32, - 33, + 19, + 26, ], "type": "Identifier", - "value": "x", + "value": "someVar", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 24, + "line": 2, }, "start": Object { - "column": 6, - "line": 5, + "column": 23, + "line": 2, }, }, "range": Array [ - 34, - 35, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 33, + "line": 2, }, "start": Object { - "column": 8, - "line": 5, + "column": 25, + "line": 2, }, }, "range": Array [ + 28, 36, - 37, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 42, - 45, ], "type": "Identifier", - "value": "foo", + "value": "otherVar", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 34, + "line": 2, }, "start": Object { - "column": 7, - "line": 6, + "column": 33, + "line": 2, }, }, "range": Array [ - 45, - 46, + 36, + 37, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - "value": "foo", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 38, + "line": 2, }, "start": Object { - "column": 12, - "line": 6, + "column": 35, + "line": 2, }, }, "range": Array [ - 50, - 51, + 38, + 41, ], "type": "Punctuator", - "value": ",", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 45, + "line": 2, }, "start": Object { - "column": 4, - "line": 7, + "column": 38, + "line": 2, }, }, "range": Array [ - 56, - 59, + 41, + 48, ], "type": "Identifier", - "value": "get", + "value": "options", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 46, + "line": 2, }, "start": Object { - "column": 7, - "line": 7, + "column": 45, + "line": 2, }, }, "range": Array [ - 59, - 60, + 48, + 49, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 47, + "line": 2, }, "start": Object { - "column": 9, - "line": 7, + "column": 46, + "line": 2, }, }, "range": Array [ - 61, - 64, + 49, + 50, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 49, + "line": 2, }, "start": Object { - "column": 12, - "line": 7, + "column": 48, + "line": 2, }, }, "range": Array [ - 64, - 65, + 51, + 52, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 5, + "line": 4, }, "start": Object { "column": 4, - "line": 8, + "line": 4, }, }, "range": Array [ - 70, - 73, + 103, + 104, ], "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 7, - "line": 8, - }, - }, - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - "value": "set", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 8, + "column": 1, + "line": 5, }, "start": Object { - "column": 10, - "line": 8, + "column": 0, + "line": 5, }, }, "range": Array [ - 76, - 77, + 105, + 106, ], "type": "Punctuator", - "value": ".", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 2, + "line": 5, }, "start": Object { - "column": 11, - "line": 8, - }, - }, - "range": Array [ - 77, - 80, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, + "line": 5, }, }, "range": Array [ - 81, - 82, + 106, + 107, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 3, + "line": 5, }, "start": Object { - "column": 1, - "line": 9, + "column": 2, + "line": 5, }, }, "range": Array [ - 82, - 83, + 107, + 108, ], "type": "Punctuator", "value": ";", @@ -69120,280 +74140,318 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "initialize", - "range": Array [ - 7, - 17, - ], - "type": "Identifier", - }, - "kind": "init", + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 1, }, "start": Object { "column": 4, - "line": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, }, }, - "method": true, - "range": Array [ - 7, - 104, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "initialize", + "range": Array [ + 14, + 24, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { "column": 5, "line": 4, }, "start": Object { - "column": 48, + "column": 4, "line": 2, }, }, + "method": true, "range": Array [ - 51, - 104, + 14, + 111, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "params": Array [ - Object { + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 58, + 111, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 46, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 15, + "column": 14, "line": 2, }, }, - "properties": Array [ + "params": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "someVar", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { - "column": 23, + "column": 46, "line": 2, }, "start": Object { - "column": 16, + "column": 15, "line": 2, }, }, - "method": false, - "range": Array [ - 19, - 26, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 26, + 33, + ], + "type": "Identifier", }, - }, - "name": "someVar", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, }, - "start": Object { - "column": 25, - "line": 2, + "method": false, + "range": Array [ + 26, + 33, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 26, + 33, + ], + "type": "Identifier", }, }, - "name": "otherVar", - "range": Array [ - 28, - 36, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 28, - 36, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 35, + 43, + ], + "type": "Identifier", }, - "start": Object { - "column": 25, - "line": 2, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 35, + 43, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 35, + 43, + ], + "type": "Identifier", }, }, - "name": "otherVar", - "range": Array [ - 28, - 36, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 2, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "name": "options", + "range": Array [ + 48, + 55, + ], + "type": "Identifier", }, - "start": Object { - "column": 38, - "line": 2, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, }, + "range": Array [ + 45, + 55, + ], + "type": "RestElement", }, - "name": "options", - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 35, - "line": 2, - }, - }, + ], "range": Array [ - 38, - 48, + 25, + 56, ], - "type": "RestElement", + "type": "ObjectPattern", }, ], "range": Array [ - 18, - 49, + 24, + 111, ], - "type": "ObjectPattern", + "type": "FunctionExpression", }, - ], - "range": Array [ - 17, - 104, - ], - "type": "FunctionExpression", + }, + ], + "range": Array [ + 8, + 113, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, }, }, - ], - "range": Array [ - 1, - 106, - ], - "type": "ObjectExpression", - }, + "range": Array [ + 4, + 113, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 3, + "column": 2, "line": 5, }, "start": Object { @@ -69403,15 +74461,15 @@ Object { }, "range": Array [ 0, - 108, + 114, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 2, + "line": 5, }, "start": Object { "column": 0, @@ -69420,14 +74478,14 @@ Object { }, "range": Array [ 0, - 109, + 114, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -69437,25 +74495,61 @@ Object { }, "range": Array [ 0, - 1, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 1, }, "start": Object { - "column": 1, + "column": 8, "line": 1, }, }, "range": Array [ - 1, - 2, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -69472,8 +74566,8 @@ Object { }, }, "range": Array [ - 7, - 17, + 14, + 24, ], "type": "Identifier", "value": "initialize", @@ -69490,8 +74584,8 @@ Object { }, }, "range": Array [ - 17, - 18, + 24, + 25, ], "type": "Punctuator", "value": "(", @@ -69508,8 +74602,8 @@ Object { }, }, "range": Array [ - 18, - 19, + 25, + 26, ], "type": "Punctuator", "value": "{", @@ -69526,8 +74620,8 @@ Object { }, }, "range": Array [ - 19, 26, + 33, ], "type": "Identifier", "value": "someVar", @@ -69544,8 +74638,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 33, + 34, ], "type": "Punctuator", "value": ",", @@ -69562,8 +74656,8 @@ Object { }, }, "range": Array [ - 28, - 36, + 35, + 43, ], "type": "Identifier", "value": "otherVar", @@ -69580,8 +74674,8 @@ Object { }, }, "range": Array [ - 36, - 37, + 43, + 44, ], "type": "Punctuator", "value": ",", @@ -69598,8 +74692,8 @@ Object { }, }, "range": Array [ - 38, - 41, + 45, + 48, ], "type": "Punctuator", "value": "...", @@ -69616,8 +74710,8 @@ Object { }, }, "range": Array [ - 41, 48, + 55, ], "type": "Identifier", "value": "options", @@ -69634,8 +74728,8 @@ Object { }, }, "range": Array [ - 48, - 49, + 55, + 56, ], "type": "Punctuator", "value": "}", @@ -69652,8 +74746,8 @@ Object { }, }, "range": Array [ - 49, - 50, + 56, + 57, ], "type": "Punctuator", "value": ")", @@ -69670,8 +74764,8 @@ Object { }, }, "range": Array [ - 51, - 52, + 58, + 59, ], "type": "Punctuator", "value": "{", @@ -69688,8 +74782,8 @@ Object { }, }, "range": Array [ - 103, - 104, + 110, + 111, ], "type": "Punctuator", "value": "}", @@ -69706,8 +74800,8 @@ Object { }, }, "range": Array [ - 105, - 106, + 112, + 113, ], "type": "Punctuator", "value": "}", @@ -69724,38 +74818,148 @@ Object { }, }, "range": Array [ - 106, - 107, + 113, + 114, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 8, + "line": 3, }, "start": Object { - "column": 2, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 107, - 108, + 0, + 26, ], - "type": "Punctuator", - "value": ";", + "type": "VariableDeclaration", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` -Object { - "body": Array [ Object { "declarations": Array [ Object { @@ -69763,17 +74967,17 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 5, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "name": "x", "range": Array [ - 4, - 5, + 32, + 33, ], "type": "Identifier", }, @@ -69781,11 +74985,11 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 8, - "line": 1, + "line": 5, }, }, "properties": Array [ @@ -69794,269 +74998,170 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 7, + "line": 6, }, "start": Object { "column": 4, - "line": 2, + "line": 6, }, }, - "name": "initialize", + "name": "foo", "range": Array [ - 14, - 24, + 42, + 45, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 6, }, "start": Object { "column": 4, - "line": 2, + "line": 6, }, }, - "method": true, + "method": false, "range": Array [ - 14, - 111, + 42, + 45, ], - "shorthand": false, + "shorthand": true, "type": "Property", "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 48, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, }, - "range": Array [ - 58, - 111, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": null, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 7, }, "start": Object { - "column": 14, - "line": 2, + "column": 4, + "line": 7, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "someVar", - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 26, - 33, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "someVar", - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "name": "otherVar", - "range": Array [ - 35, - 43, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 35, - 43, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "name": "otherVar", - "range": Array [ - 35, - 43, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 38, - "line": 2, - }, - }, - "name": "options", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 35, - "line": 2, - }, - }, - "range": Array [ - 45, - 55, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 25, - 56, - ], - "type": "ObjectPattern", + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 51, + 54, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", "range": Array [ - 24, - 111, + 63, + 66, ], - "type": "FunctionExpression", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, }, + "range": Array [ + 60, + 66, + ], + "type": "SpreadElement", }, ], "range": Array [ - 8, - 113, + 36, + 68, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "range": Array [ - 4, - 113, + 32, + 68, ], "type": "VariableDeclarator", }, @@ -70065,24 +75170,24 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 114, + 28, + 69, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 0, + "line": 10, }, "start": Object { "column": 0, @@ -70091,7 +75196,7 @@ Object { }, "range": Array [ 0, - 114, + 70, ], "sourceType": "script", "tokens": Array [ @@ -70116,7 +75221,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -70126,92 +75231,92 @@ Object { }, "range": Array [ 4, - 5, + 7, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 8, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 8, - 9, + 13, + 16, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 2, }, "start": Object { - "column": 4, + "column": 7, "line": 2, }, }, "range": Array [ - 14, - 24, + 16, + 17, ], - "type": "Identifier", - "value": "initialize", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 14, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 24, + 22, 25, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ @@ -70219,202 +75324,202 @@ Object { 26, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 3, + "line": 5, }, "start": Object { - "column": 16, - "line": 2, + "column": 0, + "line": 5, }, }, "range": Array [ - 26, - 33, + 28, + 31, ], - "type": "Identifier", - "value": "someVar", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 5, + "line": 5, }, "start": Object { - "column": 23, - "line": 2, + "column": 4, + "line": 5, }, }, "range": Array [ + 32, 33, - 34, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 7, + "line": 5, }, "start": Object { - "column": 25, - "line": 2, + "column": 6, + "line": 5, }, }, "range": Array [ + 34, 35, - 43, ], - "type": "Identifier", - "value": "otherVar", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 9, + "line": 5, }, "start": Object { - "column": 33, - "line": 2, + "column": 8, + "line": 5, }, }, "range": Array [ - 43, - 44, + 36, + 37, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 2, + "column": 7, + "line": 6, }, "start": Object { - "column": 35, - "line": 2, + "column": 4, + "line": 6, }, }, "range": Array [ + 42, 45, - 48, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 2, + "column": 8, + "line": 6, }, "start": Object { - "column": 38, - "line": 2, + "column": 7, + "line": 6, }, }, "range": Array [ - 48, - 55, + 45, + 46, ], - "type": "Identifier", - "value": "options", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 2, + "column": 7, + "line": 7, }, "start": Object { - "column": 45, - "line": 2, + "column": 4, + "line": 7, }, }, "range": Array [ - 55, - 56, + 51, + 54, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 2, + "column": 8, + "line": 7, }, "start": Object { - "column": 46, - "line": 2, + "column": 7, + "line": 7, }, }, "range": Array [ - 56, - 57, + 54, + 55, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 2, + "column": 7, + "line": 8, }, "start": Object { - "column": 48, - "line": 2, + "column": 4, + "line": 8, }, }, "range": Array [ - 58, - 59, + 60, + 63, ], "type": "Punctuator", - "value": "{", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 10, + "line": 8, }, "start": Object { - "column": 4, - "line": 4, + "column": 7, + "line": 8, }, }, "range": Array [ - 110, - 111, + 63, + 66, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 5, + "line": 9, }, }, "range": Array [ - 112, - 113, + 67, + 68, ], "type": "Punctuator", "value": "}", @@ -70423,16 +75528,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 9, }, "start": Object { "column": 1, - "line": 5, + "line": 9, }, }, "range": Array [ - 113, - 114, + 68, + 69, ], "type": "Punctuator", "value": ";", @@ -70442,7 +75547,7 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` Object { "body": Array [ Object { @@ -70629,7 +75734,7 @@ Object { "kind": "init", "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 6, }, "start": Object { @@ -70640,25 +75745,25 @@ Object { "method": false, "range": Array [ 42, - 45, + 50, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 6, }, "start": Object { - "column": 4, + "column": 9, "line": 6, }, }, "name": "foo", "range": Array [ - 42, - 45, + 47, + 50, ], "type": "Identifier", }, @@ -70678,15 +75783,15 @@ Object { }, "name": "get", "range": Array [ - 51, - 54, + 56, + 59, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 7, }, "start": Object { @@ -70696,26 +75801,26 @@ Object { }, "method": false, "range": Array [ - 51, - 54, + 56, + 64, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 7, }, "start": Object { - "column": 4, + "column": 9, "line": 7, }, }, "name": "get", "range": Array [ - 51, - 54, + 61, + 64, ], "type": "Identifier", }, @@ -70734,8 +75839,8 @@ Object { }, "name": "set", "range": Array [ - 63, - 66, + 73, + 76, ], "type": "Identifier", }, @@ -70750,15 +75855,15 @@ Object { }, }, "range": Array [ - 60, - 66, + 70, + 76, ], "type": "SpreadElement", }, ], "range": Array [ 36, - 68, + 78, ], "type": "ObjectExpression", }, @@ -70774,7 +75879,7 @@ Object { }, "range": Array [ 32, - 68, + 78, ], "type": "VariableDeclarator", }, @@ -70792,7 +75897,7 @@ Object { }, "range": Array [ 28, - 69, + 79, ], "type": "VariableDeclaration", }, @@ -70809,7 +75914,7 @@ Object { }, "range": Array [ 0, - 70, + 80, ], "sourceType": "script", "tokens": Array [ @@ -71045,6 +76150,42 @@ Object { 46, ], "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", "value": ",", }, Object { @@ -71059,8 +76200,8 @@ Object { }, }, "range": Array [ - 51, - 54, + 56, + 59, ], "type": "Identifier", "value": "get", @@ -71077,8 +76218,44 @@ Object { }, }, "range": Array [ - 54, - 55, + 59, + 60, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 64, + 65, ], "type": "Punctuator", "value": ",", @@ -71095,8 +76272,8 @@ Object { }, }, "range": Array [ - 60, - 63, + 70, + 73, ], "type": "Punctuator", "value": "...", @@ -71113,8 +76290,8 @@ Object { }, }, "range": Array [ - 63, - 66, + 73, + 76, ], "type": "Identifier", "value": "set", @@ -71131,8 +76308,8 @@ Object { }, }, "range": Array [ - 67, - 68, + 77, + 78, ], "type": "Punctuator", "value": "}", @@ -71149,8 +76326,8 @@ Object { }, }, "range": Array [ - 68, - 69, + 78, + 79, ], "type": "Punctuator", "value": ";", @@ -71160,7 +76337,415 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 4, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 1, + 16, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` Object { "body": Array [ Object { @@ -71382,29 +76967,27 @@ Object { }, }, Object { - "computed": false, - "key": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 7, }, "start": Object { - "column": 4, + "column": 7, "line": 7, }, }, "name": "get", "range": Array [ - 56, 59, + 62, ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 7, }, "start": Object { @@ -71412,31 +76995,11 @@ Object { "line": 7, }, }, - "method": false, "range": Array [ 56, - 64, + 62, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, + "type": "SpreadElement", }, Object { "argument": Object { @@ -71452,8 +77015,8 @@ Object { }, "name": "set", "range": Array [ - 73, - 76, + 71, + 74, ], "type": "Identifier", }, @@ -71468,15 +77031,15 @@ Object { }, }, "range": Array [ - 70, - 76, + 68, + 74, ], "type": "SpreadElement", }, ], "range": Array [ 36, - 78, + 76, ], "type": "ObjectExpression", }, @@ -71492,7 +77055,7 @@ Object { }, "range": Array [ 32, - 78, + 76, ], "type": "VariableDeclarator", }, @@ -71510,7 +77073,7 @@ Object { }, "range": Array [ 28, - 79, + 77, ], "type": "VariableDeclaration", }, @@ -71527,7 +77090,7 @@ Object { }, "range": Array [ 0, - 80, + 78, ], "sourceType": "script", "tokens": Array [ @@ -71816,13 +77379,13 @@ Object { 56, 59, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 7, }, "start": Object { @@ -71832,25 +77395,7 @@ Object { }, "range": Array [ 59, - 60, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "range": Array [ - 61, - 64, + 62, ], "type": "Identifier", "value": "get", @@ -71858,17 +77403,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 7, }, "start": Object { - "column": 12, + "column": 10, "line": 7, }, }, "range": Array [ - 64, - 65, + 62, + 63, ], "type": "Punctuator", "value": ",", @@ -71885,8 +77430,8 @@ Object { }, }, "range": Array [ - 70, - 73, + 68, + 71, ], "type": "Punctuator", "value": "...", @@ -71903,8 +77448,8 @@ Object { }, }, "range": Array [ - 73, - 76, + 71, + 74, ], "type": "Identifier", "value": "set", @@ -71921,8 +77466,8 @@ Object { }, }, "range": Array [ - 77, - 78, + 75, + 76, ], "type": "Punctuator", "value": "}", @@ -71939,8 +77484,8 @@ Object { }, }, "range": Array [ - 78, - 79, + 76, + 77, ], "type": "Punctuator", "value": ";", @@ -71950,181 +77495,68 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` +exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "block": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 16, + "column": 6, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, + "range": Array [ + 4, + 6, + ], + "type": "BlockStatement", + }, + "finalizer": null, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, }, - "method": false, - "range": Array [ - 3, - 4, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", + "start": Object { + "column": 13, + "line": 1, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 6, - 7, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + "range": Array [ + 13, + 15, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 13, - ], - "type": "SpreadElement", + "start": Object { + "column": 7, + "line": 1, }, - ], + }, + "param": null, "range": Array [ - 1, - 16, + 7, + 15, ], - "type": "ObjectExpression", + "type": "CatchClause", }, "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -72133,60 +77565,114 @@ Object { }, }, "range": Array [ - 0, - 17, + 0, + 15, + ], + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 12, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 1, + 7, + 12, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "catch", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 14, "line": 1, }, "start": Object { - "column": 1, + "column": 13, "line": 1, }, }, "range": Array [ - 1, - 2, + 13, + 14, ], "type": "Punctuator", "value": "{", @@ -72194,110 +77680,206 @@ Object { Object { "loc": Object { "end": Object { - "column": 4, + "column": 15, "line": 1, }, "start": Object { - "column": 3, + "column": 14, "line": 1, }, }, "range": Array [ - 3, - 4, + 14, + 15, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` +Object { + "body": Array [ Object { + "block": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "BlockStatement", + }, + "finalizer": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "param": null, + "range": Array [ + 7, + 15, + ], + "type": "CatchClause", + }, "loc": Object { "end": Object { - "column": 5, + "column": 26, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, "range": Array [ - 4, - 5, + 0, + 26, ], - "type": "Punctuator", - "value": ",", + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { - "column": 6, + "column": 0, "line": 1, }, }, "range": Array [ - 6, - 7, + 0, + 3, ], - "type": "Identifier", - "value": "b", + "type": "Keyword", + "value": "try", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, "range": Array [ - 7, - 8, + 4, + 5, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 6, "line": 1, }, "start": Object { - "column": 9, + "column": 5, "line": 1, }, }, "range": Array [ - 9, - 12, + 5, + 6, ], "type": "Punctuator", - "value": "...", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 7, "line": 1, }, }, "range": Array [ + 7, 12, - 13, ], - "type": "Identifier", - "value": "c", + "type": "Keyword", + "value": "catch", }, Object { "loc": Object { @@ -72315,22 +77897,22 @@ Object { 14, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 16, ], "type": "Punctuator", "value": "}", @@ -72338,7 +77920,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { @@ -72348,147 +77930,55 @@ Object { }, "range": Array [ 16, - 17, + 23, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "finally", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", + "start": Object { + "column": 24, + "line": 1, }, + }, + "range": Array [ + 24, + 25, ], - "kind": "var", + "type": "Punctuator", + "value": "{", + }, + Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 0, + "column": 25, "line": 1, }, }, "range": Array [ - 0, + 25, 26, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/exponentiationOperators/exponential-operators.src 1`] = ` +Object { + "body": Array [ Object { "declarations": Array [ Object { @@ -72496,179 +77986,89 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "name": "x", "range": Array [ - 32, - 33, + 4, + 5, ], "type": "Identifier", }, "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "method": false, - "range": Array [ - 42, - 50, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 7, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 59, - 62, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 56, - 62, - ], - "type": "SpreadElement", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 7, - "line": 8, - }, - }, - "name": "set", - "range": Array [ - 71, - 74, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 68, - 74, - ], - "type": "SpreadElement", }, - ], + "range": Array [ + 8, + 9, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "**", "range": Array [ - 36, - 76, + 8, + 14, ], - "type": "ObjectExpression", + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "BinaryExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 14, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 76, + 4, + 14, ], "type": "VariableDeclarator", }, @@ -72676,25 +78076,97 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 15, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 77, + 0, + 15, ], "type": "VariableDeclaration", }, + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "**=", + "range": Array [ + 16, + 23, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 16, + 24, + ], + "type": "ExpressionStatement", + }, ], "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 3, }, "start": Object { "column": 0, @@ -72703,7 +78175,7 @@ Object { }, "range": Array [ 0, - 78, + 25, ], "sourceType": "script", "tokens": Array [ @@ -72728,7 +78200,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -72738,97 +78210,97 @@ Object { }, "range": Array [ 4, - 7, + 5, ], "type": "Identifier", - "value": "foo", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 13, - 16, + 8, + 9, ], - "type": "Identifier", - "value": "get", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 16, - 17, + 10, + 12, ], "type": "Punctuator", - "value": ",", + "value": "**", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 13, + "line": 1, }, }, "range": Array [ - 22, - 25, + 13, + 14, ], - "type": "Identifier", - "value": "set", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 14, + "line": 1, }, }, "range": Array [ - 25, - 26, + 14, + 15, ], "type": "Punctuator", "value": ";", @@ -72836,402 +78308,534 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 1, + "line": 2, }, "start": Object { "column": 0, - "line": 5, + "line": 2, }, }, "range": Array [ - 28, - 31, + 16, + 17, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 2, }, "start": Object { - "column": 4, - "line": 5, + "column": 2, + "line": 2, }, }, "range": Array [ - 32, - 33, + 18, + 21, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "**=", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 5, + "line": 2, }, "start": Object { "column": 6, - "line": 5, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forOf/for-of-with-function-initializer.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 61, + 62, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 60, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 53, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 63, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 64, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "operator": "in", + "range": Array [ + 33, + 41, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 41, + ], + "type": "ArrayExpression", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 41, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 43, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 43, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 43, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, }, + "range": Array [ + 5, + 43, + ], + "type": "VariableDeclaration", }, - "range": Array [ - 34, - 35, - ], - "type": "Punctuator", - "value": "=", - }, - Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 64, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 36, - 37, + 0, + 64, ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, + "right": Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, }, + "name": "list", + "range": Array [ + 47, + 51, + ], + "type": "Identifier", }, - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - "value": "foo", + "type": "ForOfStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 6, - }, - "start": Object { - "column": 7, - "line": 6, - }, - }, - "range": Array [ - 45, - 46, - ], - "type": "Punctuator", - "value": ":", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - "value": "foo", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 65, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 3, + "line": 1, }, "start": Object { - "column": 12, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 50, - 51, + 0, + 3, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 5, + "line": 1, }, "start": Object { "column": 4, - "line": 7, - }, - }, - "range": Array [ - 56, - 59, - ], - "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 7, - "line": 7, - }, - }, - "range": Array [ - 59, - 62, - ], - "type": "Identifier", - "value": "get", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, + "line": 1, }, }, "range": Array [ - 62, - 63, + 4, + 5, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 8, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 5, + "line": 1, }, }, "range": Array [ - 68, - 71, + 5, + 8, ], - "type": "Punctuator", - "value": "...", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 8, + "line": 1, }, "start": Object { - "column": 7, - "line": 8, + "column": 9, + "line": 1, }, }, "range": Array [ - 71, - 74, + 9, + 10, ], "type": "Identifier", - "value": "set", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 12, + "line": 1, }, "start": Object { - "column": 0, - "line": 9, + "column": 11, + "line": 1, }, }, "range": Array [ - 75, - 76, + 11, + 12, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 21, + "line": 1, }, "start": Object { - "column": 1, - "line": 9, + "column": 13, + "line": 1, }, }, "range": Array [ - 76, - 77, + 13, + 21, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "function", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` -Object { - "body": Array [ Object { - "block": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 6, - ], - "type": "BlockStatement", - }, - "finalizer": null, - "handler": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 15, - ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "param": null, - "range": Array [ - 7, - 15, - ], - "type": "CatchClause", - }, "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 21, "line": 1, }, }, "range": Array [ - 0, - 15, + 21, + 22, ], - "type": "TryStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "(", }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 23, "line": 1, }, "start": Object { - "column": 0, + "column": 22, "line": 1, }, }, "range": Array [ - 0, - 3, + 22, + 23, ], - "type": "Keyword", - "value": "try", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 25, "line": 1, }, "start": Object { - "column": 4, + "column": 24, "line": 1, }, }, "range": Array [ - 4, - 5, + 24, + 25, ], "type": "Punctuator", "value": "{", @@ -73239,458 +78843,397 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 32, "line": 1, }, "start": Object { - "column": 5, + "column": 26, "line": 1, }, }, "range": Array [ - 5, - 6, + 26, + 32, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 35, "line": 1, }, "start": Object { - "column": 7, + "column": 33, "line": 1, }, }, "range": Array [ - 7, - 12, + 33, + 35, ], - "type": "Keyword", - "value": "catch", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 38, "line": 1, }, "start": Object { - "column": 13, + "column": 36, "line": 1, }, }, "range": Array [ - 13, - 14, + 36, + 38, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 40, "line": 1, }, "start": Object { - "column": 14, + "column": 39, "line": 1, }, }, "range": Array [ - 14, - 15, + 39, + 40, ], "type": "Punctuator", - "value": "}", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` -Object { - "body": Array [ Object { - "block": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 6, - ], - "type": "BlockStatement", - }, - "finalizer": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 26, - ], - "type": "BlockStatement", - }, - "handler": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 15, - ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "param": null, - "range": Array [ - 7, - 15, - ], - "type": "CatchClause", - }, "loc": Object { "end": Object { - "column": 26, + "column": 41, "line": 1, }, "start": Object { - "column": 0, + "column": 40, "line": 1, }, }, "range": Array [ - 0, - 26, - ], - "type": "TryStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 27, - ], - "sourceType": "script", - "tokens": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "]", + }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 43, "line": 1, }, "start": Object { - "column": 0, + "column": 42, "line": 1, }, }, "range": Array [ - 0, - 3, + 42, + 43, ], - "type": "Keyword", - "value": "try", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 46, "line": 1, }, "start": Object { - "column": 4, + "column": 44, "line": 1, }, }, "range": Array [ - 4, - 5, + 44, + 46, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 51, "line": 1, }, "start": Object { - "column": 5, + "column": 47, "line": 1, }, }, "range": Array [ - 5, - 6, + 47, + 51, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "list", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 52, "line": 1, }, "start": Object { - "column": 7, + "column": 51, "line": 1, }, }, "range": Array [ - 7, - 12, + 51, + 52, ], - "type": "Keyword", - "value": "catch", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 60, "line": 1, }, "start": Object { - "column": 13, + "column": 53, "line": 1, }, }, "range": Array [ - 13, - 14, + 53, + 60, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "process", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 61, "line": 1, }, "start": Object { - "column": 14, + "column": 60, "line": 1, }, }, "range": Array [ - 14, - 15, + 60, + 61, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 62, "line": 1, }, "start": Object { - "column": 16, + "column": 61, "line": 1, }, }, "range": Array [ - 16, - 23, + 61, + 62, ], - "type": "Keyword", - "value": "finally", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 63, "line": 1, }, "start": Object { - "column": 24, + "column": 62, "line": 1, }, }, "range": Array [ - 24, - 25, + 62, + 63, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 64, "line": 1, }, "start": Object { - "column": 25, + "column": 63, "line": 1, }, }, "range": Array [ - 25, - 26, + 63, + 64, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/exponentiationOperators/exponential-operators.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "await": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "name": "x", "range": Array [ - 4, - 5, + 25, + 39, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "init": Object { - "left": Object { + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 41, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, + "name": "x", "range": Array [ - 8, 9, + 10, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "Identifier", }, + "init": null, "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, - "operator": "**", "range": Array [ - 8, - 14, + 9, + 10, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "BinaryExpression", + "type": "VariableDeclarator", }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 5, + 10, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -73699,87 +79242,33 @@ Object { }, "range": Array [ 0, - 15, + 41, ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, + "right": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 1, }, }, - "operator": "**=", + "name": "foo", "range": Array [ - 16, - 23, + 14, + 17, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, + "type": "Identifier", }, - "range": Array [ - 16, - 24, - ], - "type": "ExpressionStatement", + "type": "ForOfStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -73788,7 +79277,7 @@ Object { }, "range": Array [ 0, - 25, + 42, ], "sourceType": "script", "tokens": Array [ @@ -73808,7 +79297,7 @@ Object { 3, ], "type": "Keyword", - "value": "var", + "value": "for", }, Object { "loc": Object { @@ -73825,250 +79314,267 @@ Object { 4, 5, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ - 6, - 7, + 5, + 8, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, 9, + 10, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, "range": Array [ - 10, - 12, + 11, + 13, ], - "type": "Punctuator", - "value": "**", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 17, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 17, ], - "type": "Numeric", - "value": "3", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 17, "line": 1, }, }, "range": Array [ - 14, - 15, + 17, + 18, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, "line": 2, }, "start": Object { - "column": 0, + "column": 4, "line": 2, }, }, "range": Array [ - 16, - 17, + 25, + 36, ], "type": "Identifier", - "value": "x", + "value": "doSomething", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 16, "line": 2, }, "start": Object { - "column": 2, + "column": 15, "line": 2, }, }, "range": Array [ - 18, - 21, + 36, + 37, ], "type": "Punctuator", - "value": "**=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 17, "line": 2, }, "start": Object { - "column": 6, + "column": 16, "line": 2, }, }, "range": Array [ - 22, - 23, + 37, + 38, ], - "type": "Numeric", - "value": "4", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 18, "line": 2, }, "start": Object { - "column": 7, + "column": 17, "line": 2, }, }, "range": Array [ - 23, - 24, + 38, + 39, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`javascript fixtures/forOf/for-of-with-function-initializer.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` Object { "body": Array [ Object { "await": false, "body": Object { "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 61, - 62, - ], - "type": "Identifier", - }, - ], + "arguments": Array [], "callee": Object { "loc": Object { "end": Object { - "column": 60, - "line": 1, + "column": 15, + "line": 2, }, - "start": Object { - "column": 53, - "line": 1, + "start": Object { + "column": 4, + "line": 2, }, }, - "name": "process", + "name": "doSomething", "range": Array [ - 53, - 60, + 23, + 34, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 63, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 53, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 53, - 63, + 23, + 36, ], "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 53, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 53, - 64, + 23, + 37, ], "type": "ExpressionStatement", }, @@ -74086,129 +79592,17 @@ Object { "line": 1, }, }, - "name": "i", + "name": "x", "range": Array [ 9, 10, ], "type": "Identifier", }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 35, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "operator": "in", - "range": Array [ - 33, - 41, - ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 41, - ], - "type": "ArrayExpression", - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 41, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 43, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 43, - ], - "type": "FunctionExpression", - }, + "init": null, "loc": Object { "end": Object { - "column": 43, + "column": 10, "line": 1, }, "start": Object { @@ -74218,7 +79612,7 @@ Object { }, "range": Array [ 9, - 43, + 10, ], "type": "VariableDeclarator", }, @@ -74226,7 +79620,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 43, + "column": 10, "line": 1, }, "start": Object { @@ -74236,14 +79630,14 @@ Object { }, "range": Array [ 5, - 43, + 10, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 0, @@ -74252,23 +79646,23 @@ Object { }, "range": Array [ 0, - 64, + 37, ], "right": Object { "loc": Object { "end": Object { - "column": 51, + "column": 17, "line": 1, }, "start": Object { - "column": 47, + "column": 14, "line": 1, }, }, - "name": "list", + "name": "foo", "range": Array [ - 47, - 51, + 14, + 17, ], "type": "Identifier", }, @@ -74278,7 +79672,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -74287,7 +79681,7 @@ Object { }, "range": Array [ 0, - 65, + 38, ], "sourceType": "script", "tokens": Array [ @@ -74361,12 +79755,12 @@ Object { 10, ], "type": "Identifier", - "value": "i", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { @@ -74376,313 +79770,465 @@ Object { }, "range": Array [ 11, - 12, + 13, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 17, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, - 21, + 14, + 17, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 18, "line": 1, }, "start": Object { - "column": 21, + "column": 17, "line": 1, }, }, "range": Array [ - 21, - 22, + 17, + 18, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 22, 23, + 34, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "doSomething", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 24, - 25, + 34, + 35, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 26, - 32, + 35, + 36, ], - "type": "Keyword", - "value": "return", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 33, - 35, + 36, + 37, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` +Object { + "body": Array [ Object { + "await": false, + "body": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 39, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 12, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 36, + "column": 0, "line": 1, }, }, "range": Array [ - 36, - 38, + 0, + 39, ], - "type": "Keyword", - "value": "in", + "right": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 40, + "column": 3, "line": 1, }, "start": Object { - "column": 39, + "column": 0, "line": 1, }, }, "range": Array [ - 39, - 40, + 0, + 3, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 5, "line": 1, }, "start": Object { - "column": 40, + "column": 4, "line": 1, }, }, "range": Array [ - 40, - 41, + 4, + 5, ], "type": "Punctuator", - "value": "]", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 10, "line": 1, }, "start": Object { - "column": 42, + "column": 5, "line": 1, }, }, "range": Array [ - 42, - 43, + 5, + 10, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 12, "line": 1, }, "start": Object { - "column": 44, + "column": 11, "line": 1, }, }, "range": Array [ - 44, - 46, + 11, + 12, ], "type": "Identifier", - "value": "of", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 51, + "column": 15, "line": 1, }, "start": Object { - "column": 47, + "column": 13, "line": 1, }, }, "range": Array [ - 47, - 51, + 13, + 15, ], "type": "Identifier", - "value": "list", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 52, + "column": 19, "line": 1, }, "start": Object { - "column": 51, + "column": 16, "line": 1, }, }, "range": Array [ - 51, - 52, + 16, + 19, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 60, + "column": 20, "line": 1, }, "start": Object { - "column": 53, + "column": 19, "line": 1, }, }, "range": Array [ - 53, - 60, + 19, + 20, ], - "type": "Identifier", - "value": "process", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 61, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 60, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 60, - 61, + 25, + 36, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "doSomething", }, Object { "loc": Object { "end": Object { - "column": 62, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 61, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 61, - 62, + 36, + 37, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 63, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 62, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 62, - 63, + 37, + 38, ], "type": "Punctuator", "value": ")", @@ -74690,17 +80236,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 63, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 63, - 64, + 38, + 39, ], "type": "Punctuator", "value": ";", @@ -74710,53 +80256,18 @@ Object { } `; -exports[`javascript fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` +exports[`javascript fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` Object { "body": Array [ Object { "await": false, "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "doSomething", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 38, - ], - "type": "CallExpression", - }, + "expression": Object { + "arguments": Array [], + "callee": Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 2, }, "start": Object { @@ -74764,28 +80275,44 @@ Object { "line": 2, }, }, + "name": "doSomething", "range": Array [ - 25, - 39, + 23, + 34, ], - "type": "ExpressionStatement", + "type": "Identifier", }, - ], + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 36, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 41, + 23, + 37, ], - "type": "BlockStatement", + "type": "ExpressionStatement", }, "left": Object { "declarations": Array [ @@ -74826,7 +80353,7 @@ Object { "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "let", "loc": Object { "end": Object { "column": 10, @@ -74845,8 +80372,8 @@ Object { }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 2, }, "start": Object { "column": 0, @@ -74855,7 +80382,7 @@ Object { }, "range": Array [ 0, - 41, + 37, ], "right": Object { "loc": Object { @@ -74881,7 +80408,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 3, }, "start": Object { "column": 0, @@ -74890,7 +80417,7 @@ Object { }, "range": Array [ 0, - 42, + 38, ], "sourceType": "script", "tokens": Array [ @@ -74946,7 +80473,7 @@ Object { 8, ], "type": "Keyword", - "value": "var", + "value": "let", }, Object { "loc": Object { @@ -75020,24 +80547,6 @@ Object { "type": "Punctuator", "value": ")", }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "{", - }, Object { "loc": Object { "end": Object { @@ -75050,8 +80559,8 @@ Object { }, }, "range": Array [ - 25, - 36, + 23, + 34, ], "type": "Identifier", "value": "doSomething", @@ -75068,8 +80577,8 @@ Object { }, }, "range": Array [ - 36, - 37, + 34, + 35, ], "type": "Punctuator", "value": "(", @@ -75086,8 +80595,8 @@ Object { }, }, "range": Array [ - 37, - 38, + 35, + 36, ], "type": "Punctuator", "value": ")", @@ -75104,358 +80613,514 @@ Object { }, }, "range": Array [ - 38, - 39, + 36, + 37, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } `; -exports[`javascript fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` +exports[`javascript fixtures/generators/anonymous-generator.src 1`] = ` Object { "body": Array [ Object { - "await": false, - "body": Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "delegate": false, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "YieldExpression", }, - }, - "name": "doSomething", - "range": Array [ - 23, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 23, - 36, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 23, - 37, - ], - "type": "ExpressionStatement", - }, - "left": Object { - "declarations": Array [ - Object { - "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 23, "line": 1, }, "start": Object { - "column": 9, + "column": 16, "line": 1, }, }, - "name": "x", "range": Array [ - 9, - 10, + 16, + 23, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "init": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 14, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 10, + "column": 25, "line": 1, }, "start": Object { - "column": 5, + "column": 1, "line": 1, }, }, + "params": Array [], "range": Array [ - 5, - 10, + 1, + 25, ], - "type": "VariableDeclaration", + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, }, + "range": Array [ + 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 0, + "column": 22, "line": 1, }, }, "range": Array [ - 0, - 37, + 22, + 23, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "v", }, - }, - "range": Array [ - 0, - 38, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 25, "line": 1, }, "start": Object { - "column": 0, + "column": 24, "line": 1, }, }, "range": Array [ - 0, - 3, + 24, + 25, ], - "type": "Keyword", - "value": "for", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 26, "line": 1, }, "start": Object { - "column": 4, + "column": 25, "line": 1, }, }, "range": Array [ - 4, - 5, + 25, + 26, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 27, "line": 1, }, "start": Object { - "column": 5, + "column": 26, "line": 1, }, }, "range": Array [ - 5, - 8, + 26, + 27, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/generators/async-generator-function.src 1`] = ` +Object { + "body": Array [ Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 9, - "line": 1, + "column": 0, + "line": 2, }, }, + "params": Array [], "range": Array [ - 9, - 10, + 1, + 27, ], - "type": "Identifier", - "value": "x", + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 2, }, + }, + "range": Array [ + 1, + 28, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 11, - 13, + 1, + 6, ], "type": "Identifier", - "value": "of", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 14, - 17, + 7, + 15, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ + 16, 17, - 18, ], "type": "Punctuator", - "value": ")", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 19, "line": 2, }, "start": Object { - "column": 4, + "column": 16, "line": 2, }, }, "range": Array [ - 23, - 34, + 17, + 20, ], "type": "Identifier", - "value": "doSomething", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 2, }, "start": Object { - "column": 15, + "column": 19, "line": 2, }, }, "range": Array [ - 34, - 35, + 20, + 21, ], "type": "Punctuator", "value": "(", @@ -75463,17 +81128,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 2, }, "start": Object { - "column": 16, + "column": 20, "line": 2, }, }, "range": Array [ - 35, - 36, + 21, + 22, ], "type": "Punctuator", "value": ")", @@ -75481,144 +81146,277 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 2, }, "start": Object { - "column": 17, + "column": 22, "line": 2, }, }, "range": Array [ - 36, - 37, + 23, + 24, ], "type": "Punctuator", - "value": ";", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` +exports[`javascript fixtures/generators/async-generator-method.src 1`] = ` Object { "body": Array [ Object { - "await": false, "body": Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "doSomething", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 38, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 39, - ], - "type": "ExpressionStatement", - }, - "left": Object { - "declarations": Array [ + "body": Array [ Object { - "id": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 12, + "line": 2, }, }, - "name": "x", + "name": "f", "range": Array [ - 11, - 12, + 22, + 23, ], "type": "Identifier", }, - "init": null, + "kind": "method", "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 11, - 12, + 14, + 63, ], - "type": "VariableDeclarator", + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + "init": Object { + "argument": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "name": "g", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "range": Array [ + 53, + 56, + ], + "type": "CallExpression", + }, + "delegate": true, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 46, + 56, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 42, + 56, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 36, + 57, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 63, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 23, + 63, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, }, + }, + "range": Array [ + 8, + 65, ], - "kind": "const", + "type": "ClassBody", + }, + "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, + "name": "C", "range": Array [ - 5, - 12, + 6, + 7, ], - "type": "VariableDeclaration", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 5, }, "start": Object { "column": 0, @@ -75627,33 +81425,16 @@ Object { }, "range": Array [ 0, - 39, + 65, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 6, }, "start": Object { "column": 0, @@ -75662,14 +81443,14 @@ Object { }, "range": Array [ 0, - 40, + 66, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -75679,151 +81460,115 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "for", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ 5, - 10, ], "type": "Keyword", - "value": "const", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 7, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, "range": Array [ - 11, - 12, + 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 13, + "column": 8, "line": 1, }, }, "range": Array [ - 13, - 15, + 8, + 9, ], - "type": "Identifier", - "value": "of", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 16, + 14, 19, ], "type": "Identifier", - "value": "foo", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 19, 20, + 21, ], "type": "Punctuator", - "value": ")", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 12, "line": 2, }, }, "range": Array [ - 25, - 36, + 22, + 23, ], "type": "Identifier", - "value": "doSomething", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "range": Array [ - 36, - 37, + 23, + 24, ], "type": "Punctuator", "value": "(", @@ -75831,17 +81576,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 2, }, "start": Object { - "column": 16, + "column": 14, "line": 2, }, }, "range": Array [ - 37, - 38, + 24, + 25, ], "type": "Punctuator", "value": ")", @@ -75849,313 +81594,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 2, }, "start": Object { - "column": 17, + "column": 16, "line": 2, }, }, "range": Array [ - 38, - 39, + 26, + 27, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` -Object { - "body": Array [ Object { - "await": false, - "body": Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "doSomething", - "range": Array [ - 23, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 23, - 36, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 23, - 37, - ], - "type": "ExpressionStatement", - }, - "left": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 10, - ], - "type": "VariableDeclaration", - }, "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 13, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 0, - 37, + 36, + 41, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "const", }, - }, - "range": Array [ - 0, - 38, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 0, - 3, + 42, + 43, ], - "type": "Keyword", - "value": "for", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 17, + "line": 3, }, "start": Object { - "column": 4, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 4, - 5, + 44, + 45, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 23, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 18, + "line": 3, }, }, "range": Array [ - 5, - 8, + 46, + 51, ], "type": "Keyword", - "value": "let", + "value": "yield", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 24, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 23, + "line": 3, }, }, "range": Array [ - 9, - 10, + 51, + 52, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 26, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 25, + "line": 3, }, }, "range": Array [ - 11, - 13, + 53, + 54, ], "type": "Identifier", - "value": "of", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 27, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 26, + "line": 3, }, }, "range": Array [ - 14, - 17, + 54, + 55, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 28, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 27, + "line": 3, }, }, "range": Array [ - 17, - 18, + 55, + 56, ], "type": "Punctuator", "value": ")", @@ -76163,81 +81756,63 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 23, - 34, - ], - "type": "Identifier", - "value": "doSomething", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, + "column": 29, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 3, }, }, "range": Array [ - 34, - 35, + 56, + 57, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 16, - "line": 2, + "column": 4, + "line": 4, }, }, "range": Array [ - 35, - 36, + 62, + 63, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 5, }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 5, }, }, "range": Array [ - 36, - 37, + 64, + 65, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/generators/anonymous-generator.src 1`] = ` +exports[`javascript fixtures/generators/double-yield.src 1`] = ` Object { "body": Array [ Object { @@ -76248,9 +81823,29 @@ Object { Object { "expression": Object { "argument": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "delegate": false, "loc": Object { "end": Object { - "column": 23, + "column": 30, "line": 1, }, "start": Object { @@ -76258,17 +81853,16 @@ Object { "line": 1, }, }, - "name": "v", "range": Array [ 22, - 23, + 30, ], - "type": "Identifier", + "type": "YieldExpression", }, "delegate": false, "loc": Object { "end": Object { - "column": 23, + "column": 30, "line": 1, }, "start": Object { @@ -76278,13 +81872,13 @@ Object { }, "range": Array [ 16, - 23, + 30, ], "type": "YieldExpression", }, "loc": Object { "end": Object { - "column": 23, + "column": 30, "line": 1, }, "start": Object { @@ -76294,14 +81888,14 @@ Object { }, "range": Array [ 16, - 23, + 30, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 25, + "column": 32, "line": 1, }, "start": Object { @@ -76311,7 +81905,7 @@ Object { }, "range": Array [ 14, - 25, + 32, ], "type": "BlockStatement", }, @@ -76320,7 +81914,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 25, + "column": 32, "line": 1, }, "start": Object { @@ -76331,13 +81925,13 @@ Object { "params": Array [], "range": Array [ 1, - 25, + 32, ], "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 27, + "column": 34, "line": 1, }, "start": Object { @@ -76347,14 +81941,14 @@ Object { }, "range": Array [ 0, - 27, + 34, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 27, + "column": 34, "line": 1, }, "start": Object { @@ -76364,7 +81958,7 @@ Object { }, "range": Array [ 0, - 27, + 34, ], "sourceType": "script", "tokens": Array [ @@ -76497,7 +82091,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 27, "line": 1, }, "start": Object { @@ -76507,251 +82101,61 @@ Object { }, "range": Array [ 22, - 23, + 27, ], - "type": "Identifier", - "value": "v", + "type": "Keyword", + "value": "yield", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { - "column": 24, + "column": 28, "line": 1, }, }, "range": Array [ - 24, - 25, + 28, + 30, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 32, "line": 1, }, "start": Object { - "column": 25, + "column": 31, "line": 1, }, }, "range": Array [ - 25, - 26, + 31, + 32, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 33, "line": 1, }, "start": Object { - "column": 26, + "column": 32, "line": 1, }, }, "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/generators/async-generator-function.src 1`] = ` -Object { - "body": Array [ - Object { - "async": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "range": Array [ - 23, - 27, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 1, - 27, - ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 1, - 28, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 1, - 6, - ], - "type": "Identifier", - "value": "async", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 7, - 15, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": "*", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 21, - 22, + 32, + 33, ], "type": "Punctuator", "value": ")", @@ -76759,295 +82163,108 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, + "column": 34, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 33, + "line": 1, }, }, "range": Array [ - 26, - 27, + 33, + 34, ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/generators/async-generator-method.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "name": "f", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 63, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": true, - "body": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "name": "x", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "init": Object { - "argument": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 3, - }, - "start": Object { - "column": 25, - "line": 3, - }, - }, - "name": "g", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 25, - "line": 3, - }, - }, - "range": Array [ - 53, - 56, - ], - "type": "CallExpression", - }, - "delegate": true, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 46, - 56, - ], - "type": "YieldExpression", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 42, - 56, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 36, - 57, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 63, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 23, - 63, - ], - "type": "FunctionExpression", - }, - }, - ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/generators/empty-generator-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, + "column": 14, "line": 1, }, }, "range": Array [ - 8, - 65, + 14, + 16, ], - "type": "ClassBody", + "type": "BlockStatement", }, + "expression": false, + "generator": true, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 11, "line": 1, }, "start": Object { - "column": 6, + "column": 10, "line": 1, }, }, - "name": "C", + "name": "t", "range": Array [ - 6, - 7, + 10, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 65, + 16, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 17, + "line": 1, }, "start": Object { "column": 0, @@ -77056,14 +82273,14 @@ Object { }, "range": Array [ 0, - 66, + 17, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -77073,331 +82290,466 @@ Object { }, "range": Array [ 0, - 5, + 8, ], "type": "Keyword", - "value": "class", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "range": Array [ - 6, - 7, + 8, + 9, ], - "type": "Identifier", - "value": "C", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "t", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 14, - 19, + 11, + 12, ], - "type": "Identifier", - "value": "async", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 20, - 21, + 12, + 13, ], "type": "Punctuator", - "value": "*", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 22, - 23, + 14, + 15, ], - "type": "Identifier", - "value": "f", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 23, - 24, + 15, + 16, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 24, - 25, + 16, + 17, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/generators/generator-declaration.src 1`] = ` +Object { + "body": Array [ Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "delegate": true, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 0, + "line": 1, }, }, + "params": Array [], "range": Array [ - 26, - 27, + 0, + 30, ], - "type": "Punctuator", - "value": "{", + "type": "FunctionDeclaration", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 31, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 30, + "line": 1, }, }, "range": Array [ - 36, - 41, + 30, + 31, ], - "type": "Keyword", - "value": "const", + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 8, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 42, - 43, + 0, + 8, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 9, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 8, + "line": 1, }, }, "range": Array [ - 44, - 45, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 18, - "line": 3, + "column": 10, + "line": 1, }, }, "range": Array [ - 46, - 51, + 10, + 14, ], - "type": "Keyword", - "value": "yield", + "type": "Identifier", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 23, - "line": 3, + "column": 15, + "line": 1, }, }, "range": Array [ - 51, - 52, + 15, + 16, ], "type": "Punctuator", - "value": "*", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 25, - "line": 3, + "column": 16, + "line": 1, }, }, "range": Array [ - 53, - 54, + 16, + 17, ], - "type": "Identifier", - "value": "g", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { - "column": 26, - "line": 3, + "column": 18, + "line": 1, }, }, "range": Array [ - 54, - 55, + 18, + 19, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 25, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { "column": 27, - "line": 3, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, }, }, "range": Array [ - 55, - 56, + 26, + 27, ], "type": "Punctuator", - "value": ")", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 28, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 56, - 57, + 27, + 28, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "v", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 30, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 29, + "line": 1, }, }, "range": Array [ - 62, - 63, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -77405,27 +82757,27 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 31, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 30, + "line": 1, }, }, "range": Array [ - 64, - 65, + 30, + 31, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/generators/double-yield.src 1`] = ` +exports[`javascript fixtures/generators/yield-delegation.src 1`] = ` Object { "body": Array [ Object { @@ -77436,46 +82788,27 @@ Object { Object { "expression": Object { "argument": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 30, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "delegate": false, "loc": Object { "end": Object { - "column": 30, + "column": 24, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, + "name": "v", "range": Array [ - 22, - 30, + 23, + 24, ], - "type": "YieldExpression", + "type": "Identifier", }, - "delegate": false, + "delegate": true, "loc": Object { "end": Object { - "column": 30, + "column": 24, "line": 1, }, "start": Object { @@ -77485,13 +82818,13 @@ Object { }, "range": Array [ 16, - 30, + 24, ], "type": "YieldExpression", }, "loc": Object { "end": Object { - "column": 30, + "column": 24, "line": 1, }, "start": Object { @@ -77501,14 +82834,14 @@ Object { }, "range": Array [ 16, - 30, + 24, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { @@ -77518,7 +82851,7 @@ Object { }, "range": Array [ 14, - 32, + 26, ], "type": "BlockStatement", }, @@ -77527,7 +82860,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { @@ -77538,13 +82871,13 @@ Object { "params": Array [], "range": Array [ 1, - 32, + 26, ], "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { @@ -77554,14 +82887,14 @@ Object { }, "range": Array [ 0, - 34, + 28, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { @@ -77571,7 +82904,7 @@ Object { }, "range": Array [ 0, - 34, + 28, ], "sourceType": "script", "tokens": Array [ @@ -77704,7 +83037,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { @@ -77714,43 +83047,43 @@ Object { }, "range": Array [ 22, - 27, + 23, ], - "type": "Keyword", - "value": "yield", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 24, "line": 1, }, "start": Object { - "column": 28, + "column": 23, "line": 1, }, }, "range": Array [ - 28, - 30, + 23, + 24, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "v", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { - "column": 31, + "column": 25, "line": 1, }, }, "range": Array [ - 31, - 32, + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -77758,17 +83091,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, + "column": 27, "line": 1, }, "start": Object { - "column": 32, + "column": 26, "line": 1, }, }, "range": Array [ - 32, - 33, + 26, + 27, ], "type": "Punctuator", "value": ")", @@ -77776,17 +83109,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 33, + "column": 27, "line": 1, }, }, "range": Array [ - 33, - 34, + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -77796,52 +83129,90 @@ Object { } `; -exports[`javascript fixtures/generators/empty-generator-declaration.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": null, + "delegate": false, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 24, + ], + "type": "BlockStatement", }, - "range": Array [ - 14, - 16, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 11, + "column": 24, "line": 1, }, "start": Object { - "column": 10, + "column": 1, "line": 1, }, }, - "name": "t", + "params": Array [], "range": Array [ - 10, - 11, + 1, + 24, ], - "type": "Identifier", + "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 16, + "column": 26, "line": 1, }, "start": Object { @@ -77849,35 +83220,17 @@ Object { "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 16, - ], - "type": "FunctionDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, + 26, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -77886,14 +83239,14 @@ Object { }, "range": Array [ 0, - 17, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -77903,10 +83256,10 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -77915,34 +83268,34 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 1, "line": 1, }, }, "range": Array [ - 8, + 1, 9, ], - "type": "Punctuator", - "value": "*", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 11, ], - "type": "Identifier", - "value": "t", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { @@ -78001,17 +83354,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 21, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, ], "type": "Punctuator", "value": "}", @@ -78019,17 +83408,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 24, "line": 1, }, }, "range": Array [ - 16, - 17, + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, ], "type": "Punctuator", "value": ";", @@ -78039,102 +83446,123 @@ Object { } `; -exports[`javascript fixtures/generators/generator-declaration.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value-in-call.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "argument": null, + "delegate": false, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "YieldExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "fn", + "range": Array [ + 16, + 18, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 28, + "column": 25, "line": 1, }, "start": Object { - "column": 27, + "column": 16, "line": 1, }, }, - "name": "v", "range": Array [ - 27, - 28, + 16, + 25, ], - "type": "Identifier", + "type": "CallExpression", }, - "delegate": true, "loc": Object { "end": Object { - "column": 28, + "column": 26, "line": 1, }, "start": Object { - "column": 20, + "column": 16, "line": 1, }, }, "range": Array [ - 20, - 28, + 16, + 26, ], - "type": "YieldExpression", + "type": "ExpressionStatement", }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, - "range": Array [ - 20, - 28, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, }, + "range": Array [ + 14, + 28, + ], + "type": "BlockStatement", }, - "range": Array [ - 18, - 30, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 14, + "column": 28, "line": 1, }, "start": Object { - "column": 10, + "column": 1, "line": 1, }, }, - "name": "test", + "params": Array [], "range": Array [ - 10, - 14, + 1, + 28, ], - "type": "Identifier", + "type": "FunctionExpression", }, "loc": Object { "end": Object { @@ -78146,35 +83574,17 @@ Object { "line": 1, }, }, - "params": Array [], "range": Array [ 0, 30, ], - "type": "FunctionDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -78190,7 +83600,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -78200,7 +83610,25 @@ Object { }, "range": Array [ 0, - 8, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, ], "type": "Keyword", "value": "function", @@ -78208,92 +83636,128 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 12, "line": 1, }, }, "range": Array [ - 8, - 9, + 12, + 13, ], "type": "Punctuator", - "value": "*", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, 14, + 15, ], - "type": "Identifier", - "value": "test", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 18, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { - "column": 16, + "column": 18, "line": 1, }, }, "range": Array [ - 16, - 17, + 18, + 19, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 24, "line": 1, }, "start": Object { - "column": 18, + "column": 19, "line": 1, }, }, "range": Array [ - 18, 19, + 24, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "yield", }, Object { "loc": Object { @@ -78302,34 +83766,34 @@ Object { "line": 1, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "range": Array [ - 20, + 24, 25, ], - "type": "Keyword", - "value": "yield", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 26, "line": 1, }, "start": Object { - "column": 26, + "column": 25, "line": 1, }, }, "range": Array [ + 25, 26, - 27, ], "type": "Punctuator", - "value": "*", + "value": ";", }, Object { "loc": Object { @@ -78346,41 +83810,41 @@ Object { 27, 28, ], - "type": "Identifier", - "value": "v", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 29, "line": 1, }, "start": Object { - "column": 29, + "column": 28, "line": 1, }, }, "range": Array [ + 28, 29, - 30, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 30, "line": 1, }, "start": Object { - "column": 30, + "column": 29, "line": 1, }, }, "range": Array [ + 29, 30, - 31, ], "type": "Punctuator", "value": ";", @@ -78390,7 +83854,7 @@ Object { } `; -exports[`javascript fixtures/generators/yield-delegation.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value-no-semi.src 1`] = ` Object { "body": Array [ Object { @@ -78400,28 +83864,11 @@ Object { "body": Array [ Object { "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "v", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "delegate": true, + "argument": null, + "delegate": false, "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 1, }, "start": Object { @@ -78431,13 +83878,13 @@ Object { }, "range": Array [ 16, - 24, + 21, ], "type": "YieldExpression", }, "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 1, }, "start": Object { @@ -78447,14 +83894,14 @@ Object { }, "range": Array [ 16, - 24, + 21, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 26, + "column": 23, "line": 1, }, "start": Object { @@ -78464,7 +83911,7 @@ Object { }, "range": Array [ 14, - 26, + 23, ], "type": "BlockStatement", }, @@ -78473,7 +83920,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 26, + "column": 23, "line": 1, }, "start": Object { @@ -78484,13 +83931,13 @@ Object { "params": Array [], "range": Array [ 1, - 26, + 23, ], "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 28, + "column": 25, "line": 1, }, "start": Object { @@ -78500,15 +83947,15 @@ Object { }, "range": Array [ 0, - 28, + 25, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -78517,7 +83964,7 @@ Object { }, "range": Array [ 0, - 28, + 26, ], "sourceType": "script", "tokens": Array [ @@ -78663,7 +84110,7 @@ Object { 23, ], "type": "Punctuator", - "value": "*", + "value": "}", }, Object { "loc": Object { @@ -78680,59 +84127,23 @@ Object { 23, 24, ], - "type": "Identifier", - "value": "v", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], "type": "Punctuator", "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 25, "line": 1, }, "start": Object { - "column": 27, + "column": 24, "line": 1, }, }, "range": Array [ - 27, - 28, + 24, + 25, ], "type": "Punctuator", "value": ";", @@ -78742,90 +84153,31 @@ Object { } `; -exports[`javascript fixtures/generators/yield-without-value.src 1`] = ` +exports[`javascript fixtures/globalReturn/return-identifier.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": null, - "delegate": false, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 21, - ], - "type": "YieldExpression", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 22, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 24, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": null, + "argument": Object { "loc": Object { "end": Object { - "column": 24, + "column": 11, "line": 1, }, "start": Object { - "column": 1, + "column": 7, "line": 1, }, }, - "params": Array [], + "name": "fooz", "range": Array [ - 1, - 24, + 7, + 11, ], - "type": "FunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 26, + "column": 12, "line": 1, }, "start": Object { @@ -78835,9 +84187,9 @@ Object { }, "range": Array [ 0, - 26, + 12, ], - "type": "ExpressionStatement", + "type": "ReturnStatement", }, ], "loc": Object { @@ -78852,14 +84204,14 @@ Object { }, "range": Array [ 0, - 27, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 6, "line": 1, }, "start": Object { @@ -78869,46 +84221,28 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 9, + 6, ], "type": "Keyword", - "value": "function", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 10, + 7, + 11, ], - "type": "Punctuator", - "value": "*", + "type": "Identifier", + "value": "fooz", }, Object { "loc": Object { @@ -78926,130 +84260,198 @@ Object { 12, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/globalReturn/return-no-arg.src 1`] = ` +Object { + "body": Array [ Object { + "argument": null, "loc": Object { "end": Object { - "column": 13, + "column": 7, "line": 1, }, "start": Object { - "column": 12, + "column": 0, "line": 1, }, }, "range": Array [ - 12, - 13, + 0, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 8, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 15, + "column": 6, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 6, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 7, "line": 1, }, "start": Object { - "column": 16, + "column": 6, "line": 1, }, }, "range": Array [ - 16, - 21, + 6, + 7, ], - "type": "Keyword", - "value": "yield", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/globalReturn/return-true.src 1`] = ` +Object { + "body": Array [ Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 21, + "column": 0, "line": 1, }, }, "range": Array [ - 21, - 22, + 0, + 12, ], - "type": "Punctuator", - "value": ";", + "type": "ReturnStatement", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 24, + "column": 6, "line": 1, }, "start": Object { - "column": 23, + "column": 0, "line": 1, }, }, "range": Array [ - 23, - 24, + 0, + 6, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 11, "line": 1, }, "start": Object { - "column": 24, + "column": 7, "line": 1, }, }, "range": Array [ - 24, - 25, + 7, + 11, ], - "type": "Punctuator", - "value": ")", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 12, "line": 1, }, "start": Object { - "column": 25, + "column": 11, "line": 1, }, }, "range": Array [ - 25, - 26, + 11, + 12, ], "type": "Punctuator", "value": ";", @@ -79059,127 +84461,102 @@ Object { } `; -exports[`javascript fixtures/generators/yield-without-value-in-call.src 1`] = ` +exports[`javascript fixtures/importMeta/simple-import-meta.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "argument": null, - "delegate": false, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 24, - ], - "type": "YieldExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "fn", - "range": Array [ - 16, - 18, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 25, - ], - "type": "CallExpression", + "computed": false, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "import", + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, - "range": Array [ - 16, - 26, - ], - "type": "ExpressionStatement", }, + "name": "meta", + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 11, ], + "type": "MetaProperty", + }, + "property": Object { "loc": Object { "end": Object { - "column": 28, + "column": 15, "line": 1, }, "start": Object { - "column": 14, + "column": 12, "line": 1, }, }, + "name": "url", "range": Array [ - 14, - 28, + 12, + 15, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": null, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, + "type": "Identifier", }, - "params": Array [], "range": Array [ - 1, - 28, + 0, + 15, ], - "type": "FunctionExpression", + "type": "MemberExpression", }, "loc": Object { "end": Object { - "column": 30, + "column": 16, "line": 1, }, "start": Object { @@ -79189,7 +84566,7 @@ Object { }, "range": Array [ 0, - 30, + 16, ], "type": "ExpressionStatement", }, @@ -79206,14 +84583,14 @@ Object { }, "range": Array [ 0, - 31, + 17, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 6, "line": 1, }, "start": Object { @@ -79223,46 +84600,46 @@ Object { }, "range": Array [ 0, - 1, + 6, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 9, + 6, + 7, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 10, + 7, + 11, ], - "type": "Punctuator", - "value": "*", + "type": "Identifier", + "value": "meta", }, Object { "loc": Object { @@ -79280,12 +84657,12 @@ Object { 12, ], "type": "Punctuator", - "value": "(", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { @@ -79295,29 +84672,37 @@ Object { }, "range": Array [ 12, - 13, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "url", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, + 16, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/error-delete.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { @@ -79325,139 +84710,283 @@ Object { "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, + 0, 18, ], - "type": "Identifier", - "value": "fn", + "source": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "raw": "\\"x\\"", + "type": "Literal", + "value": "x", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 8, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", }, Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "delete", + "prefix": true, + "range": Array [ + 19, + 27, + ], + "type": "UnaryExpression", + }, "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 18, 19, + 28, ], - "type": "Punctuator", - "value": "(", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 24, + "column": 6, "line": 1, }, "start": Object { - "column": 19, + "column": 0, "line": 1, }, }, "range": Array [ - 19, - 24, + 0, + 6, ], "type": "Keyword", - "value": "yield", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 8, "line": 1, }, "start": Object { - "column": 24, + "column": 7, "line": 1, }, }, "range": Array [ - 24, - 25, + 7, + 8, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 13, "line": 1, }, "start": Object { - "column": 25, + "column": 9, "line": 1, }, }, "range": Array [ - 25, - 26, + 9, + 13, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 17, "line": 1, }, "start": Object { - "column": 27, + "column": 14, "line": 1, }, }, "range": Array [ - 27, - 28, + 14, + 17, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"x\\"", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 18, "line": 1, }, "start": Object { - "column": 28, + "column": 17, "line": 1, }, }, "range": Array [ - 28, - 29, + 17, + 18, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 29, - 30, + 19, + 25, + ], + "type": "Keyword", + "value": "delete", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -79467,108 +84996,107 @@ Object { } `; -exports[`javascript fixtures/generators/yield-without-value-no-semi.src 1`] = ` +exports[`javascript fixtures/modules/error-function.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": null, - "delegate": false, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 21, - ], - "type": "YieldExpression", - }, + "async": false, + "body": Object { + "body": Array [ + Object { + "declaration": Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { "column": 16, - "line": 1, + "line": 2, }, }, + "name": "friends", "range": Array [ - 16, - 21, + 31, + 38, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, + "type": "Identifier", }, - "start": Object { - "column": 14, - "line": 1, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, }, + "range": Array [ + 16, + 39, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, }, - "range": Array [ - 14, - 23, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": true, - "id": null, + "range": Array [ + 13, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 23, + "column": 10, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, - "params": Array [], + "name": "x", "range": Array [ - 1, - 23, + 9, + 10, ], - "type": "FunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 25, + 41, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -79577,14 +85105,14 @@ Object { }, "range": Array [ 0, - 26, + 43, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -79594,46 +85122,46 @@ Object { }, "range": Array [ 0, - 1, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, "range": Array [ - 1, 9, + 10, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", - "value": "*", + "value": "(", }, Object { "loc": Object { @@ -79651,164 +85179,364 @@ Object { 12, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 2, }, }, "range": Array [ - 14, - 15, + 16, + 22, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 16, - 21, + 23, + 30, ], "type": "Keyword", - "value": "yield", + "value": "default", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 1, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 22, - 23, + 31, + 38, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "friends", }, Object { "loc": Object { "end": Object { "column": 24, - "line": 1, + "line": 2, }, "start": Object { "column": 23, - "line": 1, + "line": 2, }, }, "range": Array [ - 23, - 24, + 38, + 39, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 24, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 24, - 25, + 40, + 41, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/globalReturn/return-identifier.src 1`] = ` +exports[`javascript fixtures/modules/error-strict.src 1`] = ` Object { "body": Array [ Object { - "argument": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "source": Object { "loc": Object { "end": Object { - "column": 11, + "column": 25, "line": 1, }, "start": Object { - "column": 7, + "column": 18, "line": 1, }, }, - "name": "fooz", "range": Array [ - 7, - 11, + 18, + 25, ], - "type": "Identifier", + "raw": "\\"house\\"", + "type": "Literal", + "value": "house", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "house", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 12, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + Object { + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "name": "roof", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "name": "console", + "range": Array [ + 44, + 51, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "log", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", + }, + "range": Array [ + 44, + 55, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 44, + 61, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 44, + 62, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 41, + 64, + ], + "type": "BlockStatement", }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, - "line": 1, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, }, + "name": "house", + "range": Array [ + 34, + 39, + ], + "type": "Identifier", }, "range": Array [ - 0, - 12, + 28, + 64, ], - "type": "ReturnStatement", + "type": "WithStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 6, }, "start": Object { "column": 0, @@ -79817,9 +85545,9 @@ Object { }, "range": Array [ 0, - 13, + 65, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { @@ -79837,12 +85565,12 @@ Object { 6, ], "type": "Keyword", - "value": "return", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 12, "line": 1, }, "start": Object { @@ -79852,324 +85580,329 @@ Object { }, "range": Array [ 7, - 11, + 12, ], "type": "Identifier", - "value": "fooz", + "value": "house", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 17, "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "range": Array [ - 11, - 12, + 13, + 17, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 25, + ], + "type": "String", + "value": "\\"house\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, ], "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/globalReturn/return-no-arg.src 1`] = ` -Object { - "body": Array [ Object { - "argument": null, "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 4, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "Keyword", + "value": "with", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 34, + 39, + ], + "type": "Identifier", + "value": "house", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 44, + 51, + ], + "type": "Identifier", + "value": "console", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 4, }, }, "range": Array [ - 0, - 7, + 51, + 52, ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ".", }, - }, - "range": Array [ - 0, - 8, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 4, }, }, "range": Array [ - 0, - 6, + 52, + 55, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "log", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 13, + "line": 4, }, "start": Object { - "column": 6, - "line": 1, + "column": 12, + "line": 4, }, }, "range": Array [ - 6, - 7, + 55, + 56, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/globalReturn/return-true.src 1`] = ` -Object { - "body": Array [ Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 11, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 13, + "line": 4, }, }, "range": Array [ - 0, - 12, + 56, + 60, ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "roof", }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 0, - 6, + 60, + 61, ], - "type": "Keyword", - "value": "return", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 7, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 7, - 11, + 61, + 62, ], - "type": "Boolean", - "value": "true", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 11, - 12, + 63, + 64, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/importMeta/simple-import-meta.src 1`] = ` +exports[`javascript fixtures/modules/export-default-array.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "computed": false, + "declaration": Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, - "object": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "meta": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "import", - "range": Array [ - 0, - 6, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "meta", - "range": Array [ - 7, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 0, - 11, - ], - "type": "MetaProperty", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "url", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, "range": Array [ - 0, 15, + 17, ], - "type": "MemberExpression", + "type": "ArrayExpression", }, "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { @@ -80179,9 +85912,9 @@ Object { }, "range": Array [ 0, - 16, + 18, ], - "type": "ExpressionStatement", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { @@ -80196,7 +85929,7 @@ Object { }, "range": Array [ 0, - 17, + 19, ], "sourceType": "module", "tokens": Array [ @@ -80216,30 +85949,12 @@ Object { 6, ], "type": "Keyword", - "value": "import", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": ".", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { @@ -80249,61 +85964,61 @@ Object { }, "range": Array [ 7, - 11, + 14, ], - "type": "Identifier", - "value": "meta", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, - 12, + 15, + 16, ], "type": "Punctuator", - "value": ".", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 15, + 16, + 17, ], - "type": "Identifier", - "value": "url", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 16, + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -80313,141 +86028,68 @@ Object { } `; -exports[`javascript fixtures/modules/error-delete.src 1`] = ` +exports[`javascript fixtures/modules/export-default-class.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 18, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 17, - ], - "raw": "\\"x\\"", - "type": "Literal", - "value": "x", - }, - "specifiers": Array [ - Object { + "declaration": Object { + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 7, + "column": 21, "line": 1, }, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "range": Array [ - 7, - 8, - ], - "type": "ImportDefaultSpecifier", - }, - ], - "type": "ImportDeclaration", - }, - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "name": "x", "range": Array [ - 26, - 27, + 21, + 25, ], - "type": "Identifier", + "type": "ClassBody", }, + "id": null, "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 1, }, }, - "operator": "delete", - "prefix": true, "range": Array [ - 19, - 27, + 15, + 25, ], - "type": "UnaryExpression", + "superClass": null, + "type": "ClassDeclaration", }, "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 19, - 28, + 0, + 25, ], - "type": "ExpressionStatement", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -80456,7 +86098,7 @@ Object { }, "range": Array [ 0, - 29, + 26, ], "sourceType": "module", "tokens": Array [ @@ -80476,12 +86118,12 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 1, }, "start": Object { @@ -80491,225 +86133,151 @@ Object { }, "range": Array [ 7, - 8, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 13, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ 14, - 17, - ], - "type": "String", - "value": "\\"x\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ";", + ], + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 19, - 25, + 15, + 20, ], "type": "Keyword", - "value": "delete", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 26, - 27, + 21, + 22, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 27, - 28, + 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/error-function.src 1`] = ` +exports[`javascript fixtures/modules/export-default-expression.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "declaration": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "friends", - "range": Array [ - 31, - 38, - ], - "type": "Identifier", + "declaration": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 1, - "line": 2, - }, + "start": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 16, - 39, - ], - "type": "ExportDefaultDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 1, }, + "range": Array [ + 16, + 17, + ], + "raw": "1", + "type": "Literal", + "value": 1, }, - "range": Array [ - 13, - 41, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 21, "line": 1, }, "start": Object { - "column": 9, + "column": 16, "line": 1, }, }, - "name": "x", + "operator": "+", "range": Array [ - 9, - 10, + 16, + 21, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "BinaryExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 41, + 23, ], - "type": "FunctionDeclaration", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 2, }, "start": Object { "column": 0, @@ -80718,14 +86286,14 @@ Object { }, "range": Array [ 0, - 43, + 24, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -80735,43 +86303,43 @@ Object { }, "range": Array [ 0, - 8, + 6, ], "type": "Keyword", - "value": "function", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 10, + 7, + 14, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 15, "line": 1, }, }, "range": Array [ - 10, - 11, + 15, + 16, ], "type": "Punctuator", "value": "(", @@ -80779,377 +86347,163 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 17, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 17, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 19, "line": 1, }, "start": Object { - "column": 13, + "column": 18, "line": 1, }, }, "range": Array [ - 13, - 14, + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 1, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 16, - 22, + 20, + 21, ], - "type": "Keyword", - "value": "export", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 23, - 30, + 21, + 22, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 31, - 38, - ], - "type": "Identifier", - "value": "friends", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 38, - 39, + 22, + 23, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/error-strict.src 1`] = ` +exports[`javascript fixtures/modules/export-default-function.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 25, - ], - "raw": "\\"house\\"", - "type": "Literal", - "value": "house", - }, - "specifiers": Array [ - Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 1, }, "start": Object { - "column": 7, + "column": 27, "line": 1, }, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "house", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, "range": Array [ - 7, - 12, + 27, + 29, ], - "type": "ImportDefaultSpecifier", + "type": "BlockStatement", }, - ], - "type": "ImportDeclaration", - }, - Object { - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "name": "roof", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "name": "console", - "range": Array [ - 44, - 51, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "name": "log", - "range": Array [ - 52, - 55, - ], - "type": "Identifier", - }, - "range": Array [ - 44, - 55, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 44, - 61, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 44, - 62, - ], - "type": "ExpressionStatement", - }, - ], + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 29, + "line": 1, }, "start": Object { - "column": 13, - "line": 3, + "column": 15, + "line": 1, }, }, + "params": Array [], "range": Array [ - 41, - 64, + 15, + 29, ], - "type": "BlockStatement", + "type": "FunctionDeclaration", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 3, + "column": 29, + "line": 1, }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, + "start": Object { + "column": 0, + "line": 1, }, - "name": "house", - "range": Array [ - 34, - 39, - ], - "type": "Identifier", }, "range": Array [ - 28, - 64, + 0, + 29, ], - "type": "WithStatement", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -81158,7 +86512,7 @@ Object { }, "range": Array [ 0, - 65, + 30, ], "sourceType": "module", "tokens": Array [ @@ -81178,12 +86532,12 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { @@ -81193,28 +86547,28 @@ Object { }, "range": Array [ 7, - 12, + 14, ], - "type": "Identifier", - "value": "house", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 17, + 15, + 23, ], - "type": "Identifier", - "value": "from", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -81223,16 +86577,16 @@ Object { "line": 1, }, "start": Object { - "column": 18, + "column": 24, "line": 1, }, }, "range": Array [ - 18, + 24, 25, ], - "type": "String", - "value": "\\"house\\"", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -81250,238 +86604,244 @@ Object { 26, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ + 27, 28, - 32, ], - "type": "Keyword", - "value": "with", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 29, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 28, + "line": 1, }, }, "range": Array [ - 33, - 34, + 28, + 29, ], "type": "Punctuator", - "value": "(", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-default-named-class.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "ClassBody", }, - }, - "range": Array [ - 34, - 39, - ], - "type": "Identifier", - "value": "house", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 21, + 25, + ], + "type": "Identifier", }, - "start": Object { - "column": 11, - "line": 3, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, }, + "range": Array [ + 15, + 30, + ], + "superClass": null, + "type": "ClassDeclaration", }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": ")", - }, - Object { "loc": Object { "end": Object { - "column": 14, + "column": 1, "line": 3, }, "start": Object { - "column": 13, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 41, - 42, + 0, + 30, ], - "type": "Punctuator", - "value": "{", + "type": "ExportDefaultDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 44, - 51, - ], - "type": "Identifier", - "value": "console", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 51, - 52, - ], - "type": "Punctuator", - "value": ".", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { - "column": 9, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 52, - 55, + 0, + 6, ], - "type": "Identifier", - "value": "log", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 14, + "line": 1, }, "start": Object { - "column": 12, - "line": 4, + "column": 7, + "line": 1, }, }, "range": Array [ - 55, - 56, + 7, + 14, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 20, + "line": 1, }, "start": Object { - "column": 13, - "line": 4, + "column": 15, + "line": 1, }, }, "range": Array [ - 56, - 60, + 15, + 20, ], - "type": "Identifier", - "value": "roof", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 25, + "line": 1, }, "start": Object { - "column": 17, - "line": 4, + "column": 21, + "line": 1, }, }, "range": Array [ - 60, - 61, + 21, + 25, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 27, + "line": 1, }, "start": Object { - "column": 18, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 61, - 62, + 26, + 27, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 63, - 64, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -81491,15 +86851,53 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-array.src 1`] = ` +exports[`javascript fixtures/modules/export-default-named-function.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "elements": Array [], + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, + "column": 32, "line": 1, }, "start": Object { @@ -81507,15 +86905,16 @@ Object { "line": 1, }, }, + "params": Array [], "range": Array [ 15, - 17, + 32, ], - "type": "ArrayExpression", + "type": "FunctionDeclaration", }, "loc": Object { "end": Object { - "column": 18, + "column": 32, "line": 1, }, "start": Object { @@ -81525,7 +86924,7 @@ Object { }, "range": Array [ 0, - 18, + 32, ], "type": "ExportDefaultDeclaration", }, @@ -81542,7 +86941,7 @@ Object { }, "range": Array [ 0, - 19, + 33, ], "sourceType": "module", "tokens": Array [ @@ -81585,7 +86984,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { @@ -81595,80 +86994,115 @@ Object { }, "range": Array [ 15, - 16, + 23, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 29, "line": 1, }, "start": Object { - "column": 16, + "column": 28, "line": 1, }, }, "range": Array [ - 16, - 17, + 28, + 29, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 31, "line": 1, }, "start": Object { - "column": 17, + "column": 30, "line": 1, }, }, "range": Array [ - 17, - 18, + 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-default-class.src 1`] = ` +exports[`javascript fixtures/modules/export-default-number.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 25, - ], - "type": "ClassBody", - }, - "id": null, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { "column": 15, @@ -81677,15 +87111,16 @@ Object { }, "range": Array [ 15, - 25, + 17, ], - "superClass": null, - "type": "ClassDeclaration", + "raw": "42", + "type": "Literal", + "value": 42, }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { "column": 0, @@ -81694,7 +87129,7 @@ Object { }, "range": Array [ 0, - 25, + 18, ], "type": "ExportDefaultDeclaration", }, @@ -81702,7 +87137,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -81711,7 +87146,7 @@ Object { }, "range": Array [ 0, - 26, + 19, ], "sourceType": "module", "tokens": Array [ @@ -81749,130 +87184,133 @@ Object { 14, ], "type": "Keyword", - "value": "default", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 20, - ], - "type": "Keyword", - "value": "class", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 17, "line": 1, }, "start": Object { - "column": 21, + "column": 15, "line": 1, }, }, "range": Array [ - 21, - 22, + 15, + 17, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 24, - 25, + 17, + 18, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-default-expression.src 1`] = ` +exports[`javascript fixtures/modules/export-default-object.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, - "operator": "+", - "range": Array [ - 16, - 21, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", }, - "start": Object { - "column": 20, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "1", + "type": "Literal", + "value": 1, }, }, - "range": Array [ - 20, - 21, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "type": "BinaryExpression", + ], + "range": Array [ + 15, + 25, + ], + "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 23, + "column": 26, "line": 1, }, "start": Object { @@ -81882,7 +87320,7 @@ Object { }, "range": Array [ 0, - 23, + 26, ], "type": "ExportDefaultDeclaration", }, @@ -81899,7 +87337,7 @@ Object { }, "range": Array [ 0, - 24, + 27, ], "sourceType": "module", "tokens": Array [ @@ -81955,94 +87393,94 @@ Object { 16, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 20, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 21, "line": 1, }, "start": Object { - "column": 18, + "column": 20, "line": 1, }, }, "range": Array [ - 18, - 19, + 20, + 21, ], "type": "Punctuator", - "value": "+", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 20, + "column": 22, "line": 1, }, }, "range": Array [ - 20, - 21, + 22, + 23, ], "type": "Numeric", - "value": "2", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 21, + "column": 24, "line": 1, }, }, "range": Array [ - 21, - 22, + 24, + 25, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 26, "line": 1, }, "start": Object { - "column": 22, + "column": 25, "line": 1, }, }, "range": Array [ - 22, - 23, + 25, + 26, ], "type": "Punctuator", "value": ";", @@ -82052,36 +87490,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-function.src 1`] = ` +exports[`javascript fixtures/modules/export-default-value.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 29, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 29, + "column": 18, "line": 1, }, "start": Object { @@ -82089,16 +87505,16 @@ Object { "line": 1, }, }, - "params": Array [], + "name": "foo", "range": Array [ 15, - 29, + 18, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 29, + "column": 19, "line": 1, }, "start": Object { @@ -82108,7 +87524,7 @@ Object { }, "range": Array [ 0, - 29, + 19, ], "type": "ExportDefaultDeclaration", }, @@ -82125,7 +87541,7 @@ Object { }, "range": Array [ 0, - 30, + 20, ], "sourceType": "module", "tokens": Array [ @@ -82168,7 +87584,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { @@ -82178,167 +87594,78 @@ Object { }, "range": Array [ 15, - 23, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, + 18, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 19, "line": 1, }, "start": Object { - "column": 27, + "column": 18, "line": 1, }, }, "range": Array [ - 27, - 28, + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-from-batch.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { - "column": 28, + "column": 0, "line": 1, }, }, "range": Array [ - 28, - 29, + 0, + 20, ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-default-named-class.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 30, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Test", - "range": Array [ - 21, - 25, - ], - "type": "Identifier", - }, + "source": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ - 15, - 30, + 14, + 19, ], - "superClass": null, - "type": "ClassDeclaration", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", }, - "range": Array [ - 0, - 30, - ], - "type": "ExportDefaultDeclaration", + "type": "ExportAllDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -82347,7 +87674,7 @@ Object { }, "range": Array [ 0, - 31, + 21, ], "sourceType": "module", "tokens": Array [ @@ -82372,7 +87699,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -82382,164 +87709,164 @@ Object { }, "range": Array [ 7, - 14, + 8, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 13, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 20, + 9, + 13, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 19, "line": 1, }, "start": Object { - "column": 21, + "column": 14, "line": 1, }, }, "range": Array [ - 21, - 25, + 14, + 19, ], - "type": "Identifier", - "value": "Test", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 20, "line": 1, }, "start": Object { - "column": 26, + "column": 19, "line": 1, }, }, "range": Array [ - 26, - 27, + 19, + 20, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-from-default.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 29, - 30, + 0, + 28, ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-default-named-function.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, + "source": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, }, - "range": Array [ - 30, - 32, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": Object { + "range": Array [ + 22, + 27, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 27, + "column": 15, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, - "name": "foo", + "local": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, "range": Array [ - 24, - 27, + 8, + 15, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 15, - 32, - ], - "type": "FunctionDeclaration", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 32, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -82554,7 +87881,7 @@ Object { }, "range": Array [ 0, - 33, + 29, ], "sourceType": "module", "tokens": Array [ @@ -82579,7 +87906,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -82589,162 +87916,200 @@ Object { }, "range": Array [ 7, - 14, + 8, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 15, - 23, ], "type": "Keyword", - "value": "function", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 16, "line": 1, }, "start": Object { - "column": 24, + "column": 15, "line": 1, }, }, "range": Array [ - 24, - 27, + 15, + 16, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 21, "line": 1, }, "start": Object { - "column": 27, + "column": 17, "line": 1, }, }, "range": Array [ - 27, - 28, + 17, + 21, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 27, "line": 1, }, "start": Object { - "column": 28, + "column": 22, "line": 1, }, }, "range": Array [ - 28, - 29, + 22, + 27, ], - "type": "Punctuator", - "value": ")", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 28, "line": 1, }, "start": Object { - "column": 30, + "column": 27, "line": 1, }, }, "range": Array [ - 30, - 31, + 27, + 28, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-from-named-as-default.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 32, + "column": 35, "line": 1, }, "start": Object { - "column": 31, + "column": 0, "line": 1, }, }, "range": Array [ - 31, - 32, + 0, + 35, ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-default-number.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { + "source": Object { "loc": Object { "end": Object { - "column": 17, + "column": 34, "line": 1, }, "start": Object { - "column": 15, + "column": 29, "line": 1, }, }, "range": Array [ - 15, - 17, + 29, + 34, ], - "raw": "42", + "raw": "\\"foo\\"", "type": "Literal", - "value": 42, + "value": "foo", }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 18, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -82759,7 +88124,7 @@ Object { }, "range": Array [ 0, - 19, + 36, ], "sourceType": "module", "tokens": Array [ @@ -82784,7 +88149,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -82794,15 +88159,51 @@ Object { }, "range": Array [ 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, 14, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 22, "line": 1, }, "start": Object { @@ -82812,25 +88213,79 @@ Object { }, "range": Array [ 15, - 17, + 22, ], - "type": "Numeric", - "value": "42", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 1, }, "start": Object { - "column": 17, + "column": 22, "line": 1, }, }, "range": Array [ - 17, - 18, + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", "value": ";", @@ -82840,102 +88295,100 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-object.src 1`] = ` +exports[`javascript fixtures/modules/export-from-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "source": Object { "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { - "column": 15, + "column": 25, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "kind": "init", + "range": Array [ + 25, + 30, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, - "method": false, + "name": "bar", "range": Array [ - 17, - 23, + 15, + 18, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 22, - 23, - ], - "raw": "1", - "type": "Literal", - "value": 1, }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", }, - ], - "range": Array [ - 15, - 25, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 8, + 18, + ], + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 26, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -82950,7 +88403,7 @@ Object { }, "range": Array [ 0, - 27, + 32, ], "sourceType": "module", "tokens": Array [ @@ -82966,134 +88419,152 @@ Object { }, }, "range": Array [ - 0, - 6, + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, - 14, + 8, + 11, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, "range": Array [ - 15, - 16, + 12, + 14, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, "range": Array [ - 17, - 20, + 15, + 18, ], "type": "Identifier", - "value": "foo", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 20, + "column": 18, "line": 1, }, }, "range": Array [ - 20, - 21, + 18, + 19, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 1, }, "start": Object { - "column": 22, + "column": 20, "line": 1, }, }, "range": Array [ - 22, - 23, + 20, + 24, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { - "column": 24, + "column": 25, "line": 1, }, }, "range": Array [ - 24, 25, + 30, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 31, "line": 1, }, "start": Object { - "column": 25, + "column": 30, "line": 1, }, }, "range": Array [ - 25, - 26, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -83103,43 +88574,153 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-value.src 1`] = ` +exports[`javascript fixtures/modules/export-from-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "source": Object { "loc": Object { "end": Object { - "column": 18, + "column": 39, "line": 1, }, "start": Object { - "column": 15, + "column": 34, "line": 1, }, }, - "name": "foo", "range": Array [ - 15, - 18, + 34, + 39, ], - "type": "Identifier", + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "range": Array [ + 24, + 27, + ], + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 19, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -83154,7 +88735,7 @@ Object { }, "range": Array [ 0, - 20, + 41, ], "sourceType": "module", "tokens": Array [ @@ -83179,7 +88760,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -83189,25 +88770,25 @@ Object { }, "range": Array [ 7, - 14, + 8, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, "range": Array [ - 15, - 18, + 8, + 11, ], "type": "Identifier", "value": "foo", @@ -83215,132 +88796,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 14, "line": 1, }, "start": Object { - "column": 18, + "column": 12, "line": 1, }, }, "range": Array [ - 18, - 19, + 12, + 14, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "as", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-from-batch.src 1`] = ` -Object { - "body": Array [ Object { "loc": Object { "end": Object { - "column": 20, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, "range": Array [ - 0, - 20, + 15, + 22, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, }, - "range": Array [ - 14, - 19, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", }, - "type": "ExportAllDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 27, "line": 1, }, "start": Object { - "column": 0, + "column": 24, "line": 1, }, }, "range": Array [ - 0, - 6, + 24, + 27, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 28, "line": 1, }, "start": Object { - "column": 7, + "column": 27, "line": 1, }, }, "range": Array [ - 7, - 8, + 27, + 28, ], "type": "Punctuator", - "value": "*", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 33, "line": 1, }, "start": Object { - "column": 9, + "column": 29, "line": 1, }, }, "range": Array [ - 9, - 13, + 29, + 33, ], "type": "Identifier", "value": "from", @@ -83348,17 +88904,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 39, "line": 1, }, "start": Object { - "column": 14, + "column": 34, "line": 1, }, }, "range": Array [ - 14, - 19, + 34, + 39, ], "type": "String", "value": "\\"foo\\"", @@ -83366,17 +88922,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 40, "line": 1, }, "start": Object { - "column": 19, + "column": 39, "line": 1, }, }, "range": Array [ - 19, - 20, + 39, + 40, ], "type": "Punctuator", "value": ";", @@ -83386,14 +88942,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-default.src 1`] = ` +exports[`javascript fixtures/modules/export-from-specifier.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { @@ -83403,22 +88959,22 @@ Object { }, "range": Array [ 0, - 28, + 24, ], "source": Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 22, + "column": 18, "line": 1, }, }, "range": Array [ - 22, - 27, + 18, + 23, ], "raw": "\\"foo\\"", "type": "Literal", @@ -83429,7 +88985,7 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -83437,16 +88993,16 @@ Object { "line": 1, }, }, - "name": "default", + "name": "foo", "range": Array [ 8, - 15, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -83457,7 +89013,7 @@ Object { "local": Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -83465,16 +89021,16 @@ Object { "line": 1, }, }, - "name": "default", + "name": "foo", "range": Array [ 8, - 15, + 11, ], "type": "Identifier", }, "range": Array [ 8, - 15, + 11, ], "type": "ExportSpecifier", }, @@ -83494,7 +89050,7 @@ Object { }, "range": Array [ 0, - 29, + 25, ], "sourceType": "module", "tokens": Array [ @@ -83537,7 +89093,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -83547,25 +89103,25 @@ Object { }, "range": Array [ 8, - 15, + 11, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 12, "line": 1, }, "start": Object { - "column": 15, + "column": 11, "line": 1, }, }, "range": Array [ - 15, - 16, + 11, + 12, ], "type": "Punctuator", "value": "}", @@ -83573,17 +89129,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 17, "line": 1, }, "start": Object { - "column": 17, + "column": 13, "line": 1, }, }, "range": Array [ + 13, 17, - 21, ], "type": "Identifier", "value": "from", @@ -83591,17 +89147,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 22, + "column": 18, "line": 1, }, }, "range": Array [ - 22, - 27, + 18, + 23, ], "type": "String", "value": "\\"foo\\"", @@ -83609,17 +89165,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { - "column": 27, + "column": 23, "line": 1, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -83629,14 +89185,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-named-as-default.src 1`] = ` +exports[`javascript fixtures/modules/export-from-specifiers.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { @@ -83646,78 +89202,131 @@ Object { }, "range": Array [ 0, - 35, + 29, ], "source": Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, - "range": Array [ - 29, - 34, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, - "specifiers": Array [ + "range": Array [ + 23, + 28, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, Object { "exported": Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, - "name": "default", + "name": "bar", "range": Array [ - 15, - 22, + 13, + 16, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 8, - 11, + 13, + 16, ], "type": "Identifier", }, "range": Array [ - 8, - 22, + 13, + 16, ], "type": "ExportSpecifier", }, @@ -83737,7 +89346,7 @@ Object { }, "range": Array [ 0, - 36, + 30, ], "sourceType": "module", "tokens": Array [ @@ -83798,53 +89407,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 14, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 22, + 13, + 16, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, ], "type": "Punctuator", "value": "}", @@ -83852,17 +89461,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 22, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "range": Array [ - 24, - 28, + 18, + 22, ], "type": "Identifier", "value": "from", @@ -83870,17 +89479,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 34, + 23, + 28, ], "type": "String", "value": "\\"foo\\"", @@ -83888,17 +89497,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { - "column": 34, + "column": 28, "line": 1, }, }, "range": Array [ - 34, - 35, + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -83908,99 +89517,83 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-function.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 0, - "line": 1, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", }, - }, - "range": Array [ - 0, - 31, - ], - "source": Object { "loc": Object { "end": Object { - "column": 30, + "column": 25, "line": 1, }, "start": Object { - "column": 25, + "column": 7, "line": 1, }, }, + "params": Array [], "range": Array [ + 7, 25, - 30, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "type": "FunctionDeclaration", }, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 18, - ], - "type": "ExportSpecifier", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 25, ], + "source": null, + "specifiers": Array [], "type": "ExportNamedDeclaration", }, ], @@ -84016,7 +89609,7 @@ Object { }, "range": Array [ 0, - 32, + 26, ], "sourceType": "module", "tokens": Array [ @@ -84041,7 +89634,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 1, }, "start": Object { @@ -84051,25 +89644,25 @@ Object { }, "range": Array [ 7, - 8, + 15, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 19, "line": 1, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, "range": Array [ - 8, - 11, + 16, + 19, ], "type": "Identifier", "value": "foo", @@ -84077,56 +89670,38 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 14, - ], - "type": "Identifier", - "value": "as", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, + "column": 21, "line": 1, }, "start": Object { - "column": 15, + "column": 20, "line": 1, }, }, "range": Array [ - 15, - 18, + 20, + 21, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 22, "line": 1, }, "start": Object { - "column": 18, + "column": 21, "line": 1, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { @@ -84135,66 +89710,48 @@ Object { "line": 1, }, "start": Object { - "column": 20, + "column": 23, "line": 1, }, }, "range": Array [ - 20, + 23, 24, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { "column": 25, "line": 1, }, - }, - "range": Array [ - 25, - 30, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, "start": Object { - "column": 30, + "column": 24, "line": 1, }, }, "range": Array [ - 30, - 31, + 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-from-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-default.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 40, + "column": 24, "line": 1, }, "start": Object { @@ -84204,27 +89761,9 @@ Object { }, "range": Array [ 0, - 40, + 24, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 39, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, + "source": null, "specifiers": Array [ Object { "exported": Object { @@ -84279,59 +89818,6 @@ Object { ], "type": "ExportSpecifier", }, - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "range": Array [ - 24, - 27, - ], - "type": "ExportSpecifier", - }, ], "type": "ExportNamedDeclaration", }, @@ -84348,7 +89834,7 @@ Object { }, "range": Array [ 0, - 41, + 25, ], "sourceType": "module", "tokens": Array [ @@ -84458,94 +89944,22 @@ Object { 23, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", "value": "}", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 33, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 39, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, + "column": 24, "line": 1, }, "start": Object { - "column": 39, + "column": 23, "line": 1, }, }, "range": Array [ - 39, - 40, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -84555,67 +89969,49 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 24, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, + "declaration": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "range": Array [ - 18, - 23, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", }, + "range": Array [ + 0, + 20, + ], + "source": null, "specifiers": Array [ Object { "exported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 18, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 8, - 11, + 15, + 18, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 11, + "column": 18, "line": 1, }, "start": Object { @@ -84643,7 +90039,7 @@ Object { }, "range": Array [ 8, - 11, + 18, ], "type": "ExportSpecifier", }, @@ -84663,7 +90059,7 @@ Object { }, "range": Array [ 0, - 25, + 21, ], "sourceType": "module", "tokens": Array [ @@ -84724,43 +90120,43 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 17, + 15, + 18, ], "type": "Identifier", - "value": "from", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 19, "line": 1, }, "start": Object { @@ -84770,25 +90166,25 @@ Object { }, "range": Array [ 18, - 23, + 19, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 20, "line": 1, }, "start": Object { - "column": 23, + "column": 19, "line": 1, }, }, "range": Array [ - 23, - 24, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -84798,7 +90194,7 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -84817,48 +90213,30 @@ Object { 0, 29, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 28, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, + "source": null, "specifiers": Array [ Object { "exported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 22, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "default", "range": Array [ - 8, - 11, + 15, + 22, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 11, + "column": 22, "line": 1, }, "start": Object { @@ -84886,7 +90264,7 @@ Object { }, "range": Array [ 8, - 11, + 22, ], "type": "ExportSpecifier", }, @@ -84894,52 +90272,52 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 16, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, "name": "bar", "range": Array [ - 13, - 16, + 24, + 27, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, "name": "bar", "range": Array [ - 13, - 16, + 24, + 27, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 24, + 27, ], "type": "ExportSpecifier", }, @@ -85020,74 +90398,74 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 14, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 16, + 15, + 22, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { - "column": 16, + "column": 22, "line": 1, }, }, "range": Array [ - 16, - 17, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { - "column": 18, + "column": 24, "line": 1, }, }, "range": Array [ - 18, - 22, + 24, + 27, ], "type": "Identifier", - "value": "from", + "value": "bar", }, Object { "loc": Object { @@ -85096,16 +90474,16 @@ Object { "line": 1, }, "start": Object { - "column": 23, + "column": 27, "line": 1, }, }, "range": Array [ - 23, + 27, 28, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -85130,71 +90508,68 @@ Object { } `; -exports[`javascript fixtures/modules/export-function.src 1`] = ` +exports[`javascript fixtures/modules/export-named-class.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "async": false, "body": Object { "body": Array [], "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 23, + "column": 18, "line": 1, }, }, "range": Array [ - 23, - 25, + 18, + 22, ], - "type": "BlockStatement", + "type": "ClassBody", }, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { - "column": 16, + "column": 13, "line": 1, }, }, - "name": "foo", + "name": "Test", "range": Array [ - 16, - 19, + 13, + 17, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 7, "line": 1, }, }, - "params": Array [], "range": Array [ 7, - 25, + 22, ], - "type": "FunctionDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -85203,7 +90578,7 @@ Object { }, "range": Array [ 0, - 25, + 22, ], "source": null, "specifiers": Array [], @@ -85213,7 +90588,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -85222,7 +90597,7 @@ Object { }, "range": Array [ 0, - 26, + 23, ], "sourceType": "module", "tokens": Array [ @@ -85247,7 +90622,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 12, "line": 1, }, "start": Object { @@ -85257,10 +90632,28 @@ Object { }, "range": Array [ 7, - 15, + 12, ], "type": "Keyword", - "value": "function", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { @@ -85269,102 +90662,354 @@ Object { "line": 1, }, "start": Object { - "column": 16, + "column": 18, "line": 1, }, }, "range": Array [ - 16, + 18, 19, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-named-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-named-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 8, "line": 1, }, "start": Object { - "column": 20, + "column": 7, "line": 1, }, }, "range": Array [ - 20, - 21, + 7, + 8, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { - "column": 21, + "column": 8, "line": 1, }, }, "range": Array [ - 21, - 22, + 8, + 11, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 12, "line": 1, }, "start": Object { - "column": 23, + "column": 11, "line": 1, }, }, "range": Array [ - 23, - 24, + 11, + 12, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 13, "line": 1, }, "start": Object { - "column": 24, + "column": 12, "line": 1, }, }, "range": Array [ - 24, - 25, + 12, + 13, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-named-as-default.src 1`] = ` +exports[`javascript fixtures/modules/export-named-specifiers.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 24, + "column": 18, "line": 1, }, "start": Object { @@ -85374,7 +91019,7 @@ Object { }, "range": Array [ 0, - 24, + 18, ], "source": null, "specifiers": Array [ @@ -85382,24 +91027,24 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, - "name": "default", + "name": "foo", "range": Array [ - 15, - 22, + 8, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { @@ -85427,7 +91072,60 @@ Object { }, "range": Array [ 8, - 22, + 11, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, ], "type": "ExportSpecifier", }, @@ -85447,7 +91145,7 @@ Object { }, "range": Array [ 0, - 25, + 19, ], "sourceType": "module", "tokens": Array [ @@ -85508,53 +91206,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 14, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 22, + 13, + 16, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, ], "type": "Punctuator", "value": "}", @@ -85562,17 +91260,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 18, "line": 1, }, "start": Object { - "column": 23, + "column": 17, "line": 1, }, }, "range": Array [ - 23, - 24, + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -85582,14 +91280,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { @@ -85599,7 +91297,7 @@ Object { }, "range": Array [ 0, - 20, + 19, ], "source": null, "specifiers": Array [ @@ -85607,24 +91305,24 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, - "name": "bar", + "name": "foo", "range": Array [ - 15, - 18, + 8, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { @@ -85652,7 +91350,60 @@ Object { }, "range": Array [ 8, - 18, + 11, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, ], "type": "ExportSpecifier", }, @@ -85672,7 +91423,7 @@ Object { }, "range": Array [ 0, - 21, + 20, ], "sourceType": "module", "tokens": Array [ @@ -85733,35 +91484,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 14, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 18, + 13, + 16, ], "type": "Identifier", "value": "bar", @@ -85769,17 +91520,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { "column": 18, "line": 1, }, + "start": Object { + "column": 17, + "line": 1, + }, }, "range": Array [ + 17, 18, - 19, ], "type": "Punctuator", "value": "}", @@ -85787,17 +91556,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { - "column": 19, + "column": 18, "line": 1, }, }, "range": Array [ + 18, 19, - 20, ], "type": "Punctuator", "value": ";", @@ -85807,14 +91576,69 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-var.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 29, + "column": 15, "line": 1, }, "start": Object { @@ -85824,117 +91648,221 @@ Object { }, "range": Array [ 0, - 29, + 15, ], "source": null, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-var-anonymous-function.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", }, - "name": "default", - "range": Array [ - 15, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, + "init": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 8, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, }, + "params": Array [], + "range": Array [ + 17, + 31, + ], + "type": "FunctionExpression", }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 22, - ], - "type": "ExportSpecifier", - }, - Object { - "exported": Object { "loc": Object { "end": Object { - "column": 27, + "column": 31, "line": 1, }, "start": Object { - "column": 24, + "column": 11, "line": 1, }, }, - "name": "bar", "range": Array [ - 24, - 27, + 11, + 31, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", + "start": Object { + "column": 7, + "line": 1, }, - "range": Array [ - 24, - 27, - ], - "type": "ExportSpecifier", }, + "range": Array [ + 7, + 32, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, ], + "source": null, + "specifiers": Array [], "type": "ExportNamedDeclaration", }, ], @@ -85950,7 +91878,7 @@ Object { }, "range": Array [ 0, - 30, + 33, ], "sourceType": "module", "tokens": Array [ @@ -85975,7 +91903,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -85985,25 +91913,25 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, 11, + 14, ], "type": "Identifier", "value": "foo", @@ -86011,89 +91939,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 15, "line": 1, }, }, "range": Array [ - 12, - 14, + 15, + 16, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 22, + 17, + 25, ], "type": "Keyword", - "value": "default", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 27, "line": 1, }, "start": Object { - "column": 22, + "column": 26, "line": 1, }, }, "range": Array [ - 22, - 23, + 26, + 27, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 28, "line": 1, }, "start": Object { - "column": 24, + "column": 27, "line": 1, }, }, "range": Array [ - 24, 27, + 28, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 30, "line": 1, }, "start": Object { - "column": 27, + "column": 29, "line": 1, }, }, "range": Array [ - 27, - 28, + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, ], "type": "Punctuator", "value": "}", @@ -86101,17 +92047,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 32, "line": 1, }, "start": Object { - "column": 28, + "column": 31, "line": 1, }, }, "range": Array [ - 28, - 29, + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -86121,51 +92067,72 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-class.src 1`] = ` +exports[`javascript fixtures/modules/export-var-number.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", }, - }, - "range": Array [ - 18, - 22, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "1", + "type": "Literal", + "value": 1, }, - "start": Object { - "column": 13, - "line": 1, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "range": Array [ + 11, + 18, + ], + "type": "VariableDeclarator", }, - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { "column": 7, @@ -86174,15 +92141,14 @@ Object { }, "range": Array [ 7, - 22, + 19, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { "column": 0, @@ -86191,7 +92157,7 @@ Object { }, "range": Array [ 0, - 22, + 19, ], "source": null, "specifiers": Array [], @@ -86201,7 +92167,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -86210,7 +92176,7 @@ Object { }, "range": Array [ 0, - 23, + 20, ], "sourceType": "module", "tokens": Array [ @@ -86235,7 +92201,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { @@ -86245,178 +92211,79 @@ Object { }, "range": Array [ 7, - 12, + 10, ], "type": "Keyword", - "value": "class", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 1, }, "start": Object { - "column": 13, + "column": 11, "line": 1, }, }, "range": Array [ - 13, - 17, + 11, + 14, ], "type": "Identifier", - "value": "Test", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-named-empty.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 10, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 11, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "export", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 16, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 8, + 15, + 16, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { - "column": 8, + "column": 17, "line": 1, }, }, "range": Array [ - 8, - 9, + 17, + 18, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 18, "line": 1, }, }, "range": Array [ - 9, - 10, + 18, + 19, ], "type": "Punctuator", "value": ";", @@ -86426,14 +92293,13 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-specifier.src 1`] = ` +exports[`javascript fixtures/modules/import-default.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 13, + "column": 22, "line": 1, }, "start": Object { @@ -86443,65 +92309,65 @@ Object { }, "range": Array [ 0, - 13, + 22, ], - "source": null, + "source": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, "specifiers": Array [ Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "name": "foo", "range": Array [ - 8, - 11, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 8, - 11, + 7, + 10, ], - "type": "ExportSpecifier", + "type": "ImportDefaultSpecifier", }, ], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -86516,7 +92382,7 @@ Object { }, "range": Array [ 0, - 14, + 23, ], "sourceType": "module", "tokens": Array [ @@ -86536,12 +92402,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -86551,61 +92417,61 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, 11, + 15, ], "type": "Identifier", - "value": "foo", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 21, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 21, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 22, "line": 1, }, "start": Object { - "column": 12, + "column": 21, "line": 1, }, }, "range": Array [ - 12, - 13, + 21, + 22, ], "type": "Punctuator", "value": ";", @@ -86615,14 +92481,13 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-default-and-named-specifiers.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 18, + "column": 29, "line": 1, }, "start": Object { @@ -86632,65 +92497,65 @@ Object { }, "range": Array [ 0, - 18, + 29, ], - "source": null, + "source": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, "specifiers": Array [ Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "name": "foo", "range": Array [ - 8, - 11, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 8, - 11, + 7, + 10, ], - "type": "ExportSpecifier", + "type": "ImportDefaultSpecifier", }, Object { - "exported": Object { + "imported": Object { "loc": Object { "end": Object { "column": 16, @@ -86740,10 +92605,10 @@ Object { 13, 16, ], - "type": "ExportSpecifier", + "type": "ImportSpecifier", }, ], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -86758,7 +92623,7 @@ Object { }, "range": Array [ 0, - 19, + 30, ], "sourceType": "module", "tokens": Array [ @@ -86778,12 +92643,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -86793,10 +92658,10 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -86805,34 +92670,34 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, + 10, 11, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 13, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { @@ -86873,17 +92738,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 22, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -86893,14 +92794,13 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-specifiers-comma.src 1`] = ` +exports[`javascript fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 19, + "column": 32, "line": 1, }, "start": Object { @@ -86910,118 +92810,100 @@ Object { }, "range": Array [ 0, - 19, + 32, ], - "source": null, + "source": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 31, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, "specifiers": Array [ Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "name": "foo", "range": Array [ - 8, - 11, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 8, - 11, + 7, + 10, ], - "type": "ExportSpecifier", + "type": "ImportDefaultSpecifier", }, Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "name": "bar", "range": Array [ - 13, - 16, + 17, + 20, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 12, + 20, ], - "type": "ExportSpecifier", + "type": "ImportNamespaceSpecifier", }, ], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -87036,7 +92918,7 @@ Object { }, "range": Array [ 0, - 20, + 33, ], "sourceType": "module", "tokens": Array [ @@ -87056,12 +92938,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -87071,10 +92953,10 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -87083,34 +92965,34 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, + 10, 11, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 13, ], "type": "Punctuator", - "value": ",", + "value": "*", }, Object { "loc": Object { @@ -87119,175 +93001,101 @@ Object { "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, + 14, 16, ], "type": "Identifier", - "value": "bar", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 20, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 25, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "range": Array [ - 17, - 18, + 21, + 25, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 26, "line": 1, }, }, "range": Array [ - 18, - 19, + 26, + 31, ], - "type": "Punctuator", - "value": ";", + "type": "String", + "value": "\\"foo\\"", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-var.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 15, - ], - "type": "VariableDeclaration", - }, "loc": Object { "end": Object { - "column": 15, + "column": 32, "line": 1, }, "start": Object { - "column": 0, + "column": 31, "line": 1, }, }, "range": Array [ - 0, - 15, + 31, + 32, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 16, ], - "sourceType": "module", - "tokens": Array [ + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-default-as.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 35, "line": 1, }, "start": Object { @@ -87297,186 +93105,83 @@ Object { }, "range": Array [ 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 10, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, + 35, ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "source": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, }, + "range": Array [ + 29, + 34, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-var-anonymous-function.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "BlockStatement", + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, + "start": Object { + "column": 8, + "line": 1, }, - "params": Array [], - "range": Array [ - 17, - 31, - ], - "type": "FunctionExpression", }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { "loc": Object { "end": Object { - "column": 31, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 19, "line": 1, }, }, + "name": "foo", "range": Array [ - 11, - 31, + 19, + 22, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "type": "Identifier", }, + "range": Array [ + 8, + 22, + ], + "type": "ImportSpecifier", }, - "range": Array [ - 7, - 32, - ], - "type": "VariableDeclaration", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 32, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -87491,7 +93196,7 @@ Object { }, "range": Array [ 0, - 33, + 36, ], "sourceType": "module", "tokens": Array [ @@ -87511,12 +93216,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -87526,82 +93231,82 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ - 11, - 14, + 8, + 15, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 18, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 19, "line": 1, }, }, "range": Array [ - 17, - 25, + 19, + 22, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 22, "line": 1, }, }, "range": Array [ - 26, - 27, + 22, + 23, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { @@ -87610,21 +93315,21 @@ Object { "line": 1, }, "start": Object { - "column": 27, + "column": 24, "line": 1, }, }, "range": Array [ - 27, + 24, 28, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 34, "line": 1, }, "start": Object { @@ -87634,147 +93339,109 @@ Object { }, "range": Array [ 29, - 30, + 34, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 35, "line": 1, }, "start": Object { - "column": 30, + "column": 34, "line": 1, }, }, "range": Array [ - 30, - 31, + 34, + 35, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-jquery.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 32, + "column": 22, "line": 1, }, "start": Object { - "column": 31, + "column": 0, "line": 1, }, }, "range": Array [ - 31, - 32, + 0, + 22, ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-var-number.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", + "source": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 22, + ], + "raw": "\\"jquery\\"", + "type": "Literal", + "value": "jquery", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, }, - "init": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "raw": "1", - "type": "Literal", - "value": 1, + "start": Object { + "column": 7, + "line": 1, }, + }, + "local": Object { "loc": Object { "end": Object { - "column": 18, + "column": 8, "line": 1, }, "start": Object { - "column": 11, + "column": 7, "line": 1, }, }, + "name": "$", "range": Array [ - 11, - 18, + 7, + 8, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "type": "Identifier", }, + "range": Array [ + 7, + 8, + ], + "type": "ImportDefaultSpecifier", }, - "range": Array [ - 7, - 19, - ], - "type": "VariableDeclaration", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 19, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -87789,7 +93456,7 @@ Object { }, "range": Array [ 0, - 20, + 23, ], "sourceType": "module", "tokens": Array [ @@ -87809,12 +93476,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -87824,79 +93491,159 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "$", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 14, + 9, + 13, ], "type": "Identifier", - "value": "foo", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ - 15, - 16, + 14, + 22, ], - "type": "Punctuator", - "value": "=", + "type": "String", + "value": "\\"jquery\\"", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-module.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { - "column": 17, + "column": 0, "line": 1, }, }, "range": Array [ - 17, - 18, + 0, + 13, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, ], - "type": "Numeric", - "value": "1", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 13, "line": 1, }, "start": Object { - "column": 18, + "column": 12, "line": 1, }, }, "range": Array [ - 18, - 19, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -87906,13 +93653,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default.src 1`] = ` +exports[`javascript fixtures/modules/import-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 31, "line": 1, }, "start": Object { @@ -87922,22 +93669,22 @@ Object { }, "range": Array [ 0, - 22, + 31, ], "source": Object { "loc": Object { "end": Object { - "column": 21, + "column": 30, "line": 1, }, "start": Object { - "column": 16, + "column": 25, "line": 1, }, }, "range": Array [ - 16, - 21, + 25, + 30, ], "raw": "\\"foo\\"", "type": "Literal", @@ -87945,39 +93692,57 @@ Object { }, "specifiers": Array [ Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "baz", "range": Array [ - 7, - 10, + 15, + 18, ], "type": "Identifier", }, "range": Array [ - 7, - 10, + 8, + 18, ], - "type": "ImportDefaultSpecifier", + "type": "ImportSpecifier", }, ], "type": "ImportDeclaration", @@ -87995,7 +93760,7 @@ Object { }, "range": Array [ 0, - 23, + 32, ], "sourceType": "module", "tokens": Array [ @@ -88020,7 +93785,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -88030,25 +93795,97 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, ], "type": "Identifier", "value": "from", @@ -88056,17 +93893,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 30, "line": 1, }, "start": Object { - "column": 16, + "column": 25, "line": 1, }, }, "range": Array [ - 16, - 21, + 25, + 30, ], "type": "String", "value": "\\"foo\\"", @@ -88074,17 +93911,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 31, "line": 1, }, "start": Object { - "column": 21, + "column": 30, "line": 1, }, }, "range": Array [ - 21, - 22, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -88094,13 +93931,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default-and-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 29, + "column": 36, "line": 1, }, "start": Object { @@ -88110,22 +93947,22 @@ Object { }, "range": Array [ 0, - 29, + 36, ], "source": Object { "loc": Object { "end": Object { - "column": 28, + "column": 35, "line": 1, }, "start": Object { - "column": 23, + "column": 30, "line": 1, }, }, "range": Array [ - 23, - 28, + 30, + 35, ], "raw": "\\"foo\\"", "type": "Literal", @@ -88133,90 +93970,108 @@ Object { }, "specifiers": Array [ Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "baz", "range": Array [ - 7, - 10, + 15, + 18, ], "type": "Identifier", }, "range": Array [ - 7, - 10, + 8, + 18, ], - "type": "ImportDefaultSpecifier", + "type": "ImportSpecifier", }, Object { "imported": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, - "name": "bar", + "name": "xyz", "range": Array [ - 13, - 16, + 20, + 23, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, - "name": "bar", + "name": "xyz", "range": Array [ - 13, - 16, + 20, + 23, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 20, + 23, ], "type": "ImportSpecifier", }, @@ -88236,7 +94091,7 @@ Object { }, "range": Array [ 0, - 30, + 37, ], "sourceType": "module", "tokens": Array [ @@ -88261,7 +94116,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -88271,10 +94126,10 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -88283,21 +94138,21 @@ Object { "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, + 8, 11, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { @@ -88307,43 +94162,79 @@ Object { }, "range": Array [ 12, - 13, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, "range": Array [ - 13, - 16, + 20, + 23, ], "type": "Identifier", - "value": "bar", + "value": "xyz", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 16, + "column": 23, "line": 1, }, }, "range": Array [ - 16, - 17, + 23, + 24, ], "type": "Punctuator", "value": "}", @@ -88351,17 +94242,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 29, "line": 1, }, "start": Object { - "column": 18, + "column": 25, "line": 1, }, }, "range": Array [ - 18, - 22, + 25, + 29, ], "type": "Identifier", "value": "from", @@ -88369,17 +94260,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 35, "line": 1, }, "start": Object { - "column": 23, + "column": 30, "line": 1, }, }, "range": Array [ - 23, - 28, + 30, + 35, ], "type": "String", "value": "\\"foo\\"", @@ -88387,17 +94278,187 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-named-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, "line": 1, }, "start": Object { - "column": 28, + "column": 20, "line": 1, }, }, "range": Array [ - 28, - 29, + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -88407,13 +94468,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 32, + "column": 24, "line": 1, }, "start": Object { @@ -88423,22 +94484,22 @@ Object { }, "range": Array [ 0, - 32, + 24, ], "source": Object { "loc": Object { "end": Object { - "column": 31, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 18, "line": 1, }, }, "range": Array [ - 26, - 31, + 18, + 23, ], "raw": "\\"foo\\"", "type": "Literal", @@ -88446,74 +94507,57 @@ Object { }, "specifiers": Array [ Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "local": Object { + "imported": Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 7, - 10, + 8, + 11, ], "type": "Identifier", }, - "range": Array [ - 7, - 10, - ], - "type": "ImportDefaultSpecifier", - }, - Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 17, + "column": 8, "line": 1, }, }, "name": "bar", "range": Array [ - 17, - 20, + 8, + 11, ], "type": "Identifier", }, "range": Array [ - 12, - 20, + 8, + 11, ], - "type": "ImportNamespaceSpecifier", + "type": "ImportSpecifier", }, ], "type": "ImportDeclaration", @@ -88531,7 +94575,7 @@ Object { }, "range": Array [ 0, - 33, + 25, ], "sourceType": "module", "tokens": Array [ @@ -88556,7 +94600,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -88566,10 +94610,10 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -88578,85 +94622,49 @@ Object { "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, + 8, 11, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 13, ], "type": "Punctuator", - "value": "*", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "Identifier", - "value": "as", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { "column": 17, "line": 1, }, - }, - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, "start": Object { - "column": 21, + "column": 13, "line": 1, }, }, "range": Array [ - 21, - 25, + 13, + 17, ], "type": "Identifier", "value": "from", @@ -88664,17 +94672,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 18, "line": 1, }, }, "range": Array [ - 26, - 31, + 18, + 23, ], "type": "String", "value": "\\"foo\\"", @@ -88682,17 +94690,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 24, "line": 1, }, "start": Object { - "column": 31, + "column": 23, "line": 1, }, }, "range": Array [ - 31, - 32, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -88702,13 +94710,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default-as.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifiers.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { @@ -88718,22 +94726,22 @@ Object { }, "range": Array [ 0, - 35, + 29, ], "source": Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 34, + 23, + 28, ], "raw": "\\"foo\\"", "type": "Literal", @@ -88744,7 +94752,7 @@ Object { "imported": Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -88752,16 +94760,16 @@ Object { "line": 1, }, }, - "name": "default", + "name": "bar", "range": Array [ 8, - 15, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { @@ -88772,24 +94780,77 @@ Object { "local": Object { "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { - "column": 19, + "column": 8, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 19, - 22, + 8, + 11, ], "type": "Identifier", }, "range": Array [ 8, - 22, + 11, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, ], "type": "ImportSpecifier", }, @@ -88809,7 +94870,7 @@ Object { }, "range": Array [ 0, - 36, + 30, ], "sourceType": "module", "tokens": Array [ @@ -88852,7 +94913,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -88862,61 +94923,61 @@ Object { }, "range": Array [ 8, - 15, + 11, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ - 16, - 18, + 11, + 12, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 19, + "column": 13, "line": 1, }, }, "range": Array [ - 19, - 22, + 13, + 16, ], "type": "Identifier", - "value": "foo", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, ], "type": "Punctuator", "value": "}", @@ -88924,17 +94985,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 22, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "range": Array [ - 24, - 28, + 18, + 22, ], "type": "Identifier", "value": "from", @@ -88942,17 +95003,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 34, + 23, + 28, ], "type": "String", "value": "\\"foo\\"", @@ -88960,17 +95021,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { - "column": 34, + "column": 28, "line": 1, }, }, "range": Array [ - 34, - 35, + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -88980,13 +95041,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-jquery.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 30, "line": 1, }, "start": Object { @@ -88996,62 +95057,133 @@ Object { }, "range": Array [ 0, - 22, + 30, ], "source": Object { "loc": Object { "end": Object { - "column": 22, + "column": 29, "line": 1, }, "start": Object { - "column": 14, + "column": 24, "line": 1, }, }, "range": Array [ - 14, - 22, + 24, + 29, ], - "raw": "\\"jquery\\"", + "raw": "\\"foo\\"", "type": "Literal", - "value": "jquery", + "value": "foo", }, "specifiers": Array [ Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, - "name": "$", + "name": "bar", "range": Array [ - 7, 8, + 11, ], "type": "Identifier", }, "range": Array [ - 7, 8, + 11, ], - "type": "ImportDefaultSpecifier", + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ImportSpecifier", }, ], "type": "ImportDeclaration", @@ -89069,7 +95201,7 @@ Object { }, "range": Array [ 0, - 23, + 31, ], "sourceType": "module", "tokens": Array [ @@ -89106,139 +95238,131 @@ Object { 7, 8, ], - "type": "Identifier", - "value": "$", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ - 9, - 13, + 8, + 11, ], "type": "Identifier", - "value": "from", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, "range": Array [ - 14, - 22, + 11, + 12, ], - "type": "String", - "value": "\\"jquery\\"", + "type": "Punctuator", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/import-module.src 1`] = ` -Object { - "body": Array [ Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 13, "line": 1, }, }, "range": Array [ - 0, 13, + 16, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 7, - 12, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", }, - "specifiers": Array [], - "type": "ImportDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 14, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 23, "line": 1, }, "start": Object { - "column": 0, + "column": 19, "line": 1, }, }, "range": Array [ - 0, - 6, + 19, + 23, ], - "type": "Keyword", - "value": "import", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 1, }, "start": Object { - "column": 7, + "column": 24, "line": 1, }, }, "range": Array [ - 7, - 12, + 24, + 29, ], "type": "String", "value": "\\"foo\\"", @@ -89246,17 +95370,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 30, "line": 1, }, "start": Object { - "column": 12, + "column": 29, "line": 1, }, }, "range": Array [ - 12, - 13, + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -89266,13 +95390,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/import-namespace-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 31, + "column": 27, "line": 1, }, "start": Object { @@ -89282,22 +95406,22 @@ Object { }, "range": Array [ 0, - 31, + 27, ], "source": Object { "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 1, }, "start": Object { - "column": 25, + "column": 21, "line": 1, }, }, "range": Array [ - 25, - 30, + 21, + 26, ], "raw": "\\"foo\\"", "type": "Literal", @@ -89305,57 +95429,39 @@ Object { }, "specifiers": Array [ Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, - "name": "baz", + "name": "foo", "range": Array [ + 12, 15, - 18, ], "type": "Identifier", }, "range": Array [ - 8, - 18, + 7, + 15, ], - "type": "ImportSpecifier", + "type": "ImportNamespaceSpecifier", }, ], "type": "ImportDeclaration", @@ -89373,7 +95479,7 @@ Object { }, "range": Array [ 0, - 32, + 28, ], "sourceType": "module", "tokens": Array [ @@ -89411,7 +95517,7 @@ Object { 8, ], "type": "Punctuator", - "value": "{", + "value": "*", }, Object { "loc": Object { @@ -89420,21 +95526,21 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, + 9, 11, ], "type": "Identifier", - "value": "bar", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { @@ -89444,61 +95550,25 @@ Object { }, "range": Array [ 12, - 14, - ], - "type": "Identifier", - "value": "as", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ 15, - 18, ], "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "}", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 20, "line": 1, }, "start": Object { - "column": 20, + "column": 16, "line": 1, }, }, "range": Array [ + 16, 20, - 24, ], "type": "Identifier", "value": "from", @@ -89506,17 +95576,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 1, }, "start": Object { - "column": 25, + "column": 21, "line": 1, }, }, "range": Array [ - 25, - 30, + 21, + 26, ], "type": "String", "value": "\\"foo\\"", @@ -89524,17 +95594,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 27, "line": 1, }, "start": Object { - "column": 30, + "column": 26, "line": 1, }, }, "range": Array [ - 30, - 31, + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -89544,13 +95614,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-null-as-nil.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 36, + "column": 33, "line": 1, }, "start": Object { @@ -89560,131 +95630,78 @@ Object { }, "range": Array [ 0, - 36, + 33, ], "source": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 1, }, "start": Object { - "column": 30, + "column": 28, "line": 1, }, }, "range": Array [ - 30, - 35, + 28, + 33, ], - "raw": "\\"foo\\"", + "raw": "\\"bar\\"", "type": "Literal", - "value": "foo", + "value": "bar", }, "specifiers": Array [ Object { "imported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, - "name": "bar", + "name": "null", "range": Array [ - 8, - 11, + 9, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 18, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { "column": 20, "line": 1, }, - }, - "name": "xyz", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, "start": Object { - "column": 20, + "column": 17, "line": 1, }, }, - "name": "xyz", + "name": "nil", "range": Array [ + 17, 20, - 23, ], "type": "Identifier", }, "range": Array [ + 9, 20, - 23, ], "type": "ImportSpecifier", }, @@ -89704,7 +95721,7 @@ Object { }, "range": Array [ 0, - 37, + 34, ], "sourceType": "module", "tokens": Array [ @@ -89747,35 +95764,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, - 11, + 9, + 13, ], - "type": "Identifier", - "value": "bar", + "type": "Null", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, 14, + 16, ], "type": "Identifier", "value": "as", @@ -89783,156 +95800,279 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 18, + 17, + 20, ], "type": "Identifier", - "value": "baz", + "value": "nil", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 22, "line": 1, }, "start": Object { - "column": 18, + "column": 21, "line": 1, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 27, "line": 1, }, "start": Object { - "column": 20, + "column": 23, "line": 1, }, }, "range": Array [ - 20, 23, + 27, ], "type": "Identifier", - "value": "xyz", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 33, "line": 1, }, "start": Object { - "column": 23, + "column": 28, "line": 1, }, }, "range": Array [ - 23, - 24, + 28, + 33, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"bar\\"", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/invalid-await.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "await", + "range": Array [ + 11, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 25, + "column": 0, "line": 1, }, }, "range": Array [ - 25, - 29, + 0, + 17, ], - "type": "Identifier", - "value": "from", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 35, + "column": 6, "line": 1, }, "start": Object { - "column": 30, + "column": 0, "line": 1, }, }, "range": Array [ - 30, - 35, + 0, + 6, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 10, "line": 1, }, "start": Object { - "column": 35, + "column": 7, "line": 1, }, }, "range": Array [ - 35, - 36, + 7, + 10, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "var", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/import-named-empty.src 1`] = ` -Object { - "body": Array [ Object { "loc": Object { "end": Object { - "column": 21, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 21, + 11, + 16, ], - "source": Object { + "type": "Keyword", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/invalid-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "ClassBody", + }, + "id": null, "loc": Object { "end": Object { - "column": 20, + "column": 23, "line": 1, }, "start": Object { @@ -89942,14 +96082,26 @@ Object { }, "range": Array [ 15, - 20, + 23, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, - "specifiers": Array [], - "type": "ImportDeclaration", + "range": Array [ + 0, + 23, + ], + "type": "ExportDefaultDeclaration", }, ], "loc": Object { @@ -89964,7 +96116,7 @@ Object { }, "range": Array [ 0, - 22, + 24, ], "sourceType": "module", "tokens": Array [ @@ -89984,12 +96136,12 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 1, }, "start": Object { @@ -89999,95 +96151,88 @@ Object { }, "range": Array [ 7, - 8, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 20, "line": 1, }, "start": Object { - "column": 10, + "column": 15, "line": 1, }, }, "range": Array [ - 10, - 14, + 15, + 20, ], - "type": "Identifier", - "value": "from", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 22, "line": 1, }, "start": Object { - "column": 15, + "column": 21, "line": 1, }, }, "range": Array [ - 15, - 20, + 21, + 22, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 20, + "column": 22, "line": 1, }, }, "range": Array [ - 20, - 21, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/import-named-specifier.src 1`] = ` +exports[`javascript fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; + +exports[`javascript fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/modules/invalid-export-named-default.src 1`] = ` Object { "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 24, + "column": 16, "line": 1, }, "start": Object { @@ -90097,33 +96242,15 @@ Object { }, "range": Array [ 0, - 24, + 16, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 23, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, + "source": null, "specifiers": Array [ Object { - "imported": Object { + "exported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -90131,16 +96258,16 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "default", "range": Array [ 8, - 11, + 15, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -90151,7 +96278,7 @@ Object { "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -90159,21 +96286,21 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "default", "range": Array [ 8, - 11, + 15, ], "type": "Identifier", }, "range": Array [ 8, - 11, + 15, ], - "type": "ImportSpecifier", + "type": "ExportSpecifier", }, ], - "type": "ImportDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -90188,7 +96315,7 @@ Object { }, "range": Array [ 0, - 25, + 17, ], "sourceType": "module", "tokens": Array [ @@ -90208,7 +96335,7 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { @@ -90231,7 +96358,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -90241,95 +96368,53 @@ Object { }, "range": Array [ 8, - 11, + 15, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, - 12, + 15, + 16, ], "type": "Punctuator", "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 23, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ";", - }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/import-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { @@ -90339,133 +96424,61 @@ Object { }, "range": Array [ 0, - 29, + 20, ], "source": Object { "loc": Object { "end": Object { - "column": 28, + "column": 19, "line": 1, }, "start": Object { - "column": 23, + "column": 16, "line": 1, }, }, + "name": "bar", "range": Array [ - 23, - 28, + 16, + 19, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "type": "Identifier", }, "specifiers": Array [ Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 11, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 13, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 13, + "column": 7, "line": 1, }, }, - "name": "baz", + "name": "foo", "range": Array [ - 13, - 16, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 7, + 10, ], - "type": "ImportSpecifier", + "type": "ImportDefaultSpecifier", }, ], "type": "ImportDeclaration", @@ -90483,7 +96496,7 @@ Object { }, "range": Array [ 0, - 30, + 21, ], "sourceType": "module", "tokens": Array [ @@ -90508,7 +96521,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -90518,33 +96531,15 @@ Object { }, "range": Array [ 7, - 8, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 11, + 10, ], "type": "Identifier", - "value": "bar", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { @@ -90554,33 +96549,15 @@ Object { }, "range": Array [ 11, - 12, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 16, + 15, ], "type": "Identifier", - "value": "baz", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { @@ -90590,61 +96567,25 @@ Object { }, "range": Array [ 16, - 17, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 22, + 19, ], "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 28, - ], - "type": "String", - "value": "\\"foo\\"", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { - "column": 28, + "column": 19, "line": 1, }, }, "range": Array [ - 28, - 29, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -90654,13 +96595,16 @@ Object { } `; -exports[`javascript fixtures/modules/import-named-specifiers-comma.src 1`] = ` +exports[`javascript fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-module-specifier.src 1`] = ` Object { "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 30, + "column": 21, "line": 1, }, "start": Object { @@ -90670,30 +96614,29 @@ Object { }, "range": Array [ 0, - 30, + 21, ], "source": Object { "loc": Object { "end": Object { - "column": 29, + "column": 21, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, + "name": "bar", "range": Array [ - 24, - 29, + 18, + 21, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "type": "Identifier", }, "specifiers": Array [ Object { - "imported": Object { + "exported": Object { "loc": Object { "end": Object { "column": 11, @@ -90704,7 +96647,7 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "foo", "range": Array [ 8, 11, @@ -90732,74 +96675,21 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "foo", "range": Array [ 8, 11, ], "type": "Identifier", }, - "range": Array [ - 8, - 11, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "range": Array [ - 13, - 16, + "range": Array [ + 8, + 11, ], - "type": "ImportSpecifier", + "type": "ExportSpecifier", }, ], - "type": "ImportDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -90814,7 +96704,7 @@ Object { }, "range": Array [ 0, - 31, + 22, ], "sourceType": "module", "tokens": Array [ @@ -90834,7 +96724,7 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { @@ -90870,7 +96760,7 @@ Object { 11, ], "type": "Identifier", - "value": "bar", + "value": "foo", }, Object { "loc": Object { @@ -90888,12 +96778,12 @@ Object { 12, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -90903,181 +96793,158 @@ Object { }, "range": Array [ 13, - 16, + 17, ], "type": "Identifier", - "value": "baz", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { "column": 18, "line": 1, }, - "start": Object { - "column": 17, - "line": 1, - }, }, "range": Array [ - 17, 18, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 23, + 21, ], "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 29, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": ";", + "value": "bar", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/import-namespace-specifier.src 1`] = ` +exports[`javascript fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; + +exports[`javascript fixtures/newTarget/invalid-new-target.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 27, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 26, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, - "specifiers": Array [ + "declarations": Array [ Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "local": Object { + "init": Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, - "name": "foo", + "meta": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "new", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "target", + "range": Array [ + 12, + 18, + ], + "type": "Identifier", + }, "range": Array [ - 12, - 15, + 8, + 18, ], - "type": "Identifier", + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, "range": Array [ - 7, - 15, + 4, + 18, ], - "type": "ImportNamespaceSpecifier", + "type": "VariableDeclarator", }, ], - "type": "ImportDeclaration", + "kind": "var", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "VariableDeclaration", }, ], "loc": Object { @@ -91092,14 +96959,14 @@ Object { }, "range": Array [ 0, - 28, + 20, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -91109,115 +96976,115 @@ Object { }, "range": Array [ 0, - 6, + 3, ], "type": "Keyword", - "value": "import", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, "range": Array [ - 7, - 8, + 4, + 5, ], - "type": "Punctuator", - "value": "*", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 11, + 6, + 7, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, "range": Array [ - 12, - 15, + 8, + 11, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ - 16, - 20, + 11, + 12, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 18, "line": 1, }, "start": Object { - "column": 21, + "column": 12, "line": 1, }, }, "range": Array [ - 21, - 26, + 12, + 18, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Identifier", + "value": "target", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 19, "line": 1, }, "start": Object { - "column": 26, + "column": 18, "line": 1, }, }, "range": Array [ - 26, - 27, + 18, + 19, ], "type": "Punctuator", "value": ";", @@ -91227,99 +97094,174 @@ Object { } `; -exports[`javascript fixtures/modules/import-null-as-nil.src 1`] = ` +exports[`javascript fixtures/newTarget/invalid-unknown-property.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 33, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 33, - ], - "raw": "\\"bar\\"", - "type": "Literal", - "value": "bar", - }, - "specifiers": Array [ + "declarations": Array [ Object { - "imported": Object { + "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 5, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, - "name": "null", + "name": "f", "range": Array [ - 9, - 13, + 4, + 5, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "new", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "unknown_property", + "range": Array [ + 25, + 41, + ], + "type": "Identifier", + }, + "range": Array [ + 21, + 41, + ], + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 42, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 44, + ], + "type": "BlockStatement", }, - }, - "local": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 20, + "column": 44, "line": 1, }, "start": Object { - "column": 17, + "column": 8, "line": 1, }, }, - "name": "nil", + "params": Array [], "range": Array [ - 17, - 20, + 8, + 44, ], - "type": "Identifier", + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, "range": Array [ - 9, - 20, + 4, + 44, ], - "type": "ImportSpecifier", + "type": "VariableDeclarator", }, ], - "type": "ImportDeclaration", + "kind": "var", + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", }, ], "loc": Object { @@ -91334,14 +97276,14 @@ Object { }, "range": Array [ 0, - 34, + 45, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -91351,69 +97293,87 @@ Object { }, "range": Array [ 0, - 6, + 3, ], "type": "Keyword", - "value": "import", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { "column": 7, "line": 1, }, + "start": Object { + "column": 6, + "line": 1, + }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ - 9, - 13, + 8, + 16, ], - "type": "Null", - "value": "null", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, 16, + 17, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { @@ -91423,15 +97383,33 @@ Object { }, "range": Array [ 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, 20, ], - "type": "Identifier", - "value": "nil", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 24, "line": 1, }, "start": Object { @@ -91441,135 +97419,262 @@ Object { }, "range": Array [ 21, - 22, + 24, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, ], "type": "Punctuator", - "value": "}", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 41, "line": 1, }, "start": Object { - "column": 23, + "column": 25, "line": 1, }, }, "range": Array [ - 23, - 27, + 25, + 41, ], "type": "Identifier", - "value": "from", + "value": "unknown_property", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 42, "line": 1, }, "start": Object { - "column": 28, + "column": 41, "line": 1, }, }, "range": Array [ - 28, - 33, + 41, + 42, ], - "type": "String", - "value": "\\"bar\\"", + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-await.src 1`] = ` +exports[`javascript fixtures/newTarget/simple-new-target.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "declarations": Array [ + "async": false, + "body": Object { + "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", }, - "start": Object { - "column": 11, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "new", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "target", + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + }, + "range": Array [ + 27, + 37, + ], + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, }, + "range": Array [ + 23, + 37, + ], + "type": "VariableDeclarator", }, - "name": "await", - "range": Array [ - 11, - 16, - ], - "type": "Identifier", - }, - "init": null, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 11, - 16, + 19, + 38, ], - "type": "VariableDeclarator", + "type": "VariableDeclaration", }, ], - "kind": "var", "loc": Object { "end": Object { - "column": 17, + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 40, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, + "name": "f", "range": Array [ - 7, - 17, + 9, + 10, ], - "type": "VariableDeclaration", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 17, + 40, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -91578,14 +97683,14 @@ Object { }, "range": Array [ 0, - 18, + 41, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -91595,10 +97700,10 @@ Object { }, "range": Array [ 0, - 6, + 8, ], "type": "Keyword", - "value": "export", + "value": "function", }, Object { "loc": Object { @@ -91607,21 +97712,39 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, + 9, 10, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, "line": 1, }, "start": Object { @@ -91630,79 +97753,313 @@ Object { }, }, "range": Array [ - 11, - 16, + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "target", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, ], - "type": "Keyword", - "value": "await", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 16, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 16, - 17, + 39, + 40, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-class.src 1`] = ` +exports[`javascript fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], + "expression": Object { + "left": Object { + "computed": false, "loc": Object { "end": Object { - "column": 23, + "column": 8, "line": 1, }, "start": Object { - "column": 21, + "column": 0, "line": 1, }, }, + "object": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 3, + 5, + ], + "type": "ObjectExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "fn", + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "CallExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, "range": Array [ - 21, - 23, + 0, + 8, ], - "type": "ClassBody", + "type": "MemberExpression", }, - "id": null, "loc": Object { "end": Object { - "column": 23, + "column": 14, "line": 1, }, "start": Object { - "column": 15, + "column": 0, "line": 1, }, }, + "operator": "=", "range": Array [ - 15, - 23, + 0, + 14, ], - "superClass": null, - "type": "ClassDeclaration", + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { @@ -91712,9 +98069,9 @@ Object { }, "range": Array [ 0, - 23, + 15, ], - "type": "ExportDefaultDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { @@ -91729,14 +98086,14 @@ Object { }, "range": Array [ 0, - 24, + 16, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 2, "line": 1, }, "start": Object { @@ -91746,361 +98103,355 @@ Object { }, "range": Array [ 0, - 6, + 2, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 3, "line": 1, }, "start": Object { - "column": 7, + "column": 2, "line": 1, }, }, "range": Array [ - 7, - 14, + 2, + 3, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 4, "line": 1, }, "start": Object { - "column": 15, + "column": 3, "line": 1, }, }, "range": Array [ - 15, - 20, + 3, + 4, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 5, "line": 1, }, "start": Object { - "column": 21, + "column": 4, "line": 1, }, }, "range": Array [ - 21, - 22, + 4, + 5, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 6, "line": 1, }, "start": Object { - "column": 22, + "column": 5, "line": 1, }, }, "range": Array [ - 22, - 23, + 5, + 6, ], "type": "Punctuator", - "value": "}", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/modules/invalid-export-named-default.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 16, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 6, "line": 1, }, }, "range": Array [ - 0, - 16, - ], - "source": null, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "default", - "range": Array [ - 8, - 15, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "default", - "range": Array [ - 8, - 15, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 15, - ], - "type": "ExportSpecifier", - }, + 6, + 7, ], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ".", }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 6, + 7, + 8, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 8, + 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, - 15, + 11, + 14, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 16, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 20, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "start": Object { - "column": 16, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "operator": "+", + "range": Array [ + 15, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "BinaryExpression", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 14, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 8, + 28, + ], + "type": "ObjectExpression", }, - }, - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "specifiers": Array [ - Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, "range": Array [ - 7, - 10, + 4, + 28, ], - "type": "ImportDefaultSpecifier", + "type": "VariableDeclarator", }, ], - "type": "ImportDeclaration", + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -92109,14 +98460,14 @@ Object { }, "range": Array [ 0, - 21, + 30, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -92126,423 +98477,371 @@ Object { }, "range": Array [ 0, - 6, + 3, ], "type": "Keyword", - "value": "import", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, "range": Array [ - 7, - 10, + 4, + 5, ], "type": "Identifier", - "value": "foo", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 7, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, "range": Array [ - 11, - 15, + 6, + 7, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 9, "line": 1, }, "start": Object { - "column": 16, + "column": 8, "line": 1, }, }, "range": Array [ - 16, - 19, + 8, + 9, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 20, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-module-specifier.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 0, - 21, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 11, - ], - "type": "ExportSpecifier", - }, + 15, + 16, ], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Numeric", + "value": "5", }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 0, - 6, + 17, + 18, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 7, - 8, + 19, + 20, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "5", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 1, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 8, - 11, + 20, + 21, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 1, + "line": 2, }, "start": Object { "column": 11, - "line": 1, + "line": 2, }, }, "range": Array [ - 11, - 12, + 21, + 22, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { "column": 13, - "line": 1, + "line": 2, }, }, "range": Array [ - 13, - 17, + 23, + 26, ], "type": "Identifier", - "value": "from", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 18, - 21, + 27, + 28, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; - -exports[`javascript fixtures/newTarget/invalid-new-target.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 18, + "column": 9, "line": 1, }, "start": Object { - "column": 8, + "column": 2, "line": 1, }, }, - "meta": Object { + "method": false, + "range": Array [ + 2, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, - "name": "new", "range": Array [ - 8, - 11, + 7, + 9, ], - "type": "Identifier", + "raw": "10", + "type": "Literal", + "value": 10, }, - "property": Object { + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, - "name": "target", + "name": "y", "range": Array [ + 11, 12, - 18, ], "type": "Identifier", }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, "range": Array [ - 8, - 18, + 11, + 16, ], - "type": "MetaProperty", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "20", + "type": "Literal", + "value": 20, }, }, - "range": Array [ - 4, - 18, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 17, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { "column": 19, @@ -92557,13 +98856,13 @@ Object { 0, 19, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { "column": 0, @@ -92572,14 +98871,14 @@ Object { }, "range": Array [ 0, - 20, + 19, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -92589,25 +98888,61 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, "line": 1, }, "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { "column": 4, "line": 1, }, + "start": Object { + "column": 3, + "line": 1, + }, }, "range": Array [ + 3, 4, - 5, ], "type": "Identifier", "value": "x", @@ -92615,38 +98950,74 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { "column": 6, "line": 1, }, + "start": Object { + "column": 5, + "line": 1, + }, }, "range": Array [ + 5, 6, - 7, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "range": Array [ - 8, - 11, + 7, + 9, ], - "type": "Keyword", - "value": "new", + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -92663,13 +99034,13 @@ Object { 11, 12, ], - "type": "Punctuator", - "value": ".", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { @@ -92679,10 +99050,64 @@ Object { }, "range": Array [ 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Numeric", + "value": "20", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, 18, ], - "type": "Identifier", - "value": "target", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -92707,162 +99132,209 @@ Object { } `; -exports[`javascript fixtures/newTarget/invalid-unknown-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "get", "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 2, "line": 1, }, }, - "name": "f", + "method": false, "range": Array [ - 4, - 5, + 2, + 14, ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "meta": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "new", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "unknown_property", - "range": Array [ - 25, - 41, - ], - "type": "Identifier", - }, - "range": Array [ - 21, - 41, - ], - "type": "MetaProperty", + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, + "start": Object { + "column": 12, + "line": 1, }, - "range": Array [ - 21, - 42, - ], - "type": "ExpressionStatement", }, + "range": Array [ + 12, + 14, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 9, + 14, ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { "loc": Object { "end": Object { - "column": 44, + "column": 22, "line": 1, }, "start": Object { - "column": 19, + "column": 21, "line": 1, }, }, + "name": "x", "range": Array [ - 19, - 44, + 21, + 22, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, + "kind": "set", "loc": Object { "end": Object { - "column": 44, + "column": 29, "line": 1, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, - "params": Array [], + "method": false, "range": Array [ - 8, - 44, + 16, + 29, ], - "type": "FunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 23, + 29, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 4, - 44, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 30, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 44, + "column": 32, "line": 1, }, "start": Object { @@ -92872,15 +99344,15 @@ Object { }, "range": Array [ 0, - 44, + 32, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { "column": 0, @@ -92889,552 +99361,325 @@ Object { }, "range": Array [ 0, - 45, + 32, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, + "column": 1, "line": 1, }, "start": Object { - "column": 8, + "column": 0, "line": 1, }, }, "range": Array [ - 8, - 16, + 0, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 2, "line": 1, }, "start": Object { - "column": 16, + "column": 1, "line": 1, }, }, "range": Array [ - 16, - 17, + 1, + 2, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 5, "line": 1, }, "start": Object { - "column": 17, + "column": 2, "line": 1, }, }, "range": Array [ - 17, - 18, + 2, + 5, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 7, "line": 1, }, "start": Object { - "column": 19, + "column": 6, "line": 1, }, }, "range": Array [ - 19, - 20, + 6, + 7, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 8, "line": 1, }, "start": Object { - "column": 21, + "column": 7, "line": 1, }, }, "range": Array [ - 21, - 24, + 7, + 8, ], - "type": "Keyword", - "value": "new", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 9, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, "range": Array [ - 24, - 25, + 8, + 9, ], "type": "Punctuator", - "value": ".", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 10, "line": 1, }, "start": Object { - "column": 25, + "column": 9, "line": 1, }, }, "range": Array [ - 25, - 41, + 9, + 10, ], - "type": "Identifier", - "value": "unknown_property", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 11, "line": 1, }, "start": Object { - "column": 41, + "column": 10, "line": 1, }, }, "range": Array [ - 41, - 42, + 10, + 11, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 13, "line": 1, }, "start": Object { - "column": 43, + "column": 12, "line": 1, }, }, "range": Array [ - 43, - 44, + 12, + 13, ], "type": "Punctuator", - "value": "}", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/newTarget/simple-new-target.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "meta": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "name": "new", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "target", - "range": Array [ - 31, - 37, - ], - "type": "Identifier", - }, - "range": Array [ - 27, - 37, - ], - "type": "MetaProperty", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 23, - 37, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 38, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 40, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 0, + "column": 13, "line": 1, }, }, - "params": Array [], "range": Array [ - 0, - 40, + 13, + 14, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 41, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, "range": Array [ - 0, - 8, + 14, + 15, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 16, "line": 1, }, }, "range": Array [ - 9, - 10, + 16, + 19, ], "type": "Identifier", - "value": "f", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 20, "line": 1, }, }, "range": Array [ - 10, - 11, + 20, + 21, ], "type": "Punctuator", - "value": "(", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 21, "line": 1, }, }, "range": Array [ - 11, - 12, + 21, + 22, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 22, "line": 1, }, }, "range": Array [ - 13, - 14, + 22, + 23, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 19, - 22, + 23, + 24, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ - 23, 24, + 25, ], "type": "Identifier", - "value": "x", + "value": "v", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ @@ -93442,238 +99687,226 @@ Object { 26, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 27, + "line": 1, }, }, "range": Array [ 27, - 30, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, + 28, ], "type": "Punctuator", - "value": ".", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 31, - 37, + 28, + 29, ], - "type": "Identifier", - "value": "target", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 37, - 38, + 29, + 30, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 31, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 30, + "line": 1, }, }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "object": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 3, - 5, - ], - "type": "ObjectExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "fn", - "range": Array [ - 0, - 2, - ], - "type": "Identifier", - }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 6, + "column": 5, "line": 1, }, "start": Object { - "column": 0, + "column": 4, "line": 1, }, }, + "name": "x", "range": Array [ - 0, - 6, + 4, + 5, ], - "type": "CallExpression", + "type": "Identifier", }, - "property": Object { + "init": Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, - "name": "x", + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 20, + ], + "raw": "\\"hey\\"", + "type": "Literal", + "value": "hey", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 14, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + }, + ], "range": Array [ - 7, 8, + 28, ], - "type": "Identifier", - }, - "range": Array [ - 0, - 8, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "ObjectExpression", }, - }, - "operator": "=", - "range": Array [ - 0, - 14, - ], - "right": Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, + "column": 4, "line": 1, }, }, - "name": "obj", "range": Array [ - 11, - 14, + 4, + 28, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { "column": 0, @@ -93682,15 +99915,15 @@ Object { }, "range": Array [ 0, - 15, + 29, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -93699,14 +99932,14 @@ Object { }, "range": Array [ 0, - 16, + 30, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, + "column": 3, "line": 1, }, "start": Object { @@ -93716,43 +99949,61 @@ Object { }, "range": Array [ 0, - 2, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Identifier", - "value": "fn", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, "range": Array [ - 2, - 3, + 6, + 7, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 9, "line": 1, }, "start": Object { - "column": 3, + "column": 8, "line": 1, }, }, "range": Array [ - 3, - 4, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -93761,124 +100012,124 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 2, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, "range": Array [ - 4, - 5, + 14, + 15, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { "column": 5, - "line": 1, + "line": 2, }, }, "range": Array [ - 5, - 6, + 15, + 20, ], - "type": "Punctuator", - "value": ")", + "type": "String", + "value": "\\"hey\\"", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 6, - 7, + 20, + 21, ], "type": "Punctuator", - "value": ".", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 7, - 8, + 21, + 22, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 9, - 10, + 23, + 26, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 11, - 14, + 27, + 28, ], - "type": "Identifier", - "value": "obj", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 3, }, }, "range": Array [ - 14, - 15, + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -93888,7 +100139,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` Object { "body": Array [ Object { @@ -93927,28 +100178,9 @@ Object { Object { "computed": true, "key": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 15, - 16, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 2, }, "start": Object { @@ -93956,36 +100188,17 @@ Object { "line": 2, }, }, - "operator": "+", + "name": "bar", "range": Array [ 15, - 20, + 18, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 20, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, - "type": "BinaryExpression", + "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { @@ -93996,25 +100209,25 @@ Object { "method": false, "range": Array [ 14, - 26, + 24, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 13, + "column": 11, "line": 2, }, }, "name": "foo", "range": Array [ - 23, - 26, + 21, + 24, ], "type": "Identifier", }, @@ -94022,7 +100235,7 @@ Object { ], "range": Array [ 8, - 28, + 26, ], "type": "ObjectExpression", }, @@ -94038,7 +100251,7 @@ Object { }, "range": Array [ 4, - 28, + 26, ], "type": "VariableDeclarator", }, @@ -94056,7 +100269,7 @@ Object { }, "range": Array [ 0, - 29, + 27, ], "type": "VariableDeclaration", }, @@ -94073,7 +100286,7 @@ Object { }, "range": Array [ 0, - 30, + 28, ], "sourceType": "script", "tokens": Array [ @@ -94170,7 +100383,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 2, }, "start": Object { @@ -94180,28 +100393,28 @@ Object { }, "range": Array [ 15, - 16, + 18, ], - "type": "Numeric", - "value": "5", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 2, }, "start": Object { - "column": 7, + "column": 8, "line": 2, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Punctuator", - "value": "+", + "value": "]", }, Object { "loc": Object { @@ -94218,31 +100431,13 @@ Object { 19, 20, ], - "type": "Numeric", - "value": "5", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, - ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 2, }, "start": Object { @@ -94252,25 +100447,7 @@ Object { }, "range": Array [ 21, - 22, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 26, + 24, ], "type": "Identifier", "value": "foo", @@ -94287,8 +100464,8 @@ Object { }, }, "range": Array [ - 27, - 28, + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -94305,8 +100482,8 @@ Object { }, }, "range": Array [ - 28, - 29, + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -94316,14 +100493,18 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; + +exports[`javascript fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; + +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "loc": Object { "end": Object { - "column": 17, + "column": 10, "line": 1, }, "start": Object { @@ -94390,74 +100571,16 @@ Object { "value": 10, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 11, - 16, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "raw": "20", - "type": "Literal", - "value": 20, - }, - }, ], "range": Array [ 1, - 17, + 10, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 19, + "column": 12, "line": 1, }, "start": Object { @@ -94467,15 +100590,15 @@ Object { }, "range": Array [ 0, - 19, + 12, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -94484,7 +100607,7 @@ Object { }, "range": Array [ 0, - 19, + 13, ], "sourceType": "script", "tokens": Array [ @@ -94630,94 +100753,22 @@ Object { 10, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "Numeric", - "value": "20", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 17, + "column": 10, "line": 1, }, }, "range": Array [ - 17, - 18, + 10, + 11, ], "type": "Punctuator", "value": ")", @@ -94725,17 +100776,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 12, "line": 1, }, "start": Object { - "column": 18, + "column": 11, "line": 1, }, }, "range": Array [ - 18, - 19, + 11, + 12, ], "type": "Punctuator", "value": ";", @@ -94745,14 +100796,14 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { @@ -94764,190 +100815,109 @@ Object { Object { "computed": true, "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "get", - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 14, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "left": Object { "loc": Object { "end": Object { - "column": 14, + "column": 6, "line": 1, }, "start": Object { - "column": 12, + "column": 3, "line": 1, }, }, "range": Array [ - 12, - 14, + 3, + 6, ], - "type": "BlockStatement", + "raw": "\\"x\\"", + "type": "Literal", + "value": "x", }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 3, "line": 1, }, }, - "params": Array [], + "operator": "+", "range": Array [ - 9, - 14, + 3, + 12, ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "range": Array [ + 9, + 12, + ], + "raw": "\\"y\\"", + "type": "Literal", + "value": "y", }, - "name": "x", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", + "type": "BinaryExpression", }, - "kind": "set", + "kind": "init", "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 16, + "column": 2, "line": 1, }, }, "method": false, "range": Array [ - 16, - 29, + 2, + 17, ], "shorthand": false, "type": "Property", "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 29, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 23, + "column": 15, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "v", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - ], "range": Array [ - 23, - 29, + 15, + 17, ], - "type": "FunctionExpression", + "raw": "10", + "type": "Literal", + "value": 10, }, }, ], "range": Array [ 1, - 30, + 18, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 32, + "column": 20, "line": 1, }, "start": Object { @@ -94957,15 +100927,15 @@ Object { }, "range": Array [ 0, - 32, + 20, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -94974,7 +100944,7 @@ Object { }, "range": Array [ 0, - 32, + 21, ], "sourceType": "script", "tokens": Array [ @@ -95017,7 +100987,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -95027,28 +100997,28 @@ Object { }, "range": Array [ 2, - 5, + 3, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, "range": Array [ + 3, 6, - 7, ], - "type": "Punctuator", - "value": "[", + "type": "String", + "value": "\\"x\\"", }, Object { "loc": Object { @@ -95065,31 +101035,13 @@ Object { 7, 8, ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], "type": "Punctuator", - "value": "]", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -95099,28 +101051,10 @@ Object { }, "range": Array [ 9, - 10, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, + 12, ], - "type": "Punctuator", - "value": ")", + "type": "String", + "value": "\\"y\\"", }, Object { "loc": Object { @@ -95138,7 +101072,7 @@ Object { 13, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { @@ -95156,202 +101090,40 @@ Object { 14, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - "value": "set", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - "value": "v", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 28, + "column": 15, "line": 1, }, }, "range": Array [ - 28, - 29, + 15, + 17, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { - "column": 29, + "column": 17, "line": 1, }, }, "range": Array [ - 29, - 30, + 17, + 18, ], "type": "Punctuator", "value": "}", @@ -95359,17 +101131,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 19, "line": 1, }, "start": Object { - "column": 30, + "column": 18, "line": 1, }, }, "range": Array [ - 30, - 31, + 18, + 19, ], "type": "Punctuator", "value": ")", @@ -95377,17 +101149,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 20, "line": 1, }, "start": Object { - "column": 31, + "column": 19, "line": 1, }, }, "range": Array [ - 31, - 32, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -95397,129 +101169,112 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 5, + "column": 20, "line": 1, }, "start": Object { - "column": 4, + "column": 2, "line": 1, }, }, - "name": "x", + "method": false, "range": Array [ - 4, - 5, + 2, + 20, ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 15, - 20, - ], - "raw": "\\"hey\\"", - "type": "Literal", - "value": "hey", - }, - "kind": "init", + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 18, + "line": 1, }, }, - "method": false, "range": Array [ - 14, - 26, + 18, + 20, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, }, - ], - "range": Array [ - 8, - 28, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 1, + "params": Array [], + "range": Array [ + 7, + 20, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 21, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { "column": 0, @@ -95528,15 +101283,15 @@ Object { }, "range": Array [ 0, - 29, + 23, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -95545,14 +101300,14 @@ Object { }, "range": Array [ 0, - 30, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -95562,25 +101317,61 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, "line": 1, }, "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { "column": 4, "line": 1, }, + "start": Object { + "column": 3, + "line": 1, + }, }, "range": Array [ + 3, 4, - 5, ], "type": "Identifier", "value": "x", @@ -95588,143 +101379,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 5, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 1, }, "start": Object { - "column": 8, + "column": 5, "line": 1, }, }, "range": Array [ - 8, - 9, + 5, + 6, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 14, + 7, 15, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ 15, - 20, + 16, ], - "type": "String", - "value": "\\"hey\\"", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 20, - 21, + 16, + 17, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 21, - 22, + 18, + 19, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 23, - 26, + 19, + 20, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 20, + "line": 1, }, }, "range": Array [ - 27, - 28, + 20, + 21, ], "type": "Punctuator", "value": "}", @@ -95732,17 +101523,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 1, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 28, - 29, + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, ], "type": "Punctuator", "value": ";", @@ -95752,9 +101561,119 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` Object { "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "proto", + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 30, + ], + "type": "VariableDeclaration", + }, Object { "declarations": Array [ Object { @@ -95762,17 +101681,17 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 5, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "name": "x", "range": Array [ - 4, - 5, + 36, + 37, ], "type": "Identifier", }, @@ -95780,91 +101699,148 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 8, }, "start": Object { "column": 8, - "line": 1, + "line": 5, }, }, "properties": Array [ Object { - "computed": true, + "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 10, + "line": 6, }, "start": Object { - "column": 5, - "line": 2, + "column": 1, + "line": 6, }, }, - "name": "bar", + "name": "__proto__", "range": Array [ - 15, - 18, + 43, + 52, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 17, + "line": 6, }, "start": Object { - "column": 4, - "line": 2, + "column": 1, + "line": 6, }, }, "method": false, "range": Array [ - 14, - 24, + 43, + 59, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 17, + "line": 6, }, "start": Object { - "column": 11, - "line": 2, + "column": 12, + "line": 6, }, }, - "name": "foo", + "name": "proto", "range": Array [ - 21, - 24, + 54, + 59, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "name": "__proto__", + "range": Array [ + 62, + 71, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 62, + 78, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "name": "proto", + "range": Array [ + 73, + 78, ], "type": "Identifier", }, }, ], "range": Array [ - 8, - 26, + 40, + 80, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 8, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "range": Array [ - 4, - 26, + 36, + 80, ], "type": "VariableDeclarator", }, @@ -95873,24 +101849,24 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 3, + "line": 8, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 27, + 32, + 81, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 4, + "column": 2, + "line": 8, }, "start": Object { "column": 0, @@ -95899,14 +101875,14 @@ Object { }, "range": Array [ 0, - 28, + 81, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 12, "line": 1, }, "start": Object { @@ -95916,490 +101892,367 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, + 12, ], - "type": "Identifier", - "value": "x", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 12, "line": 1, }, }, "range": Array [ - 6, - 7, + 12, + 13, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 8, - 9, + 15, + 18, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { "column": 4, - "line": 2, + "line": 3, }, }, "range": Array [ - 14, - 15, + 19, + 24, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 5, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 15, - 18, + 25, + 26, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 13, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 18, - 19, + 27, + 28, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 14, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 13, + "line": 3, }, }, "range": Array [ - 19, - 20, + 28, + 29, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 15, + "line": 3, }, "start": Object { - "column": 11, - "line": 2, + "column": 14, + "line": 3, }, }, "range": Array [ - 21, - 24, + 29, + 30, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 25, - 26, + 32, + 35, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 5, + "line": 5, }, "start": Object { - "column": 1, - "line": 3, + "column": 4, + "line": 5, }, }, "range": Array [ - 26, - 27, + 36, + 37, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "x", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; - -exports[`javascript fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; - -exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 9, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 9, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - }, - ], - "range": Array [ - 1, - 10, - ], - "type": "ObjectExpression", - }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 5, }, }, "range": Array [ - 0, - 12, + 38, + 39, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "=", }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 0, - 1, + 40, + 41, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 10, + "line": 6, }, "start": Object { "column": 1, - "line": 1, + "line": 6, }, }, "range": Array [ - 1, - 2, + 43, + 52, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "__proto__", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 11, + "line": 6, }, "start": Object { - "column": 2, - "line": 1, + "column": 10, + "line": 6, }, }, "range": Array [ - 2, - 3, + 52, + 53, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 17, + "line": 6, }, "start": Object { - "column": 3, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 3, - 4, + 54, + 59, ], "type": "Identifier", - "value": "x", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 18, + "line": 6, }, "start": Object { - "column": 4, - "line": 1, + "column": 17, + "line": 6, }, }, "range": Array [ - 4, - 5, + 59, + 60, ], "type": "Punctuator", - "value": "]", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 7, }, "start": Object { - "column": 5, - "line": 1, + "column": 1, + "line": 7, }, }, "range": Array [ - 5, - 6, + 62, + 71, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "__proto__", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 11, + "line": 7, }, "start": Object { - "column": 7, - "line": 1, + "column": 10, + "line": 7, }, }, - "range": Array [ - 7, - 9, + "range": Array [ + 71, + 72, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 17, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 12, + "line": 7, }, }, "range": Array [ - 9, - 10, + 73, + 78, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { - "column": 10, - "line": 1, + "column": 0, + "line": 8, }, }, "range": Array [ - 10, - 11, + 79, + 80, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 2, + "line": 8, }, "start": Object { - "column": 11, - "line": 1, + "column": 1, + "line": 8, }, }, "range": Array [ - 11, - 12, + 80, + 81, ], "type": "Punctuator", "value": ";", @@ -96409,146 +102262,314 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "left": Object { + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "proto", + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 30, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 43, + 54, + ], + "raw": "\\"__proto__\\"", + "type": "Literal", + "value": "__proto__", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 19, + "line": 6, }, "start": Object { - "column": 3, - "line": 1, + "column": 1, + "line": 6, }, }, + "method": false, "range": Array [ - 3, - 6, + 43, + 61, ], - "raw": "\\"x\\"", - "type": "Literal", - "value": "x", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "name": "proto", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", }, }, - "operator": "+", - "range": Array [ - 3, - 12, - ], - "right": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 64, + 75, + ], + "raw": "\\"__proto__\\"", + "type": "Literal", + "value": "__proto__", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 19, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 1, + "line": 7, }, }, + "method": false, "range": Array [ - 9, - 12, + 64, + 82, ], - "raw": "\\"y\\"", - "type": "Literal", - "value": "y", - }, - "type": "BinaryExpression", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "name": "proto", + "range": Array [ + 77, + 82, + ], + "type": "Identifier", + }, }, - }, - "method": false, + ], "range": Array [ - 2, - 17, + 40, + 84, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 17, - ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 5, }, }, - ], - "range": Array [ - 1, - 18, - ], - "type": "ObjectExpression", - }, + "range": Array [ + 36, + 84, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 2, + "line": 8, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 20, + 32, + 85, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 2, + "line": 8, }, "start": Object { "column": 0, @@ -96557,100 +102578,10 @@ Object { }, "range": Array [ 0, - 21, + 85, ], "sourceType": "script", "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 6, - ], - "type": "String", - "value": "\\"x\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "+", - }, Object { "loc": Object { "end": Object { @@ -96658,513 +102589,373 @@ Object { "line": 1, }, "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 12, - ], - "type": "String", - "value": "\\"y\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, + "column": 0, "line": 1, }, }, "range": Array [ + 0, 12, - 13, ], - "type": "Punctuator", - "value": "]", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 14, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ 15, - 17, + 18, ], - "type": "Numeric", - "value": "10", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 17, - 18, + 19, + 24, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 18, - 19, + 25, + 26, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 3, }, }, "range": Array [ - 19, - 20, + 27, + 28, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 20, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 7, - 20, - ], - "type": "FunctionExpression", - }, - }, - ], - "range": Array [ - 1, - 21, - ], - "type": "ObjectExpression", - }, "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 14, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 13, + "line": 3, }, }, "range": Array [ - 0, - 23, + 28, + 29, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 24, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 0, - 1, + 29, + 30, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 1, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 1, - 2, + 32, + 35, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 5, + "line": 5, }, "start": Object { - "column": 2, - "line": 1, + "column": 4, + "line": 5, }, }, "range": Array [ - 2, - 3, + 36, + 37, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 3, - "line": 1, + "column": 6, + "line": 5, }, }, "range": Array [ - 3, - 4, + 38, + 39, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 4, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 4, - 5, + 40, + 41, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 5, - "line": 1, + "column": 1, + "line": 6, }, }, "range": Array [ - 5, - 6, + 43, + 54, ], - "type": "Punctuator", - "value": ":", + "type": "String", + "value": "\\"__proto__\\"", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 6, }, "start": Object { - "column": 7, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 7, - 15, + 54, + 55, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 19, + "line": 6, }, "start": Object { - "column": 15, - "line": 1, + "column": 14, + "line": 6, }, }, "range": Array [ - 15, - 16, + 56, + 61, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 20, + "line": 6, }, "start": Object { - "column": 16, - "line": 1, + "column": 19, + "line": 6, }, }, "range": Array [ - 16, - 17, + 61, + 62, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 7, }, }, "range": Array [ - 18, - 19, + 64, + 75, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"__proto__\\"", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 13, + "line": 7, }, "start": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 7, }, }, "range": Array [ - 19, - 20, + 75, + 76, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 19, + "line": 7, }, "start": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 7, }, }, "range": Array [ - 20, - 21, + 77, + 82, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 8, }, }, "range": Array [ - 21, - 22, + 83, + 84, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 2, + "line": 8, }, "start": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 8, }, }, "range": Array [ - 22, - 23, + 84, + 85, ], "type": "Punctuator", "value": ";", @@ -97174,10 +102965,11 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -97219,7 +103011,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -97227,83 +103019,10 @@ Object { "line": 3, }, }, - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "properties": Array [], - "range": Array [ - 27, - 29, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 29, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 30, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, "name": "x", "range": Array [ - 36, - 37, + 19, + 20, ], "type": "Identifier", }, @@ -97311,11 +103030,11 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 8, - "line": 5, + "line": 3, }, }, "properties": Array [ @@ -97324,56 +103043,57 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, - "line": 6, + "column": 2, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, - "name": "__proto__", + "name": "y", "range": Array [ - 43, - 52, + 26, + 27, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 11, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "method": false, "range": Array [ - 43, - 59, + 26, + 36, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 11, + "line": 4, }, "start": Object { - "column": 12, - "line": 6, + "column": 4, + "line": 4, }, }, - "name": "proto", "range": Array [ - 54, - 59, + 29, + 36, ], - "type": "Identifier", + "raw": "'first'", + "type": "Literal", + "value": "first", }, }, Object { @@ -97381,78 +103101,79 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 2, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, - "name": "__proto__", + "name": "y", "range": Array [ - 62, - 71, + 39, + 40, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 12, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, "method": false, "range": Array [ - 62, - 78, + 39, + 50, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 12, + "line": 5, }, "start": Object { - "column": 12, - "line": 7, + "column": 4, + "line": 5, }, }, - "name": "proto", "range": Array [ - 73, - 78, + 42, + 50, ], - "type": "Identifier", + "raw": "'second'", + "type": "Literal", + "value": "second", }, }, ], "range": Array [ - 40, - 80, + 23, + 52, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 36, - 80, + 19, + 52, ], "type": "VariableDeclarator", }, @@ -97461,16 +103182,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 32, - 81, + 15, + 53, ], "type": "VariableDeclaration", }, @@ -97478,7 +103199,7 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, @@ -97487,7 +103208,7 @@ Object { }, "range": Array [ 0, - 81, + 53, ], "sourceType": "script", "tokens": Array [ @@ -97548,7 +103269,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -97558,25 +103279,25 @@ Object { }, "range": Array [ 19, - 24, + 20, ], "type": "Identifier", - "value": "proto", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 3, }, "start": Object { - "column": 10, + "column": 6, "line": 3, }, }, "range": Array [ - 25, - 26, + 21, + 22, ], "type": "Punctuator", "value": "=", @@ -97584,17 +103305,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 9, "line": 3, }, "start": Object { - "column": 12, + "column": 8, "line": 3, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": "{", @@ -97602,101 +103323,101 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 2, + "line": 4, }, "start": Object { - "column": 13, - "line": 3, + "column": 1, + "line": 4, }, }, "range": Array [ - 28, - 29, + 26, + 27, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 3, + "line": 4, }, "start": Object { - "column": 14, - "line": 3, + "column": 2, + "line": 4, }, }, "range": Array [ - 29, - 30, + 27, + 28, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 11, + "line": 4, }, "start": Object { - "column": 0, - "line": 5, + "column": 4, + "line": 4, }, }, "range": Array [ - 32, - 35, + 29, + 36, ], - "type": "Keyword", - "value": "var", + "type": "String", + "value": "'first'", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 12, + "line": 4, }, "start": Object { - "column": 4, - "line": 5, + "column": 11, + "line": 4, }, }, "range": Array [ 36, 37, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 2, "line": 5, }, "start": Object { - "column": 6, + "column": 1, "line": 5, }, }, "range": Array [ - 38, 39, + 40, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 3, "line": 5, }, "start": Object { - "column": 8, + "column": 2, "line": 5, }, }, @@ -97705,148 +103426,40 @@ Object { 41, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 6, - }, - "start": Object { - "column": 1, - "line": 6, - }, - }, - "range": Array [ - 43, - 52, - ], - "type": "Identifier", - "value": "__proto__", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 6, - }, - "start": Object { - "column": 10, - "line": 6, - }, - }, - "range": Array [ - 52, - 53, - ], - "type": "Punctuator", "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, - }, - "start": Object { "column": 12, - "line": 6, - }, - }, - "range": Array [ - 54, - 59, - ], - "type": "Identifier", - "value": "proto", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 6, - }, - "start": Object { - "column": 17, - "line": 6, - }, - }, - "range": Array [ - 59, - 60, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 1, - "line": 7, - }, - }, - "range": Array [ - 62, - 71, - ], - "type": "Identifier", - "value": "__proto__", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 71, - 72, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 7, + "line": 5, }, "start": Object { - "column": 12, - "line": 7, + "column": 4, + "line": 5, }, }, "range": Array [ - 73, - 78, + 42, + 50, ], - "type": "Identifier", - "value": "proto", + "type": "String", + "value": "'second'", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 0, - "line": 8, + "line": 6, }, }, "range": Array [ - 79, - 80, + 51, + 52, ], "type": "Punctuator", "value": "}", @@ -97855,16 +103468,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 1, - "line": 8, + "line": 6, }, }, "range": Array [ - 80, - 81, + 52, + 53, ], "type": "Punctuator", "value": ";", @@ -97874,10 +103487,11 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { @@ -97919,7 +103533,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -97927,83 +103541,10 @@ Object { "line": 3, }, }, - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "properties": Array [], - "range": Array [ - 27, - 29, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 29, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 30, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, "name": "x", "range": Array [ - 36, - 37, + 19, + 20, ], "type": "Identifier", }, @@ -98011,11 +103552,11 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 8, - "line": 5, + "line": 3, }, }, "properties": Array [ @@ -98024,57 +103565,58 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 4, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "range": Array [ - 43, - 54, + 26, + 29, ], - "raw": "\\"__proto__\\"", + "raw": "\\"y\\"", "type": "Literal", - "value": "__proto__", + "value": "y", }, "kind": "init", "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 13, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "method": false, "range": Array [ - 43, - 61, + 26, + 38, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 13, + "line": 4, }, "start": Object { - "column": 14, - "line": 6, + "column": 6, + "line": 4, }, }, - "name": "proto", "range": Array [ - 56, - 61, + 31, + 38, ], - "type": "Identifier", + "raw": "\\"first\\"", + "type": "Literal", + "value": "first", }, }, Object { @@ -98082,79 +103624,80 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 4, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, "range": Array [ - 64, - 75, + 41, + 44, ], - "raw": "\\"__proto__\\"", + "raw": "\\"y\\"", "type": "Literal", - "value": "__proto__", + "value": "y", }, "kind": "init", "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 14, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, "method": false, "range": Array [ - 64, - 82, + 41, + 54, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 14, + "line": 5, }, "start": Object { - "column": 14, - "line": 7, + "column": 6, + "line": 5, }, }, - "name": "proto", "range": Array [ - 77, - 82, + 46, + 54, ], - "type": "Identifier", + "raw": "\\"second\\"", + "type": "Literal", + "value": "second", }, }, ], "range": Array [ - 40, - 84, + 23, + 56, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 36, - 84, + 19, + 56, ], "type": "VariableDeclarator", }, @@ -98163,16 +103706,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 32, - 85, + 15, + 57, ], "type": "VariableDeclaration", }, @@ -98180,7 +103723,7 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, @@ -98189,7 +103732,7 @@ Object { }, "range": Array [ 0, - 85, + 57, ], "sourceType": "script", "tokens": Array [ @@ -98250,7 +103793,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -98260,25 +103803,25 @@ Object { }, "range": Array [ 19, - 24, + 20, ], "type": "Identifier", - "value": "proto", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 3, }, "start": Object { - "column": 10, + "column": 6, "line": 3, }, }, "range": Array [ - 25, - 26, + 21, + 22, ], "type": "Punctuator", "value": "=", @@ -98286,71 +103829,413 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 9, "line": 3, }, "start": Object { - "column": 12, + "column": 8, "line": 3, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": "{", }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "String", + "value": "\\"y\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "String", + "value": "\\"first\\"", + }, Object { "loc": Object { "end": Object { "column": 14, - "line": 3, + "line": 4, }, "start": Object { "column": 13, - "line": 3, + "line": 4, }, }, "range": Array [ - 28, - 29, + 38, + 39, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 4, + "line": 5, }, "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "String", + "value": "\\"y\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { "column": 14, - "line": 3, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, }, }, "range": Array [ - 29, - 30, + 46, + 54, + ], + "type": "String", + "value": "\\"second\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 56, + 57, ], "type": "Punctuator", "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; + +exports[`javascript fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 14, + 47, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 30, + 41, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 47, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 17, + 47, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 8, + 49, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 49, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 3, - "line": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 35, + 0, + 3, ], "type": "Keyword", "value": "var", @@ -98359,16 +104244,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 36, - 37, + 4, + 5, ], "type": "Identifier", "value": "x", @@ -98377,16 +104262,16 @@ Object { "loc": Object { "end": Object { "column": 7, - "line": 5, + "line": 1, }, "start": Object { "column": 6, - "line": 5, + "line": 1, }, }, "range": Array [ - 38, - 39, + 6, + 7, ], "type": "Punctuator", "value": "=", @@ -98395,16 +104280,16 @@ Object { "loc": Object { "end": Object { "column": 9, - "line": 5, + "line": 1, }, "start": Object { "column": 8, - "line": 5, + "line": 1, }, }, "range": Array [ - 40, - 41, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -98412,143 +104297,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 7, + "line": 2, }, "start": Object { - "column": 1, - "line": 6, + "column": 4, + "line": 2, }, }, "range": Array [ - 43, - 54, + 14, + 17, ], - "type": "String", - "value": "\\"__proto__\\"", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 8, + "line": 2, }, "start": Object { - "column": 12, - "line": 6, + "column": 7, + "line": 2, }, }, "range": Array [ - 54, - 55, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 9, + "line": 2, }, "start": Object { - "column": 14, - "line": 6, + "column": 8, + "line": 2, }, }, "range": Array [ - 56, - 61, + 18, + 19, ], - "type": "Identifier", - "value": "proto", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 6, + "column": 11, + "line": 2, }, "start": Object { - "column": 19, - "line": 6, + "column": 10, + "line": 2, }, }, "range": Array [ - 61, - 62, + 20, + 21, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 14, + "line": 3, }, "start": Object { - "column": 1, - "line": 7, + "column": 8, + "line": 3, }, }, "range": Array [ - 64, - 75, + 30, + 36, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, ], - "type": "String", - "value": "\\"__proto__\\"", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 19, + "line": 3, }, "start": Object { - "column": 12, - "line": 7, + "column": 18, + "line": 3, }, }, "range": Array [ - 75, - 76, + 40, + 41, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 5, + "line": 4, }, "start": Object { - "column": 14, - "line": 7, + "column": 4, + "line": 4, }, }, "range": Array [ - 77, - 82, + 46, + 47, ], - "type": "Identifier", - "value": "proto", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 5, }, "start": Object { "column": 0, - "line": 8, + "line": 5, }, }, "range": Array [ - 83, - 84, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -98557,16 +104460,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 5, }, "start": Object { "column": 1, - "line": 8, + "line": 5, }, }, "range": Array [ - 84, - 85, + 49, + 50, ], "type": "Punctuator", "value": ";", @@ -98576,240 +104479,182 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` Object { "body": Array [ Object { "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, "line": 1, }, }, + "operator": "=", "range": Array [ 0, - 12, + 28, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 3, - }, + "start": Object { + "column": 4, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "name": "y", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "kind": "init", + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 11, - "line": 4, + "column": 10, + "line": 2, }, "start": Object { - "column": 1, - "line": 4, + "column": 4, + "line": 2, }, }, - "method": false, + "name": "method", "range": Array [ - 26, - 36, + 10, + 16, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 29, - 36, - ], - "raw": "'first'", - "type": "Literal", - "value": "first", + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, }, }, - Object { - "computed": false, - "key": Object { + "method": true, + "range": Array [ + 10, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 13, + "line": 2, }, }, - "name": "y", "range": Array [ - 39, - 40, + 19, + 26, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "init", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 12, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 10, + "line": 2, }, }, - "method": false, + "params": Array [], "range": Array [ - 39, - 50, + 16, + 26, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 42, - 50, - ], - "raw": "'second'", - "type": "Literal", - "value": "second", - }, + "type": "FunctionExpression", }, - ], - "range": Array [ - 23, - 52, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 3, }, - }, + ], "range": Array [ - 19, - 52, + 4, + 28, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 15, - 53, + 0, + 29, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 6, + "column": 3, + "line": 4, }, "start": Object { "column": 0, @@ -98818,14 +104663,14 @@ Object { }, "range": Array [ 0, - 53, + 30, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 1, "line": 1, }, "start": Object { @@ -98835,97 +104680,43 @@ Object { }, "range": Array [ 0, - 12, + 1, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 1, }, "start": Object { - "column": 12, + "column": 2, "line": 1, }, }, "range": Array [ - 12, - 13, + 2, + 3, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "Keyword", - "value": "var", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 1, }, "start": Object { "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, + "line": 1, }, }, "range": Array [ - 23, - 24, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -98933,143 +104724,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 10, + "line": 2, }, "start": Object { - "column": 1, - "line": 4, + "column": 4, + "line": 2, }, }, "range": Array [ - 26, - 27, + 10, + 16, ], "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": ":", + "value": "method", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 4, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 10, + "line": 2, }, }, "range": Array [ - 29, - 36, + 16, + 17, ], - "type": "String", - "value": "'first'", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 4, + "line": 2, }, "start": Object { "column": 11, - "line": 4, + "line": 2, }, }, "range": Array [ - 36, - 37, + 17, + 18, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - "value": "y", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 14, + "line": 2, }, "start": Object { - "column": 2, - "line": 5, + "column": 13, + "line": 2, }, }, "range": Array [ - 40, - 41, + 19, + 20, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 42, - 50, + 25, + 26, ], - "type": "String", - "value": "'second'", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 6, + "line": 4, }, }, "range": Array [ - 51, - 52, + 27, + 28, ], "type": "Punctuator", "value": "}", @@ -99078,16 +104833,34 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "range": Array [ - 52, - 53, + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -99097,242 +104870,182 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` Object { "body": Array [ Object { "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, "line": 1, }, }, + "operator": "=", "range": Array [ 0, - 12, + 25, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 3, - }, + "start": Object { + "column": 4, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 26, - 29, - ], - "raw": "\\"y\\"", - "type": "Literal", - "value": "y", - }, - "kind": "init", + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 7, + "line": 2, }, "start": Object { - "column": 1, - "line": 4, + "column": 4, + "line": 2, }, }, - "method": false, + "name": "get", "range": Array [ - 26, - 38, + 10, + 13, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "range": Array [ - 31, - 38, - ], - "raw": "\\"first\\"", - "type": "Literal", - "value": "first", + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, }, }, - Object { - "computed": false, - "key": Object { + "method": true, + "range": Array [ + 10, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 10, + "line": 2, }, }, "range": Array [ - 41, - 44, + 16, + 23, ], - "raw": "\\"y\\"", - "type": "Literal", - "value": "y", + "type": "BlockStatement", }, - "kind": "init", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 14, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 7, + "line": 2, }, }, - "method": false, + "params": Array [], "range": Array [ - 41, - 54, + 13, + 23, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "range": Array [ - 46, - 54, - ], - "raw": "\\"second\\"", - "type": "Literal", - "value": "second", - }, + "type": "FunctionExpression", }, - ], - "range": Array [ - 23, - 56, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 3, }, - }, + ], "range": Array [ - 19, - 56, + 4, + 25, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 15, - 57, + 0, + 26, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 6, + "column": 3, + "line": 4, }, "start": Object { "column": 0, @@ -99341,14 +105054,14 @@ Object { }, "range": Array [ 0, - 57, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 1, "line": 1, }, "start": Object { @@ -99358,241 +105071,151 @@ Object { }, "range": Array [ 0, - 12, + 1, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 1, }, "start": Object { - "column": 12, + "column": 2, "line": 1, }, }, "range": Array [ - 12, - 13, + 2, + 3, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 5, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 4, + "line": 1, }, }, "range": Array [ - 15, - 18, + 4, + 5, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 7, + "line": 2, }, "start": Object { "column": 4, - "line": 3, + "line": 2, }, }, "range": Array [ - 19, - 20, + 10, + 13, ], "type": "Identifier", - "value": "x", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 8, + "line": 2, }, "start": Object { - "column": 6, - "line": 3, + "column": 7, + "line": 2, }, }, "range": Array [ - 21, - 22, + 13, + 14, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 3, + "line": 2, }, "start": Object { "column": 8, - "line": 3, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "String", - "value": "\\"y\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, + "line": 2, }, }, "range": Array [ - 29, - 30, + 14, + 15, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "range": Array [ - 31, - 38, - ], - "type": "String", - "value": "\\"first\\"", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 11, + "line": 2, }, "start": Object { - "column": 13, - "line": 4, + "column": 10, + "line": 2, }, }, "range": Array [ - 38, - 39, + 16, + 17, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "range": Array [ - 41, - 44, - ], - "type": "String", - "value": "\\"y\\"", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 44, - 45, + 22, + 23, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "range": Array [ - 46, - 54, - ], - "type": "String", - "value": "\\"second\\"", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 6, + "line": 4, }, }, "range": Array [ - 55, - 56, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -99601,16 +105224,34 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "range": Array [ - 56, - 57, + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -99620,188 +105261,148 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "init", + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 2, }, "start": Object { "column": 4, "line": 2, }, }, - "method": true, + "name": "set", "range": Array [ - 14, - 47, + 10, + 13, ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 30, - 41, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 20, - 47, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 10, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 3, }, "start": Object { - "column": 7, + "column": 10, "line": 2, }, }, - "params": Array [], "range": Array [ - 17, - 47, + 16, + 23, ], - "type": "FunctionExpression", + "type": "BlockStatement", }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 13, + 23, + ], + "type": "FunctionExpression", }, - ], - "range": Array [ - 8, - 49, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 1, }, - }, + ], "range": Array [ 4, - 49, + 25, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -99810,15 +105411,32 @@ Object { }, "range": Array [ 0, - 50, + 26, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 3, + "line": 4, }, "start": Object { "column": 0, @@ -99827,14 +105445,14 @@ Object { }, "range": Array [ 0, - 51, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -99844,25 +105462,7 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, + 1, ], "type": "Identifier", "value": "x", @@ -99870,17 +105470,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { - "column": 6, + "column": 2, "line": 1, }, }, "range": Array [ - 6, - 7, + 2, + 3, ], "type": "Punctuator", "value": "=", @@ -99888,17 +105488,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { - "column": 8, + "column": 4, "line": 1, }, }, "range": Array [ - 8, - 9, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -99915,11 +105515,11 @@ Object { }, }, "range": Array [ - 14, - 17, + 10, + 13, ], "type": "Identifier", - "value": "foo", + "value": "set", }, Object { "loc": Object { @@ -99933,8 +105533,8 @@ Object { }, }, "range": Array [ - 17, - 18, + 13, + 14, ], "type": "Punctuator", "value": "(", @@ -99951,8 +105551,8 @@ Object { }, }, "range": Array [ - 18, - 19, + 14, + 15, ], "type": "Punctuator", "value": ")", @@ -99969,8 +105569,8 @@ Object { }, }, "range": Array [ - 20, - 21, + 16, + 17, ], "type": "Punctuator", "value": "{", @@ -99978,71 +105578,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 30, - 36, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, + "column": 5, "line": 3, }, "start": Object { - "column": 18, + "column": 4, "line": 3, }, }, "range": Array [ - 40, - 41, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 4, }, "start": Object { - "column": 4, + "column": 0, "line": 4, }, }, "range": Array [ - 46, - 47, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -100050,35 +105614,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 2, + "line": 4, }, "start": Object { - "column": 0, - "line": 5, + "column": 1, + "line": 4, }, }, "range": Array [ - 48, - 49, + 25, + 26, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 3, + "line": 4, }, "start": Object { - "column": 1, - "line": 5, + "column": 2, + "line": 4, }, }, "range": Array [ - 49, - 50, + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -100088,7 +105652,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` Object { "body": Array [ Object { @@ -100114,7 +105678,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -100124,13 +105688,13 @@ Object { "operator": "=", "range": Array [ 0, - 28, + 33, ], "right": Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 4, @@ -100162,7 +105726,7 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { "column": 4, @@ -100172,7 +105736,7 @@ Object { "method": true, "range": Array [ 10, - 26, + 31, ], "shorthand": false, "type": "Property", @@ -100183,16 +105747,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { - "column": 13, + "column": 17, "line": 2, }, }, "range": Array [ - 19, - 26, + 23, + 31, ], "type": "BlockStatement", }, @@ -100202,17 +105766,36 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { "column": 10, "line": 2, }, }, - "params": Array [], + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "test", + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + }, + ], "range": Array [ 16, - 26, + 31, ], "type": "FunctionExpression", }, @@ -100220,7 +105803,7 @@ Object { ], "range": Array [ 4, - 28, + 33, ], "type": "ObjectExpression", }, @@ -100229,7 +105812,7 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -100238,7 +105821,7 @@ Object { }, "range": Array [ 0, - 29, + 34, ], "type": "ExpressionStatement", }, @@ -100246,16 +105829,16 @@ Object { "loc": Object { "end": Object { "column": 3, - "line": 4, + "line": 5, }, "start": Object { "column": 2, - "line": 4, + "line": 5, }, }, "range": Array [ - 29, - 30, + 34, + 35, ], "type": "EmptyStatement", }, @@ -100263,7 +105846,7 @@ Object { "loc": Object { "end": Object { "column": 3, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -100272,7 +105855,7 @@ Object { }, "range": Array [ 0, - 30, + 35, ], "sourceType": "script", "tokens": Array [ @@ -100369,7 +105952,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 2, }, "start": Object { @@ -100379,7 +105962,25 @@ Object { }, "range": Array [ 17, - 18, + 21, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, ], "type": "Punctuator", "value": ")", @@ -100387,17 +105988,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 2, }, "start": Object { - "column": 13, + "column": 17, "line": 2, }, }, "range": Array [ - 19, - 20, + 23, + 24, ], "type": "Punctuator", "value": "{", @@ -100406,16 +106007,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { "column": 4, - "line": 3, + "line": 4, }, }, "range": Array [ - 25, - 26, + 30, + 31, ], "type": "Punctuator", "value": "}", @@ -100424,16 +106025,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, - "line": 4, + "line": 5, }, }, "range": Array [ - 27, - 28, + 32, + 33, ], "type": "Punctuator", "value": "}", @@ -100442,16 +106043,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 4, + "line": 5, }, "start": Object { "column": 1, - "line": 4, + "line": 5, }, }, "range": Array [ - 28, - 29, + 33, + 34, ], "type": "Punctuator", "value": ";", @@ -100460,16 +106061,16 @@ Object { "loc": Object { "end": Object { "column": 3, - "line": 4, + "line": 5, }, "start": Object { "column": 2, - "line": 4, + "line": 5, }, }, "range": Array [ - 29, - 30, + 34, + 35, ], "type": "Punctuator", "value": ";", @@ -100479,7 +106080,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` Object { "body": Array [ Object { @@ -100515,7 +106116,7 @@ Object { "operator": "=", "range": Array [ 0, - 25, + 30, ], "right": Object { "loc": Object { @@ -100534,7 +106135,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 2, }, "start": Object { @@ -100542,12 +106143,13 @@ Object { "line": 2, }, }, - "name": "get", "range": Array [ 10, - 13, + 18, ], - "type": "Identifier", + "raw": "\\"method\\"", + "type": "Literal", + "value": "method", }, "kind": "init", "loc": Object { @@ -100563,7 +106165,7 @@ Object { "method": true, "range": Array [ 10, - 23, + 28, ], "shorthand": false, "type": "Property", @@ -100577,13 +106179,13 @@ Object { "line": 3, }, "start": Object { - "column": 10, + "column": 15, "line": 2, }, }, "range": Array [ - 16, - 23, + 21, + 28, ], "type": "BlockStatement", }, @@ -100596,14 +106198,14 @@ Object { "line": 3, }, "start": Object { - "column": 7, + "column": 12, "line": 2, }, }, "params": Array [], "range": Array [ - 13, - 23, + 18, + 28, ], "type": "FunctionExpression", }, @@ -100611,7 +106213,7 @@ Object { ], "range": Array [ 4, - 25, + 30, ], "type": "ObjectExpression", }, @@ -100629,7 +106231,7 @@ Object { }, "range": Array [ 0, - 26, + 31, ], "type": "ExpressionStatement", }, @@ -100645,8 +106247,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 31, + 32, ], "type": "EmptyStatement", }, @@ -100663,7 +106265,7 @@ Object { }, "range": Array [ 0, - 27, + 32, ], "sourceType": "script", "tokens": Array [ @@ -100724,7 +106326,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 2, }, "start": Object { @@ -100734,25 +106336,25 @@ Object { }, "range": Array [ 10, - 13, + 18, ], - "type": "Identifier", - "value": "get", + "type": "String", + "value": "\\"method\\"", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 2, }, "start": Object { - "column": 7, + "column": 12, "line": 2, }, }, "range": Array [ - 13, - 14, + 18, + 19, ], "type": "Punctuator", "value": "(", @@ -100760,17 +106362,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 2, }, "start": Object { - "column": 8, + "column": 13, "line": 2, }, }, "range": Array [ - 14, - 15, + 19, + 20, ], "type": "Punctuator", "value": ")", @@ -100778,17 +106380,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 2, }, "start": Object { - "column": 10, + "column": 15, "line": 2, }, }, "range": Array [ - 16, - 17, + 21, + 22, ], "type": "Punctuator", "value": "{", @@ -100805,8 +106407,8 @@ Object { }, }, "range": Array [ - 22, - 23, + 27, + 28, ], "type": "Punctuator", "value": "}", @@ -100823,8 +106425,8 @@ Object { }, }, "range": Array [ - 24, - 25, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -100841,8 +106443,8 @@ Object { }, }, "range": Array [ - 25, - 26, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -100859,8 +106461,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -100870,148 +106472,187 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 25, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { "column": 4, "line": 2, }, - }, - "name": "set", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "method": true, - "range": Array [ - 10, - 23, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + }, + "method": true, + "range": Array [ + 14, + 49, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 32, + 43, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { - "column": 10, + "column": 9, "line": 2, }, }, + "params": Array [], "range": Array [ - 16, - 23, + 19, + 49, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 2, - }, + "type": "FunctionExpression", }, - "params": Array [], - "range": Array [ - 13, - 23, - ], - "type": "FunctionExpression", }, + ], + "range": Array [ + 8, + 51, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, }, - ], + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ 4, - 25, + 51, ], - "type": "ObjectExpression", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { "column": 2, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -101020,32 +106661,15 @@ Object { }, "range": Array [ 0, - 26, - ], - "type": "ExpressionStatement", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 26, - 27, + 52, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -101054,14 +106678,14 @@ Object { }, "range": Array [ 0, - 27, + 53, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -101071,7 +106695,25 @@ Object { }, "range": Array [ 0, - 1, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Identifier", "value": "x", @@ -101079,17 +106721,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, "range": Array [ - 2, - 3, + 6, + 7, ], "type": "Punctuator", "value": "=", @@ -101097,17 +106739,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 8, "line": 1, }, }, "range": Array [ - 4, - 5, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -101115,7 +106757,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 2, }, "start": Object { @@ -101124,26 +106766,26 @@ Object { }, }, "range": Array [ - 10, - 13, + 14, + 19, ], - "type": "Identifier", - "value": "set", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 2, }, "start": Object { - "column": 7, + "column": 9, "line": 2, }, }, "range": Array [ - 13, - 14, + 19, + 20, ], "type": "Punctuator", "value": "(", @@ -101151,17 +106793,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 2, }, "start": Object { - "column": 8, + "column": 10, "line": 2, }, }, "range": Array [ - 14, - 15, + 20, + 21, ], "type": "Punctuator", "value": ")", @@ -101169,17 +106811,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 2, }, "start": Object { - "column": 10, + "column": 12, "line": 2, }, }, "range": Array [ - 16, - 17, + 22, + 23, ], "type": "Punctuator", "value": "{", @@ -101187,35 +106829,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 3, }, "start": Object { - "column": 4, + "column": 8, "line": 3, }, }, "range": Array [ - 22, - 23, + 32, + 38, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 4, }, "start": Object { - "column": 0, + "column": 4, "line": 4, }, }, "range": Array [ - 24, - 25, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -101223,35 +106901,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 1, + "line": 5, }, "start": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 5, }, }, "range": Array [ - 25, - 26, + 50, + 51, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 2, + "line": 5, }, "start": Object { - "column": 2, - "line": 4, + "column": 1, + "line": 5, }, }, "range": Array [ - 26, - 27, + 51, + 52, ], "type": "Punctuator", "value": ";", @@ -101261,201 +106939,387 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, "loc": Object { "end": Object { - "column": 1, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 4, "line": 1, }, }, - "name": "x", "range": Array [ - 0, - 1, + 4, + 7, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", }, - "start": Object { - "column": 0, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", }, - "operator": "=", - "range": Array [ - 0, - 33, - ], - "right": Object { + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 7, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 3, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 42, + 45, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 7, + "line": 7, }, "start": Object { "column": 4, - "line": 2, + "line": 7, }, }, - "name": "method", + "method": false, "range": Array [ - 10, - 16, + 51, + 54, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", }, }, - "method": true, - "range": Array [ - 10, - 31, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 8, }, "start": Object { - "column": 17, - "line": 2, + "column": 4, + "line": 8, }, }, + "name": "set", "range": Array [ - 23, - 31, + 60, + 63, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, + "kind": "init", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 8, }, "start": Object { - "column": 10, - "line": 2, + "column": 4, + "line": 8, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "test", - "range": Array [ - 17, - 21, - ], - "type": "Identifier", - }, - ], + "method": false, "range": Array [ - 16, - 31, + 60, + 63, ], - "type": "FunctionExpression", + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 60, + 63, + ], + "type": "Identifier", + }, }, + ], + "range": Array [ + 36, + 65, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, }, - ], + "start": Object { + "column": 4, + "line": 5, + }, + }, "range": Array [ - 4, - 33, + 32, + 65, ], - "type": "ObjectExpression", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 34, - ], - "type": "ExpressionStatement", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 2, "line": 5, }, }, "range": Array [ - 34, - 35, + 28, + 66, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 0, + "line": 10, }, "start": Object { "column": 0, @@ -101464,14 +107328,14 @@ Object { }, "range": Array [ 0, - 35, + 67, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -101481,51 +107345,51 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 4, "line": 1, }, }, "range": Array [ - 2, - 3, + 4, + 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "range": Array [ - 4, - 5, + 7, + 8, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 2, }, "start": Object { @@ -101534,20 +107398,20 @@ Object { }, }, "range": Array [ - 10, + 13, 16, ], "type": "Identifier", - "value": "method", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 2, }, "start": Object { - "column": 10, + "column": 7, "line": 2, }, }, @@ -101556,316 +107420,293 @@ Object { 17, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 11, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 17, - 21, + 22, + 25, ], "type": "Identifier", - "value": "test", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ - 21, - 22, + 25, + 26, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 3, + "line": 5, }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 5, }, }, "range": Array [ - 23, - 24, + 28, + 31, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 5, }, "start": Object { "column": 4, - "line": 4, + "line": 5, }, }, "range": Array [ - 30, - 31, + 32, + 33, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 7, "line": 5, }, "start": Object { - "column": 0, + "column": 6, "line": 5, }, }, "range": Array [ - 32, - 33, + 34, + 35, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 5, }, "start": Object { - "column": 1, + "column": 8, "line": 5, }, }, "range": Array [ - 33, - 34, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 7, + "line": 6, }, "start": Object { - "column": 2, - "line": 5, + "column": 4, + "line": 6, }, }, "range": Array [ - 34, - 35, + 42, + 45, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, ], "type": "Punctuator", - "value": ";", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 7, + "line": 7, }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "start": Object { + "column": 4, + "line": 7, }, - "operator": "=", - "range": Array [ - 0, - 30, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 10, - 18, - ], - "raw": "\\"method\\"", - "type": "Literal", - "value": "method", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "method": true, - "range": Array [ - 10, - 28, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 21, - 28, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 18, - 28, - ], - "type": "FunctionExpression", - }, - }, - ], - "range": Array [ - 4, - 30, - ], - "type": "ObjectExpression", + }, + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, }, - "type": "AssignmentExpression", }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ",", + }, + Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 7, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 0, - 31, + 60, + 63, ], - "type": "ExpressionStatement", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 1, + "line": 9, }, "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { "column": 2, - "line": 4, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, }, }, "range": Array [ - 31, - 32, + 65, + 66, ], - "type": "EmptyStatement", + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/octalLiterals/lowercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0o717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -101874,14 +107715,14 @@ Object { }, "range": Array [ 0, - 32, + 7, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -101891,187 +107732,292 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "0o717", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { - "column": 2, + "column": 5, "line": 1, }, }, "range": Array [ - 2, - 3, + 5, + 6, ], "type": "Punctuator", - "value": "=", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/octalLiterals/strict-uppercase.src 1`] = ` +Object { + "body": Array [ Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, "range": Array [ - 4, - 5, + 0, + 13, ], - "type": "Punctuator", - "value": "{", + "type": "ExpressionStatement", }, Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, "loc": Object { "end": Object { - "column": 12, + "column": 6, "line": 2, }, "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, "range": Array [ - 10, - 18, + 14, + 20, ], - "type": "String", - "value": "\\"method\\"", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 18, - 19, + 0, + 12, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 19, - 20, + 12, + 13, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 5, "line": 2, }, "start": Object { - "column": 15, + "column": 0, "line": 2, }, }, "range": Array [ - 21, - 22, + 14, + 19, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "0O717", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 6, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 5, + "line": 2, }, }, "range": Array [ - 27, - 28, + 19, + 20, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/octalLiterals/uppercase.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { "column": 0, - "line": 4, + "line": 1, }, }, "range": Array [ - 29, - 30, + 0, + 6, ], - "type": "Punctuator", - "value": "}", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 5, + "line": 1, }, "start": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 30, - 31, + 0, + 5, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "0O717", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 5, + "line": 1, }, }, "range": Array [ - 31, - 32, + 5, + 6, ], "type": "Punctuator", "value": ";", @@ -102081,7 +108027,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` +exports[`javascript fixtures/regex/regexp-simple.src 1`] = ` Object { "body": Array [ Object { @@ -102090,7 +108036,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -102098,152 +108044,40 @@ Object { "line": 1, }, }, - "name": "x", + "name": "foo", "range": Array [ 4, - 5, + 7, ], "type": "Identifier", }, "init": Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "method": true, - "range": Array [ - 14, - 49, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 32, - 43, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 19, - 49, - ], - "type": "FunctionExpression", - }, - }, - ], "range": Array [ - 8, - 51, + 10, + 16, ], - "type": "ObjectExpression", + "raw": "/foo./", + "regex": Object { + "flags": "", + "pattern": "foo.", + }, + "type": "Literal", + "value": Object {}, }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { "column": 4, @@ -102252,7 +108086,7 @@ Object { }, "range": Array [ 4, - 51, + 16, ], "type": "VariableDeclarator", }, @@ -102260,8 +108094,8 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 17, + "line": 1, }, "start": Object { "column": 0, @@ -102270,7 +108104,7 @@ Object { }, "range": Array [ 0, - 52, + 17, ], "type": "VariableDeclaration", }, @@ -102278,7 +108112,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -102287,7 +108121,7 @@ Object { }, "range": Array [ 0, - 53, + 18, ], "sourceType": "script", "tokens": Array [ @@ -102312,7 +108146,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -102322,28 +108156,10 @@ Object { }, "range": Array [ 4, - 5, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -102361,184 +108177,44 @@ Object { 9, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { "column": 10, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, + "line": 1, }, }, "range": Array [ - 48, - 49, + 10, + 16, ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, + "regex": Object { + "flags": "", + "pattern": "foo.", }, - "range": Array [ - 50, - 51, - ], - "type": "Punctuator", - "value": "}", + "type": "RegularExpression", + "value": "/foo./", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 17, + "line": 1, }, "start": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, }, "range": Array [ - 51, - 52, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -102548,7 +108224,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` +exports[`javascript fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` Object { "body": Array [ Object { @@ -102557,7 +108233,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -102565,99 +108241,49 @@ Object { "line": 1, }, }, - "name": "foo", + "name": "x", "range": Array [ 4, - 7, + 5, ], "type": "Identifier", }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { + "init": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, - "name": "get", "range": Array [ - 13, - 16, + 8, + 40, ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", }, - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", + "type": "Literal", + "value": Object {}, }, - "init": null, "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 40, + "line": 1, }, "start": Object { "column": 4, - "line": 3, + "line": 1, }, }, "range": Array [ - 22, - 25, + 4, + 40, ], "type": "VariableDeclarator", }, @@ -102665,8 +108291,8 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 41, + "line": 1, }, "start": Object { "column": 0, @@ -102675,234 +108301,186 @@ Object { }, "range": Array [ 0, - 26, + 41, ], "type": "VariableDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "method": false, - "range": Array [ - 42, - 45, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "method": false, - "range": Array [ - 51, - 54, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 40, + ], + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", + }, + "type": "RegularExpression", + "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": "set", - "range": Array [ - 60, - 63, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "method": false, - "range": Array [ - 60, - 63, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": "set", - "range": Array [ - 60, - 63, - ], - "type": "Identifier", - }, + "start": Object { + "column": 4, + "line": 1, }, + }, + "name": "x", + "range": Array [ + 4, + 5, ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, "range": Array [ - 36, - 65, + 8, + 21, ], - "type": "ObjectExpression", + "raw": "/\\\\u{110000}/u", + "regex": Object { + "flags": "u", + "pattern": "\\\\u{110000}", + }, + "type": "Literal", + "value": null, }, "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 21, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 65, + 4, + 21, ], "type": "VariableDeclarator", }, @@ -102910,17 +108488,17 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 22, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 66, + 0, + 22, ], "type": "VariableDeclaration", }, @@ -102928,7 +108506,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 2, }, "start": Object { "column": 0, @@ -102937,7 +108515,7 @@ Object { }, "range": Array [ 0, - 67, + 23, ], "sourceType": "script", "tokens": Array [ @@ -102962,7 +108540,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -102972,115 +108550,186 @@ Object { }, "range": Array [ 4, - 7, + 5, ], "type": "Identifier", - "value": "foo", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 13, - 16, + 8, + 21, ], - "type": "Identifier", - "value": "get", + "regex": Object { + "flags": "u", + "pattern": "\\\\u{110000}", + }, + "type": "RegularExpression", + "value": "/\\\\u{110000}/u", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 16, - 17, + 21, + 22, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/regexUFlag/regex-u-simple.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo/u", + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 22, - 25, ], - "type": "Identifier", - "value": "set", - }, - Object { + "kind": "var", "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 25, - 26, + 0, + 17, ], - "type": "Punctuator", - "value": ";", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 3, - "line": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 31, + 0, + 3, ], "type": "Keyword", "value": "var", @@ -103088,35 +108737,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 7, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 33, + 4, + 7, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 6, - "line": 5, + "column": 8, + "line": 1, }, }, "range": Array [ - 34, - 35, + 8, + 9, ], "type": "Punctuator", "value": "=", @@ -103124,143 +108773,236 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 36, - 37, + 10, + 16, + ], + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "RegularExpression", + "value": "/foo/u", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/regexYFlag/regexp-y-simple.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo/y", + "regex": Object { + "flags": "y", + "pattern": "foo", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 7, - "line": 6, + "column": 17, + "line": 1, }, "start": Object { - "column": 4, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 42, - 45, + 0, + 17, ], - "type": "Identifier", - "value": "foo", + "type": "VariableDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 3, + "line": 1, }, "start": Object { - "column": 7, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 45, - 46, + 0, + 3, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 7, + "line": 1, }, "start": Object { "column": 4, - "line": 7, + "line": 1, }, }, "range": Array [ - 51, - 54, + 4, + 7, ], "type": "Identifier", - "value": "get", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 9, + "line": 1, }, "start": Object { - "column": 7, - "line": 7, + "column": 8, + "line": 1, }, }, "range": Array [ - 54, - 55, + 8, + 9, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 10, + "line": 1, }, }, "range": Array [ - 60, - 63, + 10, + 16, ], - "type": "Identifier", - "value": "set", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, + "regex": Object { + "flags": "y", + "pattern": "foo", }, - "range": Array [ - 64, - 65, - ], - "type": "Punctuator", - "value": "}", + "type": "RegularExpression", + "value": "/foo/y", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 17, + "line": 1, }, "start": Object { - "column": 1, - "line": 9, + "column": 16, + "line": 1, }, }, "range": Array [ - 65, - 66, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -103270,34 +109012,52 @@ Object { } `; -exports[`javascript fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/octalLiterals/lowercase.src 1`] = ` +exports[`javascript fixtures/restParams/basic-rest.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 5, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 5, + 20, + 22, ], - "raw": "0o717", - "type": "Literal", - "value": 463, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 6, + "column": 22, "line": 1, }, "start": Object { @@ -103305,17 +109065,89 @@ Object { "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "RestElement", + }, + ], "range": Array [ 0, - 6, + 22, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { "column": 0, @@ -103324,14 +109156,14 @@ Object { }, "range": Array [ 0, - 7, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -103341,230 +109173,355 @@ Object { }, "range": Array [ 0, - 5, + 8, ], - "type": "Numeric", - "value": "0o717", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 6, + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/octalLiterals/strict-uppercase.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, }, - "range": Array [ - 0, - 12, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { "loc": Object { "end": Object { "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, + 12, 13, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": ",", }, Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "raw": "0O717", - "type": "Literal", - "value": 463, - }, "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ 14, - 20, + 17, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, + "type": "Punctuator", + "value": "...", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "b", }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 19, "line": 1, }, "start": Object { - "column": 0, + "column": 18, "line": 1, }, }, "range": Array [ - 0, - 12, + 18, + 19, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 21, "line": 1, }, "start": Object { - "column": 12, + "column": 20, "line": 1, }, }, "range": Array [ - 12, - 13, + 20, + 21, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 14, - 19, + 21, + 22, ], - "type": "Numeric", - "value": "0O717", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/restParams/class-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 25, + 41, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/octalLiterals/uppercase.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { + "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 6, "line": 1, }, }, + "name": "A", "range": Array [ - 0, - 5, + 6, + 7, ], - "raw": "0O717", - "type": "Literal", - "value": 463, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -103573,15 +109530,16 @@ Object { }, "range": Array [ 0, - 6, + 43, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -103590,7 +109548,7 @@ Object { }, "range": Array [ 0, - 7, + 44, ], "sourceType": "script", "tokens": Array [ @@ -103609,162 +109567,113 @@ Object { 0, 5, ], - "type": "Numeric", - "value": "0O717", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "range": Array [ - 5, 6, + 7, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "A", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/regex/regexp-simple.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, - ], - "raw": "/foo./", - "regex": Object { - "flags": "", - "pattern": "foo.", - }, - "type": "Literal", - "value": Object {}, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 17, + "column": 9, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, "range": Array [ - 0, - 17, + 8, + 9, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "{", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 0, - 3, + 26, + 29, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 4, - 7, + 29, + 32, ], "type": "Identifier", "value": "foo", @@ -103772,135 +109681,239 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 8, - 9, + 32, + 33, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 10, - 16, + 34, + 35, ], - "regex": Object { - "flags": "", - "pattern": "foo.", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, }, - "type": "RegularExpression", - "value": "/foo./", + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 16, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 16, - 17, + 42, + 43, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` +exports[`javascript fixtures/restParams/class-method.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "name": "x", "range": Array [ - 4, - 5, + 14, + 33, ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 8, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 17, + 33, + ], + "type": "FunctionExpression", }, - "range": Array [ - 8, - 40, - ], - "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "Literal", - "value": Object {}, }, - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 40, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 35, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -103909,15 +109922,16 @@ Object { }, "range": Array [ 0, - 41, + 35, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -103926,14 +109940,14 @@ Object { }, "range": Array [ 0, - 42, + 36, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -103943,375 +109957,297 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "range": Array [ - 6, - 7, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 8, - 40, + 14, + 17, ], - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "RegularExpression", - "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 40, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 40, - 41, + 17, + 18, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 21, - ], - "raw": "/\\\\u{110000}/u", - "regex": Object { - "flags": "u", - "pattern": "\\\\u{110000}", - }, - "type": "Literal", - "value": null, - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 0, - 22, + 18, + 21, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "...", }, - }, - "range": Array [ - 0, - 23, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 0, - 3, + 21, + 24, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 4, - 5, + 24, + 25, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 6, - 7, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 8, - 21, + 32, + 33, ], - "regex": Object { - "flags": "u", - "pattern": "\\\\u{110000}", - }, - "type": "RegularExpression", - "value": "/\\\\u{110000}/u", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 21, - 22, + 34, + 35, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/regexUFlag/regex-u-simple.src 1`] = ` +exports[`javascript fixtures/restParams/error-no-default.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", }, - "init": Object { + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 10, + "column": 17, "line": 1, }, }, + "name": "b", "range": Array [ - 10, - 16, + 17, + 18, ], - "raw": "/foo/u", - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "Literal", - "value": Object {}, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 4, + "column": 14, "line": 1, }, }, "range": Array [ - 4, - 16, + 14, + 22, ], - "type": "VariableDeclarator", + "type": "RestElement", }, ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, "range": Array [ 0, - 17, + 24, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { "column": 0, @@ -104320,14 +110256,14 @@ Object { }, "range": Array [ 0, - 18, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -104337,240 +110273,133 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ 8, - 9, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, ], - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "RegularExpression", - "value": "/foo/u", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/regexYFlag/regexp-y-simple.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, - ], - "raw": "/foo/y", - "regex": Object { - "flags": "y", - "pattern": "foo", - }, - "type": "Literal", - "value": Object {}, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, }, + }, + "range": Array [ + 9, + 10, ], - "kind": "var", + "type": "Identifier", + "value": "f", + }, + Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { - "column": 0, + "column": 10, "line": 1, }, }, "range": Array [ - 0, - 17, + 10, + 11, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "(", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 17, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, "range": Array [ - 0, - 3, + 14, + 17, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 18, "line": 1, }, "start": Object { - "column": 4, + "column": 17, "line": 1, }, }, "range": Array [ - 4, - 7, + 17, + 18, ], "type": "Identifier", - "value": "foo", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 19, "line": 1, }, }, "range": Array [ - 8, - 9, + 19, + 20, ], "type": "Punctuator", "value": "=", @@ -104578,39 +110407,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 10, + "column": 21, "line": 1, }, }, "range": Array [ - 10, - 16, + 21, + 22, ], - "regex": Object { - "flags": "y", - "pattern": "foo", + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, }, - "type": "RegularExpression", - "value": "/foo/y", + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 16, + "column": 23, "line": 1, }, }, "range": Array [ - 16, - 17, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -104620,29 +110463,11 @@ Object { } `; -exports[`javascript fixtures/restParams/basic-rest.src 1`] = ` +exports[`javascript fixtures/restParams/error-not-last.src 1`] = ` Object { "body": Array [ Object { "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 22, - ], - "type": "BlockStatement", - }, "expression": false, "generator": false, "id": Object { @@ -104665,7 +110490,7 @@ Object { }, "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 1, }, "start": Object { @@ -104727,29 +110552,30 @@ Object { ], "type": "RestElement", }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, ], "range": Array [ 0, - 22, - ], - "type": "FunctionDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, 23, ], - "type": "EmptyStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { @@ -104910,7 +110736,7 @@ Object { 19, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { @@ -104927,8 +110753,8 @@ Object { 20, 21, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { @@ -104946,7 +110772,7 @@ Object { 22, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { @@ -104971,165 +110797,128 @@ Object { } `; -exports[`javascript fixtures/restParams/class-constructor.src 1`] = ` +exports[`javascript fixtures/restParams/func-expression.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "constructor", - "range": Array [ - 14, - 25, - ], - "type": "Identifier", - }, - "kind": "constructor", + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 1, }, "start": Object { "column": 4, - "line": 2, + "line": 1, }, }, + "name": "x", "range": Array [ - 14, - 41, + 4, + 5, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 34, - 41, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 24, + "line": 1, }, }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 29, - 32, - ], - "type": "Identifier", - }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { "loc": Object { "end": Object { "column": 22, - "line": 2, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 21, + "line": 1, }, }, + "name": "a", "range": Array [ - 26, - 32, + 21, + 22, ], - "type": "RestElement", + "type": "Identifier", }, - ], - "range": Array [ - 25, - 41, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 43, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 8, + 26, + ], + "type": "FunctionExpression", }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 26, + ], + "type": "VariableDeclarator", }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 27, + "line": 1, }, "start": Object { "column": 0, @@ -105138,16 +110927,15 @@ Object { }, "range": Array [ 0, - 43, + 27, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 27, + "line": 1, }, "start": Object { "column": 0, @@ -105156,14 +110944,14 @@ Object { }, "range": Array [ 0, - 44, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -105173,79 +110961,79 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 5, ], "type": "Identifier", - "value": "A", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { - "column": 8, + "column": 6, "line": 1, }, }, "range": Array [ - 8, - 9, + 6, + 7, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 14, - 25, + 8, + 16, ], - "type": "Identifier", - "value": "constructor", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 25, - 26, + 17, + 18, ], "type": "Punctuator", "value": "(", @@ -105253,17 +111041,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 26, - 29, + 18, + 21, ], "type": "Punctuator", "value": "...", @@ -105272,34 +111060,34 @@ Object { "loc": Object { "end": Object { "column": 22, - "line": 2, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 21, + "line": 1, }, }, - "range": Array [ - 29, - 32, + "range": Array [ + 21, + 22, ], "type": "Identifier", - "value": "foo", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 2, + "line": 1, }, "start": Object { "column": 22, - "line": 2, + "line": 1, }, }, "range": Array [ - 32, - 33, + 22, + 23, ], "type": "Punctuator", "value": ")", @@ -105308,16 +111096,16 @@ Object { "loc": Object { "end": Object { "column": 25, - "line": 2, + "line": 1, }, "start": Object { "column": 24, - "line": 2, + "line": 1, }, }, "range": Array [ - 34, - 35, + 24, + 25, ], "type": "Punctuator", "value": "{", @@ -105325,17 +111113,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 25, + "line": 1, }, }, "range": Array [ - 40, - 41, + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -105343,185 +111131,166 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 27, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 42, - 43, + 26, + 27, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/restParams/class-method.src 1`] = ` +exports[`javascript fixtures/restParams/func-expression-multi.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 26, + "line": 1, }, }, - "name": "foo", "range": Array [ - 14, - 17, + 26, + 28, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "method", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, - "range": Array [ - 14, - 33, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 17, + "line": 1, }, }, + "name": "a", "range": Array [ - 26, - 33, + 17, + 18, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 2, - }, + "type": "Identifier", }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 23, + "line": 1, }, }, + "name": "b", "range": Array [ - 18, + 23, 24, ], - "type": "RestElement", + "type": "Identifier", }, - ], - "range": Array [ - 17, - 33, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 35, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 8, + 28, + ], + "type": "FunctionExpression", }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 29, + "line": 1, }, "start": Object { "column": 0, @@ -105530,16 +111299,15 @@ Object { }, "range": Array [ 0, - 35, + 29, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 29, + "line": 1, }, "start": Object { "column": 0, @@ -105548,14 +111316,14 @@ Object { }, "range": Array [ 0, - 36, + 29, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -105565,10 +111333,28 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -105585,13 +111371,13 @@ Object { 6, 7, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { @@ -105601,61 +111387,79 @@ Object { }, "range": Array [ 8, - 9, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 14, 17, + 18, ], "type": "Identifier", - "value": "foo", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 18, - 21, + 20, + 23, ], "type": "Punctuator", "value": "...", @@ -105663,30 +111467,30 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 21, + 23, 24, ], "type": "Identifier", - "value": "bar", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ @@ -105699,12 +111503,12 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ @@ -105717,17 +111521,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 32, - 33, + 27, + 28, ], "type": "Punctuator", "value": "}", @@ -105735,31 +111539,49 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 29, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 28, + "line": 1, }, }, "range": Array [ - 34, - 35, + 28, + 29, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/restParams/error-no-default.src 1`] = ` +exports[`javascript fixtures/restParams/invalid-rest-param.src 1`] = ` Object { "body": Array [ Object { "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, "expression": false, "generator": false, "id": Object { @@ -105773,7 +111595,7 @@ Object { "line": 1, }, }, - "name": "f", + "name": "x", "range": Array [ 9, 10, @@ -105782,7 +111604,7 @@ Object { }, "loc": Object { "end": Object { - "column": 24, + "column": 22, "line": 1, }, "start": Object { @@ -105791,70 +111613,127 @@ Object { }, }, "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, Object { "argument": Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 14, "line": 1, }, - }, - "name": "b", + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], "range": Array [ - 17, - 18, + 14, + 19, ], - "type": "Identifier", + "type": "ObjectPattern", }, "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, "range": Array [ - 14, - 22, + 11, + 19, ], "type": "RestElement", }, ], "range": Array [ 0, - 24, + 22, ], "type": "FunctionDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { @@ -105864,7 +111743,7 @@ Object { }, "range": Array [ 0, - 24, + 23, ], "sourceType": "script", "tokens": Array [ @@ -105902,7 +111781,7 @@ Object { 10, ], "type": "Identifier", - "value": "f", + "value": "x", }, Object { "loc": Object { @@ -105925,7 +111804,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { @@ -105935,28 +111814,28 @@ Object { }, "range": Array [ 11, - 12, + 14, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, - 13, + 14, + 15, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { @@ -105965,34 +111844,34 @@ Object { "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, + 16, 17, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -106010,58 +111889,58 @@ Object { 20, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { - "column": 21, + "column": 20, "line": 1, }, }, "range": Array [ + 20, 21, - 22, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 22, "line": 1, }, "start": Object { - "column": 22, + "column": 21, "line": 1, }, }, "range": Array [ + 21, 22, - 23, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { - "column": 23, + "column": 22, "line": 1, }, }, "range": Array [ + 22, 23, - 24, ], "type": "Punctuator", "value": ";", @@ -106071,11 +111950,29 @@ Object { } `; -exports[`javascript fixtures/restParams/error-not-last.src 1`] = ` +exports[`javascript fixtures/restParams/single-rest.src 1`] = ` Object { "body": Array [ Object { "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "BlockStatement", + }, "expression": false, "generator": false, "id": Object { @@ -106098,7 +111995,7 @@ Object { }, "loc": Object { "end": Object { - "column": 23, + "column": 19, "line": 1, }, "start": Object { @@ -106107,88 +112004,69 @@ Object { }, }, "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, Object { "argument": Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 17, + "column": 14, "line": 1, }, }, "name": "b", "range": Array [ - 17, - 18, + 14, + 15, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, "range": Array [ - 14, - 18, + 11, + 15, ], "type": "RestElement", }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, ], "range": Array [ 0, - 23, + 19, ], "type": "FunctionDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { @@ -106198,7 +112076,7 @@ Object { }, "range": Array [ 0, - 23, + 20, ], "sourceType": "script", "tokens": Array [ @@ -106259,7 +112137,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { @@ -106269,46 +112147,46 @@ Object { }, "range": Array [ 11, - 12, + 14, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, - 13, + 14, + 15, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, - 17, + 15, + 16, ], "type": "Punctuator", - "value": "...", + "value": ")", }, Object { "loc": Object { @@ -106325,8 +112203,8 @@ Object { 17, 18, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -106344,58 +112222,22 @@ Object { 19, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { "column": 20, "line": 1, }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - "value": "c", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, "start": Object { - "column": 22, + "column": 19, "line": 1, }, }, "range": Array [ - 22, - 23, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -106405,7 +112247,7 @@ Object { } `; -exports[`javascript fixtures/restParams/func-expression.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-float.src 1`] = ` Object { "body": Array [ Object { @@ -106414,118 +112256,61 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", }, "init": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 26, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 22, - ], - "type": "RestElement", - }, - ], "range": Array [ - 8, - 26, + 10, + 13, ], - "type": "FunctionExpression", + "raw": "1.5", + "type": "Literal", + "value": 1.5, }, "loc": Object { "end": Object { - "column": 26, + "column": 13, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 26, + 6, + 13, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 27, + "column": 14, "line": 1, }, "start": Object { @@ -106535,15 +112320,15 @@ Object { }, "range": Array [ 0, - 27, + 14, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -106552,14 +112337,14 @@ Object { }, "range": Array [ 0, - 27, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -106569,28 +112354,10 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, 5, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { @@ -106607,149 +112374,59 @@ Object { 6, 7, ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 16, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 21, - ], - "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], "type": "Identifier", "value": "a", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, + "column": 9, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, "range": Array [ - 24, - 25, + 8, + 9, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 13, "line": 1, }, "start": Object { - "column": 25, + "column": 10, "line": 1, }, }, "range": Array [ - 25, - 26, + 10, + 13, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1.5", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 14, "line": 1, }, "start": Object { - "column": 26, + "column": 13, "line": 1, }, }, "range": Array [ - 26, - 27, + 13, + 14, ], "type": "Punctuator", "value": ";", @@ -106759,7 +112436,7 @@ Object { } `; -exports[`javascript fixtures/restParams/func-expression-multi.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-float-negative.src 1`] = ` Object { "body": Array [ Object { @@ -106768,136 +112445,80 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", }, "init": Object { - "async": false, - "body": Object { - "body": Array [], + "argument": Object { "loc": Object { "end": Object { - "column": 28, + "column": 14, "line": 1, }, "start": Object { - "column": 26, + "column": 11, "line": 1, }, }, "range": Array [ - 26, - 28, + 11, + 14, ], - "type": "BlockStatement", + "raw": "1.5", + "type": "Literal", + "value": 1.5, }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 28, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 24, - ], - "type": "RestElement", - }, - ], + "operator": "-", + "prefix": true, "range": Array [ - 8, - 28, + 10, + 14, ], - "type": "FunctionExpression", + "type": "UnaryExpression", }, "loc": Object { "end": Object { - "column": 28, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 28, + 6, + 14, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 29, + "column": 15, "line": 1, }, "start": Object { @@ -106907,15 +112528,15 @@ Object { }, "range": Array [ 0, - 29, + 15, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -106924,14 +112545,14 @@ Object { }, "range": Array [ 0, - 29, + 16, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -106941,28 +112562,10 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, 5, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { @@ -106979,13 +112582,13 @@ Object { 6, 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 9, "line": 1, }, "start": Object { @@ -106995,169 +112598,250 @@ Object { }, "range": Array [ 8, - 16, + 9, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { - "column": 16, + "column": 10, "line": 1, }, }, "range": Array [ - 16, - 17, + 10, + 11, ], "type": "Punctuator", - "value": "(", + "value": "-", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 14, "line": 1, }, "start": Object { - "column": 17, + "column": 11, "line": 1, }, }, "range": Array [ - 17, - 18, + 11, + 14, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "1.5", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 15, "line": 1, }, "start": Object { - "column": 18, + "column": 14, "line": 1, }, }, "range": Array [ - 18, - 19, + 14, + 15, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/simple-literals/literal-null.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { - "column": 20, + "column": 0, "line": 1, }, }, "range": Array [ - 20, - 23, + 0, + 15, ], - "type": "Punctuator", - "value": "...", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 24, + "column": 5, "line": 1, }, "start": Object { - "column": 23, + "column": 0, "line": 1, }, }, "range": Array [ - 23, - 24, + 0, + 5, ], - "type": "Identifier", - "value": "b", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 7, "line": 1, }, "start": Object { - "column": 24, + "column": 6, "line": 1, }, }, "range": Array [ - 24, - 25, + 6, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 9, "line": 1, }, "start": Object { - "column": 26, + "column": 8, "line": 1, }, }, "range": Array [ - 26, - 27, + 8, + 9, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 14, "line": 1, }, "start": Object { - "column": 27, + "column": 10, "line": 1, }, }, "range": Array [ - 27, - 28, + 10, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 15, "line": 1, }, "start": Object { - "column": 28, + "column": 14, "line": 1, }, }, "range": Array [ - 28, - 29, + 14, + 15, ], "type": "Punctuator", "value": ";", @@ -107167,182 +112851,88 @@ Object { } `; -exports[`javascript fixtures/restParams/invalid-rest-param.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-number.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 22, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ + "declarations": Array [ Object { - "argument": Object { + "id": Object { "loc": Object { "end": Object { - "column": 19, + "column": 7, "line": 1, }, "start": Object { - "column": 14, + "column": 6, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 16, - 17, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - }, + "name": "a", + "range": Array [ + 6, + 7, ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, "range": Array [ - 14, - 19, + 10, + 11, ], - "type": "ObjectPattern", + "raw": "1", + "type": "Literal", + "value": 1, }, "loc": Object { "end": Object { - "column": 19, + "column": 11, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 11, - 19, ], - "type": "RestElement", + "type": "VariableDeclarator", }, ], - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - Object { + "kind": "const", "loc": Object { "end": Object { - "column": 23, + "column": 12, "line": 1, }, "start": Object { - "column": 22, + "column": 0, "line": 1, }, }, "range": Array [ - 22, - 23, + 0, + 12, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -107351,14 +112941,14 @@ Object { }, "range": Array [ 0, - 23, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -107368,28 +112958,46 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { "column": 9, "line": 1, }, + "start": Object { + "column": 8, + "line": 1, + }, }, "range": Array [ + 8, 9, - 10, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { @@ -107406,13 +113014,13 @@ Object { 10, 11, ], - "type": "Punctuator", - "value": "(", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { @@ -107422,133 +113030,233 @@ Object { }, "range": Array [ 11, - 14, + 12, ], "type": "Punctuator", - "value": "...", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/simple-literals/literal-number-negative.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "operator": "-", + "prefix": true, + "range": Array [ + 10, + 12, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 13, ], - "type": "Punctuator", - "value": "{", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, + "column": 5, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, - 17, + 0, + 5, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 7, "line": 1, }, "start": Object { - "column": 18, + "column": 6, "line": 1, }, }, "range": Array [ - 18, - 19, + 6, + 7, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 9, "line": 1, }, "start": Object { - "column": 19, + "column": 8, "line": 1, }, }, "range": Array [ - 19, - 20, + 8, + 9, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 11, "line": 1, }, "start": Object { - "column": 20, + "column": 10, "line": 1, }, }, "range": Array [ - 20, - 21, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "-", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 21, + "column": 11, "line": 1, }, }, "range": Array [ - 21, - 22, + 11, + 12, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 13, "line": 1, }, "start": Object { - "column": 22, + "column": 12, "line": 1, }, }, "range": Array [ - 22, - 23, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -107558,124 +113266,88 @@ Object { } `; -exports[`javascript fixtures/restParams/single-rest.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-string.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 19, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ + "declarations": Array [ Object { - "argument": Object { + "id": Object { "loc": Object { "end": Object { - "column": 15, + "column": 7, "line": 1, }, "start": Object { - "column": 14, + "column": 6, "line": 1, }, }, - "name": "b", + "name": "a", "range": Array [ - 14, - 15, + 6, + 7, ], "type": "Identifier", }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "raw": "'a'", + "type": "Literal", + "value": "a", + }, "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, "range": Array [ - 11, - 15, + 6, + 13, ], - "type": "RestElement", + "type": "VariableDeclarator", }, ], - "range": Array [ - 0, - 19, - ], - "type": "FunctionDeclaration", - }, - Object { + "kind": "const", "loc": Object { "end": Object { - "column": 20, + "column": 14, "line": 1, }, "start": Object { - "column": 19, + "column": 0, "line": 1, }, }, "range": Array [ - 19, - 20, + 0, + 14, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -107684,14 +113356,14 @@ Object { }, "range": Array [ 0, - 20, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -107701,33 +113373,51 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { "column": 9, "line": 1, }, + "start": Object { + "column": 8, + "line": 1, + }, }, "range": Array [ + 8, 9, - 10, ], - "type": "Identifier", - "value": "f", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { @@ -107737,10 +113427,10 @@ Object { }, "range": Array [ 10, - 11, + 13, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "'a'", }, Object { "loc": Object { @@ -107749,70 +113439,168 @@ Object { "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "range": Array [ - 11, + 13, 14, ], "type": "Punctuator", - "value": "...", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/simple-literals/literal-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "undefined", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 15, + "column": 5, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 5, ], - "type": "Identifier", - "value": "b", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 7, "line": 1, }, "start": Object { - "column": 15, + "column": 6, "line": 1, }, }, "range": Array [ - 15, - 16, + 6, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 9, "line": 1, }, "start": Object { - "column": 17, + "column": 8, "line": 1, }, }, "range": Array [ - 17, - 18, + 8, + 9, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { @@ -107821,16 +113609,16 @@ Object { "line": 1, }, "start": Object { - "column": 18, + "column": 10, "line": 1, }, }, "range": Array [ - 18, + 10, 19, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "undefined", }, Object { "loc": Object { @@ -111476,6 +117264,7 @@ exports[`javascript fixtures/unicodeCodePointEscapes/basic-string-literal.src 1` Object { "body": Array [ Object { + "directive": "\\\\u{714E}\\\\u{8336}", "expression": Object { "loc": Object { "end": Object { @@ -111573,6 +117362,7 @@ exports[`javascript fixtures/unicodeCodePointEscapes/complex-string-literal.src Object { "body": Array [ Object { + "directive": "\\\\u{20BB7}\\\\u{10FFFF}\\\\u{1}", "expression": Object { "loc": Object { "end": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index edcf3d40d527..619756633c98 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -10425,29 +10425,12 @@ Object { "line": 1, }, }, + "members": Array [], "range": Array [ 33, 35, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "members": Array [], - "range": Array [ - 33, - 35, - ], - "type": "TSTypeLiteral", - }, + "type": "TSTypeLiteral", }, ], "range": Array [ @@ -12175,127 +12158,268 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` +exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { - "body": Array [ - Object { - "accessibility": "private", - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 28, - ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 14, - 43, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "name": "undefined", - "range": Array [ - 33, - 42, - ], - "type": "Identifier", - }, - }, - ], + "body": Array [], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 2, }, "start": Object { - "column": 8, + "column": 46, "line": 1, }, }, "range": Array [ - 8, - 45, + 46, + 49, ], - "type": "ClassBody", + "type": "BlockStatement", }, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, - "name": "X", + "name": "M", "range": Array [ - 6, - 7, + 9, + 10, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 2, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "Base", + "range": Array [ + 37, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + }, + }, + }, + ], "range": Array [ 0, - 45, + 49, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 35, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "M", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 32, + 35, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 35, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 36, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 3, }, "start": Object { "column": 0, @@ -12304,14 +12428,14 @@ Object { }, "range": Array [ 0, - 46, + 50, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -12321,200 +12445,254 @@ Object { }, "range": Array [ 0, - 5, + 8, ], "type": "Keyword", - "value": "class", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, "range": Array [ - 6, - 7, + 9, + 10, ], "type": "Identifier", - "value": "X", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { "column": 11, - "line": 2, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 14, - 21, + 13, + 20, ], "type": "Keyword", - "value": "private", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 22, - 23, + 21, + 32, + ], + "type": "Identifier", + "value": "Constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, ], "type": "Punctuator", - "value": "[", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 34, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 33, + "line": 1, }, }, "range": Array [ - 23, - 28, + 33, + 34, ], - "type": "String", - "value": "'foo'", + "type": "Identifier", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 35, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 34, + "line": 1, }, }, "range": Array [ - 28, - 29, + 34, + 35, ], "type": "Punctuator", - "value": "]", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 36, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 35, + "line": 1, }, }, "range": Array [ - 29, - 30, + 35, + 36, ], "type": "Punctuator", - "value": "?", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 37, + "line": 1, }, "start": Object { - "column": 21, - "line": 2, + "column": 36, + "line": 1, }, }, "range": Array [ - 31, - 32, + 36, + 37, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 2, + "column": 41, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 37, + "line": 1, }, }, "range": Array [ - 33, - 42, + 37, + 41, ], - "type": "Keyword", - "value": "undefined", + "type": "Identifier", + "value": "Base", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 42, + "line": 1, }, "start": Object { - "column": 32, - "line": 2, + "column": 41, + "line": 1, }, }, "range": Array [ + 41, 42, - 43, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, }, }, "range": Array [ @@ -12522,9 +12700,399 @@ Object { 45, ], "type": "Punctuator", - "value": "}", + "value": ")", }, - ], + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 14, + 43, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "undefined", + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 45, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "String", + "value": "'foo'", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 33, + 42, + ], + "type": "Keyword", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": "}", + }, + ], "type": "Program", } `; @@ -21030,7 +21598,7 @@ Object { 9, 11, ], - "type": "ArrayPattern", + "type": "ArrayExpression", }, "type": "AssignmentPattern", }, @@ -21313,31 +21881,918 @@ Object { } `; -exports[`typescript fixtures/basics/export-assignment.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment-nested.src 1`] = ` Object { "body": Array [ Object { "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 81, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 79, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 73, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 71, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 64, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 28, + 42, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 36, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 42, + ], + "right": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 26, + 44, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 58, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 49, + 57, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + ], + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 47, + 58, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 59, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 64, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 64, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 15, + 66, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 71, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 69, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 69, + 71, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 8, + 73, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 79, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 76, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 76, + 79, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 81, + ], + "type": "ObjectPattern", + }, "loc": Object { "end": Object { - "column": 12, + "column": 127, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, - "name": "foo", + "operator": "=", "range": Array [ - 9, - 12, + 1, + 127, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 127, + "line": 1, + }, + "start": Object { + "column": 84, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 89, + "line": 1, + }, + "start": Object { + "column": 86, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 86, + 89, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 126, + "line": 1, + }, + "start": Object { + "column": 86, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 86, + 126, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 126, + "line": 1, + }, + "start": Object { + "column": 91, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 96, + "line": 1, + }, + "start": Object { + "column": 93, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 93, + 96, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 93, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 93, + 124, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 98, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 103, + "line": 1, + }, + "start": Object { + "column": 100, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 100, + 103, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 122, + "line": 1, + }, + "start": Object { + "column": 100, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 100, + 122, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 107, + "line": 1, + }, + "start": Object { + "column": 106, + "line": 1, + }, + }, + "range": Array [ + 106, + 107, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + Object { + "loc": Object { + "end": Object { + "column": 121, + "line": 1, + }, + "start": Object { + "column": 109, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 114, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 119, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 111, + 119, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 118, + "line": 1, + }, + "start": Object { + "column": 117, + "line": 1, + }, + }, + "range": Array [ + 117, + 118, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + ], + "loc": Object { + "end": Object { + "column": 119, + "line": 1, + }, + "start": Object { + "column": 116, + "line": 1, + }, + }, + "range": Array [ + 116, + 119, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 109, + 121, + ], + "type": "ObjectExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 122, + "line": 1, + }, + "start": Object { + "column": 105, + "line": 1, + }, + }, + "range": Array [ + 105, + 122, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 98, + 124, + ], + "type": "ObjectExpression", + }, + }, + ], + "range": Array [ + 91, + 126, + ], + "type": "ObjectExpression", + }, + }, + ], + "range": Array [ + 84, + 127, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 13, + "column": 129, "line": 1, }, "start": Object { @@ -21347,9 +22802,9 @@ Object { }, "range": Array [ 0, - 13, + 129, ], - "type": "TSExportAssignment", + "type": "ExpressionStatement", }, ], "loc": Object { @@ -21364,14 +22819,14 @@ Object { }, "range": Array [ 0, - 14, + 130, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 1, "line": 1, }, "start": Object { @@ -21381,46 +22836,82 @@ Object { }, "range": Array [ 0, - 6, + 1, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, "line": 1, }, "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { "column": 7, "line": 1, }, + "start": Object { + "column": 6, + "line": 1, + }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 12, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -21429,848 +22920,679 @@ Object { "line": 1, }, "start": Object { - "column": 12, + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], "type": "Punctuator", - "value": ";", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 28, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 15, - 28, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 20, - 23, - ], - "type": "TSTypeParameterDeclaration", + "start": Object { + "column": 15, + "line": 1, }, }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 0, + "column": 17, "line": 1, }, }, "range": Array [ - 0, - 28, + 17, + 20, ], - "type": "ExportDefaultDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, + "type": "Identifier", + "value": "baz", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ":", }, - }, - "range": Array [ - 0, - 29, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 23, "line": 1, }, "start": Object { - "column": 0, + "column": 22, "line": 1, }, }, "range": Array [ - 0, - 6, + 22, + 23, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 24, "line": 1, }, "start": Object { - "column": 7, + "column": 23, "line": 1, }, }, "range": Array [ - 7, - 14, + 23, + 24, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 24, "line": 1, }, }, "range": Array [ - 15, - 20, + 24, + 25, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 27, "line": 1, }, "start": Object { - "column": 20, + "column": 26, "line": 1, }, }, "range": Array [ - 20, - 21, + 26, + 27, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 31, "line": 1, }, "start": Object { - "column": 21, + "column": 28, "line": 1, }, }, "range": Array [ - 21, - 22, + 28, + 31, ], "type": "Identifier", - "value": "T", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 32, "line": 1, }, "start": Object { - "column": 22, + "column": 31, "line": 1, }, }, "range": Array [ - 22, - 23, + 31, + 32, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 34, "line": 1, }, "start": Object { - "column": 24, + "column": 33, "line": 1, }, }, "range": Array [ - 24, - 25, + 33, + 34, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 35, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 34, + "line": 1, }, }, "range": Array [ - 27, - 28, + 34, + 35, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "x", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 31, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, }, - "range": Array [ - 15, - 31, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "TSTypeParameter", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "U", - "range": Array [ - 24, - 25, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 20, - 26, - ], - "type": "TSTypeParameterDeclaration", + "start": Object { + "column": 35, + "line": 1, }, }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "]", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 38, + "line": 1, }, "start": Object { - "column": 0, + "column": 37, "line": 1, }, }, "range": Array [ - 0, - 31, + 37, + 38, ], - "type": "ExportDefaultDeclaration", + "type": "Punctuator", + "value": "=", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "[", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Numeric", + "value": "3", }, - }, - "range": Array [ - 0, - 32, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 42, "line": 1, }, "start": Object { - "column": 0, + "column": 41, "line": 1, }, }, "range": Array [ - 0, - 6, + 41, + 42, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 44, "line": 1, }, "start": Object { - "column": 7, + "column": 43, "line": 1, }, }, "range": Array [ - 7, - 14, + 43, + 44, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 46, "line": 1, }, "start": Object { - "column": 15, + "column": 45, "line": 1, }, }, "range": Array [ - 15, - 20, + 45, + 46, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 48, "line": 1, }, "start": Object { - "column": 20, + "column": 47, "line": 1, }, }, "range": Array [ - 20, - 21, + 47, + 48, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 52, "line": 1, }, "start": Object { - "column": 21, + "column": 49, "line": 1, }, }, "range": Array [ - 21, - 22, + 49, + 52, ], "type": "Identifier", - "value": "T", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 53, "line": 1, }, "start": Object { - "column": 22, + "column": 52, "line": 1, }, }, "range": Array [ - 22, - 23, + 52, + 53, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 55, "line": 1, }, "start": Object { - "column": 24, + "column": 54, "line": 1, }, }, "range": Array [ - 24, - 25, + 54, + 55, ], - "type": "Identifier", - "value": "U", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 56, "line": 1, }, "start": Object { - "column": 25, + "column": 55, "line": 1, }, }, "range": Array [ - 25, - 26, + 55, + 56, ], - "type": "Punctuator", - "value": ">", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 57, "line": 1, }, "start": Object { - "column": 27, + "column": 56, "line": 1, }, }, "range": Array [ - 27, - 28, + 56, + 57, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 58, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 57, + "line": 1, }, }, "range": Array [ - 30, - 31, + 57, + 58, ], "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 24, - ], - "type": "ClassBody", + "loc": Object { + "end": Object { + "column": 59, + "line": 1, }, - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", + "start": Object { + "column": 58, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 1, - }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, }, - "range": Array [ - 7, - 24, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 17, - 18, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 16, - 19, - ], - "type": "TSTypeParameterDeclaration", + "start": Object { + "column": 60, + "line": 1, }, }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "=", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 63, + "line": 1, }, "start": Object { - "column": 0, + "column": 62, "line": 1, }, }, "range": Array [ - 0, - 24, + 62, + 63, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, + "type": "Punctuator", + "value": "[", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "]", }, - }, - "range": Array [ - 0, - 25, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 66, "line": 1, }, "start": Object { - "column": 0, + "column": 65, "line": 1, }, }, "range": Array [ - 0, - 6, + 65, + 66, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 68, "line": 1, }, "start": Object { - "column": 7, + "column": 67, "line": 1, }, }, "range": Array [ - 7, - 12, + 67, + 68, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 70, "line": 1, }, "start": Object { - "column": 13, + "column": 69, "line": 1, }, }, "range": Array [ - 13, - 16, + 69, + 70, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 71, "line": 1, }, "start": Object { - "column": 16, + "column": 70, "line": 1, }, }, "range": Array [ - 16, - 17, + 70, + 71, ], "type": "Punctuator", - "value": "<", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 73, "line": 1, }, "start": Object { - "column": 17, + "column": 72, "line": 1, }, }, "range": Array [ - 17, - 18, + 72, + 73, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 75, "line": 1, }, "start": Object { - "column": 18, + "column": 74, "line": 1, }, }, "range": Array [ - 18, - 19, + 74, + 75, ], "type": "Punctuator", - "value": ">", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 77, "line": 1, }, "start": Object { - "column": 20, + "column": 76, "line": 1, }, }, "range": Array [ - 20, - 21, + 76, + 77, ], "type": "Punctuator", "value": "{", @@ -22278,804 +23600,666 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 79, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 78, + "line": 1, }, }, "range": Array [ - 23, - 24, + 78, + 79, ], "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 27, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 81, + "line": 1, }, - "range": Array [ - 7, - 27, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 17, - 18, - ], - "type": "TSTypeParameter", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "U", - "range": Array [ - 20, - 21, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 16, - 22, - ], - "type": "TSTypeParameterDeclaration", + "start": Object { + "column": 80, + "line": 1, }, }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": "}", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 83, + "line": 1, }, "start": Object { - "column": 0, + "column": 82, "line": 1, }, }, "range": Array [ - 0, - 27, + 82, + 83, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "=", }, - }, - "range": Array [ - 0, - 28, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 85, "line": 1, }, "start": Object { - "column": 0, + "column": 84, "line": 1, }, }, "range": Array [ - 0, - 6, + 84, + 85, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 89, "line": 1, }, "start": Object { - "column": 7, + "column": 86, "line": 1, }, }, "range": Array [ - 7, - 12, + 86, + 89, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 90, "line": 1, }, "start": Object { - "column": 13, + "column": 89, "line": 1, }, }, "range": Array [ - 13, - 16, + 89, + 90, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 92, "line": 1, }, "start": Object { - "column": 16, + "column": 91, "line": 1, }, }, "range": Array [ - 16, - 17, + 91, + 92, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 96, "line": 1, }, "start": Object { - "column": 17, + "column": 93, "line": 1, }, }, "range": Array [ - 17, - 18, + 93, + 96, ], "type": "Identifier", - "value": "T", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 97, "line": 1, }, "start": Object { - "column": 18, + "column": 96, "line": 1, }, }, "range": Array [ - 18, - 19, + 96, + 97, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 99, "line": 1, }, "start": Object { - "column": 20, + "column": 98, "line": 1, }, }, "range": Array [ - 20, - 21, + 98, + 99, ], - "type": "Identifier", - "value": "U", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 103, "line": 1, }, "start": Object { - "column": 21, + "column": 100, "line": 1, }, }, "range": Array [ - 21, - 22, + 100, + 103, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 104, "line": 1, }, "start": Object { - "column": 23, + "column": 103, "line": 1, }, }, "range": Array [ - 23, - 24, + 103, + 104, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 106, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 105, + "line": 1, }, }, "range": Array [ - 26, - 27, + 105, + 106, ], "type": "Punctuator", - "value": "}", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 107, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "start": Object { + "column": 106, + "line": 1, }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "initializer": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 22, - 29, - ], - "type": "TSEnumMember", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 35, - 38, - ], - "type": "TSEnumMember", - }, - ], - "range": Array [ - 7, - 40, - ], - "type": "TSEnumDeclaration", }, + "range": Array [ + 106, + 107, + ], + "type": "Numeric", + "value": "2", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 108, + "line": 1, }, "start": Object { - "column": 0, + "column": 107, "line": 1, }, }, "range": Array [ - 0, - 40, + 107, + 108, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "Punctuator", + "value": ",", }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, + Object { + "loc": Object { + "end": Object { + "column": 110, + "line": 1, + }, + "start": Object { + "column": 109, + "line": 1, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "{", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 114, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + "value": "foo", }, - }, - "range": Array [ - 0, - 40, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 115, "line": 1, }, "start": Object { - "column": 0, + "column": 114, "line": 1, }, }, "range": Array [ - 0, - 6, + 114, + 115, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 117, "line": 1, }, "start": Object { - "column": 7, + "column": 116, "line": 1, }, }, "range": Array [ - 7, - 11, + 116, + 117, ], - "type": "Keyword", - "value": "enum", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 118, "line": 1, }, "start": Object { - "column": 12, + "column": 117, "line": 1, }, }, "range": Array [ - 12, - 15, + 117, + 118, ], - "type": "Identifier", - "value": "Foo", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 119, "line": 1, }, "start": Object { - "column": 16, + "column": 118, "line": 1, }, }, "range": Array [ - 16, - 17, + 118, + 119, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 121, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 120, + "line": 1, }, }, "range": Array [ - 22, - 25, + 120, + 121, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 122, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 121, + "line": 1, }, }, "range": Array [ - 26, - 27, + 121, + 122, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 124, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 123, + "line": 1, }, }, "range": Array [ - 28, - 29, + 123, + 124, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 126, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 125, + "line": 1, }, }, "range": Array [ - 29, - 30, + 125, + 126, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 127, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 126, + "line": 1, }, }, "range": Array [ - 35, - 38, + 126, + 127, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 128, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 127, + "line": 1, }, }, "range": Array [ - 39, - 40, + 127, + 128, ], "type": "Punctuator", - "value": "}", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 129, + "line": 1, + }, + "start": Object { + "column": 128, + "line": 1, + }, + }, + "range": Array [ + 128, + 129, + ], + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment-object.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "id": Object { + "expression": Object { + "left": Object { "loc": Object { "end": Object { - "column": 21, + "column": 13, "line": 1, }, "start": Object { - "column": 12, + "column": 1, "line": 1, }, }, - "name": "TestAlias", + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 9, + 11, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], "range": Array [ - 12, - 21, + 1, + 13, ], - "type": "Identifier", + "type": "ObjectPattern", }, "loc": Object { "end": Object { - "column": 40, + "column": 19, "line": 1, }, "start": Object { - "column": 7, + "column": 1, "line": 1, }, }, + "operator": "=", "range": Array [ - 7, - 40, + 1, + 19, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { + "right": Object { "loc": Object { "end": Object { - "column": 39, + "column": 19, "line": 1, }, "start": Object { - "column": 24, + "column": 16, "line": 1, }, }, + "name": "bar", "range": Array [ - 24, - 39, - ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 30, - ], - "type": "TSStringKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 39, - ], - "type": "TSNumberKeyword", - }, + 16, + 19, ], + "type": "Identifier", }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 40, + "column": 21, "line": 1, }, "start": Object { @@ -23085,17 +24269,15 @@ Object { }, "range": Array [ 0, - 40, + 21, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -23104,14 +24286,14 @@ Object { }, "range": Array [ 0, - 40, + 22, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 1, "line": 1, }, "start": Object { @@ -23121,61 +24303,61 @@ Object { }, "range": Array [ 0, - 6, + 1, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 2, "line": 1, }, "start": Object { - "column": 7, + "column": 1, "line": 1, }, }, "range": Array [ - 7, - 11, + 1, + 2, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 6, "line": 1, }, "start": Object { - "column": 12, + "column": 3, "line": 1, }, }, "range": Array [ - 12, - 21, + 3, + 6, ], "type": "Identifier", - "value": "TestAlias", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 8, "line": 1, }, "start": Object { - "column": 22, + "column": 7, "line": 1, }, }, "range": Array [ - 22, - 23, + 7, + 8, ], "type": "Punctuator", "value": "=", @@ -23183,71 +24365,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, + "column": 10, "line": 1, }, "start": Object { - "column": 24, + "column": 9, "line": 1, }, }, "range": Array [ - 24, - 30, + 9, + 10, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 11, "line": 1, }, "start": Object { - "column": 31, + "column": 10, "line": 1, }, }, "range": Array [ - 31, - 32, + 10, + 11, ], "type": "Punctuator", - "value": "|", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 13, "line": 1, }, "start": Object { - "column": 33, + "column": 12, "line": 1, }, }, "range": Array [ - 33, - 39, + 12, + 13, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, ], "type": "Identifier", - "value": "number", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 20, "line": 1, }, "start": Object { - "column": 39, + "column": 19, "line": 1, }, }, "range": Array [ - 39, - 40, + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -23257,157 +24493,218 @@ Object { } `; -exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment-property.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 1, }, - "name": "TestClassProps", - "range": Array [ - 12, - 26, - ], - "type": "Identifier", }, + "range": Array [ + 33, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, + "name": "Foo", "range": Array [ - 7, - 51, + 9, + 12, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 29, - "line": 1, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", }, - "name": "count", - "range": Array [ - 35, - 40, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 35, - 48, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 15, + "line": 1, }, }, + "method": false, "range": Array [ - 40, - 48, + 15, + 23, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 42, - 48, + 15, + 23, ], - "type": "TSNumberKeyword", + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", }, }, + ], + "range": Array [ + 13, + 25, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, }, - ], + "start": Object { + "column": 13, + "line": 1, + }, + }, "range": Array [ - 29, - 50, + 13, + 31, ], - "type": "TSTypeLiteral", - }, - }, - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "right": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "type": "AssignmentPattern", }, - }, + ], "range": Array [ 0, - 51, + 37, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -23416,14 +24713,14 @@ Object { }, "range": Array [ 0, - 51, + 38, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -23433,33 +24730,33 @@ Object { }, "range": Array [ 0, - 6, + 8, ], "type": "Keyword", - "value": "export", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 12, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 11, + 9, + 12, ], "type": "Identifier", - "value": "type", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 13, "line": 1, }, "start": Object { @@ -23469,115 +24766,115 @@ Object { }, "range": Array [ 12, - 26, + 13, ], - "type": "Identifier", - "value": "TestClassProps", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 14, "line": 1, }, "start": Object { - "column": 27, + "column": 13, "line": 1, }, }, "range": Array [ - 27, - 28, + 13, + 14, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { - "column": 29, + "column": 15, "line": 1, }, }, "range": Array [ - 29, - 30, + 15, + 18, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 35, - 40, + 19, + 20, ], - "type": "Identifier", - "value": "count", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 40, - 41, + 21, + 22, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 42, - 48, + 22, + 23, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 49, - 50, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -23585,175 +24882,290 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 27, + "line": 1, }, "start": Object { - "column": 1, - "line": 3, + "column": 26, + "line": 1, }, }, "range": Array [ - 50, - 51, + 26, + 27, ], "type": "Punctuator", - "value": ";", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "TestCallback", - "range": Array [ - 12, - 24, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 47, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "start": Object { + "column": 28, + "line": 1, }, - "range": Array [ - 7, - 47, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "parameters": Array [ - Object { + }, + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": "a", "range": Array [ - 28, - 37, + 15, + 27, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 28, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, }, + "name": "a", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", }, - "range": Array [ - 29, - 37, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "init": Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 31, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 31, - 37, + 39, + 40, ], - "type": "TSNumberKeyword", + "raw": "1", + "type": "Literal", + "value": 1, }, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 35, + 40, + ], + "type": "VariableDeclarator", }, - }, - ], - "range": Array [ - 27, - 46, - ], - "type": "TSFunctionType", - "typeAnnotation": Object { + ], + "kind": "var", "loc": Object { "end": Object { - "column": 46, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 40, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 40, - 46, + 31, + 41, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "VariableDeclaration", + }, + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 46, - "line": 1, + "column": 14, + "line": 4, }, "start": Object { - "column": 42, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 42, - 46, + 44, + 56, ], - "type": "TSVoidKeyword", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, }, + "range": Array [ + 44, + 57, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 59, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, - "typeParameters": null, }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, @@ -23762,17 +25174,15 @@ Object { }, "range": Array [ 0, - 47, + 59, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "TSModuleDeclaration", }, ], "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -23781,9 +25191,9 @@ Object { }, "range": Array [ 0, - 47, + 60, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { @@ -23800,13 +25210,13 @@ Object { 0, 6, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "module", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { @@ -23816,56 +25226,56 @@ Object { }, "range": Array [ 7, - 11, + 10, ], "type": "Identifier", - "value": "type", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 24, ], - "type": "Identifier", - "value": "TestCallback", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 25, - 26, + 15, + 27, ], - "type": "Punctuator", - "value": "=", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ @@ -23873,195 +25283,307 @@ Object { 28, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 28, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 28, - 29, + 31, + 34, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 29, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 29, - 30, + 35, + 36, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 31, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 31, 37, + 38, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 37, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 37, - 38, + 39, + 40, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 39, - "line": 1, + "column": 11, + "line": 3, }, }, "range": Array [ - 39, + 40, 41, ], "type": "Punctuator", - "value": "=>", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 1, + "column": 14, + "line": 4, }, "start": Object { - "column": 42, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 42, - 46, + 44, + 56, ], - "type": "Keyword", - "value": "void", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 46, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 46, - 47, + 56, + 57, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-with-await.src 1`] = ` +exports[`typescript fixtures/basics/directive-in-namespace.src 1`] = ` Object { "body": Array [ Object { - "async": true, "body": Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, }, - "name": "future", - "range": Array [ - 40, - 46, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 30, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 31, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 38, + 43, ], - "type": "Identifier", + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, }, + }, + "range": Array [ + 34, + 44, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 14, + "line": 4, }, "start": Object { - "column": 4, - "line": 2, + "column": 2, + "line": 4, }, }, "range": Array [ - 34, - 46, + 47, + 59, ], - "type": "AwaitExpression", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 15, + "line": 4, }, "start": Object { - "column": 4, - "line": 2, + "column": 2, + "line": 4, }, }, "range": Array [ - 34, 47, + 60, ], "type": "ExpressionStatement", }, @@ -24069,80 +25591,58 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { - "column": 28, + "column": 14, "line": 1, }, }, "range": Array [ - 28, - 49, + 14, + 62, ], - "type": "BlockStatement", + "type": "TSModuleBlock", }, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 19, + "column": 13, "line": 1, }, "start": Object { - "column": 15, + "column": 10, "line": 1, }, }, - "name": "hope", + "name": "foo", "range": Array [ - 15, - 19, + 10, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "future", - "range": Array [ - 20, - 26, - ], - "type": "Identifier", - }, - ], "range": Array [ 0, - 49, + 62, ], - "type": "FunctionDeclaration", + "type": "TSModuleDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -24151,14 +25651,14 @@ Object { }, "range": Array [ 0, - 50, + 63, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { @@ -24168,169 +25668,205 @@ Object { }, "range": Array [ 0, - 5, + 9, ], "type": "Identifier", - "value": "async", + "value": "namespace", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 10, "line": 1, }, }, "range": Array [ - 6, - 14, + 10, + 13, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 19, ], - "type": "Identifier", - "value": "hope", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 19, - 20, + 18, + 30, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 20, - 26, + 30, + 31, ], - "type": "Identifier", - "value": "future", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 26, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 26, - 27, + 34, + 37, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 28, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 28, - 29, + 38, + 39, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 2, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 34, - 39, + 40, + 41, ], - "type": "Identifier", - "value": "await", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { "column": 10, - "line": 2, + "line": 3, }, }, "range": Array [ - 40, - 46, + 42, + 43, ], - "type": "Identifier", - "value": "future", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, }, }, "range": Array [ - 46, 47, + 59, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 59, + 60, ], "type": "Punctuator", "value": ";", @@ -24339,16 +25875,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 48, - 49, + 61, + 62, ], "type": "Punctuator", "value": "}", @@ -24358,32 +25894,11 @@ Object { } `; -exports[`typescript fixtures/basics/function-with-object-type-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/export-assignment.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 47, - "line": 1, - }, - }, - "range": Array [ - 47, - 51, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 12, @@ -24403,298 +25918,207 @@ Object { }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 13, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [ - Object { + "range": Array [ + 0, + 13, + ], + "type": "TSExportAssignment", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 14, - 17, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, + "range": Array [ + 24, + 28, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 28, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, }, + }, + "params": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { "column": 22, "line": 1, }, "start": Object { - "column": 19, + "column": 21, "line": 1, }, }, - "method": false, + "name": "T", "range": Array [ - 19, + 21, 22, ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, + "type": "TSTypeParameter", }, ], "range": Array [ - 13, - 45, + 20, + 23, ], - "type": "ObjectPattern", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 45, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "optional": true, - "range": Array [ - 26, - 39, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 38, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 40, - 43, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "optional": true, - "range": Array [ - 40, - 44, - ], - "type": "TSPropertySignature", - }, - ], - "range": Array [ - 25, - 45, - ], - "type": "TSTypeLiteral", - }, - }, + "type": "TSTypeParameterDeclaration", }, - ], + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 51, + 28, ], - "type": "FunctionDeclaration", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { @@ -24709,14 +26133,14 @@ Object { }, "range": Array [ 0, - 52, + 29, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -24726,259 +26150,375 @@ Object { }, "range": Array [ 0, - 8, + 6, ], "type": "Keyword", - "value": "function", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 12, + 7, + 14, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 20, "line": 1, }, "start": Object { - "column": 12, + "column": 15, "line": 1, }, }, "range": Array [ - 12, - 13, + 15, + 20, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 21, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, "range": Array [ - 13, - 14, + 20, + 21, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 22, "line": 1, }, "start": Object { - "column": 14, + "column": 21, "line": 1, }, }, "range": Array [ - 14, - 17, + 21, + 22, ], "type": "Identifier", - "value": "bar", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 1, }, "start": Object { - "column": 17, + "column": 22, "line": 1, }, }, "range": Array [ - 17, - 18, + 22, + 23, ], "type": "Punctuator", - "value": ",", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 19, + "column": 24, "line": 1, }, }, "range": Array [ - 19, - 22, + 24, + 25, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 22, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 22, - 23, + 27, + 28, ], "type": "Punctuator", "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 31, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 26, + ], + "type": "TSTypeParameterDeclaration", + }, + }, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 23, + "column": 0, "line": 1, }, }, "range": Array [ - 23, - 24, + 0, + 31, ], - "type": "Punctuator", - "value": ":", + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 26, + "column": 6, "line": 1, }, "start": Object { - "column": 25, + "column": 0, "line": 1, }, }, "range": Array [ - 25, - 26, + 0, + 6, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 14, "line": 1, }, "start": Object { - "column": 26, + "column": 7, "line": 1, }, }, "range": Array [ - 26, - 29, + 7, + 14, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 20, "line": 1, }, "start": Object { - "column": 29, + "column": 15, "line": 1, }, }, "range": Array [ - 29, - 30, + 15, + 20, ], - "type": "Punctuator", - "value": "?", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 21, "line": 1, }, "start": Object { - "column": 30, + "column": 20, "line": 1, }, }, "range": Array [ - 30, - 31, + 20, + 21, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 22, "line": 1, }, "start": Object { - "column": 32, + "column": 21, "line": 1, }, }, "range": Array [ - 32, - 38, + 21, + 22, ], "type": "Identifier", - "value": "string", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 23, "line": 1, }, "start": Object { - "column": 38, + "column": 22, "line": 1, }, }, "range": Array [ - 38, - 39, + 22, + 23, ], "type": "Punctuator", "value": ",", @@ -24986,89 +26526,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 43, + "column": 25, "line": 1, }, "start": Object { - "column": 40, + "column": 24, "line": 1, }, }, "range": Array [ - 40, - 43, + 24, + 25, ], "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "range": Array [ - 43, - 44, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 44, - "line": 1, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": "}", + "value": "U", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 26, "line": 1, }, "start": Object { - "column": 45, + "column": 25, "line": 1, }, }, "range": Array [ - 45, - 46, + 25, + 26, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 48, + "column": 28, "line": 1, }, "start": Object { - "column": 47, + "column": 27, "line": 1, }, }, "range": Array [ - 47, - 48, + 27, + 28, ], "type": "Punctuator", "value": "{", @@ -25085,8 +26589,8 @@ Object { }, }, "range": Array [ - 50, - 51, + 30, + 31, ], "type": "Punctuator", "value": "}", @@ -25096,341 +26600,118 @@ Object { } `; -exports[`typescript fixtures/basics/function-with-object-type-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 1, + }, }, - "start": Object { - "column": 45, - "line": 1, + "range": Array [ + 20, + 24, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", }, - "range": Array [ - 45, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, - "name": "foo", "range": Array [ - 9, - 12, + 7, + 24, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 43, + "column": 19, "line": 1, }, "start": Object { - "column": 13, + "column": 16, "line": 1, }, }, - "properties": Array [ + "params": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 17, "line": 1, }, }, - "method": false, + "name": "T", "range": Array [ - 14, 17, + 18, ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 19, - 22, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, + "type": "TSTypeParameter", }, ], "range": Array [ - 13, - 43, + 16, + 19, ], - "type": "ObjectPattern", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 43, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 38, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 37, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 37, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 42, - ], - "type": "TSPropertySignature", - }, - ], - "range": Array [ - 25, - 43, - ], - "type": "TSTypeLiteral", - }, - }, + "type": "TSTypeParameterDeclaration", }, - ], + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 49, + 24, ], - "type": "FunctionDeclaration", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -25445,14 +26726,14 @@ Object { }, "range": Array [ 0, - 50, + 25, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -25462,10 +26743,10 @@ Object { }, "range": Array [ 0, - 8, + 6, ], "type": "Keyword", - "value": "function", + "value": "export", }, Object { "loc": Object { @@ -25474,301 +26755,436 @@ Object { "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, + 7, 12, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 16, ], - "type": "Punctuator", - "value": "(", - }, + "type": "Identifier", + "value": "Foo", + }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 17, "line": 1, }, "start": Object { - "column": 13, + "column": 16, "line": 1, }, }, "range": Array [ - 13, - 14, + 16, + 17, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 17, "line": 1, }, }, "range": Array [ - 14, 17, + 18, ], "type": "Identifier", - "value": "bar", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Punctuator", - "value": ",", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { - "column": 19, + "column": 20, "line": 1, }, }, "range": Array [ - 19, - 22, + 20, + 21, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 22, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 22, 23, + 24, ], "type": "Punctuator", "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 27, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "TSTypeParameter", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 20, + 21, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 16, + 22, + ], + "type": "TSTypeParameterDeclaration", + }, + }, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 23, + "column": 0, "line": 1, }, }, "range": Array [ - 23, - 24, + 0, + 27, ], - "type": "Punctuator", - "value": ":", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 26, + "column": 6, "line": 1, }, "start": Object { - "column": 25, + "column": 0, "line": 1, }, }, "range": Array [ - 25, - 26, + 0, + 6, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 12, "line": 1, }, "start": Object { - "column": 26, + "column": 7, "line": 1, }, }, "range": Array [ - 26, - 29, + 7, + 12, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 16, "line": 1, }, "start": Object { - "column": 29, + "column": 13, "line": 1, }, }, "range": Array [ - 29, - 30, + 13, + 16, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 17, "line": 1, }, "start": Object { - "column": 31, + "column": 16, "line": 1, }, }, "range": Array [ - 31, - 37, + 16, + 17, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 18, "line": 1, }, "start": Object { - "column": 37, + "column": 17, "line": 1, }, }, "range": Array [ - 37, - 38, + 17, + 18, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 19, "line": 1, }, "start": Object { - "column": 39, + "column": 18, "line": 1, }, }, "range": Array [ - 39, - 42, + 18, + 19, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 21, "line": 1, }, "start": Object { - "column": 42, + "column": 20, "line": 1, }, }, "range": Array [ - 42, - 43, + 20, + 21, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "U", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 22, "line": 1, }, "start": Object { - "column": 43, + "column": 21, "line": 1, }, }, "range": Array [ - 43, - 44, + 21, + 22, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 24, "line": 1, }, "start": Object { - "column": 45, + "column": 23, "line": 1, }, }, "range": Array [ - 45, - 46, + 23, + 24, ], "type": "Punctuator", "value": "{", @@ -25785,8 +27201,8 @@ Object { }, }, "range": Array [ - 48, - 49, + 26, + 27, ], "type": "Punctuator", "value": "}", @@ -25796,35 +27212,81 @@ Object { } `; -exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "members": Array [ Object { - "argument": Object { + "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 7, "line": 2, }, "start": Object { - "column": 11, + "column": 4, "line": 2, }, }, - "name": "b", + "name": "foo", "range": Array [ - 36, - 37, + 22, + 25, ], "type": "Identifier", }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 2, }, "start": Object { @@ -25833,539 +27295,535 @@ Object { }, }, "range": Array [ + 22, 29, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, 38, ], - "type": "ReturnStatement", + "type": "TSEnumMember", }, ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, "range": Array [ - 23, + 7, 40, ], - "type": "BlockStatement", + "type": "TSEnumDeclaration", }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", }, + "range": Array [ + 0, + 40, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "module", + "tokens": Array [ + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 6, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - }, - }, - }, - ], "range": Array [ 0, - 40, + 6, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 22, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - }, - }, - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 11, - 12, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 10, - 13, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "export", }, - }, - "range": Array [ - 0, - 41, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 8, + 7, + 11, ], "type": "Keyword", - "value": "function", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 15, "line": 1, }, "start": Object { - "column": 9, + "column": 12, "line": 1, }, }, "range": Array [ - 9, - 10, + 12, + 15, ], "type": "Identifier", - "value": "a", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { - "column": 10, + "column": 16, "line": 1, }, }, "range": Array [ - 10, - 11, + 16, + 17, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 11, - 12, + 22, + 25, ], "type": "Identifier", - "value": "X", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 12, - 13, + 26, + 27, ], "type": "Punctuator", - "value": ">", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 13, - 14, + 28, + 29, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 14, - 15, + 35, + 38, ], "type": "Identifier", - "value": "b", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 15, - 16, + 39, + 40, ], "type": "Punctuator", - "value": ":", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestAlias", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 40, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 39, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "TSNumberKeyword", + }, + ], + }, + }, "loc": Object { "end": Object { - "column": 18, + "column": 40, "line": 1, }, "start": Object { - "column": 17, + "column": 0, "line": 1, }, }, "range": Array [ - 17, - 18, + 0, + 40, ], - "type": "Identifier", - "value": "X", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, + "column": 6, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 19, + 0, + 6, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 19, + "column": 7, "line": 1, }, }, "range": Array [ - 19, - 20, + 7, + 11, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { - "column": 21, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 21, - 22, ], "type": "Identifier", - "value": "X", + "value": "TestAlias", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { - "column": 23, + "column": 22, "line": 1, }, }, "range": Array [ + 22, 23, - 24, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ - 29, - 35, + 24, + 30, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 31, + "line": 1, }, }, "range": Array [ - 36, - 37, + 31, + 32, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 39, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 33, + "line": 1, }, }, "range": Array [ - 37, - 38, + 33, + 39, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 40, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 39, + "line": 1, }, }, "range": Array [ @@ -26373,115 +27831,164 @@ Object { 40, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-with-type-parameters-that-have-comments.src 1`] = ` +exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 35, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, - "name": "compare", "range": Array [ - 9, - 16, + 7, + 51, ], - "type": "Identifier", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "count", + "range": Array [ + 35, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 35, + 48, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 29, + 50, + ], + "type": "TSTypeLiteral", + }, }, "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 35, + 51, ], - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 28, - 29, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 16, - 30, - ], - "type": "TSTypeParameterDeclaration", - }, + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { "column": 0, @@ -26490,14 +27997,14 @@ Object { }, "range": Array [ 0, - 35, + 51, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -26507,64 +28014,64 @@ Object { }, "range": Array [ 0, - 8, + 6, ], "type": "Keyword", - "value": "function", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 16, + 7, + 11, ], "type": "Identifier", - "value": "compare", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 26, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, "range": Array [ - 16, - 17, + 12, + 26, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "TestClassProps", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 28, "line": 1, }, "start": Object { - "column": 28, + "column": 27, "line": 1, }, }, "range": Array [ + 27, 28, - 29, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { @@ -26582,212 +28089,157 @@ Object { 30, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 30, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 30, - 31, + 35, + 40, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "count", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 31, - 32, + 40, + 41, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 33, - 34, + 42, + 48, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 34, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 34, - 35, + 49, + 50, ], "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` +exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "b", - "range": Array [ - 47, - 48, - ], - "type": "Identifier", + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "start": Object { + "column": 12, + "line": 1, }, - "range": Array [ - 40, - 49, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 34, - "line": 1, }, + "name": "TestCallback", + "range": Array [ + 12, + 24, + ], + "type": "Identifier", }, - "range": Array [ - 34, - 51, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 47, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, - "name": "a", "range": Array [ - 9, - 10, + 7, + 47, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 29, + "column": 46, "line": 1, }, "start": Object { - "column": 25, + "column": 27, "line": 1, }, }, - "name": "b", - "range": Array [ - 25, - 29, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "parameters": Array [ + Object { "loc": Object { "end": Object { - "column": 29, + "column": 37, "line": 1, }, "start": Object { @@ -26795,151 +28247,113 @@ Object { "line": 1, }, }, + "name": "a", "range": Array [ 28, - 29, + 37, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 29, + "column": 37, "line": 1, }, "start": Object { - "column": 28, + "column": 29, "line": 1, }, }, - "name": "X", "range": Array [ - 28, 29, + 37, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSNumberKeyword", + }, }, }, - }, - }, - ], - "range": Array [ - 0, - 51, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 33, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, + ], "range": Array [ - 32, - 33, + 27, + 46, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSFunctionType", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 33, + "column": 46, "line": 1, }, "start": Object { - "column": 32, + "column": 40, "line": 1, }, }, - "name": "X", "range": Array [ - 32, - 33, + 40, + 46, ], - "type": "Identifier", - }, - }, - }, - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "constraint": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, + "column": 46, "line": 1, }, "start": Object { - "column": 21, + "column": 42, "line": 1, }, }, - "members": Array [], "range": Array [ - 21, - 23, + 42, + 46, ], - "type": "TSTypeLiteral", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "type": "TSVoidKeyword", }, - "name": "X", - "range": Array [ - 11, - 23, - ], - "type": "TSTypeParameter", }, - ], - "range": Array [ - 10, - 24, - ], - "type": "TSTypeParameterDeclaration", + "typeParameters": null, + }, + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 47, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 4, + "column": 47, + "line": 1, }, "start": Object { "column": 0, @@ -26948,14 +28362,14 @@ Object { }, "range": Array [ 0, - 52, + 47, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -26965,28 +28379,10 @@ Object { }, "range": Array [ 0, - 8, + 6, ], "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "a", + "value": "export", }, Object { "loc": Object { @@ -26995,88 +28391,16 @@ Object { "line": 1, }, "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, + "column": 7, "line": 1, }, }, "range": Array [ + 7, 11, - 12, ], "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 20, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "}", + "value": "type", }, Object { "loc": Object { @@ -27085,34 +28409,16 @@ Object { "line": 1, }, "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 24, - 25, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "TestCallback", }, Object { "loc": Object { @@ -27129,26 +28435,26 @@ Object { 25, 26, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 28, "line": 1, }, "start": Object { - "column": 26, + "column": 27, "line": 1, }, }, "range": Array [ - 26, 27, + 28, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { @@ -27166,7 +28472,7 @@ Object { 29, ], "type": "Identifier", - "value": "X", + "value": "a", }, Object { "loc": Object { @@ -27184,168 +28490,149 @@ Object { 30, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 37, "line": 1, }, "start": Object { - "column": 30, + "column": 31, "line": 1, }, }, "range": Array [ - 30, 31, + 37, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 38, "line": 1, }, "start": Object { - "column": 32, + "column": 37, "line": 1, }, }, "range": Array [ - 32, - 33, + 37, + 38, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 41, "line": 1, }, "start": Object { - "column": 34, + "column": 39, "line": 1, }, }, "range": Array [ - 34, - 35, + 39, + 41, ], "type": "Punctuator", - "value": "{", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 46, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 42, + "line": 1, }, }, "range": Array [ - 40, + 42, 46, ], "type": "Keyword", - "value": "return", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 47, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 46, + "line": 1, }, }, "range": Array [ + 46, 47, - 48, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 48, - 49, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 50, - 51, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/function-with-types.src 1`] = ` +exports[`typescript fixtures/basics/function-with-await.src 1`] = ` Object { "body": Array [ Object { - "async": false, + "async": true, "body": Object { "body": Array [ Object { - "argument": Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "future", + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 2, }, "start": Object { - "column": 11, + "column": 4, "line": 2, }, }, - "name": "name", "range": Array [ - 50, - 54, + 34, + 46, ], - "type": "Identifier", + "type": "AwaitExpression", }, "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 2, }, "start": Object { @@ -27354,10 +28641,10 @@ Object { }, }, "range": Array [ - 43, - 55, + 34, + 47, ], - "type": "ReturnStatement", + "type": "ExpressionStatement", }, ], "loc": Object { @@ -27366,13 +28653,13 @@ Object { "line": 3, }, "start": Object { - "column": 37, + "column": 28, "line": 1, }, }, "range": Array [ - 37, - 57, + 28, + 49, ], "type": "BlockStatement", }, @@ -27381,18 +28668,18 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 16, + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 15, "line": 1, }, }, - "name": "message", + "name": "hope", "range": Array [ - 9, - 16, + 15, + 19, ], "type": "Identifier", }, @@ -27410,94 +28697,26 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 26, "line": 1, }, "start": Object { - "column": 17, + "column": 20, "line": 1, }, }, - "name": "name", + "name": "future", "range": Array [ - 17, - 28, + 20, + 26, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 28, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 28, - ], - "type": "TSStringKeyword", - }, - }, }, ], "range": Array [ 0, - 57, + 49, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 36, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 36, - ], - "type": "TSStringKeyword", - }, - }, "type": "FunctionDeclaration", }, ], @@ -27513,14 +28732,14 @@ Object { }, "range": Array [ 0, - 58, + 50, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -27530,7 +28749,25 @@ Object { }, "range": Array [ 0, - 8, + 5, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, ], "type": "Keyword", "value": "function", @@ -27538,35 +28775,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 15, "line": 1, }, }, "range": Array [ - 9, - 16, + 15, + 19, ], "type": "Identifier", - "value": "message", + "value": "hope", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 19, "line": 1, }, }, "range": Array [ - 16, - 17, + 19, + 20, ], "type": "Punctuator", "value": "(", @@ -27574,56 +28811,38 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 26, "line": 1, }, "start": Object { - "column": 17, + "column": 20, "line": 1, }, }, "range": Array [ - 17, - 21, + 20, + 26, ], "type": "Identifier", - "value": "name", + "value": "future", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { - "column": 21, + "column": 26, "line": 1, }, }, "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 28, + 26, + 27, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -27641,66 +28860,12 @@ Object { 29, ], "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 36, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 37, - "line": 1, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 2, }, "start": Object { @@ -27709,44 +28874,44 @@ Object { }, }, "range": Array [ - 43, - 49, + 34, + 39, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "await", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 2, }, "start": Object { - "column": 11, + "column": 10, "line": 2, }, }, "range": Array [ - 50, - 54, + 40, + 46, ], "type": "Identifier", - "value": "name", + "value": "future", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 2, }, "start": Object { - "column": 15, + "column": 16, "line": 2, }, }, "range": Array [ - 54, - 55, + 46, + 47, ], "type": "Punctuator", "value": ";", @@ -27763,8 +28928,8 @@ Object { }, }, "range": Array [ - 56, - 57, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -27774,62 +28939,26 @@ Object { } `; -exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` +exports[`typescript fixtures/basics/function-with-object-type-with-optional-properties.src 1`] = ` Object { "body": Array [ Object { "async": false, "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "name", - "range": Array [ - 89, - 93, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 82, - 94, - ], - "type": "ReturnStatement", - }, - ], + "body": Array [], "loc": Object { "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 78, + "column": 47, "line": 1, }, }, "range": Array [ - 78, - 96, + 47, + 51, ], "type": "BlockStatement", }, @@ -27838,7 +28967,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 16, + "column": 12, "line": 1, }, "start": Object { @@ -27846,10 +28975,10 @@ Object { "line": 1, }, }, - "name": "message", + "name": "foo", "range": Array [ 9, - 16, + 12, ], "type": "Identifier", }, @@ -27867,305 +28996,285 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 45, "line": 1, }, "start": Object { - "column": 17, + "column": 13, "line": 1, }, }, - "name": "name", - "range": Array [ - 17, - 28, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", }, - }, - "range": Array [ - 21, - 28, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 28, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 14, "line": 1, }, }, + "method": false, "range": Array [ - 22, - 28, + 14, + 17, ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", }, }, - "name": "age", - "range": Array [ - 30, - 40, - ], - "type": "Identifier", - "typeAnnotation": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 40, + "column": 22, "line": 1, }, "start": Object { - "column": 33, + "column": 19, "line": 1, }, }, + "method": false, "range": Array [ - 33, - 40, + 19, + 22, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "shorthand": true, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 40, + "column": 22, "line": 1, }, "start": Object { - "column": 34, + "column": 19, "line": 1, }, }, + "name": "baz", "range": Array [ - 34, - 40, + 19, + 22, ], - "type": "TSNumberKeyword", + "type": "Identifier", }, }, - }, - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, + ], "range": Array [ - 30, - 46, + 13, + 45, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "range": Array [ - 43, - 46, - ], - "raw": "100", - "type": "Literal", - "value": 100, - }, - "type": "AssignmentPattern", - }, - Object { - "argument": Object { + "type": "ObjectPattern", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 69, + "column": 45, "line": 1, }, "start": Object { - "column": 51, + "column": 23, "line": 1, }, }, - "name": "args", "range": Array [ - 51, - 69, + 23, + 45, ], - "type": "Identifier", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 69, + "column": 45, "line": 1, }, "start": Object { - "column": 55, + "column": 25, "line": 1, }, }, - "range": Array [ - 55, - 69, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 69, - "line": 1, - }, - "start": Object { - "column": 56, - "line": 1, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", }, - }, - "range": Array [ - 56, - 69, - ], - "type": "TSTypeReference", - "typeName": Object { "loc": Object { "end": Object { - "column": 61, + "column": 39, "line": 1, }, "start": Object { - "column": 56, + "column": 26, "line": 1, }, }, - "name": "Array", + "optional": true, "range": Array [ - 56, - 61, + 26, + 39, ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 69, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, }, - }, - "params": Array [ - Object { + "range": Array [ + 30, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 68, + "column": 38, "line": 1, }, "start": Object { - "column": 62, + "column": 32, "line": 1, }, }, "range": Array [ - 62, - 68, + 32, + 38, ], "type": "TSStringKeyword", }, - ], + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 40, + 43, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "optional": true, "range": Array [ - 61, - 69, + 40, + 44, ], - "type": "TSTypeParameterInstantiation", + "type": "TSPropertySignature", }, - }, - }, - }, - "loc": Object { - "end": Object { - "column": 69, - "line": 1, - }, - "start": Object { - "column": 48, - "line": 1, + ], + "range": Array [ + 25, + 45, + ], + "type": "TSTypeLiteral", }, }, - "range": Array [ - 48, - 69, - ], - "type": "RestElement", }, ], "range": Array [ 0, - 96, + 51, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 70, - "line": 1, - }, - }, - "range": Array [ - 70, - 77, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 71, - "line": 1, - }, - }, - "range": Array [ - 71, - 77, - ], - "type": "TSStringKeyword", - }, - }, "type": "FunctionDeclaration", }, ], @@ -28181,7 +29290,7 @@ Object { }, "range": Array [ 0, - 97, + 52, ], "sourceType": "script", "tokens": Array [ @@ -28206,7 +29315,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 12, "line": 1, }, "start": Object { @@ -28216,25 +29325,25 @@ Object { }, "range": Array [ 9, - 16, + 12, ], "type": "Identifier", - "value": "message", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, "range": Array [ - 16, - 17, + 12, + 13, ], "type": "Punctuator", "value": "(", @@ -28242,71 +29351,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 21, - ], - "type": "Identifier", - "value": "name", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, + "column": 14, "line": 1, }, "start": Object { - "column": 21, + "column": 13, "line": 1, }, }, "range": Array [ - 21, - 22, + 13, + 14, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 14, "line": 1, }, }, "range": Array [ - 22, - 28, + 14, + 17, ], "type": "Identifier", - "value": "string", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 18, "line": 1, }, "start": Object { - "column": 28, + "column": 17, "line": 1, }, }, "range": Array [ - 28, - 29, + 17, + 18, ], "type": "Punctuator", "value": ",", @@ -28314,161 +29405,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, + "column": 22, "line": 1, }, "start": Object { - "column": 30, + "column": 19, "line": 1, }, }, "range": Array [ - 30, - 33, + 19, + 22, ], "type": "Identifier", - "value": "age", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 23, "line": 1, }, "start": Object { - "column": 33, + "column": 22, "line": 1, }, }, "range": Array [ - 33, - 34, + 22, + 23, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 40, - ], - "type": "Identifier", - "value": "number", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 24, "line": 1, }, "start": Object { - "column": 41, + "column": 23, "line": 1, }, }, "range": Array [ - 41, - 42, + 23, + 24, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 43, - "line": 1, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "Numeric", - "value": "100", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 47, + "column": 26, "line": 1, }, "start": Object { - "column": 46, + "column": 25, "line": 1, }, }, "range": Array [ - 46, - 47, + 25, + 26, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 51, + "column": 29, "line": 1, }, "start": Object { - "column": 48, + "column": 26, "line": 1, }, }, "range": Array [ - 48, - 51, + 26, + 29, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 55, + "column": 30, "line": 1, }, "start": Object { - "column": 51, + "column": 29, "line": 1, }, }, "range": Array [ - 51, - 55, + 29, + 30, ], - "type": "Identifier", - "value": "args", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 56, + "column": 31, "line": 1, }, "start": Object { - "column": 55, + "column": 30, "line": 1, }, }, "range": Array [ - 55, - 56, + 30, + 31, ], "type": "Punctuator", "value": ":", @@ -28476,201 +29531,129 @@ Object { Object { "loc": Object { "end": Object { - "column": 61, + "column": 38, "line": 1, }, "start": Object { - "column": 56, + "column": 32, "line": 1, }, }, "range": Array [ - 56, - 61, + 32, + 38, ], "type": "Identifier", - "value": "Array", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 62, + "column": 39, "line": 1, }, "start": Object { - "column": 61, + "column": 38, "line": 1, }, }, "range": Array [ - 61, - 62, + 38, + 39, ], "type": "Punctuator", - "value": "<", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 68, + "column": 43, "line": 1, }, "start": Object { - "column": 62, + "column": 40, "line": 1, }, }, "range": Array [ - 62, - 68, + 40, + 43, ], "type": "Identifier", - "value": "string", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 69, + "column": 44, "line": 1, }, "start": Object { - "column": 68, + "column": 43, "line": 1, }, }, "range": Array [ - 68, - 69, + 43, + 44, ], "type": "Punctuator", - "value": ">", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 70, + "column": 45, "line": 1, }, "start": Object { - "column": 69, + "column": 44, "line": 1, }, }, "range": Array [ - 69, - 70, + 44, + 45, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 71, + "column": 46, "line": 1, }, "start": Object { - "column": 70, + "column": 45, "line": 1, }, }, "range": Array [ - 70, - 71, + 45, + 46, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 71, - "line": 1, - }, - }, - "range": Array [ - 71, - 77, - ], - "type": "Identifier", - "value": "string", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 79, + "column": 48, "line": 1, }, "start": Object { - "column": 78, + "column": 47, "line": 1, }, }, "range": Array [ - 78, - 79, + 47, + 48, ], "type": "Punctuator", "value": "{", }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 82, - 88, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 89, - 93, - ], - "type": "Identifier", - "value": "name", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 93, - 94, - ], - "type": "Punctuator", - "value": ";", - }, Object { "loc": Object { "end": Object { @@ -28683,8 +29666,8 @@ Object { }, }, "range": Array [ - 95, - 96, + 50, + 51, ], "type": "Punctuator", "value": "}", @@ -28694,48 +29677,35 @@ Object { } `; -exports[`typescript fixtures/basics/import-type.src 1`] = ` +exports[`typescript fixtures/basics/function-with-object-type-without-annotation.src 1`] = ` Object { "body": Array [ Object { - "id": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 5, + "column": 45, "line": 1, }, }, - "name": "A", "range": Array [ - 5, - 6, + 45, + 49, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "BlockStatement", }, - "range": Array [ - 0, - 28, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "isTypeOf": true, + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 27, + "column": 12, "line": 1, }, "start": Object { @@ -28743,217 +29713,311 @@ Object { "line": 1, }, }, - "parameter": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 26, - ], - "raw": "'A'", - "type": "Literal", - "value": "A", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 26, - ], - "type": "TSLiteralType", - }, - "qualifier": null, + "name": "foo", "range": Array [ 9, - 27, - ], - "type": "TSImportType", - "typeParameters": null, - }, - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "B", - "range": Array [ - 34, - 35, + 12, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, - "range": Array [ - 29, - 55, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "isTypeOf": false, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "parameter": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 45, - 48, - ], - "raw": "\\"B\\"", - "type": "Literal", - "value": "B", - }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 43, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 13, + "line": 1, }, }, - "range": Array [ - 45, - 48, - ], - "type": "TSLiteralType", - }, - "qualifier": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "name": "X", - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - }, - "range": Array [ - 38, - 54, - ], - "type": "TSImportType", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, }, - }, - "params": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 19, + "line": 1, }, }, + "method": false, "range": Array [ - 52, - 53, + 19, + 22, ], - "type": "TSTypeReference", - "typeName": Object { + "shorthand": true, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 19, + "line": 1, }, }, - "name": "Y", + "name": "baz", "range": Array [ - 52, - 53, + 19, + 22, ], "type": "Identifier", }, }, ], "range": Array [ - 51, - 54, + 13, + 43, ], - "type": "TSTypeParameterInstantiation", + "type": "ObjectPattern", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 43, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 38, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "TSPropertySignature", + }, + ], + "range": Array [ + 25, + 43, + ], + "type": "TSTypeLiteral", + }, + }, }, - }, + ], + "range": Array [ + 0, + 49, + ], + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -28962,14 +30026,14 @@ Object { }, "range": Array [ 0, - 56, + 50, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 8, "line": 1, }, "start": Object { @@ -28979,435 +30043,405 @@ Object { }, "range": Array [ 0, - 4, + 8, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 12, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 6, + 9, + 12, ], "type": "Identifier", - "value": "A", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 12, "line": 1, }, }, "range": Array [ - 7, - 8, + 12, + 13, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 13, "line": 1, }, }, "range": Array [ - 9, - 15, + 13, + 14, ], - "type": "Keyword", - "value": "typeof", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 17, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, "range": Array [ - 16, - 22, + 14, + 17, ], - "type": "Keyword", - "value": "import", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 22, + "column": 17, "line": 1, }, }, "range": Array [ - 22, - 23, + 17, + 18, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 22, "line": 1, }, "start": Object { - "column": 23, + "column": 19, "line": 1, }, }, "range": Array [ - 23, - 26, + 19, + 22, ], - "type": "String", - "value": "'A'", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 22, "line": 1, }, }, "range": Array [ - 26, - 27, + 22, + 23, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { - "column": 27, + "column": 23, "line": 1, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ - 29, - 33, + 25, + 26, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ - 34, - 35, + 26, + 29, ], "type": "Identifier", - "value": "B", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 36, - 37, + 29, + 30, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 37, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 31, + "line": 1, }, }, "range": Array [ - 38, - 44, + 31, + 37, ], - "type": "Keyword", - "value": "import", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 38, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 37, + "line": 1, }, }, "range": Array [ - 44, - 45, + 37, + 38, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 42, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 39, + "line": 1, }, }, "range": Array [ - 45, - 48, + 39, + 42, ], - "type": "String", - "value": "\\"B\\"", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 43, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 42, + "line": 1, }, }, "range": Array [ - 48, - 49, + 42, + 43, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 44, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 43, + "line": 1, }, }, "range": Array [ - 49, - 50, + 43, + 44, ], "type": "Punctuator", - "value": ".", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "range": Array [ - 51, - 52, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "range": Array [ - 52, - 53, - ], - "type": "Identifier", - "value": "Y", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, + "column": 46, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 45, + "line": 1, }, }, "range": Array [ - 53, - 54, + 45, + 46, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 25, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 54, - 55, + 48, + 49, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` +exports[`typescript fixtures/basics/function-with-type-parameters.src 1`] = ` Object { "body": Array [ Object { - "id": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 29, + 38, + ], + "type": "ReturnStatement", + }, + ], "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 5, + "column": 23, "line": 1, }, }, - "name": "X", "range": Array [ - 5, - 6, + 23, + 40, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "BlockStatement", }, - "range": Array [ - 0, - 30, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 29, + "column": 10, "line": 1, }, "start": Object { @@ -29415,163 +30449,195 @@ Object { "line": 1, }, }, + "name": "a", "range": Array [ 9, - 29, + 10, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 9, + "column": 14, "line": 1, }, }, - "name": "A", + "name": "b", "range": Array [ - 9, - 10, + 14, + 18, ], "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, }, - }, - "params": Array [ - Object { - "isTypeOf": false, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, + "column": 18, "line": 1, }, "start": Object { - "column": 11, + "column": 17, "line": 1, }, }, - "parameter": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "raw": "\\"\\"", - "type": "Literal", - "value": "", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "TSLiteralType", - }, - "qualifier": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "B", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, "range": Array [ - 11, - 28, + 17, + 18, ], - "type": "TSImportType", - "typeParameters": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 28, + "column": 18, "line": 1, }, "start": Object { - "column": 23, + "column": 17, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 27, - ], - "type": "TSAnyKeyword", - }, - ], + "name": "X", "range": Array [ - 23, - 28, + 17, + 18, ], - "type": "TSTypeParameterInstantiation", + "type": "Identifier", }, }, - ], + }, + }, + ], + "range": Array [ + 0, + 40, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, "range": Array [ - 10, - 29, + 21, + 22, ], - "type": "TSTypeParameterInstantiation", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + }, + }, + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 13, + ], + "type": "TSTypeParameterDeclaration", }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -29580,14 +30646,14 @@ Object { }, "range": Array [ 0, - 31, + 41, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 8, "line": 1, }, "start": Object { @@ -29597,46 +30663,10 @@ Object { }, "range": Array [ 0, - 4, - ], - "type": "Identifier", - "value": "type", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, 8, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -29654,7 +30684,7 @@ Object { 10, ], "type": "Identifier", - "value": "A", + "value": "a", }, Object { "loc": Object { @@ -29677,7 +30707,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 12, "line": 1, }, "start": Object { @@ -29687,395 +30717,226 @@ Object { }, "range": Array [ 11, - 17, + 12, ], - "type": "Keyword", - "value": "import", + "type": "Identifier", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { - "column": 17, + "column": 12, "line": 1, }, }, "range": Array [ - 17, - 18, + 12, + 13, ], "type": "Punctuator", - "value": "(", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 14, "line": 1, }, "start": Object { - "column": 18, + "column": 13, "line": 1, }, }, "range": Array [ - 18, - 20, + 13, + 14, ], - "type": "String", - "value": "\\"\\"", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 15, "line": 1, }, "start": Object { - "column": 20, + "column": 14, "line": 1, }, }, "range": Array [ - 20, - 21, + 14, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 21, + "column": 15, "line": 1, }, }, "range": Array [ - 21, - 22, + 15, + 16, ], "type": "Punctuator", - "value": ".", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 22, + "column": 17, "line": 1, }, }, "range": Array [ - 22, - 23, + 17, + 18, ], "type": "Identifier", - "value": "B", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 1, }, "start": Object { - "column": 23, + "column": 18, "line": 1, }, }, "range": Array [ - 23, - 24, + 18, + 19, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - "value": "any", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 20, "line": 1, }, "start": Object { - "column": 27, + "column": 19, "line": 1, }, }, "range": Array [ - 27, - 28, + 19, + 20, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 22, "line": 1, }, "start": Object { - "column": 28, + "column": 21, "line": 1, }, }, "range": Array [ - 28, - 29, + 21, + 22, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 24, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 30, + 23, + 24, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-extends.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 30, - ], - "type": "TSInterfaceBody", - }, - "heritage": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 25, - ], - "type": "TSInterfaceHeritage", - }, - ], - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 30, - ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 31, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "Keyword", - "value": "interface", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 14, - 21, + 29, + 35, ], "type": "Keyword", - "value": "extends", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 22, - 25, + 36, + 37, ], "type": "Identifier", - "value": "Bar", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 26, - 27, + 37, + 38, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { @@ -30089,8 +30950,8 @@ Object { }, }, "range": Array [ - 29, - 30, + 39, + 40, ], "type": "Punctuator", "value": "}", @@ -30100,139 +30961,108 @@ Object { } `; -exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` +exports[`typescript fixtures/basics/function-with-type-parameters-that-have-comments.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 35, + "line": 1, }, "start": Object { - "column": 30, + "column": 33, "line": 1, }, }, "range": Array [ - 30, - 34, + 33, + 35, ], - "type": "TSInterfaceBody", + "type": "BlockStatement", }, - "heritage": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 25, - ], - "type": "TSInterfaceHeritage", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "Baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "TSInterfaceHeritage", - }, - ], + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, - "name": "Foo", + "name": "compare", "range": Array [ - 10, - 13, + 9, + 16, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 35, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 34, + 35, ], - "type": "TSInterfaceDeclaration", + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 16, + 30, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { - "column": 0, - "line": 4, + "column": 35, + "line": 1, }, "start": Object { "column": 0, @@ -30248,7 +31078,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { @@ -30258,128 +31088,128 @@ Object { }, "range": Array [ 0, - 9, + 8, ], "type": "Keyword", - "value": "interface", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ - 10, - 13, + 9, + 16, ], "type": "Identifier", - "value": "Foo", + "value": "compare", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 17, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, - 21, + 16, + 17, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 29, "line": 1, }, "start": Object { - "column": 22, + "column": 28, "line": 1, }, }, "range": Array [ - 22, - 25, + 28, + 29, ], "type": "Identifier", - "value": "Bar", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 30, "line": 1, }, "start": Object { - "column": 25, + "column": 29, "line": 1, }, }, "range": Array [ - 25, - 26, + 29, + 30, ], "type": "Punctuator", - "value": ",", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 31, "line": 1, }, "start": Object { - "column": 26, + "column": 30, "line": 1, }, }, "range": Array [ - 26, - 29, + 30, + 31, ], - "type": "Identifier", - "value": "Baz", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 32, "line": 1, }, "start": Object { - "column": 30, + "column": 31, "line": 1, }, }, "range": Array [ - 30, 31, + 32, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 34, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 33, + "line": 1, }, }, "range": Array [ @@ -30387,6 +31217,24 @@ Object { 34, ], "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", "value": "}", }, ], @@ -30394,44 +31242,82 @@ Object { } `; -exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` +exports[`typescript fixtures/basics/function-with-type-parameters-with-constraint.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 40, + 49, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 17, + "column": 34, "line": 1, }, }, "range": Array [ - 17, - 21, + 34, + 51, ], - "type": "TSInterfaceBody", + "type": "BlockStatement", }, - "heritage": Array [], + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, - "name": "Foo", + "name": "a", "range": Array [ + 9, 10, - 13, ], "type": "Identifier", }, @@ -30445,45 +31331,187 @@ Object { "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 25, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + }, + }, + }, + ], "range": Array [ 0, - 21, + 51, ], - "type": "TSInterfaceDeclaration", + "returnType": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + }, + }, + "type": "FunctionDeclaration", "typeParameters": Object { "loc": Object { "end": Object { - "column": 16, + "column": 24, "line": 1, }, "start": Object { - "column": 13, + "column": 10, "line": 1, }, }, "params": Array [ Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 21, + 23, + ], + "type": "TSTypeLiteral", + }, "loc": Object { "end": Object { - "column": 15, + "column": 23, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, - "name": "T", + "name": "X", "range": Array [ - 14, - 15, + 11, + 23, ], "type": "TSTypeParameter", }, ], "range": Array [ - 13, - 16, + 10, + 24, ], "type": "TSTypeParameterDeclaration", }, @@ -30501,14 +31529,14 @@ Object { }, "range": Array [ 0, - 22, + 52, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { @@ -30518,15 +31546,33 @@ Object { }, "range": Array [ 0, - 9, + 8, ], "type": "Keyword", - "value": "interface", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, "line": 1, }, "start": Object { @@ -30536,15 +31582,33 @@ Object { }, "range": Array [ 10, - 13, + 11, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, ], "type": "Identifier", - "value": "Foo", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 20, "line": 1, }, "start": Object { @@ -30554,43 +31618,61 @@ Object { }, "range": Array [ 13, - 14, + 20, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 23, "line": 1, }, "start": Object { - "column": 14, + "column": 22, "line": 1, }, }, "range": Array [ - 14, - 15, + 22, + 23, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 24, "line": 1, }, "start": Object { - "column": 15, + "column": 23, "line": 1, }, }, "range": Array [ - 15, - 16, + 23, + 24, ], "type": "Punctuator", "value": ">", @@ -30598,21 +31680,201 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 25, "line": 1, }, "start": Object { - "column": 17, + "column": 24, "line": 1, }, }, "range": Array [ - 17, - 18, + 24, + 25, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", "value": "{", }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ";", + }, Object { "loc": Object { "end": Object { @@ -30625,8 +31887,8 @@ Object { }, }, "range": Array [ - 20, - 21, + 50, + 51, ], "type": "Punctuator", "value": "}", @@ -30636,29 +31898,29 @@ Object { } `; -exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` +exports[`typescript fixtures/basics/function-with-types.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { "body": Array [ Object { - "computed": false, - "key": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 7, + "column": 15, "line": 2, }, "start": Object { - "column": 4, + "column": 11, "line": 2, }, }, - "name": "baa", + "name": "name", "range": Array [ - 20, - 23, + 50, + 54, ], "type": "Identifier", }, @@ -30673,1234 +31935,825 @@ Object { }, }, "range": Array [ - 20, - 32, + 43, + 55, ], - "type": "TSPropertySignature", + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 57, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "message", + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 23, - 31, + 22, + 28, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 25, - 31, - ], - "type": "TSNumberKeyword", - }, + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 57, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, }, }, + "range": Array [ + 30, + 36, + ], + "type": "TSStringKeyword", + }, + }, + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + "value": "message", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 50, + 54, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-with-types-assignation.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ Object { - "computed": false, - "key": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 13, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 9, + "line": 2, }, }, - "name": "bar", + "name": "name", "range": Array [ - 37, - 40, + 89, + 93, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 14, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 2, + "line": 2, }, }, - "optional": true, "range": Array [ - 37, - 50, + 82, + 94, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 41, - 49, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 43, - 49, - ], - "type": "TSNumberKeyword", - }, - }, + "type": "ReturnStatement", }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "name": "bax", - "range": Array [ - 56, - 59, - ], - "type": "Identifier", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 96, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "message", + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 21, + "line": 1, }, }, "range": Array [ - 55, - 69, + 21, + 28, ], - "type": "TSPropertySignature", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 28, + "line": 1, }, "start": Object { - "column": 9, - "line": 4, + "column": 22, + "line": 1, }, }, "range": Array [ - 60, - 68, + 22, + 28, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, - }, - "start": Object { - "column": 11, - "line": 4, - }, - }, - "range": Array [ - 62, - 68, - ], - "type": "TSStringKeyword", - }, + "type": "TSStringKeyword", }, }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 5, - "line": 5, - }, - }, - "name": "baz", - "range": Array [ - 75, - 78, - ], - "type": "Identifier", - }, + }, + Object { + "left": Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 40, + "line": 1, }, "start": Object { - "column": 4, - "line": 5, + "column": 30, + "line": 1, }, }, - "optional": true, + "name": "age", "range": Array [ - 74, - 89, + 30, + 40, ], - "type": "TSPropertySignature", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 40, + "line": 1, }, "start": Object { - "column": 10, - "line": 5, + "column": 33, + "line": 1, }, }, "range": Array [ - 80, - 88, + 33, + 40, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 40, + "line": 1, }, "start": Object { - "column": 12, - "line": 5, + "column": 34, + "line": 1, }, }, "range": Array [ - 82, - 88, + 34, + 40, ], - "type": "TSStringKeyword", + "type": "TSNumberKeyword", }, }, }, - Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 5, - "line": 6, - }, + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 46, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, }, - "name": "eee", - "range": Array [ - 95, - 106, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 98, - 106, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 10, - "line": 6, - }, - }, - "range": Array [ - 100, - 106, - ], - "type": "TSNumberKeyword", - }, + "start": Object { + "column": 43, + "line": 1, }, }, + "range": Array [ + 43, + 46, + ], + "raw": "100", + "type": "Literal", + "value": 100, + }, + "type": "AssignmentPattern", + }, + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 26, - "line": 6, + "column": 69, + "line": 1, }, "start": Object { - "column": 4, - "line": 6, + "column": 51, + "line": 1, }, }, + "name": "args", "range": Array [ - 94, - 116, + 51, + 69, ], - "static": false, - "type": "TSIndexSignature", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, - "line": 6, + "column": 69, + "line": 1, }, "start": Object { - "column": 17, - "line": 6, + "column": 55, + "line": 1, }, }, "range": Array [ - 107, - 115, + 55, + 69, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, - "line": 6, - }, - "start": Object { - "column": 19, - "line": 6, - }, - }, - "range": Array [ - 109, - 115, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 7, - }, - "start": Object { - "column": 5, - "line": 7, - }, - }, - "name": "fff", - "optional": true, - "range": Array [ - 122, - 134, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 7, + "column": 69, + "line": 1, }, "start": Object { - "column": 9, - "line": 7, + "column": 56, + "line": 1, }, }, "range": Array [ - 126, - 134, + 56, + 69, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 61, + "line": 1, }, "start": Object { - "column": 11, - "line": 7, + "column": 56, + "line": 1, }, }, + "name": "Array", "range": Array [ - 128, - 134, + 56, + 61, ], - "type": "TSNumberKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 121, - 144, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 7, - }, - "start": Object { - "column": 18, - "line": 7, + "type": "Identifier", }, - }, - "range": Array [ - 135, - 143, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 7, - }, - "start": Object { - "column": 20, - "line": 7, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 68, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 61, + 69, + ], + "type": "TSTypeParameterInstantiation", }, - "range": Array [ - 137, - 143, - ], - "type": "TSStringKeyword", }, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": "doo", - "range": Array [ - 149, - 152, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 69, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 16, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "optional": false, - "params": Array [], - "range": Array [ - 149, - 161, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 9, - "line": 8, - }, - }, - "range": Array [ - 154, - 160, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 11, - "line": 8, - }, - }, - "range": Array [ - 156, - 160, - ], - "type": "TSVoidKeyword", - }, + "start": Object { + "column": 48, + "line": 1, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 9, - }, - }, - "name": "doo", - "range": Array [ - 166, - 169, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 9, - }, - }, - "optional": true, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 9, - }, - "start": Object { - "column": 9, - "line": 9, - }, - }, - "name": "a", - "range": Array [ - 171, - 172, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 9, - }, - "start": Object { - "column": 12, - "line": 9, - }, - }, - "name": "b", - "range": Array [ - 174, - 175, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 9, - }, - "start": Object { - "column": 15, - "line": 9, - }, - }, - "name": "c", - "range": Array [ - 177, - 178, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 166, - 186, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 9, - }, - "start": Object { - "column": 17, - "line": 9, - }, - }, - "range": Array [ - 179, - 185, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 9, - }, - "start": Object { - "column": 19, - "line": 9, - }, - }, - "range": Array [ - 181, - 185, - ], - "type": "TSVoidKeyword", - }, - }, + "range": Array [ + 48, + 69, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 0, + 96, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 10, - }, - "start": Object { - "column": 5, - "line": 10, - }, - }, - "name": "loo", - "range": Array [ - 192, - 195, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 10, - }, - }, - "optional": true, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 10, - }, - "start": Object { - "column": 11, - "line": 10, - }, - }, - "name": "a", - "range": Array [ - 198, - 199, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 10, - }, - "start": Object { - "column": 14, - "line": 10, - }, - }, - "name": "b", - "range": Array [ - 201, - 202, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 10, - }, - "start": Object { - "column": 17, - "line": 10, - }, - }, - "name": "c", - "range": Array [ - 204, - 205, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 191, - 213, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 10, - }, - "start": Object { - "column": 19, - "line": 10, - }, - }, - "range": Array [ - 206, - 212, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 10, - }, - "start": Object { - "column": 21, - "line": 10, - }, - }, - "range": Array [ - 208, - 212, - ], - "type": "TSVoidKeyword", - }, - }, + "start": Object { + "column": 70, + "line": 1, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "name": "boo", - "range": Array [ - 218, - 221, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "optional": false, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 11, - }, - "start": Object { - "column": 11, - "line": 11, - }, - }, - "name": "a", - "range": Array [ - 225, - 226, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 11, - }, - "start": Object { - "column": 14, - "line": 11, - }, - }, - "name": "b", - "range": Array [ - 228, - 229, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 11, - }, - "start": Object { - "column": 17, - "line": 11, - }, - }, - "name": "c", - "range": Array [ - 231, - 232, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 218, - 240, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 11, - }, - "start": Object { - "column": 19, - "line": 11, - }, - }, - "range": Array [ - 233, - 239, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 11, - }, - "start": Object { - "column": 21, - "line": 11, - }, - }, - "range": Array [ - 235, - 239, - ], - "type": "TSVoidKeyword", - }, + }, + "range": Array [ + 70, + 77, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 11, - }, - "start": Object { - "column": 7, - "line": 11, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 11, - }, - "start": Object { - "column": 8, - "line": 11, - }, - }, - "name": "J", - "range": Array [ - 222, - 223, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 221, - 224, - ], - "type": "TSTypeParameterDeclaration", + "start": Object { + "column": 71, + "line": 1, }, }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 12, - }, - "start": Object { - "column": 4, - "line": 12, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 12, - }, - "start": Object { - "column": 9, - "line": 12, - }, - }, - "name": "a", - "range": Array [ - 250, - 251, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 12, - }, - "start": Object { - "column": 12, - "line": 12, - }, - }, - "name": "b", - "optional": true, - "range": Array [ - 253, - 254, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 245, - 265, - ], - "type": "TSConstructSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 12, - }, - "start": Object { - "column": 15, - "line": 12, - }, - }, - "range": Array [ - 256, - 264, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 12, - }, - "start": Object { - "column": 17, - "line": 12, - }, - }, - "range": Array [ - 258, - 264, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 13, - }, - "start": Object { - "column": 4, - "line": 13, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 13, - }, - "start": Object { - "column": 12, - "line": 13, - }, - }, - "name": "a", - "range": Array [ - 278, - 279, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 13, - }, - "start": Object { - "column": 15, - "line": 13, - }, - }, - "name": "b", - "optional": true, - "range": Array [ - 281, - 282, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 270, - 293, - ], - "type": "TSConstructSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 13, - }, - "start": Object { - "column": 18, - "line": 13, - }, - }, - "range": Array [ - 284, - 292, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 13, - }, - "start": Object { - "column": 20, - "line": 13, - }, - }, - "range": Array [ - 286, - 292, - ], - "type": "TSStringKeyword", - }, - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 13, - }, - "start": Object { - "column": 8, - "line": 13, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 13, - }, - "start": Object { - "column": 9, - "line": 13, - }, - }, - "name": "F", - "range": Array [ - 275, - 276, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 274, - 277, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 14, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 295, - ], - "type": "TSInterfaceBody", - }, - "heritage": Array [], - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 14, - }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 71, + 77, + ], + "type": "TSStringKeyword", }, }, - "range": Array [ - 0, - 295, - ], - "type": "TSInterfaceDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 16, + "line": 4, }, "start": Object { "column": 0, @@ -31909,14 +32762,14 @@ Object { }, "range": Array [ 0, - 297, + 97, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { @@ -31926,79 +32779,79 @@ Object { }, "range": Array [ 0, - 9, + 8, ], "type": "Keyword", - "value": "interface", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ - 10, - 13, + 9, + 16, ], "type": "Identifier", - "value": "Foo", + "value": "message", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, - 15, + 16, + 17, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 20, - 23, + 17, + 21, ], "type": "Identifier", - "value": "baa", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 23, - 24, + 21, + 22, ], "type": "Punctuator", "value": ":", @@ -32006,84 +32859,102 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 25, - 31, + 22, + 28, ], "type": "Identifier", - "value": "number", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 31, - 32, + 28, + 29, ], "type": "Punctuator", - "value": ";", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 30, + "line": 1, }, }, "range": Array [ - 37, - 40, + 30, + 33, ], "type": "Identifier", - "value": "bar", + "value": "age", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 34, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 33, + "line": 1, }, }, "range": Array [ - 40, - 41, + 33, + 34, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 40, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, }, }, "range": Array [ @@ -32091,125 +32962,143 @@ Object { 42, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 46, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 43, + "line": 1, }, }, "range": Array [ 43, - 49, + 46, ], - "type": "Identifier", - "value": "number", + "type": "Numeric", + "value": "100", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 47, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 46, + "line": 1, }, }, "range": Array [ - 49, - 50, + 46, + 47, ], "type": "Punctuator", - "value": ";", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 51, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 48, + "line": 1, }, }, "range": Array [ - 55, - 56, + 48, + 51, ], "type": "Punctuator", - "value": "[", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 4, + "column": 55, + "line": 1, }, "start": Object { - "column": 5, - "line": 4, + "column": 51, + "line": 1, }, }, "range": Array [ - 56, - 59, + 51, + 55, ], "type": "Identifier", - "value": "bax", + "value": "args", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 56, + "line": 1, }, "start": Object { - "column": 8, - "line": 4, + "column": 55, + "line": 1, }, }, "range": Array [ - 59, - 60, + 55, + 56, ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 61, + "line": 1, }, "start": Object { - "column": 9, - "line": 4, + "column": 56, + "line": 1, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, }, }, "range": Array [ - 60, 61, + 62, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 68, + "line": 1, }, "start": Object { - "column": 11, - "line": 4, + "column": 62, + "line": 1, }, }, "range": Array [ @@ -32222,12 +33111,12 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 69, + "line": 1, }, "start": Object { - "column": 17, - "line": 4, + "column": 68, + "line": 1, }, }, "range": Array [ @@ -32235,130 +33124,130 @@ Object { 69, ], "type": "Punctuator", - "value": ";", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 70, + "line": 1, }, "start": Object { - "column": 4, - "line": 5, + "column": 69, + "line": 1, }, }, "range": Array [ - 74, - 75, + 69, + 70, ], "type": "Punctuator", - "value": "[", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 71, + "line": 1, }, "start": Object { - "column": 5, - "line": 5, + "column": 70, + "line": 1, }, }, "range": Array [ - 75, - 78, + 70, + 71, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 77, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 71, + "line": 1, }, }, "range": Array [ - 78, - 79, + 71, + 77, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 79, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 78, + "line": 1, }, }, "range": Array [ + 78, 79, - 80, ], "type": "Punctuator", - "value": "?", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 5, + "column": 8, + "line": 2, }, "start": Object { - "column": 10, - "line": 5, + "column": 2, + "line": 2, }, }, "range": Array [ - 80, - 81, + 82, + 88, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 13, + "line": 2, }, "start": Object { - "column": 12, - "line": 5, + "column": 9, + "line": 2, }, }, "range": Array [ - 82, - 88, + 89, + 93, ], "type": "Identifier", - "value": "string", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 14, + "line": 2, }, "start": Object { - "column": 18, - "line": 5, + "column": 13, + "line": 2, }, }, "range": Array [ - 88, - 89, + 93, + 94, ], "type": "Punctuator", "value": ";", @@ -32366,1007 +33255,1663 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 6, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 6, + "column": 0, + "line": 3, }, }, "range": Array [ - 94, 95, + 96, ], "type": "Punctuator", - "value": "[", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/import-type.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 28, + "line": 1, }, "start": Object { - "column": 5, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 95, - 98, + 0, + 28, ], - "type": "Identifier", - "value": "eee", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "isTypeOf": true, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "parameter": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "raw": "'A'", + "type": "Literal", + "value": "A", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "TSLiteralType", + }, + "qualifier": null, + "range": Array [ + 9, + 27, + ], + "type": "TSImportType", + "typeParameters": null, + }, }, Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "B", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 9, - "line": 6, + "column": 26, + "line": 2, }, "start": Object { - "column": 8, - "line": 6, + "column": 0, + "line": 2, }, }, "range": Array [ - 98, - 99, + 29, + 55, ], - "type": "Punctuator", - "value": ":", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "isTypeOf": false, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "parameter": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "raw": "\\"B\\"", + "type": "Literal", + "value": "B", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 45, + 48, + ], + "type": "TSLiteralType", + }, + "qualifier": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "X", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "range": Array [ + 38, + 54, + ], + "type": "TSImportType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "Y", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 51, + 54, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 56, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 16, - "line": 6, + "column": 4, + "line": 1, }, "start": Object { - "column": 10, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 100, - 106, + 0, + 4, ], "type": "Identifier", - "value": "number", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 6, + "line": 1, }, "start": Object { - "column": 16, - "line": 6, + "column": 5, + "line": 1, }, }, "range": Array [ - 106, - 107, + 5, + 6, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 6, + "column": 8, + "line": 1, }, "start": Object { - "column": 17, - "line": 6, + "column": 7, + "line": 1, }, }, "range": Array [ - 107, - 108, + 7, + 8, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 6, + "column": 15, + "line": 1, }, "start": Object { - "column": 19, - "line": 6, + "column": 9, + "line": 1, }, }, "range": Array [ - 109, - 115, + 9, + 15, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "typeof", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 6, + "column": 22, + "line": 1, }, "start": Object { - "column": 25, - "line": 6, + "column": 16, + "line": 1, }, }, "range": Array [ - 115, - 116, + 16, + 22, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 7, + "column": 23, + "line": 1, }, "start": Object { - "column": 4, - "line": 7, + "column": 22, + "line": 1, }, }, "range": Array [ - 121, - 122, + 22, + 23, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 26, + "line": 1, }, "start": Object { - "column": 5, - "line": 7, + "column": 23, + "line": 1, }, }, "range": Array [ - 122, - 125, + 23, + 26, ], - "type": "Identifier", - "value": "fff", + "type": "String", + "value": "'A'", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 7, + "column": 27, + "line": 1, }, "start": Object { - "column": 8, - "line": 7, + "column": 26, + "line": 1, }, }, "range": Array [ - 125, - 126, + 26, + 27, ], "type": "Punctuator", - "value": "?", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 28, + "line": 1, }, "start": Object { - "column": 9, - "line": 7, + "column": 27, + "line": 1, }, }, "range": Array [ - 126, - 127, + 27, + 28, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 4, + "line": 2, }, "start": Object { - "column": 11, - "line": 7, + "column": 0, + "line": 2, }, }, "range": Array [ - 128, - 134, + 29, + 33, ], "type": "Identifier", - "value": "number", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 7, + "column": 6, + "line": 2, }, "start": Object { - "column": 17, - "line": 7, + "column": 5, + "line": 2, }, }, "range": Array [ - 134, - 135, + 34, + 35, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 8, + "line": 2, }, "start": Object { - "column": 18, - "line": 7, + "column": 7, + "line": 2, }, }, "range": Array [ - 135, - 136, + 36, + 37, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 7, + "column": 15, + "line": 2, }, "start": Object { - "column": 20, - "line": 7, + "column": 9, + "line": 2, }, }, "range": Array [ - 137, - 143, + 38, + 44, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 7, + "column": 16, + "line": 2, }, "start": Object { - "column": 26, - "line": 7, + "column": 15, + "line": 2, }, }, "range": Array [ - 143, - 144, + 44, + 45, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 19, + "line": 2, }, "start": Object { - "column": 4, - "line": 8, + "column": 16, + "line": 2, }, }, "range": Array [ - 149, - 152, + 45, + 48, ], - "type": "Identifier", - "value": "doo", + "type": "String", + "value": "\\"B\\"", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 8, + "column": 20, + "line": 2, }, "start": Object { - "column": 7, - "line": 8, + "column": 19, + "line": 2, }, }, "range": Array [ - 152, - 153, + 48, + 49, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 21, + "line": 2, }, "start": Object { - "column": 8, - "line": 8, + "column": 20, + "line": 2, }, }, "range": Array [ - 153, - 154, + 49, + 50, ], "type": "Punctuator", - "value": ")", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 8, + "column": 22, + "line": 2, }, "start": Object { - "column": 9, - "line": 8, + "column": 21, + "line": 2, }, }, "range": Array [ - 154, - 155, + 50, + 51, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 8, + "column": 23, + "line": 2, }, "start": Object { - "column": 11, - "line": 8, + "column": 22, + "line": 2, }, }, "range": Array [ - 156, - 160, + 51, + 52, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 8, + "column": 24, + "line": 2, }, "start": Object { - "column": 15, - "line": 8, + "column": 23, + "line": 2, }, }, "range": Array [ - 160, - 161, + 52, + 53, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "Y", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 9, + "column": 25, + "line": 2, }, "start": Object { - "column": 4, - "line": 9, + "column": 24, + "line": 2, }, }, "range": Array [ - 166, - 169, + 53, + 54, ], - "type": "Identifier", - "value": "doo", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 9, + "column": 26, + "line": 2, }, "start": Object { - "column": 7, - "line": 9, + "column": 25, + "line": 2, }, }, "range": Array [ - 169, - 170, + 54, + 55, ], "type": "Punctuator", - "value": "?", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/import-type-with-type-parameters-in-type-reference.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 9, - "line": 9, + "column": 30, + "line": 1, }, "start": Object { - "column": 8, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 170, - 171, + 0, + 30, ], - "type": "Punctuator", - "value": "(", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "isTypeOf": false, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "parameter": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "TSLiteralType", + }, + "qualifier": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "range": Array [ + 11, + 28, + ], + "type": "TSImportType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 23, + 28, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 10, + 29, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 10, - "line": 9, + "column": 4, + "line": 1, }, "start": Object { - "column": 9, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 171, - 172, + 0, + 4, ], "type": "Identifier", - "value": "a", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 9, + "column": 6, + "line": 1, }, "start": Object { - "column": 10, - "line": 9, + "column": 5, + "line": 1, }, }, "range": Array [ - 172, - 173, + 5, + 6, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 9, + "column": 8, + "line": 1, }, "start": Object { - "column": 12, - "line": 9, + "column": 7, + "line": 1, }, }, "range": Array [ - 174, - 175, + 7, + 8, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 9, + "column": 10, + "line": 1, }, "start": Object { - "column": 13, - "line": 9, + "column": 9, + "line": 1, }, }, "range": Array [ - 175, - 176, + 9, + 10, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 9, + "column": 11, + "line": 1, }, "start": Object { - "column": 15, - "line": 9, + "column": 10, + "line": 1, }, }, "range": Array [ - 177, - 178, + 10, + 11, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 9, + "line": 1, }, "start": Object { - "column": 16, - "line": 9, + "column": 11, + "line": 1, }, }, "range": Array [ - 178, - 179, + 11, + 17, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "import", }, Object { "loc": Object { "end": Object { "column": 18, - "line": 9, + "line": 1, }, "start": Object { "column": 17, - "line": 9, + "line": 1, }, }, "range": Array [ - 179, - 180, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 9, + "column": 20, + "line": 1, }, "start": Object { - "column": 19, - "line": 9, + "column": 18, + "line": 1, }, }, "range": Array [ - 181, - 185, + 18, + 20, ], - "type": "Keyword", - "value": "void", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 9, + "column": 21, + "line": 1, }, "start": Object { - "column": 23, - "line": 9, + "column": 20, + "line": 1, }, }, "range": Array [ - 185, - 186, + 20, + 21, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 10, + "column": 22, + "line": 1, }, "start": Object { - "column": 4, - "line": 10, + "column": 21, + "line": 1, }, }, "range": Array [ - 191, - 192, + 21, + 22, ], "type": "Punctuator", - "value": "[", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 10, + "column": 23, + "line": 1, }, "start": Object { - "column": 5, - "line": 10, + "column": 22, + "line": 1, }, }, "range": Array [ - 192, - 195, + 22, + 23, ], "type": "Identifier", - "value": "loo", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 10, + "column": 24, + "line": 1, }, "start": Object { - "column": 8, - "line": 10, + "column": 23, + "line": 1, }, }, "range": Array [ - 195, - 196, + 23, + 24, ], "type": "Punctuator", - "value": "]", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 10, + "column": 27, + "line": 1, }, "start": Object { - "column": 9, - "line": 10, + "column": 24, + "line": 1, }, }, "range": Array [ - 196, - 197, + 24, + 27, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 10, + "column": 28, + "line": 1, }, "start": Object { - "column": 10, - "line": 10, + "column": 27, + "line": 1, }, }, "range": Array [ - 197, - 198, + 27, + 28, ], "type": "Punctuator", - "value": "(", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 10, + "column": 29, + "line": 1, }, "start": Object { - "column": 11, - "line": 10, + "column": 28, + "line": 1, }, }, "range": Array [ - 198, - 199, + 28, + 29, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 10, + "column": 30, + "line": 1, }, "start": Object { - "column": 12, - "line": 10, + "column": 29, + "line": 1, }, }, "range": Array [ - 199, - 200, + 29, + 30, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-extends.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "TSInterfaceHeritage", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 15, - "line": 10, + "column": 1, + "line": 3, }, "start": Object { - "column": 14, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 201, - 202, + 0, + 30, ], - "type": "Identifier", - "value": "b", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 16, - "line": 10, + "column": 9, + "line": 1, }, "start": Object { - "column": 15, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 202, - 203, + 0, + 9, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 10, + "column": 13, + "line": 1, }, "start": Object { - "column": 17, - "line": 10, + "column": 10, + "line": 1, }, }, "range": Array [ - 204, - 205, + 10, + 13, ], "type": "Identifier", - "value": "c", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 10, + "column": 21, + "line": 1, }, "start": Object { - "column": 18, - "line": 10, + "column": 14, + "line": 1, }, }, "range": Array [ - 205, - 206, + 14, + 21, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 10, + "column": 25, + "line": 1, }, "start": Object { - "column": 19, - "line": 10, + "column": 22, + "line": 1, }, }, "range": Array [ - 206, - 207, + 22, + 25, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 10, + "column": 27, + "line": 1, }, "start": Object { - "column": 21, - "line": 10, + "column": 26, + "line": 1, }, }, "range": Array [ - 208, - 212, + 26, + 27, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 10, + "column": 1, + "line": 3, }, "start": Object { - "column": 25, - "line": 10, + "column": 0, + "line": 3, }, }, "range": Array [ - 212, - 213, + 29, + 30, ], "type": "Punctuator", - "value": ";", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-extends-multiple.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 34, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "TSInterfaceHeritage", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "Baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "TSInterfaceHeritage", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 7, - "line": 11, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 11, + "column": 0, + "line": 1, }, }, "range": Array [ - 218, - 221, + 0, + 34, ], - "type": "Identifier", - "value": "boo", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 11, + "column": 9, + "line": 1, }, "start": Object { - "column": 7, - "line": 11, + "column": 0, + "line": 1, }, }, "range": Array [ - 221, - 222, + 0, + 9, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 11, + "column": 13, + "line": 1, }, "start": Object { - "column": 8, - "line": 11, + "column": 10, + "line": 1, }, }, "range": Array [ - 222, - 223, + 10, + 13, ], "type": "Identifier", - "value": "J", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 11, - }, - "start": Object { - "column": 9, - "line": 11, - }, - }, - "range": Array [ - 223, - 224, - ], - "type": "Punctuator", - "value": ">", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 11, + "column": 21, + "line": 1, }, "start": Object { - "column": 10, - "line": 11, + "column": 14, + "line": 1, }, }, "range": Array [ - 224, - 225, + 14, + 21, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 11, + "column": 25, + "line": 1, }, "start": Object { - "column": 11, - "line": 11, + "column": 22, + "line": 1, }, }, "range": Array [ - 225, - 226, + 22, + 25, ], "type": "Identifier", - "value": "a", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 11, + "column": 26, + "line": 1, }, "start": Object { - "column": 12, - "line": 11, + "column": 25, + "line": 1, }, }, "range": Array [ - 226, - 227, + 25, + 26, ], "type": "Punctuator", "value": ",", @@ -33374,576 +34919,333 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 11, + "column": 29, + "line": 1, }, "start": Object { - "column": 14, - "line": 11, + "column": 26, + "line": 1, }, }, "range": Array [ - 228, - 229, + 26, + 29, ], "type": "Identifier", - "value": "b", + "value": "Baz", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 11, + "column": 31, + "line": 1, }, "start": Object { - "column": 15, - "line": 11, + "column": 30, + "line": 1, }, }, "range": Array [ - 229, - 230, + 30, + 31, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 11, - }, - "start": Object { - "column": 17, - "line": 11, - }, - }, - "range": Array [ - 231, - 232, - ], - "type": "Identifier", - "value": "c", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 11, + "column": 1, + "line": 3, }, "start": Object { - "column": 18, - "line": 11, + "column": 0, + "line": 3, }, }, "range": Array [ - 232, - 233, + 33, + 34, ], "type": "Punctuator", - "value": ")", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-type-parameters.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 11, - }, - "start": Object { - "column": 19, - "line": 11, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 1, + }, }, + "range": Array [ + 17, + 21, + ], + "type": "TSInterfaceBody", }, - "range": Array [ - 233, - 234, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 11, - }, - "start": Object { - "column": 21, - "line": 11, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 235, - 239, - ], - "type": "Keyword", - "value": "void", - }, - Object { "loc": Object { "end": Object { - "column": 26, - "line": 11, + "column": 1, + "line": 3, }, "start": Object { - "column": 25, - "line": 11, + "column": 0, + "line": 1, }, }, "range": Array [ - 239, - 240, + 0, + 21, ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 12, - }, - "start": Object { - "column": 4, - "line": 12, + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 245, - 248, - ], - "type": "Keyword", - "value": "new", }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 12, - }, - "start": Object { - "column": 8, - "line": 12, - }, - }, - "range": Array [ - 249, - 250, - ], - "type": "Punctuator", - "value": "(", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 12, - }, - "start": Object { - "column": 9, - "line": 12, - }, - }, - "range": Array [ - 250, - 251, - ], - "type": "Identifier", - "value": "a", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 11, - "line": 12, + "column": 9, + "line": 1, }, "start": Object { - "column": 10, - "line": 12, + "column": 0, + "line": 1, }, }, "range": Array [ - 251, - 252, + 0, + 9, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 12, + "line": 1, }, "start": Object { - "column": 12, - "line": 12, + "column": 10, + "line": 1, }, }, "range": Array [ - 253, - 254, + 10, + 13, ], "type": "Identifier", - "value": "b", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 12, + "line": 1, }, "start": Object { "column": 13, - "line": 12, + "line": 1, }, }, "range": Array [ - 254, - 255, + 13, + 14, ], "type": "Punctuator", - "value": "?", + "value": "<", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 12, + "line": 1, }, "start": Object { "column": 14, - "line": 12, + "line": 1, }, }, "range": Array [ - 255, - 256, + 14, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { "column": 16, - "line": 12, + "line": 1, }, "start": Object { "column": 15, - "line": 12, + "line": 1, }, }, "range": Array [ - 256, - 257, + 15, + 16, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 12, + "column": 18, + "line": 1, }, "start": Object { "column": 17, - "line": 12, - }, - }, - "range": Array [ - 258, - 264, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 12, - }, - "start": Object { - "column": 23, - "line": 12, - }, - }, - "range": Array [ - 264, - 265, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 13, - }, - "start": Object { - "column": 4, - "line": 13, - }, - }, - "range": Array [ - 270, - 273, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 13, - }, - "start": Object { - "column": 8, - "line": 13, - }, - }, - "range": Array [ - 274, - 275, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 13, - }, - "start": Object { - "column": 9, - "line": 13, - }, - }, - "range": Array [ - 275, - 276, - ], - "type": "Identifier", - "value": "F", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 13, - }, - "start": Object { - "column": 10, - "line": 13, + "line": 1, }, }, "range": Array [ - 276, - 277, + 17, + 18, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 13, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, - "line": 13, + "column": 0, + "line": 3, }, }, "range": Array [ - 277, - 278, + 20, + 21, ], "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 13, - }, - "start": Object { - "column": 12, - "line": 13, - }, - }, - "range": Array [ - 278, - 279, - ], - "type": "Identifier", - "value": "a", + "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 13, - }, - "start": Object { - "column": 13, - "line": 13, - }, - }, - "range": Array [ - 279, - 280, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 13, - }, - "start": Object { - "column": 15, - "line": 13, - }, - }, - "range": Array [ - 281, - 282, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 13, - }, - "start": Object { - "column": 16, - "line": 13, - }, - }, - "range": Array [ - 282, - 283, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 13, - }, - "start": Object { - "column": 17, - "line": 13, - }, - }, - "range": Array [ - 283, - 284, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 13, - }, - "start": Object { - "column": 18, - "line": 13, - }, - }, - "range": Array [ - 284, - 285, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 13, - }, - "start": Object { - "column": 20, - "line": 13, - }, - }, - "range": Array [ - 286, - 292, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 13, - }, - "start": Object { - "column": 26, - "line": 13, - }, - }, - "range": Array [ - 292, - 293, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 14, - }, - "start": Object { - "column": 0, - "line": 14, - }, - }, - "range": Array [ - 294, - 295, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` -Object { - "body": Array [ + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-all-property-types.src 1`] = ` +Object { + "body": Array [ Object { "body": Object { "body": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "baa", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 30, + "column": 16, "line": 2, }, "start": Object { @@ -33951,12 +35253,31 @@ Object { "line": 2, }, }, - "params": Array [ - Object { - "accessibility": "public", + "range": Array [ + 20, + 32, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 31, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 2, }, "start": Object { @@ -33964,1489 +35285,664 @@ Object { "line": 2, }, }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, + "range": Array [ + 25, + 31, + ], + "type": "TSNumberKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 37, + 50, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 41, + 49, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, }, - "name": "x", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", }, "range": Array [ - 26, - 34, + 43, + 49, ], - "type": "TSParameterProperty", + "type": "TSNumberKeyword", }, - Object { - "accessibility": "private", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "name": "bax", + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 55, + 69, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 60, + 68, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 17, + "line": 4, }, "start": Object { - "column": 19, - "line": 2, + "column": 11, + "line": 4, }, }, - "parameter": Object { + "range": Array [ + 62, + 68, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "name": "baz", + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "optional": true, + "range": Array [ + 74, + 89, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 80, + 88, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 82, + 88, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 5, + "line": 6, + }, + }, + "name": "eee", + "range": Array [ + 95, + 106, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 98, + 106, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 16, + "line": 6, }, "start": Object { - "column": 27, - "line": 2, + "column": 10, + "line": 6, }, }, - "name": "y", "range": Array [ - 44, - 45, + 100, + 106, ], - "type": "Identifier", + "type": "TSNumberKeyword", }, - "range": Array [ - 36, - 45, - ], - "type": "TSParameterProperty", }, - ], + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, "range": Array [ - 21, - 47, + 94, + 116, ], - "type": "TSConstructSignature", - "typeAnnotation": null, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 49, - ], - "type": "TSInterfaceBody", - }, - "heritage": Array [], - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 49, - ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 50, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "Keyword", - "value": "interface", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - "value": "Test", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 24, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "Keyword", - "value": "public", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 36, - 43, - ], - "type": "Keyword", - "value": "private", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 27, - "line": 2, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 45, - 46, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 2, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "range": Array [ - 46, - 47, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 48, - 49, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 36, - ], - "type": "TSInterfaceBody", - }, - "heritage": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, }, - "start": Object { - "column": 25, - "line": 1, + "range": Array [ + 107, + 115, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "range": Array [ + 109, + 115, + ], + "type": "TSStringKeyword", }, }, - "name": "Bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, }, - "range": Array [ - 25, - 28, - ], - "type": "TSInterfaceHeritage", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 5, + "line": 7, + }, }, - }, - "params": Array [ - Object { + "name": "fff", + "optional": true, + "range": Array [ + 122, + 134, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 17, + "line": 7, }, "start": Object { - "column": 29, - "line": 1, + "column": 9, + "line": 7, }, }, "range": Array [ - 29, - 30, + 126, + 134, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 17, + "line": 7, }, "start": Object { - "column": 29, - "line": 1, + "column": 11, + "line": 7, }, }, - "name": "J", "range": Array [ - 29, - 30, + 128, + 134, ], - "type": "Identifier", + "type": "TSNumberKeyword", }, }, - ], - "range": Array [ - 28, - 31, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 36, - ], - "type": "TSInterfaceDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [ - Object { + }, "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 27, + "line": 7, }, "start": Object { - "column": 14, - "line": 1, + "column": 4, + "line": 7, }, }, - "name": "T", "range": Array [ - 14, - 15, + 121, + 144, ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 13, - 16, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 37, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "Keyword", - "value": "interface", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - "value": "T", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 24, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - "value": "Bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - "value": "J", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 21, - ], - "type": "TSInterfaceBody", - }, - "heritage": Array [], - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 21, - ], - "type": "TSInterfaceDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "range": Array [ + 135, + 143, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 137, + 143, + ], + "type": "TSStringKeyword", + }, + }, }, - }, - "params": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "doo", + "range": Array [ + 149, + 152, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 16, - "line": 1, + "line": 8, }, "start": Object { - "column": 15, - "line": 1, + "column": 4, + "line": 8, }, }, - "name": "T", + "optional": false, + "params": Array [], "range": Array [ - 15, - 16, + 149, + 161, ], - "type": "TSTypeParameter", + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 154, + 160, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 156, + 160, + ], + "type": "TSVoidKeyword", + }, + }, }, - ], - "range": Array [ - 14, - 17, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "Keyword", - "value": "interface", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - "value": "Test", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - "value": "T", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ Object { "computed": false, "key": Object { "loc": Object { "end": Object { "column": 7, - "line": 6, + "line": 9, }, "start": Object { "column": 4, - "line": 6, + "line": 9, }, }, - "name": "foo", + "name": "doo", "range": Array [ - 76, - 79, + 166, + 169, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 24, + "line": 9, }, "start": Object { "column": 4, - "line": 6, + "line": 9, }, }, - "optional": false, + "optional": true, "params": Array [ Object { "loc": Object { "end": Object { - "column": 11, - "line": 6, + "column": 10, + "line": 9, }, "start": Object { - "column": 8, - "line": 6, + "column": 9, + "line": 9, }, }, - "name": "bar", + "name": "a", "range": Array [ - 80, - 83, + 171, + 172, ], "type": "Identifier", }, - ], - "range": Array [ - 76, - 85, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": null, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 87, - ], - "type": "TSInterfaceBody", - }, - "heritage": Array [], - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 87, - ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 88, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "Keyword", - "value": "interface", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - "value": "Test", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 76, - 79, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 6, - }, - "start": Object { - "column": 7, - "line": 6, - }, - }, - "range": Array [ - 79, - 80, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "range": Array [ - 80, - 83, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 11, - "line": 6, - }, - }, - "range": Array [ - 83, - 84, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 84, - 85, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 86, - 87, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, }, + "name": "b", + "range": Array [ + 174, + 175, + ], + "type": "Identifier", }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 21, - 26, - ], - "type": "TSPropertySignature", - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, }, + "name": "c", + "range": Array [ + 177, + 178, + ], + "type": "Identifier", }, - "name": "bar", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "optional": true, + ], "range": Array [ - 31, - 44, + 166, + 186, ], - "type": "TSPropertySignature", + "static": false, + "type": "TSMethodSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 23, + "line": 9, }, "start": Object { - "column": 8, - "line": 3, + "column": 17, + "line": 9, }, }, "range": Array [ - 35, - 43, + 179, + 185, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 23, + "line": 9, }, "start": Object { - "column": 10, - "line": 3, + "column": 19, + "line": 9, }, }, "range": Array [ - 37, - 43, + 181, + 185, ], - "type": "TSStringKeyword", + "type": "TSVoidKeyword", }, }, }, Object { - "computed": false, + "computed": true, "key": Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 8, + "line": 10, }, "start": Object { - "column": 4, - "line": 4, + "column": 5, + "line": 10, }, }, - "name": "baz", + "name": "loo", "range": Array [ - 49, - 52, + 192, + 195, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 26, + "line": 10, }, "start": Object { "column": 4, - "line": 4, + "line": 10, }, }, "optional": true, @@ -35455,115 +35951,494 @@ Object { "loc": Object { "end": Object { "column": 12, - "line": 4, + "line": 10, }, "start": Object { - "column": 9, - "line": 4, + "column": 11, + "line": 10, }, }, - "name": "foo", + "name": "a", "range": Array [ - 54, - 57, + 198, + 199, ], "type": "Identifier", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 15, + "line": 10, }, "start": Object { "column": 14, - "line": 4, + "line": 10, }, }, - "name": "bar", - "optional": true, + "name": "b", "range": Array [ - 59, - 71, + 201, + 202, ], "type": "Identifier", - "typeAnnotation": Object { + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "name": "c", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 191, + 213, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 10, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 21, + "line": 10, + }, + }, + "range": Array [ + 208, + 212, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "name": "boo", + "range": Array [ + 218, + 221, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 11, + }, + }, + "name": "a", + "range": Array [ + 225, + 226, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 11, + }, + "start": Object { + "column": 14, + "line": 11, + }, + }, + "name": "b", + "range": Array [ + 228, + 229, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 11, + }, + "start": Object { + "column": 17, + "line": 11, + }, + }, + "name": "c", + "range": Array [ + 231, + 232, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 218, + 240, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 19, + "line": 11, + }, + }, + "range": Array [ + 233, + 239, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 21, + "line": 11, + }, + }, + "range": Array [ + 235, + 239, + ], + "type": "TSVoidKeyword", + }, + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 11, + }, + "start": Object { + "column": 7, + "line": 11, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 9, + "line": 11, }, "start": Object { - "column": 18, - "line": 4, + "column": 8, + "line": 11, }, }, + "name": "J", "range": Array [ - 63, - 71, + 222, + 223, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 20, - "line": 4, - }, - }, - "range": Array [ - 65, - 71, - ], - "type": "TSStringKeyword", + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 221, + 224, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 12, }, }, + "name": "a", + "range": Array [ + 250, + 251, + ], + "type": "Identifier", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 13, + "line": 12, }, "start": Object { - "column": 28, - "line": 4, + "column": 12, + "line": 12, }, }, - "name": "baz", + "name": "b", "optional": true, "range": Array [ - 73, - 76, + 253, + 254, ], "type": "Identifier", }, ], "range": Array [ - 49, - 79, + 245, + 265, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": null, + "type": "TSConstructSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "range": Array [ + 256, + 264, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "range": Array [ + 258, + 264, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "name": "a", + "range": Array [ + 278, + 279, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "name": "b", + "optional": true, + "range": Array [ + 281, + 282, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 270, + 293, + ], + "type": "TSConstructSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 18, + "line": 13, + }, + }, + "range": Array [ + 284, + 292, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 20, + "line": 13, + }, + }, + "range": Array [ + 286, + 292, + ], + "type": "TSStringKeyword", + }, + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 9, + "line": 13, + }, + }, + "name": "F", + "range": Array [ + 275, + 276, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 274, + 277, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 14, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ - 15, - 81, + 14, + 295, ], "type": "TSInterfaceBody", }, @@ -35571,7 +36446,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { @@ -35579,17 +36454,17 @@ Object { "line": 1, }, }, - "name": "test", + "name": "Foo", "range": Array [ 10, - 14, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 14, }, "start": Object { "column": 0, @@ -35598,7 +36473,7 @@ Object { }, "range": Array [ 0, - 81, + 295, ], "type": "TSInterfaceDeclaration", }, @@ -35606,7 +36481,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 16, }, "start": Object { "column": 0, @@ -35615,7 +36490,7 @@ Object { }, "range": Array [ 0, - 82, + 297, ], "sourceType": "script", "tokens": Array [ @@ -35640,7 +36515,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { @@ -35650,25 +36525,25 @@ Object { }, "range": Array [ 10, - 14, + 13, ], "type": "Identifier", - "value": "test", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 16, ], "type": "Punctuator", "value": "{", @@ -35685,11 +36560,11 @@ Object { }, }, "range": Array [ - 21, - 24, + 20, + 23, ], "type": "Identifier", - "value": "foo", + "value": "baa", }, Object { "loc": Object { @@ -35703,26 +36578,44 @@ Object { }, }, "range": Array [ + 23, 24, - 25, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 15, "line": 2, }, "start": Object { - "column": 8, + "column": 9, "line": 2, }, }, "range": Array [ 25, - 26, + 31, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -35739,8 +36632,8 @@ Object { }, }, "range": Array [ - 31, - 34, + 37, + 40, ], "type": "Identifier", "value": "bar", @@ -35757,8 +36650,8 @@ Object { }, }, "range": Array [ - 34, - 35, + 40, + 41, ], "type": "Punctuator", "value": "?", @@ -35775,8 +36668,8 @@ Object { }, }, "range": Array [ - 35, - 36, + 41, + 42, ], "type": "Punctuator", "value": ":", @@ -35793,11 +36686,11 @@ Object { }, }, "range": Array [ - 37, 43, + 49, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { @@ -35811,8 +36704,8 @@ Object { }, }, "range": Array [ - 43, - 44, + 49, + 50, ], "type": "Punctuator", "value": ";", @@ -35820,7 +36713,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 4, }, "start": Object { @@ -35829,11 +36722,11 @@ Object { }, }, "range": Array [ - 49, - 52, + 55, + 56, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { @@ -35842,16 +36735,16 @@ Object { "line": 4, }, "start": Object { - "column": 7, + "column": 5, "line": 4, }, }, "range": Array [ - 52, - 53, + 56, + 59, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "bax", }, Object { "loc": Object { @@ -35865,16 +36758,16 @@ Object { }, }, "range": Array [ - 53, - 54, + 59, + 60, ], "type": "Punctuator", - "value": "(", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 4, }, "start": Object { @@ -35883,29 +36776,11 @@ Object { }, }, "range": Array [ - 54, - 57, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 57, - 58, + 60, + 61, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { @@ -35914,16 +36789,16 @@ Object { "line": 4, }, "start": Object { - "column": 14, + "column": 11, "line": 4, }, }, "range": Array [ - 59, 62, + 68, ], "type": "Identifier", - "value": "bar", + "value": "string", }, Object { "loc": Object { @@ -35937,134 +36812,134 @@ Object { }, }, "range": Array [ - 62, - 63, + 68, + 69, ], "type": "Punctuator", - "value": "?", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 5, + "line": 5, }, "start": Object { - "column": 18, - "line": 4, + "column": 4, + "line": 5, }, }, "range": Array [ - 63, - 64, + 74, + 75, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 8, + "line": 5, }, "start": Object { - "column": 20, - "line": 4, + "column": 5, + "line": 5, }, }, "range": Array [ - 65, - 71, + 75, + 78, ], "type": "Identifier", - "value": "string", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 9, + "line": 5, }, "start": Object { - "column": 26, - "line": 4, + "column": 8, + "line": 5, }, }, "range": Array [ - 71, - 72, + 78, + 79, ], "type": "Punctuator", - "value": ",", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 10, + "line": 5, }, "start": Object { - "column": 28, - "line": 4, + "column": 9, + "line": 5, }, }, "range": Array [ - 73, - 76, + 79, + 80, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 11, + "line": 5, }, "start": Object { - "column": 31, - "line": 4, + "column": 10, + "line": 5, }, }, "range": Array [ - 76, - 77, + 80, + 81, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 4, + "column": 18, + "line": 5, }, "start": Object { - "column": 32, - "line": 4, + "column": 12, + "line": 5, }, }, "range": Array [ - 77, - 78, + 82, + 88, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 19, + "line": 5, }, "start": Object { - "column": 33, - "line": 4, + "column": 18, + "line": 5, }, }, "range": Array [ - 78, - 79, + 88, + 89, ], "type": "Punctuator", "value": ";", @@ -36072,223 +36947,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 5, + "line": 6, }, "start": Object { - "column": 0, - "line": 5, + "column": 4, + "line": 6, }, }, "range": Array [ - 80, - 81, + 94, + 95, ], "type": "Punctuator", - "value": "}", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 25, - ], - "type": "TSPropertySignature", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 27, - ], - "type": "TSInterfaceBody", - }, - "heritage": Array [], - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 8, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 5, + "line": 6, }, }, "range": Array [ - 0, - 27, + 95, + 98, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "eee", }, - }, - "range": Array [ - 0, - 28, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 6, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 6, }, }, "range": Array [ - 0, - 9, + 98, + 99, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 16, + "line": 6, }, "start": Object { "column": 10, - "line": 1, + "line": 6, }, }, "range": Array [ - 10, - 14, + 100, + 106, ], "type": "Identifier", - "value": "test", + "value": "number", }, Object { "loc": Object { "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { "column": 16, - "line": 1, + "line": 6, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, }, "start": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 6, }, }, "range": Array [ - 15, - 16, + 107, + 108, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 25, + "line": 6, }, "start": Object { - "column": 4, - "line": 2, + "column": 19, + "line": 6, }, }, "range": Array [ - 21, - 24, + 109, + 115, ], "type": "Identifier", - "value": "foo", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 26, + "line": 6, }, "start": Object { - "column": 7, - "line": 2, + "column": 25, + "line": 6, }, }, "range": Array [ - 24, - 25, + 115, + 116, ], "type": "Punctuator", "value": ";", @@ -36296,569 +37091,233 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 5, + "line": 7, }, "start": Object { - "column": 0, - "line": 3, + "column": 4, + "line": 7, }, }, "range": Array [ - 26, - 27, + 121, + 122, ], "type": "Punctuator", - "value": "}", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 5, + "line": 7, }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", }, + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + "value": "fff", + }, + Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 9, + "line": 7, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 7, }, }, "range": Array [ - 0, - 19, + 125, + 126, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "operator": "keyof", - "range": Array [ - 9, - 18, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "?", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 10, + "line": 7, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 7, }, }, "range": Array [ - 0, - 4, + 126, + 127, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 17, + "line": 7, }, "start": Object { - "column": 5, - "line": 1, + "column": 11, + "line": 7, }, }, "range": Array [ - 5, - 6, + 128, + 134, ], "type": "Identifier", - "value": "x", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 18, + "line": 7, }, "start": Object { - "column": 7, - "line": 1, + "column": 17, + "line": 7, }, }, "range": Array [ - 7, - 8, + 134, + 135, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 19, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 18, + "line": 7, }, }, "range": Array [ - 9, - 14, + 135, + 136, ], - "type": "Identifier", - "value": "keyof", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 26, + "line": 7, }, "start": Object { - "column": 15, - "line": 1, + "column": 20, + "line": 7, }, }, "range": Array [ - 15, - 18, + 137, + 143, ], "type": "Identifier", - "value": "foo", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 27, + "line": 7, }, "start": Object { - "column": 18, - "line": 1, + "column": 26, + "line": 7, }, }, "range": Array [ - 18, - 19, + 143, + 144, ], "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "nestedArray", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 44, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 44, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 17, - 22, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 43, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 23, - 28, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 42, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 29, - 34, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "TSStringKeyword", - }, - ], - "range": Array [ - 34, - 42, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 28, - 43, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 22, - 44, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 44, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 7, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 0, - 44, + 149, + 152, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "doo", }, - }, - "range": Array [ - 0, - 44, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 8, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 7, + "line": 8, }, }, "range": Array [ - 0, - 3, + 152, + 153, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 9, + "line": 8, }, "start": Object { - "column": 4, - "line": 1, + "column": 8, + "line": 8, }, }, "range": Array [ - 4, - 15, + 153, + 154, ], - "type": "Identifier", - "value": "nestedArray", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 10, + "line": 8, }, "start": Object { - "column": 15, - "line": 1, + "column": 9, + "line": 8, }, }, "range": Array [ - 15, - 16, + 154, + 155, ], "type": "Punctuator", "value": ":", @@ -36866,1240 +37325,719 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 15, + "line": 8, }, "start": Object { - "column": 17, - "line": 1, + "column": 11, + "line": 8, }, }, "range": Array [ - 17, - 22, + 156, + 160, ], - "type": "Identifier", - "value": "Array", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 16, + "line": 8, }, "start": Object { - "column": 22, - "line": 1, + "column": 15, + "line": 8, }, }, "range": Array [ - 22, - 23, + 160, + 161, ], "type": "Punctuator", - "value": "<", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 7, + "line": 9, }, "start": Object { - "column": 23, - "line": 1, + "column": 4, + "line": 9, }, }, "range": Array [ - 23, - 28, + 166, + 169, ], "type": "Identifier", - "value": "Array", + "value": "doo", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 8, + "line": 9, }, "start": Object { - "column": 28, - "line": 1, - }, + "column": 7, + "line": 9, + }, }, "range": Array [ - 28, - 29, + 169, + 170, ], "type": "Punctuator", - "value": "<", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 9, + "line": 9, }, "start": Object { - "column": 29, - "line": 1, + "column": 8, + "line": 9, }, }, "range": Array [ - 29, - 34, + 170, + 171, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 9, + "line": 9, + }, + }, + "range": Array [ + 171, + 172, ], "type": "Identifier", - "value": "Array", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 11, + "line": 9, }, "start": Object { - "column": 34, - "line": 1, + "column": 10, + "line": 9, }, }, "range": Array [ - 34, - 35, + 172, + 173, ], "type": "Punctuator", - "value": "<", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 13, + "line": 9, }, "start": Object { - "column": 35, - "line": 1, + "column": 12, + "line": 9, }, }, "range": Array [ - 35, - 41, + 174, + 175, ], "type": "Identifier", - "value": "string", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 14, + "line": 9, }, "start": Object { - "column": 41, - "line": 1, + "column": 13, + "line": 9, }, }, "range": Array [ - 41, - 42, + 175, + 176, ], "type": "Punctuator", - "value": ">", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 16, + "line": 9, }, "start": Object { - "column": 42, - "line": 1, + "column": 15, + "line": 9, }, }, "range": Array [ - 42, - 43, + 177, + 178, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 17, + "line": 9, }, "start": Object { - "column": 43, - "line": 1, + "column": 16, + "line": 9, }, }, "range": Array [ - 43, - 44, + 178, + 179, ], "type": "Punctuator", - "value": ">", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/never-type-param.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 17, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 17, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 17, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 16, - ], - "type": "TSNeverKeyword", - }, - ], - "range": Array [ - 10, - 17, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 17, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { "column": 18, - "line": 1, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 9, }, }, "range": Array [ - 0, - 18, + 179, + 180, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": ":", }, Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "name": "Observable", - "range": Array [ - 19, - 29, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "empty", - "range": Array [ - 30, - 35, - ], - "type": "Identifier", - }, - "range": Array [ - 19, - 35, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 23, + "line": 9, }, - "range": Array [ - 19, - 44, - ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 36, - 41, - ], - "type": "TSNeverKeyword", - }, - ], - "range": Array [ - 35, - 42, - ], - "type": "TSTypeParameterInstantiation", + "start": Object { + "column": 19, + "line": 9, }, }, + "range": Array [ + 181, + 185, + ], + "type": "Keyword", + "value": "void", + }, + Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 24, + "line": 9, }, "start": Object { - "column": 0, - "line": 2, + "column": 23, + "line": 9, }, }, "range": Array [ - 19, - 45, + 185, + 186, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 46, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 10, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 10, }, }, "range": Array [ - 0, - 5, + 191, + 192, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 8, + "line": 10, }, "start": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 10, }, }, "range": Array [ - 6, - 7, + 192, + 195, ], "type": "Identifier", - "value": "x", + "value": "loo", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 9, + "line": 10, }, "start": Object { - "column": 7, - "line": 1, + "column": 8, + "line": 10, }, }, "range": Array [ - 7, - 8, + 195, + 196, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 1, + "line": 10, }, "start": Object { "column": 9, - "line": 1, + "line": 10, }, }, "range": Array [ - 9, - 10, + 196, + 197, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 1, + "line": 10, }, "start": Object { "column": 10, - "line": 1, + "line": 10, }, }, "range": Array [ - 10, - 11, + 197, + 198, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 12, + "line": 10, }, "start": Object { "column": 11, - "line": 1, + "line": 10, }, }, "range": Array [ - 11, - 16, + 198, + 199, ], "type": "Identifier", - "value": "never", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 13, + "line": 10, }, "start": Object { - "column": 16, - "line": 1, + "column": 12, + "line": 10, }, }, "range": Array [ - 16, - 17, + 199, + 200, ], "type": "Punctuator", - "value": ">", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 15, + "line": 10, }, "start": Object { - "column": 17, - "line": 1, + "column": 14, + "line": 10, }, }, "range": Array [ - 17, - 18, + 201, + 202, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 16, + "line": 10, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 10, }, }, "range": Array [ - 19, - 29, + 202, + 203, ], - "type": "Identifier", - "value": "Observable", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 18, + "line": 10, }, "start": Object { - "column": 10, - "line": 2, + "column": 17, + "line": 10, }, }, "range": Array [ - 29, - 30, + 204, + 205, ], - "type": "Punctuator", - "value": ".", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 19, + "line": 10, }, "start": Object { - "column": 11, - "line": 2, + "column": 18, + "line": 10, }, }, "range": Array [ - 30, - 35, + 205, + 206, ], - "type": "Identifier", - "value": "empty", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 20, + "line": 10, }, "start": Object { - "column": 16, - "line": 2, + "column": 19, + "line": 10, }, }, "range": Array [ - 35, - 36, + 206, + 207, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 25, + "line": 10, }, "start": Object { - "column": 17, - "line": 2, + "column": 21, + "line": 10, }, }, "range": Array [ - 36, - 41, + 208, + 212, ], - "type": "Identifier", - "value": "never", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 26, + "line": 10, }, "start": Object { - "column": 22, - "line": 2, + "column": 25, + "line": 10, }, }, "range": Array [ - 41, - 42, + 212, + 213, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 7, + "line": 11, }, "start": Object { - "column": 23, - "line": 2, + "column": 4, + "line": 11, }, }, "range": Array [ - 42, - 43, + 218, + 221, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "boo", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 8, + "line": 11, }, "start": Object { - "column": 24, - "line": 2, + "column": 7, + "line": 11, }, }, "range": Array [ - 43, - 44, + 221, + 222, ], "type": "Punctuator", - "value": ")", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 9, + "line": 11, }, "start": Object { - "column": 25, - "line": 2, + "column": 8, + "line": 11, }, }, "range": Array [ - 44, - 45, + 222, + 223, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "J", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": "e", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "validateEntity", - "range": Array [ - 41, - 55, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 58, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 59, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": "s", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "init": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "object": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "name": "e", - "range": Array [ - 72, - 73, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 72, - 74, - ], - "type": "TSNonNullExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "name", - "range": Array [ - 75, - 79, - ], - "type": "Identifier", - }, - "range": Array [ - 72, - 79, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 68, - 79, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 64, - 80, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 82, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "processEntity", - "range": Array [ - 9, - 22, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 10, + "line": 11, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 11, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "e", - "optional": true, - "range": Array [ - 23, - 33, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 33, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 33, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "name": "Entity", - "range": Array [ - 27, - 33, - ], - "type": "Identifier", - }, - }, - }, - }, - ], "range": Array [ - 0, - 82, + 223, + 224, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ">", }, - }, - "range": Array [ - 0, - 82, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 11, + "line": 11, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 11, }, }, "range": Array [ - 0, - 8, + 224, + 225, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 12, + "line": 11, }, "start": Object { - "column": 9, - "line": 1, + "column": 11, + "line": 11, }, }, "range": Array [ - 9, - 22, + 225, + 226, ], "type": "Identifier", - "value": "processEntity", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 13, + "line": 11, }, "start": Object { - "column": 22, - "line": 1, + "column": 12, + "line": 11, }, }, "range": Array [ - 22, - 23, + 226, + 227, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 11, }, "start": Object { - "column": 23, - "line": 1, + "column": 14, + "line": 11, }, }, "range": Array [ - 23, - 24, + 228, + 229, ], "type": "Identifier", - "value": "e", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 11, }, "start": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 11, }, }, "range": Array [ - 24, - 25, + 229, + 230, ], "type": "Punctuator", - "value": "?", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 18, + "line": 11, }, "start": Object { - "column": 25, - "line": 1, + "column": 17, + "line": 11, }, }, "range": Array [ - 25, - 26, + 231, + 232, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 232, + 233, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 11, + }, + "start": Object { + "column": 19, + "line": 11, + }, + }, + "range": Array [ + 233, + 234, ], "type": "Punctuator", "value": ":", @@ -38107,125 +38045,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 25, + "line": 11, }, "start": Object { - "column": 27, - "line": 1, + "column": 21, + "line": 11, }, }, "range": Array [ - 27, - 33, + 235, + 239, ], - "type": "Identifier", - "value": "Entity", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 26, + "line": 11, }, "start": Object { - "column": 33, - "line": 1, + "column": 25, + "line": 11, }, }, "range": Array [ - 33, - 34, + 239, + 240, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 7, + "line": 12, }, "start": Object { - "column": 35, - "line": 1, + "column": 4, + "line": 12, }, }, "range": Array [ - 35, - 36, + 245, + 248, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "range": Array [ + 249, + 250, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 10, + "line": 12, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 12, }, }, "range": Array [ - 41, - 55, + 250, + 251, ], "type": "Identifier", - "value": "validateEntity", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 11, + "line": 12, }, "start": Object { - "column": 18, - "line": 2, + "column": 10, + "line": 12, }, }, "range": Array [ - 55, - 56, + 251, + 252, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 13, + "line": 12, }, "start": Object { - "column": 19, - "line": 2, + "column": 12, + "line": 12, }, }, "range": Array [ - 56, - 57, + 253, + 254, ], "type": "Identifier", - "value": "e", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 14, + "line": 12, }, "start": Object { - "column": 20, - "line": 2, + "column": 13, + "line": 12, }, }, "range": Array [ - 57, - 58, + 254, + 255, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 14, + "line": 12, + }, + }, + "range": Array [ + 255, + 256, ], "type": "Punctuator", "value": ")", @@ -38233,17 +38207,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 16, + "line": 12, }, "start": Object { - "column": 21, - "line": 2, + "column": 15, + "line": 12, }, }, "range": Array [ - 58, - 59, + 256, + 257, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "range": Array [ + 258, + 264, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 12, + }, + "start": Object { + "column": 23, + "line": 12, + }, + }, + "range": Array [ + 264, + 265, ], "type": "Punctuator", "value": ";", @@ -38252,142 +38262,232 @@ Object { "loc": Object { "end": Object { "column": 7, - "line": 3, + "line": 13, }, "start": Object { "column": 4, - "line": 3, + "line": 13, }, }, "range": Array [ - 64, - 67, + 270, + 273, ], "type": "Keyword", - "value": "let", + "value": "new", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 3, + "line": 13, }, "start": Object { "column": 8, - "line": 3, + "line": 13, }, }, "range": Array [ - 68, - 69, + 274, + 275, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 9, + "line": 13, + }, + }, + "range": Array [ + 275, + 276, ], "type": "Identifier", - "value": "s", + "value": "F", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 3, + "line": 13, }, "start": Object { "column": 10, - "line": 3, + "line": 13, }, }, "range": Array [ - 70, - 71, + 276, + 277, ], "type": "Punctuator", - "value": "=", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 13, + }, + "start": Object { + "column": 11, + "line": 13, + }, + }, + "range": Array [ + 277, + 278, + ], + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 3, + "line": 13, }, "start": Object { "column": 12, - "line": 3, + "line": 13, }, }, "range": Array [ - 72, - 73, + 278, + 279, ], "type": "Identifier", - "value": "e", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 3, + "line": 13, }, "start": Object { "column": 13, - "line": 3, + "line": 13, }, }, "range": Array [ - 73, - 74, + 279, + 280, ], "type": "Punctuator", - "value": "!", + "value": ",", }, Object { "loc": Object { "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { "column": 15, - "line": 3, + "line": 13, + }, + }, + "range": Array [ + 281, + 282, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 13, }, "start": Object { - "column": 14, - "line": 3, + "column": 16, + "line": 13, }, }, "range": Array [ - 74, - 75, + 282, + 283, ], "type": "Punctuator", - "value": ".", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 13, + }, + "start": Object { + "column": 17, + "line": 13, + }, + }, + "range": Array [ + 283, + 284, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 19, - "line": 3, + "line": 13, }, "start": Object { - "column": 15, - "line": 3, + "column": 18, + "line": 13, }, }, "range": Array [ - 75, - 79, + 284, + 285, ], - "type": "Identifier", - "value": "name", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { "column": 20, - "line": 3, + "line": 13, + }, + }, + "range": Array [ + 286, + 292, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 13, }, "start": Object { - "column": 19, - "line": 3, + "column": 26, + "line": 13, }, }, "range": Array [ - 79, - 80, + 292, + 293, ], "type": "Punctuator", "value": ";", @@ -38396,16 +38496,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 14, }, "start": Object { "column": 0, - "line": 4, + "line": 14, }, }, "range": Array [ - 81, - 82, + 294, + 295, ], "type": "Punctuator", "value": "}", @@ -38415,194 +38515,161 @@ Object { } `; -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 30, + "line": 2, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "name": "x", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 11, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "params": Array [ + Object { + "accessibility": "public", "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 9, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, }, + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", }, "range": Array [ - 7, - 11, + 26, + 34, ], - "type": "TSNullKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "y", - "range": Array [ - 17, - 29, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, + "type": "TSParameterProperty", }, - "range": Array [ - 18, - 29, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + Object { + "accessibility": "private", "loc": Object { "end": Object { - "column": 16, + "column": 28, "line": 2, }, "start": Object { - "column": 7, + "column": 19, "line": 2, }, }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, "range": Array [ - 20, - 29, + 36, + 45, ], - "type": "TSUndefinedKeyword", + "type": "TSParameterProperty", }, - }, + ], + "range": Array [ + 21, + 47, + ], + "type": "TSConstructSignature", + "typeAnnotation": null, }, - "init": null, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, }, - "range": Array [ - 17, - 29, - ], - "type": "VariableDeclarator", }, - ], - "kind": "let", + "range": Array [ + 15, + 49, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 13, - 30, + 0, + 49, ], - "type": "VariableDeclaration", + "type": "TSInterfaceDeclaration", }, ], "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -38611,14 +38678,14 @@ Object { }, "range": Array [ 0, - 30, + 50, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 9, "line": 1, }, "start": Object { @@ -38628,604 +38695,421 @@ Object { }, "range": Array [ 0, - 3, + 9, ], "type": "Keyword", - "value": "let", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 10, "line": 1, }, }, "range": Array [ - 4, - 5, + 10, + 14, ], "type": "Identifier", - "value": "x", + "value": "Test", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 16, "line": 1, }, "start": Object { - "column": 5, + "column": 15, "line": 1, }, }, "range": Array [ - 5, - 6, + 15, + 16, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 7, - 11, + 21, + 24, ], "type": "Keyword", - "value": "null", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 11, - 12, + 25, + 26, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 15, "line": 2, }, "start": Object { - "column": 0, + "column": 9, "line": 2, }, }, "range": Array [ - 13, - 16, + 26, + 32, ], "type": "Keyword", - "value": "let", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 17, "line": 2, }, "start": Object { - "column": 4, + "column": 16, "line": 2, }, }, "range": Array [ - 17, - 18, + 33, + 34, ], "type": "Identifier", - "value": "y", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 18, "line": 2, }, "start": Object { - "column": 5, + "column": 17, "line": 2, }, }, "range": Array [ - 18, - 19, + 34, + 35, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 26, "line": 2, }, "start": Object { - "column": 7, + "column": 19, "line": 2, }, }, "range": Array [ - 20, - 29, + 36, + 43, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, ], "type": "Identifier", - "value": "undefined", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 29, "line": 2, }, "start": Object { - "column": 16, + "column": 28, "line": 2, }, }, "range": Array [ - 29, - 30, + 45, + 46, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 1, + "column": 32, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 7, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", + "range": Array [ + 32, + 36, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 28, "line": 1, }, "start": Object { - "column": 3, + "column": 25, "line": 1, }, }, - "method": false, + "name": "Bar", "range": Array [ - 3, - 13, + 25, + 28, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSInterfaceHeritage", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, }, - "start": Object { - "column": 9, - "line": 1, + "range": Array [ + 29, + 30, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "J", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", }, }, - "range": Array [ - 9, - 13, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, + ], + "range": Array [ + 28, + 31, + ], + "type": "TSTypeParameterInstantiation", }, - ], - "range": Array [ - 1, - 15, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, }, - }, - "range": Array [ - 0, - 17, ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { + "id": Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 13, + "line": 1, }, "start": Object { - "column": 1, - "line": 3, + "column": 10, + "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "range": Array [ - 22, - 26, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "method": true, - "range": Array [ - 22, - 31, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "params": Array [], - "range": Array [ - 26, - 31, - ], - "type": "FunctionExpression", - }, - }, - ], + "name": "Foo", "range": Array [ - 20, - 33, + 10, + 13, ], - "type": "ObjectExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 1, "line": 3, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 19, - 35, + 0, + 36, ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { + "type": "TSInterfaceDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 1, - "line": 5, + "column": 13, + "line": 1, }, }, - "properties": Array [ + "params": Array [ Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 41, - 45, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", "loc": Object { "end": Object { "column": 15, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "method": false, - "range": Array [ - 40, - 52, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "range": Array [ - 48, - 52, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], - "range": Array [ - 38, - 54, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 37, - 56, - ], - "type": "ExpressionStatement", - }, - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 68, - 72, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 7, + "line": 1, }, "start": Object { - "column": 10, - "line": 7, + "column": 14, + "line": 1, }, }, + "name": "T", "range": Array [ - 68, - 79, + 14, + 15, ], - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 17, - "line": 7, - }, - }, - "range": Array [ - 75, - 79, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 23, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, + "type": "TSTypeParameter", }, - }, - "range": Array [ - 66, - 81, ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "name": "X", "range": Array [ - 64, - 65, + 13, + 16, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 58, - 81, - ], - "superClass": null, - "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 8, + "line": 4, }, "start": Object { "column": 0, @@ -39234,14 +39118,14 @@ Object { }, "range": Array [ 0, - 82, + 37, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 9, "line": 1, }, "start": Object { @@ -39251,82 +39135,46 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, + 9, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 3, + "column": 10, "line": 1, }, }, "range": Array [ - 3, - 7, + 10, + 13, ], - "type": "String", - "value": "'__'", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 1, }, "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { "column": 13, "line": 1, }, - "start": Object { - "column": 9, - "line": 1, - }, }, "range": Array [ - 9, 13, + 14, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { @@ -39343,8 +39191,8 @@ Object { 14, 15, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { @@ -39362,130 +39210,112 @@ Object { 16, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 24, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 25, + "line": 1, }, }, "range": Array [ - 19, - 20, + 25, + 28, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 29, + "line": 1, }, "start": Object { - "column": 1, - "line": 3, + "column": 28, + "line": 1, }, }, "range": Array [ - 20, - 21, + 28, + 29, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "range": Array [ - 22, - 26, - ], - "type": "String", - "value": "'__'", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 30, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 29, + "line": 1, }, }, "range": Array [ - 26, - 27, + 29, + 30, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "J", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 31, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 30, + "line": 1, }, }, "range": Array [ - 27, - 28, + 30, + 31, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 32, + "line": 1, }, }, "range": Array [ - 29, - 30, + 32, + 33, ], "type": "Punctuator", "value": "{", @@ -39493,377 +39323,560 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 1, "line": 3, }, "start": Object { - "column": 11, + "column": 0, "line": 3, }, }, "range": Array [ - 30, - 31, + 35, + 36, ], "type": "Punctuator", "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 1, + }, }, - "start": Object { - "column": 13, - "line": 3, + "range": Array [ + 18, + 21, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "}", - }, - Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 1, + "line": 2, }, "start": Object { - "column": 14, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 33, - 34, + 0, + 21, ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 14, + 17, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 34, - 35, - ], - "type": "Punctuator", - "value": ";", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 37, - 38, + 0, + 9, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 14, + "line": 1, }, "start": Object { - "column": 1, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 38, - 39, + 10, + 14, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 15, + "line": 1, }, "start": Object { - "column": 3, - "line": 5, + "column": 14, + "line": 1, }, }, "range": Array [ - 40, - 41, + 14, + 15, ], "type": "Punctuator", - "value": "[", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 5, + "column": 15, + "line": 1, }, }, "range": Array [ - 41, - 45, + 15, + 16, ], - "type": "String", - "value": "'__'", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 17, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 16, + "line": 1, }, }, "range": Array [ - 45, - 46, + 16, + 17, ], "type": "Punctuator", - "value": "]", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 19, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 18, + "line": 1, }, }, "range": Array [ - 46, - 47, + 18, + 19, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 1, + "line": 2, }, "start": Object { - "column": 11, - "line": 5, + "column": 0, + "line": 2, }, }, "range": Array [ - 48, - 52, + 20, + 21, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "name": "bar", + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 76, + 85, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 87, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 1, + "line": 7, }, "start": Object { - "column": 16, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 53, - 54, + 0, + 87, ], - "type": "Punctuator", - "value": "}", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 88, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 17, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 54, - 55, + 0, + 9, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 14, + "line": 1, }, "start": Object { - "column": 18, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 55, - 56, + 10, + 14, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 7, + "column": 16, + "line": 1, }, "start": Object { - "column": 0, - "line": 7, + "column": 15, + "line": 1, }, }, "range": Array [ - 58, - 63, + 15, + 16, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 7, + "line": 6, }, "start": Object { - "column": 6, - "line": 7, + "column": 4, + "line": 6, }, }, "range": Array [ - 64, - 65, + 76, + 79, ], "type": "Identifier", - "value": "X", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 7, + "column": 8, + "line": 6, }, "start": Object { - "column": 8, - "line": 7, + "column": 7, + "line": 6, }, }, "range": Array [ - 66, - 67, + 79, + 80, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 11, + "line": 6, }, "start": Object { - "column": 10, - "line": 7, + "column": 8, + "line": 6, }, }, "range": Array [ - 68, - 72, + 80, + 83, ], - "type": "String", - "value": "'__'", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 7, + "column": 12, + "line": 6, }, "start": Object { - "column": 15, - "line": 7, + "column": 11, + "line": 6, }, }, "range": Array [ - 73, - 74, + 83, + 84, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 13, + "line": 6, }, "start": Object { - "column": 17, - "line": 7, + "column": 12, + "line": 6, }, }, "range": Array [ - 75, - 79, + 84, + 85, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 1, "line": 7, }, "start": Object { - "column": 22, + "column": 0, "line": 7, }, }, "range": Array [ - 80, - 81, + 86, + 87, ], "type": "Punctuator", "value": "}", @@ -39873,195 +39886,308 @@ Object { } `; -exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "range": Array [ - 40, - 42, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "test", - "range": Array [ - 9, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", }, - "start": Object { - "column": 14, - "line": 1, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "optional": true, + "range": Array [ + 21, + 26, + ], + "type": "TSPropertySignature", }, - "name": "abc", - "range": Array [ - 14, - 38, - ], - "type": "Identifier", - "typeAnnotation": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 17, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 4, + "line": 3, }, }, + "optional": true, "range": Array [ - 17, - 38, + 31, + 44, ], - "type": "TSTypeAnnotation", + "type": "TSPropertySignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 19, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 19, - 38, + 35, + 43, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 19, - "line": 1, + "column": 10, + "line": 3, }, }, - "name": "Map", "range": Array [ - 19, - 22, + 37, + 43, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "baz", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "optional": true, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "foo", + "range": Array [ + 54, + 57, ], "type": "Identifier", }, - "typeParameters": Object { + Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 14, + "line": 4, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, + "name": "bar", + "optional": true, + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, }, - "range": Array [ - 23, - 29, - ], - "type": "TSSymbolKeyword", }, - Object { + "range": Array [ + 63, + 71, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 31, - "line": 1, + "column": 20, + "line": 4, }, }, "range": Array [ - 31, - 37, + 65, + 71, ], "type": "TSStringKeyword", }, - ], + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "name": "baz", + "optional": true, "range": Array [ - 22, - 38, + 73, + 76, ], - "type": "TSTypeParameterInstantiation", + "type": "Identifier", }, - }, + ], + "range": Array [ + 49, + 79, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 1, }, }, - ], + "range": Array [ + 15, + 81, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 42, + 81, ], - "type": "FunctionDeclaration", + "type": "TSInterfaceDeclaration", }, ], "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -40070,14 +40196,14 @@ Object { }, "range": Array [ 0, - 42, + 82, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { @@ -40087,25 +40213,25 @@ Object { }, "range": Array [ 0, - 8, + 9, ], "type": "Keyword", - "value": "function", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, - 13, + 10, + 14, ], "type": "Identifier", "value": "test", @@ -40113,143 +40239,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 14, + 15, + 16, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 14, - 17, + 21, + 24, ], "type": "Identifier", - "value": "abc", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 17, - 18, + 24, + 25, ], "type": "Punctuator", - "value": ":", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 19, - 22, + 25, + 26, ], - "type": "Identifier", - "value": "Map", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 22, - 23, + 31, + 34, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 8, + "line": 3, }, "start": Object { - "column": 23, - "line": 1, + "column": 7, + "line": 3, }, }, "range": Array [ - 23, - 29, + 34, + 35, ], - "type": "Identifier", - "value": "symbol", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 29, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 29, - 30, + 35, + 36, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 31, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 31, 37, + 43, ], "type": "Identifier", "value": "string", @@ -40257,777 +40383,395 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 17, + "line": 3, }, "start": Object { - "column": 37, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 37, - 38, + 43, + 44, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 7, + "line": 4, }, "start": Object { - "column": 38, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 38, - 39, + 49, + 52, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 8, + "line": 4, }, "start": Object { - "column": 40, - "line": 1, + "column": 7, + "line": 4, }, }, "range": Array [ - 40, - 41, + 52, + 53, ], "type": "Punctuator", - "value": "{", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 9, + "line": 4, }, "start": Object { - "column": 41, - "line": 1, + "column": 8, + "line": 4, }, }, "range": Array [ - 41, - 42, + 53, + 54, ], "type": "Punctuator", - "value": "}", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 4, }, }, "range": Array [ - 0, - 37, + 54, + 57, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 37, - ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 27, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Success", - "range": Array [ - 17, - 24, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 37, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "Failure", - "range": Array [ - 30, - 37, - ], - "type": "Identifier", - }, - }, - ], - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 11, - 14, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "foo", }, - }, - "range": Array [ - 0, - 37, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 13, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 4, }, }, "range": Array [ - 0, - 4, + 57, + 58, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 5, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 5, - 11, + 59, + 62, ], "type": "Identifier", - "value": "Result", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 11, - 12, + 62, + 63, ], "type": "Punctuator", - "value": "<", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 12, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 12, - 13, + 63, + 64, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 13, - "line": 1, + "column": 20, + "line": 4, }, }, "range": Array [ - 13, - 14, + 65, + 71, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 27, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 26, + "line": 4, }, }, "range": Array [ - 15, - 16, + 71, + 72, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 28, + "line": 4, }, }, "range": Array [ - 17, - 24, + 73, + 76, ], "type": "Identifier", - "value": "Success", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 32, + "line": 4, }, "start": Object { - "column": 24, - "line": 1, + "column": 31, + "line": 4, }, }, "range": Array [ - 24, - 25, + 76, + 77, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - "value": "T", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 33, + "line": 4, }, "start": Object { - "column": 26, - "line": 1, + "column": 32, + "line": 4, }, }, "range": Array [ - 26, - 27, + 77, + 78, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 34, + "line": 4, }, "start": Object { - "column": 28, - "line": 1, + "column": 33, + "line": 4, }, }, "range": Array [ - 28, - 29, + 78, + 79, ], "type": "Punctuator", - "value": "|", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 30, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 30, - 37, + 80, + 81, ], - "type": "Identifier", - "value": "Failure", + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { "body": Array [ Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "TSPropertySignature", + }, + ], "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 5, + "column": 15, "line": 1, }, }, - "name": "Result", "range": Array [ - 5, - 11, + 15, + 27, ], - "type": "Identifier", + "type": "TSInterfaceBody", }, - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 48, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { + "heritage": Array [], + "id": Object { "loc": Object { "end": Object { - "column": 48, + "column": 14, "line": 1, }, "start": Object { - "column": 28, + "column": 10, "line": 1, }, }, + "name": "test", "range": Array [ - 28, - 48, - ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 38, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "Success", - "range": Array [ - 28, - 35, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 35, - 38, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 48, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "name": "Failure", - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - }, - }, + 10, + 14, ], + "type": "Identifier", }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, - "params": Array [ - Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "members": Array [], - "range": Array [ - 22, - 24, - ], - "type": "TSTypeLiteral", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 24, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 11, - 25, - ], - "type": "TSTypeParameterDeclaration", }, + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", }, ], "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -41036,14 +40780,14 @@ Object { }, "range": Array [ 0, - 48, + 28, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 9, "line": 1, }, "start": Object { @@ -41053,356 +40797,354 @@ Object { }, "range": Array [ 0, - 4, + 9, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { - "column": 5, + "column": 10, "line": 1, }, }, "range": Array [ - 5, - 11, + 10, + 14, ], "type": "Identifier", - "value": "Result", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, - 12, + 15, + 16, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 12, - 13, + 21, + 24, ], "type": "Identifier", - "value": "T", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 14, - 21, + 24, + 25, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 22, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 22, - 23, + 26, + 27, ], "type": "Punctuator", - "value": "{", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 1, }, "start": Object { - "column": 23, + "column": 0, "line": 1, }, }, "range": Array [ - 23, - 24, + 0, + 19, ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, - "start": Object { - "column": 24, - "line": 1, + "operator": "keyof", + "range": Array [ + 9, + 18, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, }, }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": ">", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 27, + "column": 4, "line": 1, }, "start": Object { - "column": 26, + "column": 0, "line": 1, }, }, "range": Array [ - 26, - 27, + 0, + 4, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 6, "line": 1, }, "start": Object { - "column": 28, + "column": 5, "line": 1, }, }, "range": Array [ - 28, - 35, + 5, + 6, ], "type": "Identifier", - "value": "Success", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 8, "line": 1, }, "start": Object { - "column": 35, + "column": 7, "line": 1, }, }, "range": Array [ - 35, - 36, + 7, + 8, ], "type": "Punctuator", - "value": "<", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 14, "line": 1, }, "start": Object { - "column": 36, + "column": 9, "line": 1, }, }, "range": Array [ - 36, - 37, + 9, + 14, ], "type": "Identifier", - "value": "T", + "value": "keyof", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 18, "line": 1, }, "start": Object { - "column": 37, + "column": 15, "line": 1, }, }, "range": Array [ - 37, - 38, + 15, + 18, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 19, "line": 1, }, "start": Object { - "column": 39, + "column": 18, "line": 1, }, }, "range": Array [ - 39, - 40, + 18, + 19, ], "type": "Punctuator", - "value": "|", - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - "value": "Failure", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` Object { "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 30, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 24, + "column": 44, "line": 1, }, "start": Object { - "column": 12, + "column": 4, "line": 1, }, }, + "name": "nestedArray", "range": Array [ - 12, - 24, + 4, + 44, ], - "type": "TSPropertySignature", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, + "column": 44, "line": 1, }, "start": Object { @@ -41412,13 +41154,13 @@ Object { }, "range": Array [ 15, - 23, + 44, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, + "column": 44, "line": 1, }, "start": Object { @@ -41428,61 +41170,214 @@ Object { }, "range": Array [ 17, - 23, + 44, ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 17, + 22, + ], + "type": "Identifier", }, - "start": Object { - "column": 25, - "line": 1, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 43, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 42, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 34, + 42, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 28, + 43, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 22, + 44, + ], + "type": "TSTypeParameterInstantiation", }, }, - "name": "baz", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, - "range": Array [ - 25, - 28, - ], - "type": "TSPropertySignature", }, - ], - "range": Array [ - 11, - 29, - ], - "type": "TSTypeLiteral", + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 44, + "line": 1, }, "start": Object { "column": 0, @@ -41491,14 +41386,14 @@ Object { }, "range": Array [ 0, - 31, + 44, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 3, "line": 1, }, "start": Object { @@ -41508,491 +41403,508 @@ Object { }, "range": Array [ 0, - 4, + 3, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 1, }, "start": Object { - "column": 5, + "column": 4, "line": 1, }, }, "range": Array [ - 5, - 8, + 4, + 15, ], "type": "Identifier", - "value": "foo", + "value": "nestedArray", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 15, "line": 1, }, }, "range": Array [ - 9, - 10, + 15, + 16, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 17, "line": 1, }, }, "range": Array [ - 11, - 12, + 17, + 22, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 28, "line": 1, }, "start": Object { - "column": 12, + "column": 23, "line": 1, }, }, "range": Array [ - 12, - 15, + 23, + 28, ], "type": "Identifier", - "value": "bar", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 29, "line": 1, }, "start": Object { - "column": 15, + "column": 28, "line": 1, }, }, "range": Array [ - 15, - 16, + 28, + 29, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 34, "line": 1, }, "start": Object { - "column": 17, + "column": 29, "line": 1, }, }, "range": Array [ - 17, - 23, + 29, + 34, ], "type": "Identifier", - "value": "string", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 35, "line": 1, }, "start": Object { - "column": 23, + "column": 34, "line": 1, }, }, "range": Array [ - 23, - 24, + 34, + 35, ], "type": "Punctuator", - "value": ",", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 41, "line": 1, }, "start": Object { - "column": 25, + "column": 35, "line": 1, }, }, "range": Array [ - 25, - 28, + 35, + 41, ], "type": "Identifier", - "value": "baz", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 42, "line": 1, }, "start": Object { - "column": 28, + "column": 41, "line": 1, }, }, "range": Array [ - 28, - 29, + 41, + 42, ], "type": "Punctuator", - "value": "}", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 43, "line": 1, }, "start": Object { - "column": 29, + "column": 42, "line": 1, }, }, "range": Array [ - 29, - 30, + 42, + 43, ], "type": "Punctuator", - "value": ";", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ">", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-guard.src 1`] = ` +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "left": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, + }, + "range": Array [ + 7, + 17, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 9, + "line": 1, }, }, - "operator": "typeof", - "prefix": true, "range": Array [ - 52, - 60, + 9, + 17, ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "operator": "===", - "range": Array [ - 52, - 73, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, - "start": Object { - "column": 24, - "line": 2, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameterInstantiation", }, - "range": Array [ - 65, - 73, - ], - "raw": "'string'", - "type": "Literal", - "value": "string", - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, }, }, - "range": Array [ - 45, - 73, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 75, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, }, - "start": Object { - "column": 9, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", }, - "name": "isString", - "range": Array [ - 9, - 17, - ], - "type": "Identifier", - }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [ - Object { + "range": Array [ + 0, + 18, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 2, }, }, - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - "typeAnnotation": Object { + "object": Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 0, + "line": 2, }, }, + "name": "Observable", "range": Array [ 19, - 24, + 29, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, }, - "range": Array [ - 21, - 24, - ], - "type": "TSAnyKeyword", }, + "name": "empty", + "range": Array [ + 30, + 35, + ], + "type": "Identifier", }, + "range": Array [ + 19, + 35, + ], + "type": "MemberExpression", }, - ], - "range": Array [ - 0, - 75, - ], - "returnType": Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 25, - 38, + 19, + 44, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "CallExpression", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, - }, - }, - "parameterName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, + "column": 16, + "line": 2, }, - "name": "x", - "range": Array [ - 27, - 28, - ], - "type": "Identifier", }, - "range": Array [ - 27, - 38, - ], - "type": "TSTypePredicate", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 32, - 38, + 36, + 41, ], - "type": "TSStringKeyword", + "type": "TSNeverKeyword", }, - }, + ], + "range": Array [ + 35, + 42, + ], + "type": "TSTypeParameterInstantiation", }, }, - "type": "FunctionDeclaration", + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 45, + ], + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 1, + "column": 0, "line": 3, }, "start": Object { @@ -42002,14 +41914,14 @@ Object { }, "range": Array [ 0, - 75, + 46, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -42019,285 +41931,267 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 17, + 6, + 7, ], "type": "Identifier", - "value": "isString", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 8, "line": 1, }, "start": Object { - "column": 17, + "column": 7, "line": 1, }, }, "range": Array [ - 17, - 18, + 7, + 8, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 10, "line": 1, }, "start": Object { - "column": 18, + "column": 9, "line": 1, }, }, "range": Array [ - 18, - 19, + 9, + 10, ], "type": "Identifier", - "value": "x", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 19, + "column": 10, "line": 1, }, }, "range": Array [ - 19, - 20, + 10, + 11, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 16, "line": 1, }, "start": Object { - "column": 21, + "column": 11, "line": 1, }, }, "range": Array [ - 21, - 24, + 11, + 16, ], "type": "Identifier", - "value": "any", + "value": "never", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 17, "line": 1, }, "start": Object { - "column": 24, + "column": 16, "line": 1, }, }, "range": Array [ - 24, - 25, + 16, + 17, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 18, "line": 1, }, "start": Object { - "column": 25, + "column": 17, "line": 1, }, }, "range": Array [ - 25, - 26, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 27, - 28, + 19, + 29, ], "type": "Identifier", - "value": "x", + "value": "Observable", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ 29, - 31, + 30, ], - "type": "Identifier", - "value": "is", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 32, - 38, + 30, + 35, ], "type": "Identifier", - "value": "string", + "value": "empty", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 39, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 39, - 40, + 35, + 36, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 2, }, "start": Object { - "column": 4, + "column": 17, "line": 2, }, }, "range": Array [ - 45, - 51, + 36, + 41, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "never", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 2, }, "start": Object { - "column": 11, + "column": 22, "line": 2, }, }, "range": Array [ - 52, - 58, + 41, + 42, ], - "type": "Keyword", - "value": "typeof", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 24, "line": 2, }, "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { "column": 23, "line": 2, }, - "start": Object { - "column": 20, - "line": 2, - }, }, "range": Array [ - 61, - 64, + 42, + 43, ], "type": "Punctuator", - "value": "===", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 25, "line": 2, }, "start": Object { @@ -42306,256 +42200,254 @@ Object { }, }, "range": Array [ - 65, - 73, + 43, + 44, ], - "type": "String", - "value": "'string'", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 26, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 25, + "line": 2, }, }, "range": Array [ - 74, - 75, + 44, + 45, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` +exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 42, - ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "params": Array [ - Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "e", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "validateEntity", + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 21, - 22, + 41, + 58, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 59, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "init": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "object": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "e", + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 72, + 74, + ], + "type": "TSNonNullExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 75, + 79, + ], + "type": "Identifier", + }, + "range": Array [ + 72, + 79, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 19, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 8, + "line": 3, }, }, - "name": "A", "range": Array [ - 21, - 22, + 68, + 79, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - }, - ], - "range": Array [ - 3, - 40, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 43, - ], - "type": "ExpressionStatement", - }, - Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 43, - "line": 2, - }, - "start": Object { - "column": 40, - "line": 2, - }, - }, - "range": Array [ - 84, - 87, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 43, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 44, - 87, - ], - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "params": Array [ - Object { + ], + "kind": "let", "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 20, + "line": 3, }, "start": Object { - "column": 24, - "line": 2, + "column": 4, + "line": 3, }, }, - "name": "A", "range": Array [ - 68, - 69, + 64, + 80, ], - "type": "TSTypeParameter", + "type": "VariableDeclaration", }, ], - "range": Array [ - 56, - 81, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - Object { - "async": false, - "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 49, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { - "column": 46, - "line": 3, + "column": 35, + "line": 1, }, }, "range": Array [ - 134, - 137, + 35, + 82, ], "type": "BlockStatement", }, @@ -42564,114 +42456,114 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { "column": 9, - "line": 3, + "line": 1, }, }, - "name": "baz", + "name": "processEntity", "range": Array [ - 97, - 100, + 9, + 22, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 49, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, - "params": Array [], - "range": Array [ - 88, - 137, - ], - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, }, - }, - "params": Array [ - Object { - "default": Object { + "name": "e", + "optional": true, + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 41, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 38, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 126, - 129, + 27, + 33, ], "type": "TSTypeReference", "typeName": Object { "loc": Object { "end": Object { - "column": 41, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 38, - "line": 3, + "column": 27, + "line": 1, }, }, - "name": "Foo", + "name": "Entity", "range": Array [ - 126, - 129, + 27, + 33, ], "type": "Identifier", }, }, - "loc": Object { - "end": Object { - "column": 41, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "name": "A", - "range": Array [ - 112, - 129, - ], - "type": "TSTypeParameter", }, - ], - "range": Array [ - 100, - 131, - ], - "type": "TSTypeParameterDeclaration", - }, + }, + ], + "range": Array [ + 0, + 82, + ], + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, + "column": 1, "line": 4, }, "start": Object { @@ -42681,14 +42573,14 @@ Object { }, "range": Array [ 0, - 138, + 82, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -42698,28 +42590,10 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 4, + 8, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -42728,193 +42602,175 @@ Object { "line": 1, }, "start": Object { - "column": 21, + "column": 9, "line": 1, }, }, "range": Array [ - 21, + 9, 22, ], "type": "Identifier", - "value": "A", + "value": "processEntity", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 23, "line": 1, }, "start": Object { - "column": 39, + "column": 22, "line": 1, }, }, "range": Array [ - 39, - 40, + 22, + 23, ], "type": "Punctuator", - "value": ">", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 24, "line": 1, }, "start": Object { - "column": 40, + "column": 23, "line": 1, }, }, "range": Array [ - 40, - 41, + 23, + 24, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 25, "line": 1, }, "start": Object { - "column": 41, + "column": 24, "line": 1, }, }, "range": Array [ - 41, - 42, + 24, + 25, ], "type": "Punctuator", - "value": ")", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 26, "line": 1, }, "start": Object { - "column": 42, + "column": 25, "line": 1, }, }, "range": Array [ - 42, - 43, + 25, + 26, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 44, - 52, - ], - "type": "Keyword", - "value": "function", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 33, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 27, + "line": 1, }, }, "range": Array [ - 53, - 56, + 27, + 33, ], "type": "Identifier", - "value": "bar", + "value": "Entity", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 34, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 33, + "line": 1, }, }, "range": Array [ - 56, - 57, + 33, + 34, ], "type": "Punctuator", - "value": "<", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 36, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 35, + "line": 1, }, }, "range": Array [ - 68, - 69, + 35, + 36, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 18, "line": 2, }, "start": Object { - "column": 36, + "column": 4, "line": 2, }, }, "range": Array [ - 80, - 81, + 41, + 55, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "validateEntity", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 19, "line": 2, }, "start": Object { - "column": 37, + "column": 18, "line": 2, }, }, "range": Array [ - 81, - 82, + 55, + 56, ], "type": "Punctuator", "value": "(", @@ -42922,143 +42778,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 39, + "column": 20, "line": 2, }, "start": Object { - "column": 38, + "column": 19, "line": 2, }, }, "range": Array [ - 82, - 83, + 56, + 57, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 21, "line": 2, }, "start": Object { - "column": 40, + "column": 20, "line": 2, }, }, "range": Array [ - 84, - 85, + 57, + 58, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 22, "line": 2, }, "start": Object { - "column": 42, + "column": 21, "line": 2, }, }, "range": Array [ - 86, - 87, + 58, + 59, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 3, }, "start": Object { - "column": 0, + "column": 4, "line": 3, }, }, "range": Array [ - 88, - 96, + 64, + 67, ], "type": "Keyword", - "value": "function", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { "column": 9, "line": 3, }, - }, - "range": Array [ - 97, - 100, - ], - "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 100, - 101, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 3, - }, - "start": Object { - "column": 24, + "column": 8, "line": 3, }, }, "range": Array [ - 112, - 113, + 68, + 69, ], "type": "Identifier", - "value": "A", + "value": "s", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 11, "line": 3, }, "start": Object { - "column": 36, + "column": 10, "line": 3, }, }, "range": Array [ - 124, - 125, + 70, + 71, ], "type": "Punctuator", "value": "=", @@ -43066,107 +42886,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 13, "line": 3, }, "start": Object { - "column": 38, + "column": 12, "line": 3, }, }, "range": Array [ - 126, - 129, + 72, + 73, ], "type": "Identifier", - "value": "Foo", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 14, "line": 3, }, "start": Object { - "column": 42, + "column": 13, "line": 3, }, }, "range": Array [ - 130, - 131, + 73, + 74, ], "type": "Punctuator", - "value": ">", + "value": "!", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 15, "line": 3, }, "start": Object { - "column": 43, + "column": 14, "line": 3, }, }, "range": Array [ - 131, - 132, + 74, + 75, ], "type": "Punctuator", - "value": "(", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 45, + "column": 19, "line": 3, }, "start": Object { - "column": 44, + "column": 15, "line": 3, }, }, "range": Array [ - 132, - 133, + 75, + 79, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 47, + "column": 20, "line": 3, }, "start": Object { - "column": 46, + "column": 19, "line": 3, }, }, "range": Array [ - 134, - 135, + 79, + 80, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { - "column": 48, - "line": 3, + "column": 0, + "line": 4, }, }, "range": Array [ - 136, - 137, + 81, + 82, ], "type": "Punctuator", "value": "}", @@ -43176,230 +42996,194 @@ Object { } `; -exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 5, + "line": 1, }, }, - "name": "mBuffers", "range": Array [ - 26, - 34, + 5, + 11, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "TSNullKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, + }, + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 51, + "column": 16, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, + "name": "y", "range": Array [ - 26, - 75, + 17, + 29, ], - "static": false, - "type": "ClassProperty", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 50, + "column": 16, "line": 2, }, "start": Object { - "column": 10, + "column": 5, "line": 2, }, }, "range": Array [ - 34, - 74, + 18, + 29, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 50, + "column": 16, "line": 2, }, "start": Object { - "column": 12, + "column": 7, "line": 2, }, }, "range": Array [ - 36, - 74, + 20, + 29, ], - "type": "TSTypeReference", - "typeName": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "name": "interop", - "range": Array [ - 36, - 43, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 36, - 53, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "name": "Reference", - "range": Array [ - 44, - 53, - ], - "type": "Identifier", - }, - "type": "TSQualifiedName", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 2, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, - }, - }, - "range": Array [ - 54, - 57, - ], - "type": "TSAnyKeyword", - }, - ], - "range": Array [ - 53, - 74, - ], - "type": "TSTypeParameterInstantiation", - }, + "type": "TSUndefinedKeyword", }, }, - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 77, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, }, - "start": Object { - "column": 6, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "range": Array [ + 17, + 29, + ], + "type": "VariableDeclarator", }, - "name": "AudioBufferList", - "range": Array [ - 6, - 21, - ], - "type": "Identifier", - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 77, + 13, + 30, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 4, + "column": 17, + "line": 2, }, "start": Object { "column": 0, @@ -43408,14 +43192,14 @@ Object { }, "range": Array [ 0, - 78, + 30, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -43425,580 +43209,604 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 21, + 4, + 5, ], "type": "Identifier", - "value": "AudioBufferList", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 6, "line": 1, }, "start": Object { - "column": 22, + "column": 5, "line": 1, }, }, "range": Array [ - 22, - 23, + 5, + 6, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 26, - 34, - ], - "type": "Identifier", - "value": "mBuffers", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 34, - 35, + 7, + 11, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 36, - 43, + 11, + 12, ], - "type": "Identifier", - "value": "interop", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 3, "line": 2, }, "start": Object { - "column": 19, + "column": 0, "line": 2, }, }, "range": Array [ - 43, - 44, + 13, + 16, ], - "type": "Punctuator", - "value": ".", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 5, "line": 2, }, "start": Object { - "column": 20, + "column": 4, "line": 2, }, }, "range": Array [ - 44, - 53, + 17, + 18, ], "type": "Identifier", - "value": "Reference", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 6, "line": 2, }, "start": Object { - "column": 29, + "column": 5, "line": 2, }, }, "range": Array [ - 53, - 54, + 18, + 19, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 16, "line": 2, }, "start": Object { - "column": 30, + "column": 7, "line": 2, }, }, "range": Array [ - 54, - 57, + 20, + 29, ], "type": "Identifier", - "value": "any", + "value": "undefined", }, Object { "loc": Object { "end": Object { - "column": 50, + "column": 17, "line": 2, }, "start": Object { - "column": 49, + "column": 16, "line": 2, }, }, "range": Array [ - 73, - 74, + 29, + 30, ], "type": "Punctuator", - "value": ">", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 51, - "line": 2, - }, - "start": Object { - "column": 50, - "line": 2, + "expression": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 13, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 1, + 15, + ], + "type": "ObjectExpression", }, - "range": Array [ - 74, - 75, - ], - "type": "Punctuator", - "value": ";", - }, - Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 76, - 77, + 0, + 17, ], - "type": "Punctuator", - "value": "}", + "type": "ExpressionStatement", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/typed-this.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "properties": Array [ Object { "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 1, - "line": 2, + "column": 3, + "line": 3, }, }, - "name": "addClickListener", "range": Array [ - 23, - 39, + 22, + 26, ], - "type": "Identifier", + "raw": "'__'", + "type": "Literal", + "value": "__", }, + "kind": "init", "loc": Object { "end": Object { - "column": 65, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 1, - "line": 2, + "column": 3, + "line": 3, }, }, - "optional": false, - "params": Array [ - Object { + "method": true, + "range": Array [ + 22, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 57, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 18, - "line": 2, + "column": 10, + "line": 3, }, }, - "name": "onclick", "range": Array [ - 40, - 79, + 29, + 31, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "range": Array [ - 47, - 79, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 2, - }, - "start": Object { - "column": 27, - "line": 2, - }, - }, - "parameters": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "name": "this", - "range": Array [ - 50, - 60, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 54, - 60, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 34, - "line": 2, - }, - }, - "range": Array [ - 56, - 60, - ], - "type": "TSVoidKeyword", - }, - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 2, - }, - "start": Object { - "column": 40, - "line": 2, - }, - }, - "name": "e", - "range": Array [ - 62, - 70, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 2, - }, - "start": Object { - "column": 41, - "line": 2, - }, - }, - "range": Array [ - 63, - 70, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 2, - }, - "start": Object { - "column": 43, - "line": 2, - }, - }, - "range": Array [ - 65, - 70, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 2, - }, - "start": Object { - "column": 43, - "line": 2, - }, - }, - "name": "Event", - "range": Array [ - 65, - 70, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "range": Array [ - 49, - 79, - ], - "type": "TSFunctionType", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 2, - }, - "start": Object { - "column": 51, - "line": 2, - }, - }, - "range": Array [ - 73, - 79, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 2, - }, - "start": Object { - "column": 53, - "line": 2, - }, - }, - "range": Array [ - 75, - 79, - ], - "type": "TSVoidKeyword", - }, - }, - "typeParameters": null, - }, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, }, }, - ], + "params": Array [], + "range": Array [ + 26, + 31, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 20, + 33, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 19, + 35, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "method": false, "range": Array [ - 23, - 87, + 40, + 52, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 64, - "line": 2, + "column": 15, + "line": 5, }, "start": Object { - "column": 58, - "line": 2, + "column": 11, + "line": 5, }, }, "range": Array [ - 80, - 86, + 48, + 52, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 64, - "line": 2, - }, - "start": Object { - "column": 60, - "line": 2, - }, + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 38, + 54, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 37, + 56, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 79, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, }, - "range": Array [ - 82, - 86, - ], - "type": "TSVoidKeyword", }, + "range": Array [ + 75, + 79, + ], + "raw": "null", + "type": "Literal", + "value": null, }, }, ], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 23, + "line": 7, }, "start": Object { - "column": 20, - "line": 1, + "column": 8, + "line": 7, }, }, "range": Array [ - 20, - 89, + 66, + 81, ], - "type": "TSInterfaceBody", + "type": "ClassBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 7, + "line": 7, }, "start": Object { - "column": 10, - "line": 1, + "column": 6, + "line": 7, }, }, - "name": "UIElement", + "name": "X", "range": Array [ - 10, - 19, + 64, + 65, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 23, + "line": 7, }, "start": Object { "column": 0, - "line": 1, + "line": 7, }, }, "range": Array [ - 0, - 89, + 58, + 81, ], - "type": "TSInterfaceDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 8, }, "start": Object { "column": 0, @@ -44007,14 +43815,14 @@ Object { }, "range": Array [ 0, - 90, + 82, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 1, "line": 1, }, "start": Object { @@ -44024,277 +43832,295 @@ Object { }, "range": Array [ 0, - 9, + 1, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 2, "line": 1, }, "start": Object { - "column": 10, + "column": 1, "line": 1, }, }, "range": Array [ - 10, - 19, + 1, + 2, ], - "type": "Identifier", - "value": "UIElement", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 7, "line": 1, }, "start": Object { - "column": 20, + "column": 3, "line": 1, }, }, "range": Array [ - 20, - 21, + 3, + 7, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "'__'", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 1, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 23, - 39, + 7, + 8, ], - "type": "Identifier", - "value": "addClickListener", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 39, - 40, + 9, + 13, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 40, - 47, + 14, + 15, ], - "type": "Identifier", - "value": "onclick", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 25, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 47, - 48, + 15, + 16, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 27, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 49, - 50, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 28, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 50, - 54, + 19, + 20, ], - "type": "Keyword", - "value": "this", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 2, + "line": 3, }, "start": Object { - "column": 32, - "line": 2, + "column": 1, + "line": 3, }, }, "range": Array [ - 54, - 55, + 20, + 21, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 34, - "line": 2, + "column": 3, + "line": 3, }, }, "range": Array [ - 56, - 60, + 22, + 26, ], - "type": "Keyword", - "value": "void", + "type": "String", + "value": "'__'", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 38, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ - 60, - 61, + 26, + 27, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 40, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 62, - 63, + 27, + 28, ], - "type": "Identifier", - "value": "e", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 41, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 63, - 64, + 29, + 30, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 48, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 43, - "line": 2, + "column": 11, + "line": 3, }, }, "range": Array [ - 65, - 70, + 30, + 31, ], - "type": "Identifier", - "value": "Event", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 2, + "column": 14, + "line": 3, }, "start": Object { - "column": 48, - "line": 2, + "column": 13, + "line": 3, }, }, "range": Array [ - 70, - 71, + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, ], "type": "Punctuator", "value": ")", @@ -44302,435 +44128,521 @@ Object { Object { "loc": Object { "end": Object { - "column": 52, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 50, - "line": 2, + "column": 15, + "line": 3, }, }, "range": Array [ - 72, - 74, + 34, + 35, ], "type": "Punctuator", - "value": "=>", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 57, - "line": 2, + "column": 1, + "line": 5, }, "start": Object { - "column": 53, - "line": 2, + "column": 0, + "line": 5, }, }, "range": Array [ - 75, - 79, + 37, + 38, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 58, - "line": 2, + "column": 2, + "line": 5, }, "start": Object { - "column": 57, - "line": 2, + "column": 1, + "line": 5, }, }, "range": Array [ - 79, - 80, + 38, + 39, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 59, - "line": 2, + "column": 4, + "line": 5, }, "start": Object { - "column": 58, - "line": 2, + "column": 3, + "line": 5, }, }, "range": Array [ - 80, - 81, + 40, + 41, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 64, - "line": 2, + "column": 8, + "line": 5, }, "start": Object { - "column": 60, - "line": 2, + "column": 4, + "line": 5, }, }, "range": Array [ - 82, - 86, + 41, + 45, ], - "type": "Keyword", - "value": "void", + "type": "String", + "value": "'__'", }, Object { "loc": Object { "end": Object { - "column": 65, - "line": 2, + "column": 9, + "line": 5, }, "start": Object { - "column": 64, - "line": 2, + "column": 8, + "line": 5, }, }, "range": Array [ - 86, - 87, + 45, + 46, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 10, + "line": 5, }, "start": Object { - "column": 0, - "line": 3, + "column": 9, + "line": 5, }, }, "range": Array [ - 88, - 89, + 46, + 47, ], "type": "Punctuator", - "value": "}", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, }, - "name": "A", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", }, + "range": Array [ + 48, + 52, + ], + "type": "Keyword", + "value": "null", + }, + Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 17, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 16, + "line": 5, }, }, "range": Array [ - 0, - 23, + 53, + 54, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, }, - "operator": "unique", - "range": Array [ - 9, - 22, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 22, - ], - "type": "TSSymbolKeyword", + "start": Object { + "column": 17, + "line": 5, }, }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ")", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 24, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 5, + "line": 7, }, "start": Object { "column": 0, - "line": 1, + "line": 7, }, }, "range": Array [ - 0, - 4, + 58, + 63, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 7, + "line": 7, }, "start": Object { - "column": 5, - "line": 1, + "column": 6, + "line": 7, }, }, "range": Array [ - 5, - 6, + 64, + 65, ], "type": "Identifier", - "value": "A", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 9, + "line": 7, }, "start": Object { - "column": 7, - "line": 1, + "column": 8, + "line": 7, }, }, "range": Array [ - 7, - 8, + 66, + 67, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 14, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 10, + "line": 7, }, }, "range": Array [ - 9, - 15, + 68, + 72, ], - "type": "Identifier", - "value": "unique", + "type": "String", + "value": "'__'", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 7, }, "start": Object { - "column": 16, - "line": 1, + "column": 15, + "line": 7, }, }, "range": Array [ - 16, - 22, + 73, + 74, ], - "type": "Identifier", - "value": "symbol", + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 1, + "line": 7, }, "start": Object { "column": 22, - "line": 1, + "line": 7, }, }, "range": Array [ - 22, - 23, + 80, + 81, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/unknown-type-annotation.src 1`] = ` +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 42, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "test", + "range": Array [ + 9, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "abc", + "range": Array [ + 14, + 38, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, "line": 1, }, "start": Object { - "column": 4, + "column": 17, "line": 1, }, }, - "name": "foo", "range": Array [ - 4, - 16, + 17, + 38, ], - "type": "Identifier", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, + "column": 38, "line": 1, }, "start": Object { - "column": 7, + "column": 19, "line": 1, }, }, "range": Array [ - 7, - 16, + 19, + 38, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 9, + "column": 19, "line": 1, }, }, + "name": "Map", "range": Array [ - 9, - 16, + 19, + 22, ], - "type": "TSUnknownKeyword", + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "TSSymbolKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 22, + 38, + ], + "type": "TSTypeParameterInstantiation", }, }, }, - "init": null, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", }, ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, "range": Array [ 0, - 17, + 42, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 42, + "line": 1, }, "start": Object { "column": 0, @@ -44739,14 +44651,14 @@ Object { }, "range": Array [ 0, - 18, + 42, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -44756,896 +44668,947 @@ Object { }, "range": Array [ 0, - 3, + 8, ], "type": "Keyword", - "value": "let", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 4, + "column": 9, "line": 1, }, }, "range": Array [ - 4, - 7, + 9, + 13, ], "type": "Identifier", - "value": "foo", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 1, }, "start": Object { - "column": 7, + "column": 13, "line": 1, }, }, "range": Array [ - 7, - 8, + 13, + 14, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 9, + "column": 14, "line": 1, }, }, "range": Array [ - 9, - 16, + 14, + 17, ], "type": "Identifier", - "value": "unknown", + "value": "abc", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 18, ], "type": "Punctuator", - "value": ";", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/var-with-definite-assignment.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "definite": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 16, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, - ], - "type": "TSStringKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 17, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 19, "line": 1, }, }, "range": Array [ - 0, - 17, + 19, + 22, ], - "type": "VariableDeclaration", + "type": "Identifier", + "value": "Map", }, Object { - "declarations": Array [ - Object { - "definite": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "y", - "range": Array [ - 22, - 32, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 24, - 32, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "TSNumberKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 22, - 32, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 18, - 33, + 22, + 23, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "<", }, Object { - "declarations": Array [ - Object { - "definite": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "z", - "range": Array [ - 38, - 48, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 40, - 48, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 42, - 48, - ], - "type": "TSObjectKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 38, - 48, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 29, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 34, - 49, + 23, + 29, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "symbol", }, - }, - "range": Array [ - 0, - 50, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 30, "line": 1, }, "start": Object { - "column": 0, + "column": 29, "line": 1, }, }, "range": Array [ - 0, - 5, + 29, + 30, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 37, "line": 1, }, "start": Object { - "column": 6, + "column": 31, "line": 1, }, }, "range": Array [ - 6, - 7, + 31, + 37, ], "type": "Identifier", - "value": "x", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 38, "line": 1, }, "start": Object { - "column": 7, + "column": 37, "line": 1, }, }, "range": Array [ - 7, - 8, + 37, + 38, ], "type": "Punctuator", - "value": "!", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 39, "line": 1, }, "start": Object { - "column": 8, + "column": 38, "line": 1, }, }, "range": Array [ - 8, - 9, + 38, + 39, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 41, "line": 1, }, "start": Object { - "column": 10, + "column": 40, "line": 1, }, }, "range": Array [ - 10, - 16, + 40, + 41, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 42, "line": 1, }, "start": Object { - "column": 16, + "column": 41, "line": 1, }, }, "range": Array [ - 16, - 17, + 41, + 42, ], "type": "Punctuator", - "value": ";", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 37, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 18, - 21, + 0, + 37, ], - "type": "Keyword", - "value": "var", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 37, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 27, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 30, + 37, + ], + "type": "Identifier", + }, + }, + ], + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 14, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 22, - 23, + 0, + 4, ], "type": "Identifier", - "value": "y", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { "column": 5, - "line": 2, + "line": 1, }, }, "range": Array [ - 23, - 24, + 5, + 11, ], - "type": "Punctuator", - "value": "!", + "type": "Identifier", + "value": "Result", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 24, - 25, + 11, + 12, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 26, - 32, + 12, + 13, ], "type": "Identifier", - "value": "number", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 32, - 33, + 13, + 14, ], "type": "Punctuator", - "value": ";", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 15, + "line": 1, }, }, "range": Array [ - 34, - 37, + 15, + 16, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 38, - 39, + 17, + 24, ], "type": "Identifier", - "value": "z", + "value": "Success", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 39, - 40, + 24, + 25, ], "type": "Punctuator", - "value": "!", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 25, + "line": 1, }, }, "range": Array [ - 40, - 41, + 25, + 26, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 27, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 26, + "line": 1, }, }, "range": Array [ - 42, - 48, + 26, + 27, ], - "type": "Identifier", - "value": "object", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 29, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 28, + "line": 1, }, }, "range": Array [ - 48, - 49, + 28, + 29, ], "type": "Punctuator", - "value": ";", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "Identifier", + "value": "Failure", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 48, + ], + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 14, + "column": 38, "line": 1, }, "start": Object { - "column": 4, + "column": 28, "line": 1, }, }, - "name": "foo", "range": Array [ - 4, - 14, + 28, + 38, ], - "type": "Identifier", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 14, + "column": 35, "line": 1, }, "start": Object { - "column": 7, + "column": 28, "line": 1, }, }, + "name": "Success", "range": Array [ - 7, - 14, + 28, + 35, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, }, - "range": Array [ - 9, - 14, - ], - "type": "TSTypeReference", - "typeName": Object { - "left": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 12, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "B", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "type": "TSQualifiedName", - }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 14, + "column": 37, "line": 1, }, "start": Object { - "column": 9, + "column": 36, "line": 1, }, }, "range": Array [ - 9, - 14, + 36, + 37, ], - "right": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 14, + "column": 37, "line": 1, }, "start": Object { - "column": 13, + "column": 36, "line": 1, }, }, - "name": "C", + "name": "T", "range": Array [ - 13, - 14, + 36, + 37, ], "type": "Identifier", }, - "type": "TSQualifiedName", }, - }, + ], + "range": Array [ + 35, + 38, + ], + "type": "TSTypeParameterInstantiation", }, }, - "init": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, }, - "start": Object { - "column": 4, - "line": 1, + "range": Array [ + 41, + 48, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", }, }, - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + ], + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 22, + 24, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 24, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 25, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 48, + "line": 1, }, "start": Object { "column": 0, @@ -45654,14 +45617,14 @@ Object { }, "range": Array [ 0, - 16, + 48, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 4, "line": 1, }, "start": Object { @@ -45671,384 +45634,436 @@ Object { }, "range": Array [ 0, - 3, + 4, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 11, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, - 7, + 5, + 11, ], "type": "Identifier", - "value": "foo", + "value": "Result", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { - "column": 7, + "column": 11, "line": 1, }, }, "range": Array [ - 7, - 8, + 11, + 12, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 13, "line": 1, }, "start": Object { - "column": 9, + "column": 12, "line": 1, }, }, "range": Array [ - 9, - 10, + 12, + 13, ], "type": "Identifier", - "value": "A", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, ], "type": "Punctuator", - "value": ".", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 24, "line": 1, }, "start": Object { - "column": 11, + "column": 23, "line": 1, }, }, "range": Array [ - 11, - 12, + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 35, ], "type": "Identifier", - "value": "B", + "value": "Success", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 36, "line": 1, }, "start": Object { - "column": 12, + "column": 35, "line": 1, }, }, "range": Array [ - 12, - 13, + 35, + 36, ], "type": "Punctuator", - "value": ".", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 37, "line": 1, }, "start": Object { - "column": 13, + "column": 36, "line": 1, }, }, "range": Array [ - 13, - 14, + 36, + 37, ], "type": "Identifier", - "value": "C", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 38, "line": 1, }, "start": Object { - "column": 14, + "column": 37, "line": 1, }, }, "range": Array [ - 14, - 15, + 37, + 38, ], "type": "Punctuator", - "value": ";", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + "value": "Failure", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/var-with-type.src 1`] = ` +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 4, - 15, - ], - "type": "Identifier", - "typeAnnotation": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { "column": 15, "line": 1, }, "start": Object { - "column": 8, + "column": 12, "line": 1, }, }, + "name": "bar", "range": Array [ - 8, + 12, 15, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 15, - ], - "type": "TSStringKeyword", - }, + "type": "Identifier", }, - }, - "init": Object { "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { - "column": 18, + "column": 12, "line": 1, }, }, "range": Array [ - 18, - 28, - ], - "raw": "\\"Nicholas\\"", - "type": "Literal", - "value": "Nicholas", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 29, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 34, - 45, + 12, + 24, ], - "type": "Identifier", + "type": "TSPropertySignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 37, - 45, + 15, + 23, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 39, - 45, + 17, + 23, ], "type": "TSStringKeyword", }, }, }, - "init": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ - 48, - 53, + 25, + 28, ], - "raw": "\\"Bar\\"", - "type": "Literal", - "value": "Bar", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "type": "TSPropertySignature", }, - "range": Array [ - 34, - 53, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, + ], + "range": Array [ + 11, + 29, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 30, - 54, - ], - "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 2, }, "start": Object { "column": 0, @@ -46057,14 +46072,14 @@ Object { }, "range": Array [ 0, - 55, + 31, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 4, "line": 1, }, "start": Object { @@ -46074,51 +46089,33 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ 4, - 8, ], "type": "Identifier", - "value": "name", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { - "column": 8, + "column": 5, "line": 1, }, }, "range": Array [ + 5, 8, - 9, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 10, "line": 1, }, "start": Object { @@ -46128,187 +46125,151 @@ Object { }, "range": Array [ 9, - 15, + 10, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ - 16, - 17, + 11, + 12, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 15, "line": 1, }, "start": Object { - "column": 18, + "column": 12, "line": 1, }, }, "range": Array [ - 18, - 28, + 12, + 15, ], - "type": "String", - "value": "\\"Nicholas\\"", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 16, "line": 1, }, "start": Object { - "column": 28, + "column": 15, "line": 1, }, }, "range": Array [ - 28, - 29, + 15, + 16, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 30, - 33, - ], - "type": "Keyword", - "value": "var", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 34, - 37, + 17, + 23, ], "type": "Identifier", - "value": "foo", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 37, - 38, + 23, + 24, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ - 39, - 45, + 25, + 28, ], "type": "Identifier", - "value": "string", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 46, - 47, + 28, + 29, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 48, - 53, - ], - "type": "String", - "value": "\\"Bar\\"", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 53, - 54, + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -46318,104 +46279,302 @@ Object { } `; -exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` +exports[`typescript fixtures/basics/type-guard.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "operator": "typeof", + "prefix": true, + "range": Array [ + 52, + 60, + ], + "type": "UnaryExpression", }, - }, - "name": "x", - "range": Array [ - 4, - 21, - ], - "type": "Identifier", - "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 11, + "line": 2, }, }, + "operator": "===", "range": Array [ - 8, - 21, + 52, + 73, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "right": Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 15, - 21, + 65, + 73, ], - "type": "TSStringKeyword", + "raw": "'string'", + "type": "Literal", + "value": "string", }, + "type": "BinaryExpression", }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "range": Array [ + 45, + 73, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 1, }, - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + }, + "range": Array [ + 39, + 75, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "isString", + "range": Array [ + 9, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], "range": Array [ 0, - 22, + 75, ], - "type": "VariableDeclaration", + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "range": Array [ + 27, + 38, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -46424,14 +46583,14 @@ Object { }, "range": Array [ 0, - 22, + 75, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -46441,249 +46600,205 @@ Object { }, "range": Array [ 0, - 3, + 8, ], "type": "Keyword", - "value": "let", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 17, "line": 1, }, "start": Object { - "column": 4, + "column": 9, "line": 1, }, }, "range": Array [ - 4, - 5, + 9, + 17, ], "type": "Identifier", - "value": "x", + "value": "isString", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { - "column": 8, + "column": 17, "line": 1, }, }, "range": Array [ - 8, - 9, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 15, + "column": 18, "line": 1, }, }, "range": Array [ - 15, - 21, + 18, + 19, ], "type": "Identifier", - "value": "string", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 20, "line": 1, }, "start": Object { - "column": 21, + "column": 19, "line": 1, }, }, "range": Array [ - 21, - 22, + 19, + 20, ], "type": "Punctuator", - "value": ";", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/declare/abstract-class.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 27, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, }, - "range": Array [ - 27, - 31, - ], - "type": "ClassBody", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, + "start": Object { + "column": 21, + "line": 1, }, - "name": "Foo", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "any", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 0, + "column": 24, "line": 1, }, }, "range": Array [ - 0, - 31, + 24, + 25, ], - "superClass": null, - "type": "TSAbstractClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ")", }, - }, - "range": Array [ - 0, - 32, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 26, "line": 1, }, "start": Object { - "column": 0, + "column": 25, "line": 1, }, }, "range": Array [ - 0, - 7, + 25, + 26, ], - "type": "Identifier", - "value": "declare", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 28, "line": 1, }, "start": Object { - "column": 8, + "column": 27, "line": 1, }, }, "range": Array [ - 8, - 16, + 27, + 28, ], "type": "Identifier", - "value": "abstract", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 31, "line": 1, }, "start": Object { - "column": 17, + "column": 29, "line": 1, }, }, "range": Array [ - 17, - 22, + 29, + 31, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "is", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 38, "line": 1, }, "start": Object { - "column": 23, + "column": 32, "line": 1, }, }, "range": Array [ - 23, - 26, + 32, + 38, ], "type": "Identifier", - "value": "Foo", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 40, "line": 1, }, "start": Object { - "column": 27, + "column": 39, "line": 1, }, }, "range": Array [ - 27, - 28, + 39, + 40, ], "type": "Punctuator", "value": "{", @@ -46691,172 +46806,92 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 10, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 4, + "line": 2, }, }, "range": Array [ - 30, - 31, + 45, + 51, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "return", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/declare/class.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 22, - ], - "type": "ClassBody", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 0, - 22, + 52, + 58, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "typeof", }, - }, - "range": Array [ - 0, - 23, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 0, - 7, + 59, + 60, ], "type": "Identifier", - "value": "declare", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 8, - 13, + 61, + 64, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "===", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 14, - 17, + 65, + 73, ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "'string'", }, Object { "loc": Object { @@ -46870,8 +46905,8 @@ Object { }, }, "range": Array [ - 21, - 22, + 74, + 75, ], "type": "Punctuator", "value": "}", @@ -46881,122 +46916,344 @@ Object { } `; -exports[`typescript fixtures/declare/enum.src 1`] = ` +exports[`typescript fixtures/basics/type-parameters-comments.src 1`] = ` Object { "body": Array [ Object { - "declare": true, - "id": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 16, + "column": 42, "line": 1, }, "start": Object { - "column": 13, + "column": 0, "line": 1, }, }, - "name": "Foo", "range": Array [ - 13, - 16, + 0, + 42, ], - "type": "Identifier", + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 3, + 40, + ], + "type": "TSTypeParameterInstantiation", + }, }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 43, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "members": Array [ - Object { - "id": Object { + "range": Array [ + 0, + 43, + ], + "type": "ExpressionStatement", + }, + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 40, + "line": 2, + }, + }, + "range": Array [ + 84, + 87, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 44, + 87, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 7, + "column": 25, "line": 2, }, "start": Object { - "column": 4, + "column": 24, "line": 2, }, }, - "name": "Bar", + "name": "A", "range": Array [ - 23, - 26, + 68, + 69, ], - "type": "Identifier", + "type": "TSTypeParameter", }, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + ], + "range": Array [ + 56, + 81, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 46, + "line": 3, }, - "range": Array [ - 23, - 26, - ], - "type": "TSEnumMember", }, - Object { - "id": Object { + "range": Array [ + 134, + 137, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "baz", + "range": Array [ + 97, + 100, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 88, + 137, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "params": Array [ + Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "range": Array [ + 126, + 129, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 126, + 129, + ], + "type": "Identifier", + }, + }, "loc": Object { "end": Object { - "column": 7, + "column": 41, "line": 3, }, "start": Object { - "column": 4, + "column": 24, "line": 3, }, }, - "name": "Baz", + "name": "A", "range": Array [ - 32, - 35, + 112, + 129, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "type": "TSTypeParameter", }, - "range": Array [ - 32, - 35, - ], - "type": "TSEnumMember", - }, - ], - "range": Array [ - 0, - 37, - ], - "type": "TSEnumDeclaration", + ], + "range": Array [ + 100, + 131, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -47005,14 +47262,14 @@ Object { }, "range": Array [ 0, - 38, + 138, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { @@ -47022,304 +47279,223 @@ Object { }, "range": Array [ 0, - 7, + 3, ], "type": "Identifier", - "value": "declare", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 4, "line": 1, }, "start": Object { - "column": 8, + "column": 3, "line": 1, }, }, "range": Array [ - 8, - 12, + 3, + 4, ], - "type": "Keyword", - "value": "enum", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 13, + "column": 21, "line": 1, }, }, "range": Array [ - 13, - 16, + 21, + 22, ], "type": "Identifier", - "value": "Foo", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 40, "line": 1, }, "start": Object { - "column": 17, + "column": 39, "line": 1, }, }, "range": Array [ - 17, - 18, + 39, + 40, ], "type": "Punctuator", - "value": "{", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 41, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 40, + "line": 1, }, }, "range": Array [ - 23, - 26, + 40, + 41, ], - "type": "Identifier", - "value": "Bar", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 42, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 41, + "line": 1, }, }, "range": Array [ - 26, - 27, + 41, + 42, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 43, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 42, + "line": 1, }, }, "range": Array [ - 32, - 35, + 42, + 43, ], - "type": "Identifier", - "value": "Baz", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 8, + "line": 2, }, "start": Object { "column": 0, - "line": 4, + "line": 2, }, }, "range": Array [ - 36, - 37, + 44, + 52, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "function", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/declare/function.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "declare": true, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 2, }, }, - "params": Array [], "range": Array [ - 0, - 28, + 53, + 56, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 28, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 28, - ], - "type": "TSVoidKeyword", - }, - }, - "type": "TSDeclareFunction", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "bar", }, - }, - "range": Array [ - 0, - 29, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 0, - 7, + 56, + 57, ], - "type": "Identifier", - "value": "declare", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 8, - 16, + 68, + 69, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 37, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 36, + "line": 2, }, }, "range": Array [ - 17, - 20, + 80, + 81, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 38, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 37, + "line": 2, }, }, "range": Array [ - 20, - 21, + 81, + 82, ], "type": "Punctuator", "value": "(", @@ -47327,17 +47503,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 39, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 38, + "line": 2, }, }, "range": Array [ - 21, - 22, + 82, + 83, ], "type": "Punctuator", "value": ")", @@ -47345,356 +47521,215 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 41, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 40, + "line": 2, }, }, "range": Array [ - 22, - 23, + 84, + 85, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 43, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 42, + "line": 2, }, }, "range": Array [ - 24, - 28, + 86, + 87, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/declare/interface.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 26, - ], - "type": "TSInterfaceBody", - }, - "declare": true, - "heritage": Array [], - "id": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 3, }, "start": Object { "column": 0, - "line": 1, + "line": 3, }, }, "range": Array [ - 0, - 26, + 88, + 96, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "function", }, - }, - "range": Array [ - 0, - 27, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 3, }, }, "range": Array [ - 0, - 7, + 97, + 100, ], "type": "Identifier", - "value": "declare", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 12, + "line": 3, }, }, "range": Array [ - 8, - 17, + 100, + 101, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 25, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 24, + "line": 3, }, }, "range": Array [ - 18, - 21, + 112, + 113, ], "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "{", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 37, "line": 3, }, "start": Object { - "column": 0, + "column": 36, "line": 3, }, }, "range": Array [ - 25, - 26, + 124, + 125, ], "type": "Punctuator", - "value": "}", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/declare/module.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 23, - ], - "type": "TSModuleBlock", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, + "column": 41, "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 38, + "line": 3, }, }, "range": Array [ - 0, - 23, + 126, + 129, ], - "type": "TSModuleDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "Foo", }, - }, - "range": Array [ - 0, - 24, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 43, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 42, + "line": 3, }, }, "range": Array [ - 0, - 7, + 130, + 131, ], - "type": "Identifier", - "value": "declare", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 44, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 43, + "line": 3, }, }, "range": Array [ - 8, - 14, + 131, + 132, ], - "type": "Identifier", - "value": "module", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 45, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 44, + "line": 3, }, }, "range": Array [ - 15, - 18, + 132, + 133, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 47, + "line": 3, }, "start": Object { - "column": 19, - "line": 1, + "column": 46, + "line": 3, }, }, "range": Array [ - 19, - 20, + 134, + 135, ], "type": "Punctuator", "value": "{", @@ -47702,17 +47737,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, + "column": 49, "line": 3, }, "start": Object { - "column": 0, + "column": 48, "line": 3, }, }, "range": Array [ - 22, - 23, + 136, + 137, ], "type": "Punctuator", "value": "}", @@ -47722,84 +47757,246 @@ Object { } `; -exports[`typescript fixtures/declare/namespace.src 1`] = ` +exports[`typescript fixtures/basics/type-reference-comments.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 26, - ], - "type": "TSModuleBlock", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "type": "TSModuleDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "mBuffers", + "range": Array [ + 26, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 51, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 26, + 75, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 34, + 74, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 74, + ], + "type": "TSTypeReference", + "typeName": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "interop", + "range": Array [ + 36, + 43, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 53, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "name": "Reference", + "range": Array [ + 44, + 53, + ], + "type": "Identifier", + }, + "type": "TSQualifiedName", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 53, + 74, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 77, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "AudioBufferList", + "range": Array [ + 6, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 77, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, }, "range": Array [ 0, - 27, + 78, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -47809,64 +48006,208 @@ Object { }, "range": Array [ 0, - 7, + 5, ], - "type": "Identifier", - "value": "declare", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 6, "line": 1, }, }, "range": Array [ - 8, - 17, + 6, + 21, ], "type": "Identifier", - "value": "namespace", + "value": "AudioBufferList", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 18, + "column": 22, "line": 1, }, }, "range": Array [ - 18, - 21, + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, ], "type": "Identifier", - "value": "Foo", + "value": "mBuffers", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 22, - 23, + 34, + 35, ], "type": "Punctuator", - "value": "{", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "Identifier", + "value": "interop", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 44, + 53, + ], + "type": "Identifier", + "value": "Reference", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 49, + "line": 2, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 2, + }, + "start": Object { + "column": 50, + "line": 2, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { @@ -47880,8 +48221,8 @@ Object { }, }, "range": Array [ - 25, - 26, + 76, + 77, ], "type": "Punctuator", "value": "}", @@ -47891,32 +48232,31 @@ Object { } `; -exports[`typescript fixtures/declare/type-alias.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` Object { "body": Array [ Object { - "declare": true, "id": Object { "loc": Object { "end": Object { - "column": 16, + "column": 8, "line": 1, }, "start": Object { - "column": 13, + "column": 5, "line": 1, }, }, "name": "Foo", "range": Array [ - 13, - 16, + 5, + 8, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 25, + "column": 17, "line": 1, }, "start": Object { @@ -47926,25 +48266,25 @@ Object { }, "range": Array [ 0, - 25, + 17, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, + "column": 17, "line": 1, }, "start": Object { - "column": 19, + "column": 11, "line": 1, }, }, "range": Array [ - 19, - 25, + 11, + 17, ], - "type": "TSStringKeyword", + "type": "TSBigIntKeyword", }, }, ], @@ -47960,14 +48300,14 @@ Object { }, "range": Array [ 0, - 26, + 18, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { @@ -47977,25 +48317,7 @@ Object { }, "range": Array [ 0, - 7, - ], - "type": "Identifier", - "value": "declare", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 12, + 4, ], "type": "Identifier", "value": "type", @@ -48003,17 +48325,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 8, "line": 1, }, "start": Object { - "column": 13, + "column": 5, "line": 1, }, }, "range": Array [ - 13, - 16, + 5, + 8, ], "type": "Identifier", "value": "Foo", @@ -48021,17 +48343,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 10, "line": 1, }, "start": Object { - "column": 17, + "column": 9, "line": 1, }, }, "range": Array [ - 17, - 18, + 9, + 10, ], "type": "Punctuator", "value": "=", @@ -48039,107 +48361,51 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 17, "line": 1, }, "start": Object { - "column": 19, + "column": 11, "line": 1, }, }, "range": Array [ - 19, - 25, + 11, + 17, ], "type": "Identifier", - "value": "string", + "value": "bigint", }, ], "type": "Program", } `; -exports[`typescript fixtures/declare/variable.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 12, - 20, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 20, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 20, - ], - "type": "TSAnyKeyword", - }, - }, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, }, - "init": null, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "start": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 12, - 20, - ], - "type": "VariableDeclarator", }, - ], - "declare": true, - "kind": "var", + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 21, + "column": 18, "line": 1, }, "start": Object { @@ -48149,9 +48415,26 @@ Object { }, "range": Array [ 0, - 21, + 18, ], - "type": "VariableDeclaration", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 18, + ], + "type": "TSBooleanKeyword", + }, }, ], "loc": Object { @@ -48166,14 +48449,14 @@ Object { }, "range": Array [ 0, - 22, + 19, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { @@ -48183,375 +48466,96 @@ Object { }, "range": Array [ 0, - 7, + 4, ], "type": "Identifier", - "value": "declare", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { "column": 8, "line": 1, }, - }, - "range": Array [ - 8, - 11, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, "start": Object { - "column": 12, + "column": 5, "line": 1, }, }, "range": Array [ - 12, - 15, + 5, + 8, ], "type": "Identifier", - "value": "foo", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 16, + 9, + 10, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { - "column": 17, + "column": 11, "line": 1, }, }, "range": Array [ - 17, - 20, + 11, + 18, ], "type": "Identifier", - "value": "any", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ";", + "value": "boolean", }, ], "type": "Program", } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 32, - 37, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "configurable", - "range": Array [ - 19, - 31, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 19, - 38, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 18, - 38, - ], - "type": "Decorator", - }, - ], - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "name": "x", - "range": Array [ - 47, - 48, - ], - "type": "Identifier", - }, - "kind": "get", - "loc": Object { - "end": Object { - "column": 31, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 18, - 70, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "range": Array [ - 60, - 64, - ], - "type": "ThisExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 26, - "line": 3, - }, - }, - "name": "_x", - "range": Array [ - 65, - 67, - ], - "type": "Identifier", - }, - "range": Array [ - 60, - 67, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 53, - 68, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 31, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 51, - 70, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 31, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "params": Array [], - "range": Array [ - 48, - 70, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 72, - ], - "type": "ClassBody", - }, "id": Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, - "name": "Point", + "name": "Foo", "range": Array [ - 6, - 11, + 5, + 8, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 16, + "line": 1, }, "start": Object { "column": 0, @@ -48560,16 +48564,51 @@ Object { }, "range": Array [ 0, - 72, + 16, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSLiteralType", + }, }, ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -48578,14 +48617,14 @@ Object { }, "range": Array [ 0, - 72, + 17, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { @@ -48595,685 +48634,692 @@ Object { }, "range": Array [ 0, - 5, + 4, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ - 6, - 11, + 5, + 8, ], "type": "Identifier", - "value": "Point", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, "line": 1, }, "start": Object { - "column": 12, + "column": 9, "line": 1, }, }, "range": Array [ - 12, - 13, + 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 18, - 19, + 11, + 16, ], - "type": "Punctuator", - "value": "@", + "type": "Boolean", + "value": "false", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, }, "range": Array [ - 19, - 31, + 0, + 16, ], - "type": "Identifier", - "value": "configurable", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSNeverKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 31, - 32, + 0, + 4, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 32, - 37, + 5, + 8, ], - "type": "Boolean", - "value": "false", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 37, - 38, + 9, + 10, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 43, - 46, + 11, + 16, ], "type": "Identifier", - "value": "get", + "value": "never", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "TSNullKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { "column": 8, - "line": 3, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, }, }, "range": Array [ - 47, - 48, + 5, + 8, ], "type": "Identifier", - "value": "x", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 3, + "line": 1, }, "start": Object { "column": 9, - "line": 3, + "line": 1, }, }, "range": Array [ - 48, - 49, + 9, + 10, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 49, - 50, + 11, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "null", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 12, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 51, - 52, + 0, + 17, ], - "type": "Punctuator", - "value": "{", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSNumberKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 53, - 59, + 0, + 4, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 3, + "column": 8, + "line": 1, }, "start": Object { - "column": 21, - "line": 3, + "column": 5, + "line": 1, }, }, "range": Array [ - 60, - 64, + 5, + 8, ], - "type": "Keyword", - "value": "this", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 25, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 64, - 65, + 9, + 10, ], "type": "Punctuator", - "value": ".", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 26, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 65, - 67, + 11, + 17, ], "type": "Identifier", - "value": "_x", + "value": "number", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 28, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 67, - 68, + 0, + 17, ], - "type": "Punctuator", - "value": ";", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSObjectKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 31, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { - "column": 30, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 69, - 70, + 0, + 4, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 8, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 5, + "line": 1, }, }, "range": Array [ - 71, - 72, + 5, + 8, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Foo", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "baz", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 25, - 34, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 30, - 34, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, - }, - ], - "range": Array [ - 23, - 36, - ], - "type": "ObjectExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 19, - 37, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 18, - 37, - ], - "type": "Decorator", - }, - ], - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 53, - 56, - ], - "type": "Identifier", - }, - "kind": "get", - "loc": Object { - "end": Object { - "column": 42, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 18, - 80, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 30, - "line": 3, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 3, - }, - "start": Object { - "column": 30, - "line": 3, - }, - }, - "range": Array [ - 68, - 72, - ], - "type": "ThisExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 35, - "line": 3, - }, - }, - "name": "_bar", - "range": Array [ - 73, - 77, - ], - "type": "Identifier", - }, - "range": Array [ - 68, - 77, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 40, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, - }, - "range": Array [ - 61, - 78, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "range": Array [ - 59, - 80, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 42, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "params": Array [], - "range": Array [ - 56, - 80, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, }, - "range": Array [ - 12, - 82, - ], - "type": "ClassBody", }, + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + "value": "object", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` +Object { + "body": Array [ + Object { "id": Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, - "name": "Other", + "name": "Foo", "range": Array [ - 6, - 11, + 5, + 8, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 17, + "line": 1, }, "start": Object { "column": 0, @@ -49282,16 +49328,32 @@ Object { }, "range": Array [ 0, - 82, + 17, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSStringKeyword", + }, }, ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -49300,14 +49362,14 @@ Object { }, "range": Array [ 0, - 82, + 18, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { @@ -49317,449 +49379,835 @@ Object { }, "range": Array [ 0, - 5, + 4, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ - 6, - 11, + 5, + 8, ], "type": "Identifier", - "value": "Other", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, "line": 1, }, "start": Object { - "column": 12, + "column": 9, "line": 1, }, }, "range": Array [ - 12, - 13, + 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 18, - 19, + 11, + 17, ], - "type": "Punctuator", - "value": "@", + "type": "Identifier", + "value": "string", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 19, - 22, + 0, + 17, ], - "type": "Identifier", - "value": "foo", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSSymbolKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 22, - 23, + 0, + 4, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 23, - 24, + 5, + 8, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 25, - 28, + 9, + 10, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 28, - 29, + 11, + 17, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "symbol", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 30, - 34, + 0, + 15, ], - "type": "Boolean", - "value": "true", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "TSLiteralType", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 21, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 35, - 36, + 0, + 4, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 36, - 37, + 5, + 8, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 3, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 42, - 48, + 9, + 10, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { "column": 11, - "line": 3, + "line": 1, }, }, "range": Array [ - 49, - 52, + 11, + 15, ], - "type": "Identifier", - "value": "get", + "type": "Boolean", + "value": "true", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 53, - 56, + 0, + 20, ], - "type": "Identifier", - "value": "bar", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 20, + ], + "type": "TSUndefinedKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { - "column": 18, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 56, - 57, + 0, + 4, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 8, + "line": 1, }, "start": Object { - "column": 19, - "line": 3, + "column": 5, + "line": 1, }, }, "range": Array [ - 57, - 58, + 5, + 8, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 21, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 59, - 60, + 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 23, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 61, - 67, + 11, + 20, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "undefined", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 34, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 30, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 68, - 72, + 0, + 18, ], - "type": "Keyword", - "value": "this", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 18, + ], + "type": "TSUnknownKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 35, - "line": 3, + "column": 4, + "line": 1, }, "start": Object { - "column": 34, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 72, - 73, + 0, + 4, ], - "type": "Punctuator", - "value": ".", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 3, + "column": 8, + "line": 1, }, "start": Object { - "column": 35, - "line": 3, + "column": 5, + "line": 1, }, }, "range": Array [ - 73, - 77, + 5, + 8, ], "type": "Identifier", - "value": "_bar", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 39, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 77, - 78, + 9, + 10, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 41, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 79, - 80, + 11, + 18, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "unknown", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 15, + "line": 1, }, "start": Object { "column": 0, - "line": 4, + "line": 1, }, }, "range": Array [ - 81, - 82, + 0, + 15, ], - "type": "Punctuator", - "value": "}", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "TSVoidKeyword", + }, }, ], - "type": "Program", + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "Keyword", + "value": "void", + }, + ], + "type": "Program", } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/basics/typed-this.src 1`] = ` Object { "body": Array [ Object { @@ -49767,229 +50215,329 @@ Object { "body": Array [ Object { "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "hidden", - "range": Array [ - 15, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 21, - ], - "type": "Decorator", - }, - ], "key": Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 8, - "line": 3, + "column": 1, + "line": 2, }, }, - "name": "z", + "name": "addClickListener", "range": Array [ - 30, - 31, + 23, + 39, ], "type": "Identifier", }, - "kind": "get", "loc": Object { "end": Object { - "column": 31, - "line": 3, + "column": 65, + "line": 2, }, "start": Object { - "column": 4, + "column": 1, "line": 2, }, }, - "range": Array [ - 14, - 53, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "onclick", + "range": Array [ + 40, + 79, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 47, + 79, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, }, - "object": Object { + "start": Object { + "column": 27, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { - "column": 25, - "line": 3, + "column": 38, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 28, + "line": 2, }, }, + "name": "this", "range": Array [ - 43, - 47, + 50, + 60, ], - "type": "ThisExpression", + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 54, + 60, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 56, + 60, + ], + "type": "TSVoidKeyword", + }, + }, }, - "property": Object { + Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 48, + "line": 2, }, "start": Object { - "column": 26, - "line": 3, + "column": 40, + "line": 2, }, }, - "name": "_z", + "name": "e", "range": Array [ - 48, - 50, + 62, + 70, ], "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 63, + 70, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 65, + 70, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "name": "Event", + "range": Array [ + 65, + 70, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 49, + 79, + ], + "type": "TSFunctionType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 51, + "line": 2, + }, }, "range": Array [ - 43, - 50, + 73, + 79, ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "range": Array [ + 75, + 79, + ], + "type": "TSVoidKeyword", }, }, - "range": Array [ - 36, - 51, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 31, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, + "typeParameters": null, }, }, - "range": Array [ - 34, - 53, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": null, + ], + "range": Array [ + 23, + 87, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 3, + "column": 64, + "line": 2, }, "start": Object { - "column": 9, - "line": 3, + "column": 58, + "line": 2, }, }, - "params": Array [], "range": Array [ - 31, - 53, + 80, + 86, ], - "type": "FunctionExpression", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 2, + }, + "start": Object { + "column": 60, + "line": 2, + }, + }, + "range": Array [ + 82, + 86, + ], + "type": "TSVoidKeyword", + }, }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { - "column": 8, + "column": 20, "line": 1, }, }, "range": Array [ - 8, - 55, + 20, + 89, ], - "type": "ClassBody", + "type": "TSInterfaceBody", }, + "heritage": Array [], "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 19, "line": 1, }, "start": Object { - "column": 6, + "column": 10, "line": 1, }, }, - "name": "P", + "name": "UIElement", "range": Array [ - 6, - 7, + 10, + 19, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 0, @@ -49998,15 +50546,14 @@ Object { }, "range": Array [ 0, - 55, + 89, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "TSInterfaceDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, + "column": 0, "line": 4, }, "start": Object { @@ -50016,14 +50563,14 @@ Object { }, "range": Array [ 0, - 55, + 90, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { @@ -50033,43 +50580,43 @@ Object { }, "range": Array [ 0, - 5, + 9, ], "type": "Keyword", - "value": "class", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 19, "line": 1, }, "start": Object { - "column": 6, + "column": 10, "line": 1, }, }, "range": Array [ - 6, - 7, + 10, + 19, ], "type": "Identifier", - "value": "P", + "value": "UIElement", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 20, "line": 1, }, }, "range": Array [ - 8, - 9, + 20, + 21, ], "type": "Punctuator", "value": "{", @@ -50077,107 +50624,233 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 17, "line": 2, }, "start": Object { - "column": 4, + "column": 1, "line": 2, }, }, "range": Array [ - 14, - 15, - ], + 23, + 39, + ], + "type": "Identifier", + "value": "addClickListener", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], "type": "Punctuator", - "value": "@", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 25, "line": 2, }, "start": Object { - "column": 5, + "column": 18, "line": 2, }, }, "range": Array [ - 15, - 21, + 40, + 47, ], "type": "Identifier", - "value": "hidden", + "value": "onclick", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 26, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 25, + "line": 2, }, }, "range": Array [ - 26, - 29, + 47, + 48, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 28, + "line": 2, }, "start": Object { - "column": 8, - "line": 3, + "column": 27, + "line": 2, }, }, "range": Array [ - 30, - 31, + 49, + 50, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 50, + 54, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 56, + 60, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 40, + "line": 2, + }, + }, + "range": Array [ + 62, + 63, ], "type": "Identifier", - "value": "z", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 42, + "line": 2, }, "start": Object { - "column": 9, - "line": 3, + "column": 41, + "line": 2, }, }, "range": Array [ - 31, - 32, + 63, + 64, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 48, + "line": 2, }, "start": Object { - "column": 10, - "line": 3, + "column": 43, + "line": 2, }, }, "range": Array [ - 32, - 33, + 65, + 70, + ], + "type": "Identifier", + "value": "Event", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 2, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 70, + 71, ], "type": "Punctuator", "value": ")", @@ -50185,107 +50858,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 52, + "line": 2, }, "start": Object { - "column": 12, - "line": 3, + "column": 50, + "line": 2, }, }, "range": Array [ - 34, - 35, + 72, + 74, ], "type": "Punctuator", - "value": "{", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 57, + "line": 2, }, "start": Object { - "column": 14, - "line": 3, + "column": 53, + "line": 2, }, }, "range": Array [ - 36, - 42, + 75, + 79, ], "type": "Keyword", - "value": "return", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 3, + "column": 58, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 57, + "line": 2, }, }, "range": Array [ - 43, - 47, + 79, + 80, ], - "type": "Keyword", - "value": "this", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 3, + "column": 59, + "line": 2, }, "start": Object { - "column": 25, - "line": 3, + "column": 58, + "line": 2, }, }, "range": Array [ - 47, - 48, + 80, + 81, ], "type": "Punctuator", - "value": ".", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 64, + "line": 2, }, "start": Object { - "column": 26, - "line": 3, + "column": 60, + "line": 2, }, }, "range": Array [ - 48, - 50, + 82, + 86, ], - "type": "Identifier", - "value": "_z", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 65, + "line": 2, }, "start": Object { - "column": 28, - "line": 3, + "column": 64, + "line": 2, }, }, "range": Array [ - 50, - 51, + 86, + 87, ], "type": "Punctuator", "value": ";", @@ -50293,330 +50966,310 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 1, "line": 3, }, "start": Object { - "column": 30, + "column": 0, "line": 3, }, }, "range": Array [ - 52, - 53, + 88, + 89, ], "type": "Punctuator", "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/unique-symbol.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 23, + "line": 1, }, "start": Object { "column": 0, - "line": 4, + "line": 1, }, }, "range": Array [ - 54, - 55, + 0, + 23, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "operator": "unique", + "range": Array [ + 9, + 22, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "TSSymbolKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, ], "type": "Punctuator", - "value": "}", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "Identifier", + "value": "unique", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Identifier", + "value": "symbol", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/basics/unknown-type-annotation.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "adminonly", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 27, - ], - "type": "Decorator", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 16, ], - "key": Object { + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { "column": 16, - "line": 3, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 7, + "line": 1, }, }, - "name": "y", "range": Array [ - 43, - 44, + 7, + 16, ], - "type": "Identifier", - }, - "kind": "set", - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 76, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 58, - 62, - ], - "type": "ThisExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "name": "_y", - "range": Array [ - 63, - 65, - ], - "type": "Identifier", - }, - "range": Array [ - 58, - 65, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "operator": "=", - "range": Array [ - 58, - 69, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "name": "a", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 58, - 70, - ], - "type": "ExpressionStatement", - }, - ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 20, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 48, - 76, + 9, + 16, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 3, - }, + "type": "TSUnknownKeyword", }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 17, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 44, - 76, - ], - "type": "FunctionExpression", }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 78, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", }, - "name": "User", - "range": Array [ - 6, - 10, - ], - "type": "Identifier", - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 17, + "line": 1, }, "start": Object { "column": 0, @@ -50625,16 +51278,15 @@ Object { }, "range": Array [ 0, - 78, + 17, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -50643,14 +51295,14 @@ Object { }, "range": Array [ 0, - 78, + 18, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -50660,313 +51312,485 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 10, + 4, + 7, ], "type": "Identifier", - "value": "User", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 8, "line": 1, }, "start": Object { - "column": 11, + "column": 7, "line": 1, }, }, "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 18, + 7, + 8, ], "type": "Punctuator", - "value": "@", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 18, - 27, + 9, + 16, ], "type": "Identifier", - "value": "adminonly", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "Keyword", - "value": "static", + "value": "unknown", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 16, + "line": 1, }, }, "range": Array [ - 39, - 42, + 16, + 17, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/var-with-definite-assignment.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, + "declarations": Array [ + Object { + "definite": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "type": "TSStringKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 43, - 44, ], - "type": "Identifier", - "value": "y", - }, - Object { + "kind": "const", "loc": Object { "end": Object { "column": 17, - "line": 3, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 44, - 45, + 0, + 17, ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 17, - "line": 3, - }, - }, - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - "value": "a", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "definite": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 22, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 32, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 15, + "line": 2, }, "start": Object { - "column": 18, - "line": 3, + "column": 0, + "line": 2, }, }, "range": Array [ - 46, - 47, + 18, + 33, ], - "type": "Punctuator", - "value": ")", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "definite": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "z", + "range": Array [ + 38, + 48, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSObjectKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 38, + 48, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 21, + "column": 15, "line": 3, }, "start": Object { - "column": 20, + "column": 0, "line": 3, }, }, "range": Array [ - 48, + 34, 49, ], - "type": "Punctuator", - "value": "{", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 5, + "line": 1, }, "start": Object { - "column": 8, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 58, - 62, + 0, + 5, ], "type": "Keyword", - "value": "this", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 7, + "line": 1, }, "start": Object { - "column": 12, - "line": 4, + "column": 6, + "line": 1, }, }, "range": Array [ - 62, - 63, + 6, + 7, ], - "type": "Punctuator", - "value": ".", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 8, + "line": 1, }, "start": Object { - "column": 13, - "line": 4, + "column": 7, + "line": 1, }, }, "range": Array [ - 63, - 65, + 7, + 8, ], - "type": "Identifier", - "value": "_y", + "type": "Punctuator", + "value": "!", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 9, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 8, + "line": 1, }, }, "range": Array [ - 66, - 67, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 16, + "line": 1, }, "start": Object { - "column": 18, - "line": 4, + "column": 10, + "line": 1, }, }, "range": Array [ - 68, - 69, + 10, + 16, ], "type": "Identifier", - "value": "a", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 4, + "column": 17, + "line": 1, }, "start": Object { - "column": 19, - "line": 4, + "column": 16, + "line": 1, }, }, "range": Array [ - 69, - 70, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -50974,445 +51798,393 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 3, + "line": 2, }, "start": Object { - "column": 4, - "line": 5, + "column": 0, + "line": 2, }, }, "range": Array [ - 75, - 76, + 18, + 21, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 5, + "line": 2, }, "start": Object { - "column": 0, - "line": 6, + "column": 4, + "line": 2, }, }, "range": Array [ - 77, - 78, + 22, + 23, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "y", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/decorators/class-decorators/class-decorator.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "ClassBody", - }, - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "sealed", - "range": Array [ - 1, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 7, - ], - "type": "Decorator", - }, - ], - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "name": "Qux", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 12, + "column": 6, "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 0, - 20, + 23, + 24, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "!", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 0, - 1, + 24, + 25, ], "type": "Punctuator", - "value": "@", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 1, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 1, - 7, + 26, + 32, ], "type": "Identifier", - "value": "sealed", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 15, "line": 2, }, "start": Object { - "column": 0, + "column": 14, "line": 2, }, }, "range": Array [ - 8, - 13, + 32, + 33, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 3, + "line": 3, }, "start": Object { - "column": 6, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 14, - 17, + 34, + 37, ], - "type": "Identifier", - "value": "Qux", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 5, + "line": 3, }, "start": Object { - "column": 10, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 18, - 19, + 38, + 39, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 6, + "line": 3, }, "start": Object { - "column": 11, - "line": 2, + "column": 5, + "line": 3, }, }, "range": Array [ - 19, - 20, + 39, + 40, ], "type": "Punctuator", - "value": "}", + "value": "!", }, - ], - "type": "Program", -} -`; + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Identifier", + "value": "object", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; -exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.src 1`] = ` +exports[`typescript fixtures/basics/var-with-dotted-type.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 19, - "line": 4, - }, - }, - "range": Array [ - 56, - 58, - ], - "type": "ClassBody", - }, - "decorators": Array [ + "declarations": Array [ Object { - "expression": Object { - "arguments": Array [ - Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 14, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "range": Array [ + 9, + 14, + ], + "type": "TSTypeReference", + "typeName": Object { + "left": Object { + "left": Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, - "name": "selector", + "name": "A", "range": Array [ - 17, - 25, + 9, + 10, ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, - "method": false, "range": Array [ - 17, - 32, + 9, + 12, ], - "shorthand": false, - "type": "Property", - "value": Object { + "right": Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 11, + "line": 1, }, }, + "name": "B", "range": Array [ - 27, - 32, + 11, + 12, ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", + "type": "Identifier", }, + "type": "TSQualifiedName", }, - ], - "range": Array [ - 11, - 35, - ], - "type": "ObjectExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "type": "TSQualifiedName", }, }, - "name": "Component", - "range": Array [ - 1, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "start": Object { - "column": 1, - "line": 1, - }, }, - "range": Array [ - 1, - 36, - ], - "type": "CallExpression", }, + "init": null, "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 0, + "column": 4, "line": 1, }, }, "range": Array [ - 0, - 36, + 4, + 14, ], - "type": "Decorator", + "type": "VariableDeclarator", }, ], - "id": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "name": "FooComponent", - "range": Array [ - 43, - 55, - ], - "type": "Identifier", - }, + "kind": "var", "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 15, + "line": 1, }, "start": Object { "column": 0, @@ -51421,16 +52193,15 @@ Object { }, "range": Array [ 0, - 58, + 15, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -51439,14 +52210,14 @@ Object { }, "range": Array [ 0, - 58, + 16, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -51456,466 +52227,384 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "@", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, - 10, + 4, + 7, ], "type": "Identifier", - "value": "Component", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 10, + "column": 7, "line": 1, }, }, "range": Array [ - 10, - 11, + 7, + 8, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 25, + 9, + 10, ], "type": "Identifier", - "value": "selector", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 27, - 32, - ], - "type": "String", - "value": "'foo'", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 32, - 33, + 10, + 11, ], "type": "Punctuator", - "value": ",", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 34, - 35, + 11, + 12, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 13, + "line": 1, }, "start": Object { - "column": 1, - "line": 3, + "column": 12, + "line": 1, }, }, "range": Array [ - 35, - 36, + 12, + 13, ], "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 37, - 42, - ], - "type": "Keyword", - "value": "class", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 14, + "line": 1, }, "start": Object { - "column": 6, - "line": 4, + "column": 13, + "line": 1, }, }, "range": Array [ - 43, - 55, + 13, + 14, ], "type": "Identifier", - "value": "FooComponent", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "start": Object { - "column": 19, - "line": 4, - }, - }, - "range": Array [ - 56, - 57, - ], - "type": "Punctuator", - "value": "{", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 15, + "line": 1, }, "start": Object { - "column": 20, - "line": 4, + "column": 14, + "line": 1, }, }, "range": Array [ - 57, - 58, + 14, + 15, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = ` +exports[`typescript fixtures/basics/var-with-type.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 24, - 29, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "onlyRead", - "range": Array [ - 15, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 15, - 30, - ], - "type": "CallExpression", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 4, + 15, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, }, + }, + "range": Array [ + 8, + 15, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 14, - 30, + 9, + 15, ], - "type": "Decorator", + "type": "TSStringKeyword", }, - ], - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + }, + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, }, - "name": "instanceMethod", - "range": Array [ - 35, - 49, - ], - "type": "Identifier", }, - "kind": "method", + "range": Array [ + 18, + 28, + ], + "raw": "\\"Nicholas\\"", + "type": "Literal", + "value": "Nicholas", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 15, + "line": 2, }, "start": Object { "column": 4, "line": 2, }, }, + "name": "foo", "range": Array [ - 14, - 54, + 34, + 45, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 37, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 15, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 9, + "line": 2, }, }, "range": Array [ - 52, - 54, + 39, + 45, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, + "type": "TSStringKeyword", }, - "params": Array [], - "range": Array [ - 49, - 54, - ], - "type": "FunctionExpression", }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 56, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 48, + 53, + ], + "raw": "\\"Bar\\"", + "type": "Literal", + "value": "Bar", }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "range": Array [ + 34, + 53, + ], + "type": "VariableDeclarator", }, - "name": "B", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 24, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 56, + 30, + 54, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 3, }, "start": Object { "column": 0, @@ -51924,14 +52613,14 @@ Object { }, "range": Array [ 0, - 57, + 55, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -51941,28 +52630,28 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 8, ], "type": "Identifier", - "value": "B", + "value": "name", }, Object { "loc": Object { @@ -51980,409 +52669,292 @@ Object { 9, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 14, + 9, 15, ], - "type": "Punctuator", - "value": "@", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 15, - 23, + 16, + 17, ], - "type": "Identifier", - "value": "onlyRead", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 23, - 24, + 18, + 28, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "\\"Nicholas\\"", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 24, + 28, 29, ], - "type": "Boolean", - "value": "false", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 3, "line": 2, }, "start": Object { - "column": 19, + "column": 0, "line": 2, }, }, "range": Array [ - 29, 30, + 33, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 7, + "line": 2, }, "start": Object { "column": 4, - "line": 3, + "line": 2, }, }, "range": Array [ - 35, - 49, + 34, + 37, ], "type": "Identifier", - "value": "instanceMethod", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 8, + "line": 2, }, "start": Object { - "column": 18, - "line": 3, + "column": 7, + "line": 2, }, }, "range": Array [ - 49, - 50, + 37, + 38, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 15, + "line": 2, }, "start": Object { - "column": 19, - "line": 3, + "column": 9, + "line": 2, }, }, "range": Array [ - 50, - 51, + 39, + 45, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ - 52, - 53, + 46, + 47, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 3, + "line": 2, }, "start": Object { - "column": 22, - "line": 3, + "column": 18, + "line": 2, }, }, "range": Array [ + 48, 53, - 54, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"Bar\\"", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 24, + "line": 2, }, "start": Object { - "column": 0, - "line": 4, + "column": 23, + "line": 2, }, }, "range": Array [ - 55, - 56, + 53, + 54, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = ` +exports[`typescript fixtures/basics/variable-declaration-type-annotation-spacing.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 24, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 15, - 25, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 25, - ], - "type": "Decorator", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, + }, + "name": "x", + "range": Array [ + 4, + 21, ], - "key": Object { + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 8, + "line": 1, }, }, - "name": "staticMethod", "range": Array [ - 37, - 49, + 8, + 21, ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 54, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 26, - "line": 3, + "column": 15, + "line": 1, }, }, "range": Array [ - 52, - 54, + 15, + 21, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, + "type": "TSStringKeyword", }, - "params": Array [], - "range": Array [ - 49, - 54, - ], - "type": "FunctionExpression", }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 56, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", }, - "name": "C", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 22, + "line": 1, }, "start": Object { "column": 0, @@ -52391,16 +52963,15 @@ Object { }, "range": Array [ 0, - 56, + 22, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 22, + "line": 1, }, "start": Object { "column": 0, @@ -52409,14 +52980,14 @@ Object { }, "range": Array [ 0, - 57, + 22, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -52426,28 +52997,28 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 5, ], "type": "Identifier", - "value": "C", + "value": "x", }, Object { "loc": Object { @@ -52465,184 +53036,210 @@ Object { 9, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "@", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ 15, - 18, + 21, ], "type": "Identifier", - "value": "Foo", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/abstract-class.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 1, + }, }, - "start": Object { - "column": 9, - "line": 2, + "range": Array [ + 27, + 31, + ], + "type": "ClassBody", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", }, - "range": Array [ - 19, - 24, - ], - "type": "Boolean", - "value": "false", - }, - Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 14, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 24, - 25, + 0, + 31, ], - "type": "Punctuator", - "value": ")", + "superClass": null, + "type": "TSAbstractClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 7, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 30, - 36, + 0, + 7, ], - "type": "Keyword", - "value": "static", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 8, + "line": 1, }, }, "range": Array [ - 37, - 49, + 8, + 16, ], "type": "Identifier", - "value": "staticMethod", + "value": "abstract", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 23, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 49, - 50, + 17, + 22, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 24, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 50, - 51, + 23, + 26, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 26, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 52, - 53, + 27, + 28, ], "type": "Punctuator", "value": "{", @@ -52650,197 +53247,216 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 1, "line": 3, }, "start": Object { - "column": 27, + "column": 0, "line": 3, }, }, "range": Array [ - 53, - 54, + 30, + 31, ], "type": "Punctuator", "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/class.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "ClassBody", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 0, - "line": 4, + "line": 1, }, }, "range": Array [ - 55, - 56, + 0, + 22, ], - "type": "Punctuator", - "value": "}", + "superClass": null, + "type": "ClassDeclaration", }, ], - "type": "Program", -} + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/declare/enum.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "onlyRead", - "range": Array [ - 15, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 23, - ], - "type": "Decorator", - }, - ], - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "instanceMethod", - "range": Array [ - 28, - 42, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 47, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "range": Array [ - 45, - 47, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "params": Array [], - "range": Array [ - 42, - 47, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 49, - ], - "type": "ClassBody", - }, + "declare": true, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 16, "line": 1, }, "start": Object { - "column": 6, + "column": 13, "line": 1, }, }, - "name": "A", + "name": "Foo", "range": Array [ - 6, - 7, + 13, + 16, ], "type": "Identifier", }, @@ -52854,12 +53470,83 @@ Object { "line": 1, }, }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "Bar", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "Baz", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "TSEnumMember", + }, + ], "range": Array [ 0, - 49, + 37, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "TSEnumDeclaration", }, ], "loc": Object { @@ -52874,14 +53561,14 @@ Object { }, "range": Array [ 0, - 50, + 38, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -52891,33 +53578,15 @@ Object { }, "range": Array [ 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, 7, ], "type": "Identifier", - "value": "A", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 12, "line": 1, }, "start": Object { @@ -52927,136 +53596,100 @@ Object { }, "range": Array [ 8, - 9, + 12, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "@", - }, - Object { - "loc": Object { - "end": Object { "column": 13, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, + "line": 1, }, }, "range": Array [ - 15, - 23, + 13, + 16, ], "type": "Identifier", - "value": "onlyRead", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 18, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 28, - 42, - ], - "type": "Identifier", - "value": "instanceMethod", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, + "line": 1, }, "start": Object { - "column": 18, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 42, - 43, + 17, + 18, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 7, + "line": 2, }, "start": Object { - "column": 19, - "line": 3, + "column": 4, + "line": 2, }, }, "range": Array [ - 43, - 44, + 23, + 26, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 3, + "column": 8, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 7, + "line": 2, }, }, "range": Array [ - 45, - 46, + 26, + 27, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 7, "line": 3, }, "start": Object { - "column": 22, + "column": 4, "line": 3, }, }, "range": Array [ - 46, - 47, + 32, + 35, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Baz", }, Object { "loc": Object { @@ -53070,8 +53703,8 @@ Object { }, }, "range": Array [ - 48, - 49, + 36, + 37, ], "type": "Punctuator", "value": "}", @@ -53081,184 +53714,88 @@ Object { } `; -exports[`typescript fixtures/decorators/method-decorators/method-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/declare/function.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "Foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 18, - ], - "type": "Decorator", - }, - ], - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, - }, - "name": "staticMethod", - "range": Array [ - 30, - 42, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 47, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 26, - "line": 3, - }, - }, - "range": Array [ - 45, - 47, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 23, - "line": 3, - }, - }, - "params": Array [], - "range": Array [ - 42, - 47, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 49, - ], - "type": "ClassBody", - }, + "async": false, + "declare": true, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 20, "line": 1, }, "start": Object { - "column": 6, + "column": 17, "line": 1, }, }, - "name": "D", + "name": "foo", "range": Array [ - 6, - 7, + 17, + 20, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 28, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 49, + 28, ], - "superClass": null, - "type": "ClassDeclaration", + "returnType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSDeclareFunction", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 2, }, "start": Object { "column": 0, @@ -53267,14 +53804,14 @@ Object { }, "range": Array [ 0, - 50, + 29, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -53284,205 +53821,285 @@ Object { }, "range": Array [ 0, - 5, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, ], "type": "Keyword", - "value": "class", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 20, "line": 1, }, "start": Object { - "column": 6, + "column": 17, "line": 1, }, }, "range": Array [ - 6, - 7, + 17, + 20, ], "type": "Identifier", - "value": "D", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 20, "line": 1, }, }, "range": Array [ - 8, - 9, + 20, + 21, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 14, - 15, + 21, + 22, ], "type": "Punctuator", - "value": "@", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 15, - 18, + 22, + 23, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 23, - 29, + 24, + 28, ], "type": "Keyword", - "value": "static", + "value": "void", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/interface.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "TSInterfaceBody", + }, + "declare": true, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 23, + "column": 1, "line": 3, }, "start": Object { - "column": 11, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 30, - 42, + 0, + 26, ], - "type": "Identifier", - "value": "staticMethod", + "type": "TSInterfaceDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 24, - "line": 3, + "column": 7, + "line": 1, }, "start": Object { - "column": 23, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 42, - 43, + 0, + 7, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 24, - "line": 3, + "column": 8, + "line": 1, }, }, "range": Array [ - 43, - 44, + 8, + 17, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 26, - "line": 3, + "column": 18, + "line": 1, }, }, "range": Array [ - 45, - 46, + 18, + 21, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { - "column": 27, - "line": 3, + "column": 22, + "line": 1, }, }, "range": Array [ - 46, - 47, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 0, - "line": 4, + "line": 3, }, }, "range": Array [ - 48, - 49, + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -53492,417 +54109,51 @@ Object { } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` +exports[`typescript fixtures/declare/module.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "constructor", - "range": Array [ - 20, - 31, - ], - "type": "Identifier", - }, - "kind": "constructor", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 20, - 113, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 81, - 85, - ], - "type": "ThisExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "name": "title", - "range": Array [ - 86, - 91, - ], - "type": "Identifier", - }, - "range": Array [ - 81, - 91, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "operator": "=", - "range": Array [ - 81, - 106, - ], - "right": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 33, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 3, - }, - }, - "name": "config", - "range": Array [ - 94, - 100, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 3, - }, - }, - "name": "title", - "range": Array [ - 101, - 106, - ], - "type": "Identifier", - }, - "range": Array [ - 94, - 106, - ], - "type": "MemberExpression", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 81, - 107, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 55, - "line": 2, - }, - }, - "range": Array [ - 71, - 113, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "params": Array [ - Object { - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "name": "APP_CONFIG", - "range": Array [ - 40, - 50, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "Inject", - "range": Array [ - 33, - 39, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 33, - 51, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 32, - 51, - ], - "type": "Decorator", - }, - ], - "loc": Object { - "end": Object { - "column": 53, - "line": 2, - }, - "start": Object { - "column": 36, - "line": 2, - }, - }, - "name": "config", - "range": Array [ - 52, - 69, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 2, - }, - "start": Object { - "column": 42, - "line": 2, - }, - }, - "range": Array [ - 58, - 69, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 2, - }, - "start": Object { - "column": 44, - "line": 2, - }, - }, - "range": Array [ - 60, - 69, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 2, - }, - "start": Object { - "column": 44, - "line": 2, - }, - }, - "name": "AppConfig", - "range": Array [ - 60, - 69, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "range": Array [ - 31, - 113, - ], - "type": "FunctionExpression", - }, - }, - ], + "body": Array [], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { - "column": 14, + "column": 19, "line": 1, }, }, "range": Array [ - 14, - 115, + 19, + 23, ], - "type": "ClassBody", + "type": "TSModuleBlock", }, + "declare": true, "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 18, "line": 1, }, "start": Object { - "column": 6, + "column": 15, "line": 1, }, }, - "name": "Service", + "name": "Foo", "range": Array [ - 6, - 13, + 15, + 18, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { "column": 0, @@ -53911,16 +54162,15 @@ Object { }, "range": Array [ 0, - 115, + 23, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "TSModuleDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 4, }, "start": Object { "column": 0, @@ -53929,14 +54179,14 @@ Object { }, "range": Array [ 0, - 116, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -53946,449 +54196,650 @@ Object { }, "range": Array [ 0, - 5, + 7, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "range": Array [ - 6, - 13, + 8, + 14, ], "type": "Identifier", - "value": "Service", + "value": "module", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, + 18, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ + 19, 20, - 31, ], - "type": "Identifier", - "value": "constructor", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 31, - 32, + 22, + 23, ], "type": "Punctuator", - "value": "(", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/namespace.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, }, - "start": Object { - "column": 16, - "line": 2, + "range": Array [ + 22, + 26, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "@", - }, - Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 33, - 39, + 0, + 26, ], - "type": "Identifier", - "value": "Inject", + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 7, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 39, - 40, + 0, + 7, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 40, - 50, + 8, + 17, ], "type": "Identifier", - "value": "APP_CONFIG", + "value": "namespace", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 34, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 50, - 51, + 18, + 21, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 36, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 52, - 58, + 22, + 23, ], - "type": "Identifier", - "value": "config", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 42, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 58, - 59, + 25, + 26, ], "type": "Punctuator", - "value": ":", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/type-alias.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { "end": Object { - "column": 53, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 44, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 60, - 69, + 0, + 25, ], - "type": "Identifier", - "value": "AppConfig", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 54, - "line": 2, + "column": 7, + "line": 1, }, "start": Object { - "column": 53, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 69, - 70, + 0, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 55, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 71, - 72, + 8, + 12, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 13, + "line": 1, }, }, "range": Array [ - 81, - 85, + 13, + 16, ], - "type": "Keyword", - "value": "this", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 12, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 85, - 86, + 17, + 18, ], "type": "Punctuator", - "value": ".", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 13, - "line": 3, + "column": 19, + "line": 1, }, }, "range": Array [ - 86, - 91, + 19, + 25, ], "type": "Identifier", - "value": "title", + "value": "string", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/declare/variable.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 12, + 20, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "TSAnyKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 20, + ], + "type": "VariableDeclarator", + }, + ], + "declare": true, + "kind": "var", "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 19, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 92, - 93, + 0, + 21, ], - "type": "Punctuator", - "value": "=", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 7, + "line": 1, }, "start": Object { - "column": 21, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 94, - 100, + 0, + 7, ], "type": "Identifier", - "value": "config", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 11, + "line": 1, }, "start": Object { - "column": 27, - "line": 3, + "column": 8, + "line": 1, }, }, "range": Array [ - 100, - 101, + 8, + 11, ], - "type": "Punctuator", - "value": ".", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 28, - "line": 3, + "column": 12, + "line": 1, }, }, "range": Array [ - 101, - 106, + 12, + 15, ], "type": "Identifier", - "value": "title", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 33, - "line": 3, + "column": 15, + "line": 1, }, }, "range": Array [ - 106, - 107, + 15, + 16, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 17, + "line": 1, }, }, "range": Array [ - 112, - 113, + 17, + 20, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 21, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 20, + "line": 1, }, }, "range": Array [ - 114, - 115, + 20, + 21, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = ` Object { "body": Array [ Object { @@ -54396,29 +54847,104 @@ Object { "body": Array [ Object { "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 32, + 37, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "configurable", + "range": Array [ + 19, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 38, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 38, + ], + "type": "Decorator", + }, + ], "key": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 3, }, }, - "name": "bar", + "name": "x", "range": Array [ - 16, - 19, + 47, + 48, ], "type": "Identifier", }, - "kind": "method", + "kind": "get", "loc": Object { "end": Object { - "column": 38, - "line": 2, + "column": 31, + "line": 3, }, "start": Object { "column": 4, @@ -54426,176 +54952,119 @@ Object { }, }, "range": Array [ - 16, - 50, + 18, + 70, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 36, - "line": 2, - }, - }, - "range": Array [ - 48, - 50, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "params": Array [ - Object { - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 29, - 33, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "special", - "range": Array [ - 21, - 28, - ], - "type": "Identifier", + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, }, + }, + "object": Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 25, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 21, + "line": 3, }, }, "range": Array [ - 21, - 34, + 60, + 64, ], - "type": "CallExpression", + "type": "ThisExpression", }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, + "property": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, }, + "name": "_x", + "range": Array [ + 65, + 67, + ], + "type": "Identifier", }, "range": Array [ - 20, - 34, + 60, + 67, ], - "type": "Decorator", - }, - ], - "loc": Object { - "end": Object { - "column": 34, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, + "type": "MemberExpression", }, - }, - "name": "baz", - "range": Array [ - 35, - 46, - ], - "type": "Identifier", - "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 29, + "line": 3, }, "start": Object { - "column": 26, - "line": 2, + "column": 14, + "line": 3, }, }, "range": Array [ - 38, - 46, + 53, + 68, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 40, - 46, - ], - "type": "TSNumberKeyword", - }, + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, }, }, - ], + "range": Array [ + 51, + 70, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "params": Array [], "range": Array [ - 19, - 50, + 48, + 70, ], "type": "FunctionExpression", }, @@ -54604,23 +55073,23 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { - "column": 10, + "column": 12, "line": 1, }, }, "range": Array [ - 10, - 52, + 12, + 72, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { @@ -54628,17 +55097,17 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "Point", "range": Array [ 6, - 9, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -54647,7 +55116,7 @@ Object { }, "range": Array [ 0, - 52, + 72, ], "superClass": null, "type": "ClassDeclaration", @@ -54655,7 +55124,7 @@ Object { ], "loc": Object { "end": Object { - "column": 0, + "column": 1, "line": 4, }, "start": Object { @@ -54665,7 +55134,7 @@ Object { }, "range": Array [ 0, - 53, + 72, ], "sourceType": "script", "tokens": Array [ @@ -54690,7 +55159,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { @@ -54700,25 +55169,25 @@ Object { }, "range": Array [ 6, - 9, + 11, ], "type": "Identifier", - "value": "Foo", + "value": "Point", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 10, + "column": 12, "line": 1, }, }, "range": Array [ - 10, - 11, + 12, + 13, ], "type": "Punctuator", "value": "{", @@ -54726,7 +55195,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 2, }, "start": Object { @@ -54735,224 +55204,278 @@ Object { }, }, "range": Array [ - 16, + 18, 19, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "@", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 17, "line": 2, }, "start": Object { - "column": 7, + "column": 5, "line": 2, }, }, "range": Array [ 19, - 20, + 31, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "configurable", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 2, }, "start": Object { - "column": 8, + "column": 17, "line": 2, }, }, "range": Array [ - 20, - 21, + 31, + 32, ], "type": "Punctuator", - "value": "@", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 2, }, "start": Object { - "column": 9, + "column": 18, "line": 2, }, }, "range": Array [ - 21, - 28, + 32, + 37, ], - "type": "Identifier", - "value": "special", + "type": "Boolean", + "value": "false", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 2, }, "start": Object { - "column": 16, + "column": 23, "line": 2, }, }, "range": Array [ - 28, - 29, + 37, + 38, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 29, - 33, + 43, + 46, ], - "type": "Boolean", - "value": "true", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 21, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 33, - 34, + 47, + 48, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 23, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 35, - 38, + 49, + 50, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 13, + "line": 3, }, "start": Object { - "column": 26, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 38, - 39, + 51, + 52, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 20, + "line": 3, }, "start": Object { - "column": 28, - "line": 2, + "column": 14, + "line": 3, }, }, "range": Array [ - 40, - 46, + 53, + 59, ], - "type": "Identifier", - "value": "number", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 25, + "line": 3, }, "start": Object { - "column": 34, - "line": 2, + "column": 21, + "line": 3, }, }, "range": Array [ - 46, - 47, + 60, + 64, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, ], "type": "Punctuator", - "value": ")", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 28, + "line": 3, }, "start": Object { - "column": 36, - "line": 2, + "column": 26, + "line": 3, }, }, "range": Array [ - 48, - 49, + 65, + 67, + ], + "type": "Identifier", + "value": "_x", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 67, + 68, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 2, + "column": 31, + "line": 3, }, "start": Object { - "column": 37, - "line": 2, + "column": 30, + "line": 3, }, }, "range": Array [ - 49, - 50, + 69, + 70, ], "type": "Punctuator", "value": "}", @@ -54961,16 +55484,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 4, }, }, "range": Array [ - 51, - 52, + 71, + 72, ], "type": "Punctuator", "value": "}", @@ -54980,7 +55503,7 @@ Object { } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = ` Object { "body": Array [ Object { @@ -54988,206 +55511,282 @@ Object { "body": Array [ Object { "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 29, - 32, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 22, - 63, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 43, - "line": 2, - }, - }, - "range": Array [ - 61, - 63, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "params": Array [ - Object { - "decorators": Array [ + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ Object { - "expression": Object { - "arguments": Array [ - Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 28, + "column": 14, "line": 2, }, "start": Object { - "column": 24, + "column": 11, "line": 2, }, }, + "name": "baz", "range": Array [ - 42, - 46, + 25, + 28, ], - "raw": "true", - "type": "Literal", - "value": true, + "type": "Identifier", }, - ], - "callee": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 2, }, "start": Object { - "column": 16, + "column": 11, "line": 2, }, }, - "name": "special", + "method": false, "range": Array [ + 25, 34, - 41, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 30, + 34, + ], + "raw": "true", + "type": "Literal", + "value": true, }, }, - "range": Array [ - 34, - 47, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, + ], "range": Array [ - 33, - 47, + 23, + 36, ], - "type": "Decorator", - }, - ], - "loc": Object { - "end": Object { - "column": 41, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, + "type": "ObjectExpression", }, - }, - "name": "baz", - "range": Array [ - 48, - 59, ], - "type": "Identifier", - "typeAnnotation": Object { + "callee": Object { "loc": Object { "end": Object { - "column": 41, + "column": 8, "line": 2, }, "start": Object { - "column": 33, + "column": 5, "line": 2, }, }, + "name": "foo", "range": Array [ - 51, - 59, + 19, + 22, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 19, + 37, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 37, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 53, + 56, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 18, + 80, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, "loc": Object { "end": Object { - "column": 41, - "line": 2, + "column": 39, + "line": 3, }, "start": Object { - "column": 35, - "line": 2, + "column": 30, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 68, + 72, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 35, + "line": 3, + }, }, + "name": "_bar", + "range": Array [ + 73, + 77, + ], + "type": "Identifier", }, "range": Array [ - 53, - 59, + 68, + 77, ], - "type": "TSNumberKeyword", + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, }, + "range": Array [ + 61, + 78, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, }, }, - ], + "range": Array [ + 59, + 80, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "params": Array [], "range": Array [ - 32, - 63, + 56, + 80, ], "type": "FunctionExpression", }, @@ -55196,23 +55795,23 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, "range": Array [ - 16, - 65, + 12, + 82, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -55220,17 +55819,17 @@ Object { "line": 1, }, }, - "name": "StaticFoo", + "name": "Other", "range": Array [ 6, - 15, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -55239,7 +55838,7 @@ Object { }, "range": Array [ 0, - 65, + 82, ], "superClass": null, "type": "ClassDeclaration", @@ -55247,7 +55846,7 @@ Object { ], "loc": Object { "end": Object { - "column": 0, + "column": 1, "line": 4, }, "start": Object { @@ -55257,7 +55856,7 @@ Object { }, "range": Array [ 0, - 66, + 82, ], "sourceType": "script", "tokens": Array [ @@ -55282,7 +55881,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -55292,25 +55891,25 @@ Object { }, "range": Array [ 6, - 15, + 11, ], "type": "Identifier", - "value": "StaticFoo", + "value": "Other", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, "range": Array [ - 16, - 17, + 12, + 13, ], "type": "Punctuator", "value": "{", @@ -55318,7 +55917,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 5, "line": 2, }, "start": Object { @@ -55327,44 +55926,44 @@ Object { }, }, "range": Array [ - 22, - 28, + 18, + 19, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "@", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 2, }, "start": Object { - "column": 11, + "column": 5, "line": 2, }, }, "range": Array [ - 29, - 32, + 19, + 22, ], "type": "Identifier", - "value": "bar", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 2, }, "start": Object { - "column": 14, + "column": 8, "line": 2, }, }, "range": Array [ - 32, - 33, + 22, + 23, ], "type": "Punctuator", "value": "(", @@ -55372,71 +55971,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 2, }, "start": Object { - "column": 15, + "column": 9, "line": 2, }, }, "range": Array [ - 33, - 34, + 23, + 24, ], "type": "Punctuator", - "value": "@", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 14, "line": 2, }, "start": Object { - "column": 16, + "column": 11, "line": 2, }, }, "range": Array [ - 34, - 41, + 25, + 28, ], "type": "Identifier", - "value": "special", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 15, "line": 2, }, "start": Object { - "column": 23, + "column": 14, "line": 2, }, }, "range": Array [ - 41, - 42, + 28, + 29, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 20, "line": 2, }, "start": Object { - "column": 24, + "column": 16, "line": 2, }, }, "range": Array [ - 42, - 46, + 30, + 34, ], "type": "Boolean", "value": "true", @@ -55444,183 +56043,346 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 22, "line": 2, }, "start": Object { - "column": 28, + "column": 21, "line": 2, }, }, "range": Array [ - 46, - 47, + 35, + 36, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 23, "line": 2, }, "start": Object { - "column": 30, + "column": 22, "line": 2, }, }, "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 42, 48, - 51, ], - "type": "Identifier", - "value": "baz", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 14, + "line": 3, }, "start": Object { - "column": 33, - "line": 2, + "column": 11, + "line": 3, }, }, "range": Array [ - 51, + 49, 52, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 2, + "column": 18, + "line": 3, }, "start": Object { - "column": 35, - "line": 2, + "column": 15, + "line": 3, }, }, "range": Array [ 53, - 59, + 56, ], "type": "Identifier", - "value": "number", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 2, + "column": 19, + "line": 3, }, "start": Object { - "column": 41, - "line": 2, + "column": 18, + "line": 3, }, }, "range": Array [ - 59, - 60, + 56, + 57, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 2, + "column": 20, + "line": 3, }, "start": Object { - "column": 43, - "line": 2, + "column": 19, + "line": 3, }, }, "range": Array [ - 61, - 62, + 57, + 58, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 2, + "column": 22, + "line": 3, }, "start": Object { - "column": 44, - "line": 2, + "column": 21, + "line": 3, }, }, "range": Array [ - 62, - 63, + 59, + 60, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 29, "line": 3, }, "start": Object { - "column": 0, + "column": 23, "line": 3, }, }, "range": Array [ - 64, - 65, + 61, + 67, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "return", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-instance-member.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 68, + 72, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 3, + }, + "start": Object { + "column": 34, + "line": 3, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 35, + "line": 3, + }, + }, + "range": Array [ + 73, + 77, + ], + "type": "Identifier", + "value": "_bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 41, + "line": 3, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "hidden", + "range": Array [ + 15, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Decorator", + }, + ], + "key": Object { "loc": Object { "end": Object { "column": 9, - "line": 2, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 3, }, }, - "name": "greet", + "name": "z", "range": Array [ - 20, - 25, + 30, + 31, ], "type": "Identifier", }, - "kind": "method", + "kind": "get", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 31, + "line": 3, }, "start": Object { "column": 4, @@ -55628,8 +56390,8 @@ Object { }, }, "range": Array [ - 20, - 95, + 14, + 53, ], "static": false, "type": "MethodDefinition", @@ -55639,127 +56401,88 @@ Object { "body": Array [ Object { "argument": Object { - "left": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 67, - 75, - ], - "raw": "\\"Hello \\"", - "type": "Literal", - "value": "Hello ", + "computed": false, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, }, + }, + "object": Object { "loc": Object { "end": Object { - "column": 30, + "column": 25, "line": 3, }, "start": Object { - "column": 15, + "column": 21, "line": 3, }, }, - "operator": "+", "range": Array [ - 67, - 82, + 43, + 47, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 3, - }, - "start": Object { - "column": 26, - "line": 3, - }, - }, - "name": "name", - "range": Array [ - 78, - 82, - ], - "type": "Identifier", - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, + "type": "ThisExpression", }, - "operator": "+", - "range": Array [ - 67, - 88, - ], - "right": Object { + "property": Object { "loc": Object { "end": Object { - "column": 36, + "column": 28, "line": 3, }, "start": Object { - "column": 33, + "column": 26, "line": 3, }, }, + "name": "_z", "range": Array [ - 85, - 88, + 48, + 50, ], - "raw": "\\"!\\"", - "type": "Literal", - "value": "!", + "type": "Identifier", }, - "type": "BinaryExpression", + "range": Array [ + 43, + 50, + ], + "type": "MemberExpression", }, "loc": Object { "end": Object { - "column": 37, + "column": 29, "line": 3, }, "start": Object { - "column": 8, + "column": 14, "line": 3, }, }, "range": Array [ - 60, - 89, + 36, + 51, ], "type": "ReturnStatement", }, ], "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 31, + "line": 3, }, "start": Object { - "column": 34, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 50, - 95, + 34, + 53, ], "type": "BlockStatement", }, @@ -55768,108 +56491,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 31, + "line": 3, }, "start": Object { "column": 9, - "line": 2, + "line": 3, }, }, - "params": Array [ - Object { - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "required", - "range": Array [ - 27, - 35, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 26, - 35, - ], - "type": "Decorator", - }, - ], - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "name": "name", - "range": Array [ - 36, - 48, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 40, - 48, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 42, - 48, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], + "params": Array [], "range": Array [ - 25, - 95, + 31, + 53, ], "type": "FunctionExpression", }, @@ -55878,23 +56511,23 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { - "column": 14, + "column": 8, "line": 1, }, }, "range": Array [ - 14, - 97, + 8, + 55, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 7, "line": 1, }, "start": Object { @@ -55902,17 +56535,17 @@ Object { "line": 1, }, }, - "name": "Greeter", + "name": "P", "range": Array [ 6, - 13, + 7, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -55921,7 +56554,7 @@ Object { }, "range": Array [ 0, - 97, + 55, ], "superClass": null, "type": "ClassDeclaration", @@ -55929,8 +56562,8 @@ Object { ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -55939,7 +56572,7 @@ Object { }, "range": Array [ 0, - 98, + 55, ], "sourceType": "script", "tokens": Array [ @@ -55964,7 +56597,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 7, "line": 1, }, "start": Object { @@ -55974,25 +56607,25 @@ Object { }, "range": Array [ 6, - 13, + 7, ], "type": "Identifier", - "value": "Greeter", + "value": "P", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 14, + "column": 8, "line": 1, }, }, "range": Array [ - 14, - 15, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -56000,7 +56633,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 2, }, "start": Object { @@ -56009,134 +56642,98 @@ Object { }, }, "range": Array [ - 20, - 25, + 14, + 15, ], - "type": "Identifier", - "value": "greet", + "type": "Punctuator", + "value": "@", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 2, }, "start": Object { - "column": 9, + "column": 5, "line": 2, }, }, "range": Array [ - 25, - 26, + 15, + 21, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "hidden", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 10, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ 26, - 27, + 29, ], - "type": "Punctuator", - "value": "@", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 11, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 27, - 35, + 30, + 31, ], "type": "Identifier", - "value": "required", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 10, + "line": 3, }, "start": Object { - "column": 20, - "line": 2, + "column": 9, + "line": 3, }, }, "range": Array [ - 36, - 40, + 31, + 32, ], - "type": "Identifier", - "value": "name", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 24, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 42, - 48, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 48, - 49, + 32, + 33, ], "type": "Punctuator", "value": ")", @@ -56144,17 +56741,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 13, + "line": 3, }, "start": Object { - "column": 34, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 50, - 51, + 34, + 35, ], "type": "Punctuator", "value": "{", @@ -56162,17 +56759,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 20, "line": 3, }, "start": Object { - "column": 8, + "column": 14, "line": 3, }, }, "range": Array [ - 60, - 66, + 36, + 42, ], "type": "Keyword", "value": "return", @@ -56180,43 +56777,43 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 25, "line": 3, }, "start": Object { - "column": 15, + "column": 21, "line": 3, }, }, "range": Array [ - 67, - 75, + 43, + 47, ], - "type": "String", - "value": "\\"Hello \\"", + "type": "Keyword", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 26, "line": 3, }, "start": Object { - "column": 24, + "column": 25, "line": 3, }, }, "range": Array [ - 76, - 77, + 47, + 48, ], "type": "Punctuator", - "value": "+", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 28, "line": 3, }, "start": Object { @@ -56225,80 +56822,44 @@ Object { }, }, "range": Array [ - 78, - 82, + 48, + 50, ], "type": "Identifier", - "value": "name", + "value": "_z", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 29, "line": 3, }, "start": Object { - "column": 31, + "column": 28, "line": 3, }, }, "range": Array [ - 83, - 84, + 50, + 51, ], "type": "Punctuator", - "value": "+", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 3, - }, - "start": Object { - "column": 33, - "line": 3, - }, - }, - "range": Array [ - 85, - 88, - ], - "type": "String", - "value": "\\"!\\"", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 31, "line": 3, }, "start": Object { - "column": 36, + "column": 30, "line": 3, }, }, "range": Array [ - 88, - 89, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 94, - 95, + 52, + 53, ], "type": "Punctuator", "value": "}", @@ -56307,16 +56868,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, - "line": 5, + "line": 4, }, }, "range": Array [ - 96, - 97, + 54, + 55, ], "type": "Punctuator", "value": "}", @@ -56326,7 +56887,7 @@ Object { } `; -exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = ` Object { "body": Array [ Object { @@ -56334,29 +56895,66 @@ Object { "body": Array [ Object { "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "adminonly", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 27, + ], + "type": "Decorator", + }, + ], "key": Object { "loc": Object { "end": Object { "column": 16, - "line": 2, + "line": 3, }, "start": Object { - "column": 11, - "line": 2, + "column": 15, + "line": 3, }, }, - "name": "greet", + "name": "y", "range": Array [ - 33, - 38, + 43, + 44, ], "type": "Identifier", }, - "kind": "method", + "kind": "set", "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 5, }, "start": Object { "column": 4, @@ -56364,8 +56962,8 @@ Object { }, }, "range": Array [ - 26, - 108, + 17, + 76, ], "static": true, "type": "MethodDefinition", @@ -56374,128 +56972,125 @@ Object { "body": Object { "body": Array [ Object { - "argument": Object { + "expression": Object { "left": Object { - "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "object": Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 12, + "line": 4, }, "start": Object { - "column": 15, - "line": 3, + "column": 8, + "line": 4, }, }, "range": Array [ - 80, - 88, + 58, + 62, ], - "raw": "\\"Hello \\"", - "type": "Literal", - "value": "Hello ", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, + "type": "ThisExpression", }, - "operator": "+", - "range": Array [ - 80, - 95, - ], - "right": Object { + "property": Object { "loc": Object { "end": Object { - "column": 30, - "line": 3, + "column": 15, + "line": 4, }, "start": Object { - "column": 26, - "line": 3, + "column": 13, + "line": 4, }, }, - "name": "name", + "name": "_y", "range": Array [ - 91, - 95, + 63, + 65, ], "type": "Identifier", }, - "type": "BinaryExpression", + "range": Array [ + 58, + 65, + ], + "type": "MemberExpression", }, "loc": Object { "end": Object { - "column": 36, - "line": 3, + "column": 19, + "line": 4, }, "start": Object { - "column": 15, - "line": 3, + "column": 8, + "line": 4, }, }, - "operator": "+", + "operator": "=", "range": Array [ - 80, - 101, + 58, + 69, ], "right": Object { "loc": Object { "end": Object { - "column": 36, - "line": 3, + "column": 19, + "line": 4, }, "start": Object { - "column": 33, - "line": 3, + "column": 18, + "line": 4, }, }, + "name": "a", "range": Array [ - 98, - 101, + 68, + 69, ], - "raw": "\\"!\\"", - "type": "Literal", - "value": "!", + "type": "Identifier", }, - "type": "BinaryExpression", + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 37, - "line": 3, + "column": 20, + "line": 4, }, "start": Object { "column": 8, - "line": 3, + "line": 4, }, }, "range": Array [ - 73, - 102, + 58, + 70, ], - "type": "ReturnStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 5, }, "start": Object { - "column": 41, - "line": 2, + "column": 20, + "line": 3, }, }, "range": Array [ - 63, - 108, + 48, + 76, ], "type": "BlockStatement", }, @@ -56505,107 +57100,36 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 5, }, "start": Object { "column": 16, - "line": 2, + "line": 3, }, }, "params": Array [ Object { - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "name": "required", - "range": Array [ - 40, - 48, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 39, - 48, - ], - "type": "Decorator", - }, - ], "loc": Object { "end": Object { - "column": 39, - "line": 2, + "column": 18, + "line": 3, }, "start": Object { - "column": 27, - "line": 2, + "column": 17, + "line": 3, }, }, - "name": "name", + "name": "a", "range": Array [ - 49, - 61, + 45, + 46, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 31, - "line": 2, - }, - }, - "range": Array [ - 53, - 61, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 33, - "line": 2, - }, - }, - "range": Array [ - 55, - 61, - ], - "type": "TSStringKeyword", - }, - }, }, ], "range": Array [ - 38, - 108, + 44, + 76, ], "type": "FunctionExpression", }, @@ -56614,23 +57138,23 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 6, }, "start": Object { - "column": 20, + "column": 11, "line": 1, }, }, "range": Array [ - 20, - 110, + 11, + 78, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 19, + "column": 10, "line": 1, }, "start": Object { @@ -56638,17 +57162,17 @@ Object { "line": 1, }, }, - "name": "StaticGreeter", + "name": "User", "range": Array [ 6, - 19, + 10, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 6, }, "start": Object { "column": 0, @@ -56657,7 +57181,7 @@ Object { }, "range": Array [ 0, - 110, + 78, ], "superClass": null, "type": "ClassDeclaration", @@ -56665,7 +57189,7 @@ Object { ], "loc": Object { "end": Object { - "column": 0, + "column": 1, "line": 6, }, "start": Object { @@ -56675,7 +57199,7 @@ Object { }, "range": Array [ 0, - 111, + 78, ], "sourceType": "script", "tokens": Array [ @@ -56700,7 +57224,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 10, "line": 1, }, "start": Object { @@ -56710,25 +57234,25 @@ Object { }, "range": Array [ 6, - 19, + 10, ], "type": "Identifier", - "value": "StaticGreeter", + "value": "User", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 12, "line": 1, }, "start": Object { - "column": 20, + "column": 11, "line": 1, }, }, "range": Array [ - 20, - 21, + 11, + 12, ], "type": "Punctuator", "value": "{", @@ -56736,7 +57260,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 5, "line": 2, }, "start": Object { @@ -56745,152 +57269,134 @@ Object { }, }, "range": Array [ - 26, - 32, + 17, + 18, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "@", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 11, + "column": 5, "line": 2, }, }, "range": Array [ - 33, - 38, + 18, + 27, ], "type": "Identifier", - "value": "greet", + "value": "adminonly", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 10, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ + 32, 38, - 39, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 14, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 11, + "line": 3, }, }, "range": Array [ 39, - 40, + 42, ], - "type": "Punctuator", - "value": "@", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 40, - 48, - ], - "type": "Identifier", - "value": "required", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 2, - }, - "start": Object { - "column": 27, - "line": 2, + "column": 15, + "line": 3, }, }, "range": Array [ - 49, - 53, + 43, + 44, ], "type": "Identifier", - "value": "name", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 2, + "column": 17, + "line": 3, }, "start": Object { - "column": 31, - "line": 2, + "column": 16, + "line": 3, }, }, "range": Array [ - 53, - 54, + 44, + 45, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 2, + "column": 18, + "line": 3, }, "start": Object { - "column": 33, - "line": 2, + "column": 17, + "line": 3, }, }, "range": Array [ - 55, - 61, + 45, + 46, ], "type": "Identifier", - "value": "string", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 2, + "column": 19, + "line": 3, }, "start": Object { - "column": 39, - "line": 2, + "column": 18, + "line": 3, }, }, "range": Array [ - 61, - 62, + 46, + 47, ], "type": "Punctuator", "value": ")", @@ -56898,17 +57404,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 42, - "line": 2, + "column": 21, + "line": 3, }, "start": Object { - "column": 41, - "line": 2, + "column": 20, + "line": 3, }, }, "range": Array [ - 63, - 64, + 48, + 49, ], "type": "Punctuator", "value": "{", @@ -56916,125 +57422,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 12, + "line": 4, }, "start": Object { "column": 8, - "line": 3, + "line": 4, }, }, "range": Array [ - 73, - 79, + 58, + 62, ], "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 80, - 88, - ], - "type": "String", - "value": "\\"Hello \\"", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 3, + "column": 13, + "line": 4, }, "start": Object { - "column": 24, - "line": 3, + "column": 12, + "line": 4, }, }, "range": Array [ - 89, - 90, + 62, + 63, ], "type": "Punctuator", - "value": "+", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 3, + "column": 15, + "line": 4, }, "start": Object { - "column": 26, - "line": 3, + "column": 13, + "line": 4, }, }, "range": Array [ - 91, - 95, + 63, + 65, ], "type": "Identifier", - "value": "name", + "value": "_y", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 3, + "column": 17, + "line": 4, }, "start": Object { - "column": 31, - "line": 3, + "column": 16, + "line": 4, }, }, "range": Array [ - 96, - 97, + 66, + 67, ], "type": "Punctuator", - "value": "+", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 3, + "column": 19, + "line": 4, }, "start": Object { - "column": 33, - "line": 3, + "column": 18, + "line": 4, }, }, "range": Array [ - 98, - 101, + 68, + 69, ], - "type": "String", - "value": "\\"!\\"", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 3, + "column": 20, + "line": 4, }, "start": Object { - "column": 36, - "line": 3, + "column": 19, + "line": 4, }, }, "range": Array [ - 101, - 102, + 69, + 70, ], "type": "Punctuator", "value": ";", @@ -57043,16 +57531,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 5, }, "start": Object { "column": 4, - "line": 4, + "line": 5, }, }, "range": Array [ - 107, - 108, + 75, + 76, ], "type": "Punctuator", "value": "}", @@ -57061,16 +57549,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 6, }, "start": Object { "column": 0, - "line": 5, + "line": 6, }, }, "range": Array [ - 109, - 110, + 77, + 78, ], "type": "Punctuator", "value": "}", @@ -57080,272 +57568,87 @@ Object { } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/class-decorators/class-decorator.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [ - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "name": "Input", - "range": Array [ - 27, - 32, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 27, - 34, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 26, - 34, - ], - "type": "Decorator", - }, - ], - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "name": "data", - "range": Array [ - 35, - 39, - ], - "type": "Identifier", - }, + "body": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 7, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 1, + "line": 1, }, }, + "name": "sealed", "range": Array [ - 26, - 40, + 1, + 7, ], - "static": false, - "type": "ClassProperty", - "value": null, + "type": "Identifier", }, - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "name": "Output", - "range": Array [ - 46, - 52, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "range": Array [ - 46, - 54, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 45, - 54, - ], - "type": "Decorator", - }, - ], - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "name": "click", - "range": Array [ - 59, - 64, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, }, - "range": Array [ - 45, - 86, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "name": "EventEmitter", - "range": Array [ - 71, - 83, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 67, - 85, - ], - "type": "NewExpression", + "start": Object { + "column": 0, + "line": 1, }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 20, - "line": 1, - }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", }, - "range": Array [ - 20, - 88, - ], - "type": "ClassBody", - }, + ], "id": Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { "column": 6, - "line": 1, + "line": 2, }, }, - "name": "SomeComponent", + "name": "Qux", "range": Array [ - 6, - 19, + 14, + 17, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 12, + "line": 2, }, "start": Object { "column": 0, @@ -57354,7 +57657,7 @@ Object { }, "range": Array [ 0, - 88, + 20, ], "superClass": null, "type": "ClassDeclaration", @@ -57362,8 +57665,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 12, + "line": 2, }, "start": Object { "column": 0, @@ -57372,14 +57675,14 @@ Object { }, "range": Array [ 0, - 88, + 20, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -57389,82 +57692,64 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "@", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 7, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, "range": Array [ - 6, - 19, + 1, + 7, ], "type": "Identifier", - "value": "SomeComponent", + "value": "sealed", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, "range": Array [ - 26, - 27, + 8, + 13, ], - "type": "Punctuator", - "value": "@", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 2, }, "start": Object { - "column": 5, + "column": 6, "line": 2, }, }, "range": Array [ - 27, - 32, + 14, + 17, ], "type": "Identifier", - "value": "Input", + "value": "Qux", }, Object { "loc": Object { @@ -57478,11 +57763,11 @@ Object { }, }, "range": Array [ - 32, - 33, + 18, + 19, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { @@ -57496,260 +57781,472 @@ Object { }, }, "range": Array [ - 33, - 34, + 19, + 20, ], "type": "Punctuator", - "value": ")", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/class-decorators/class-decorator-factory.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 56, + 58, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "selector", + "range": Array [ + 17, + 25, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 17, + 32, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + }, + ], + "range": Array [ + 11, + 35, + ], + "type": "ObjectExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "Component", + "range": Array [ + 1, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 36, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "name": "FooComponent", + "range": Array [ + 43, + 55, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 21, + "line": 4, }, "start": Object { - "column": 13, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 35, - 39, + 0, + 58, ], - "type": "Identifier", - "value": "data", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 39, - 40, + 0, + 1, ], "type": "Punctuator", - "value": ";", + "value": "@", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 1, + "line": 1, }, }, "range": Array [ - 45, - 46, + 1, + 10, ], - "type": "Punctuator", - "value": "@", + "type": "Identifier", + "value": "Component", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 3, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 10, + "line": 1, }, }, "range": Array [ - 46, - 52, + 10, + 11, ], - "type": "Identifier", - "value": "Output", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 3, + "line": 1, }, "start": Object { "column": 11, - "line": 3, + "line": 1, }, }, "range": Array [ - 52, - 53, + 11, + 12, ], "type": "Punctuator", - "value": "(", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "Identifier", + "value": "selector", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 3, + "line": 2, }, "start": Object { "column": 12, - "line": 3, + "line": 2, }, }, "range": Array [ - 53, - 54, + 25, + 26, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 19, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 14, + "line": 2, }, }, "range": Array [ - 59, - 64, + 27, + 32, ], - "type": "Identifier", - "value": "click", + "type": "String", + "value": "'foo'", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 4, + "column": 20, + "line": 2, }, "start": Object { - "column": 10, - "line": 4, + "column": 19, + "line": 2, }, }, "range": Array [ - 65, - 66, + 32, + 33, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 1, + "line": 3, }, "start": Object { - "column": 12, - "line": 4, + "column": 0, + "line": 3, }, }, "range": Array [ - 67, - 70, + 34, + 35, ], - "type": "Keyword", - "value": "new", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 4, + "column": 2, + "line": 3, }, "start": Object { - "column": 16, - "line": 4, + "column": 1, + "line": 3, }, }, "range": Array [ - 71, - 83, + 35, + 36, ], - "type": "Identifier", - "value": "EventEmitter", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 5, "line": 4, }, "start": Object { - "column": 28, + "column": 0, "line": 4, }, }, "range": Array [ - 83, - 84, + 37, + 42, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 4, }, "start": Object { - "column": 29, + "column": 6, "line": 4, }, }, "range": Array [ - 84, - 85, + 43, + 55, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "FooComponent", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 20, "line": 4, }, "start": Object { - "column": 30, + "column": 19, "line": 4, }, }, "range": Array [ - 85, - 86, + 56, + 57, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 21, + "line": 4, }, "start": Object { - "column": 0, - "line": 5, + "column": 20, + "line": 4, }, }, "range": Array [ - 87, - 88, + 57, + 58, ], "type": "Punctuator", "value": "}", @@ -57759,7 +58256,7 @@ Object { } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = ` Object { "body": Array [ Object { @@ -57774,27 +58271,27 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 2, }, "start": Object { - "column": 18, + "column": 14, "line": 2, }, }, "range": Array [ - 28, - 32, + 24, + 29, ], - "raw": "true", + "raw": "false", "type": "Literal", - "value": true, + "value": false, }, ], "callee": Object { "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 2, }, "start": Object { @@ -57802,16 +58299,16 @@ Object { "line": 2, }, }, - "name": "configurable", + "name": "onlyRead", "range": Array [ 15, - 27, + 23, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 2, }, "start": Object { @@ -57821,13 +58318,13 @@ Object { }, "range": Array [ 15, - 33, + 30, ], "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 2, }, "start": Object { @@ -57837,7 +58334,7 @@ Object { }, "range": Array [ 14, - 33, + 30, ], "type": "Decorator", }, @@ -57845,25 +58342,26 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 36, - "line": 2, + "column": 18, + "line": 3, }, "start": Object { - "column": 31, - "line": 2, + "column": 4, + "line": 3, }, }, - "name": "prop1", + "name": "instanceMethod", "range": Array [ - 41, - 46, + 35, + 49, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 23, + "line": 3, }, "start": Object { "column": 4, @@ -57872,130 +58370,56 @@ Object { }, "range": Array [ 14, - 47, + 54, ], - "static": true, - "type": "ClassProperty", - "value": null, - }, - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "range": Array [ - 67, - 72, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "name": "configurable", - "range": Array [ - 54, - 66, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, - }, - }, - "range": Array [ - 54, - 73, - ], - "type": "CallExpression", - }, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 23, + "line": 3, }, "start": Object { - "column": 4, - "line": 4, + "column": 21, + "line": 3, }, }, "range": Array [ - 53, - 73, + 52, + 54, ], - "type": "Decorator", + "type": "BlockStatement", }, - ], - "key": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 23, + "line": 3, }, "start": Object { - "column": 11, - "line": 5, + "column": 18, + "line": 3, }, }, - "name": "prop2", + "params": Array [], "range": Array [ - 85, - 90, + 49, + 54, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 4, - }, + "type": "FunctionExpression", }, - "range": Array [ - 53, - 91, - ], - "static": true, - "type": "ClassProperty", - "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 8, @@ -58004,7 +58428,7 @@ Object { }, "range": Array [ 8, - 93, + 56, ], "type": "ClassBody", }, @@ -58019,7 +58443,7 @@ Object { "line": 1, }, }, - "name": "A", + "name": "B", "range": Array [ 6, 7, @@ -58029,7 +58453,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, @@ -58038,7 +58462,7 @@ Object { }, "range": Array [ 0, - 93, + 56, ], "superClass": null, "type": "ClassDeclaration", @@ -58046,8 +58470,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -58056,7 +58480,7 @@ Object { }, "range": Array [ 0, - 93, + 57, ], "sourceType": "script", "tokens": Array [ @@ -58094,7 +58518,7 @@ Object { 7, ], "type": "Identifier", - "value": "A", + "value": "B", }, Object { "loc": Object { @@ -58135,7 +58559,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 2, }, "start": Object { @@ -58145,25 +58569,25 @@ Object { }, "range": Array [ 15, - 27, + 23, ], "type": "Identifier", - "value": "configurable", + "value": "onlyRead", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 14, "line": 2, }, "start": Object { - "column": 17, + "column": 13, "line": 2, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": "(", @@ -58171,35 +58595,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 2, }, "start": Object { - "column": 18, + "column": 14, "line": 2, }, }, "range": Array [ - 28, - 32, + 24, + 29, ], "type": "Boolean", - "value": "true", + "value": "false", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 2, }, "start": Object { - "column": 22, + "column": 19, "line": 2, }, }, "range": Array [ - 32, - 33, + 29, + 30, ], "type": "Punctuator", "value": ")", @@ -58207,107 +58631,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 34, - 40, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 31, - "line": 2, - }, - }, - "range": Array [ - 41, - 46, - ], - "type": "Identifier", - "value": "prop1", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 2, - }, - "start": Object { - "column": 36, - "line": 2, - }, - }, - "range": Array [ - 46, - 47, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, + "column": 18, + "line": 3, }, "start": Object { "column": 4, - "line": 4, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "@", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 4, + "line": 3, }, }, "range": Array [ - 54, - 66, + 35, + 49, ], "type": "Identifier", - "value": "configurable", + "value": "instanceMethod", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 19, + "line": 3, }, "start": Object { - "column": 17, - "line": 4, + "column": 18, + "line": 3, }, }, "range": Array [ - 66, - 67, + 49, + 50, ], "type": "Punctuator", "value": "(", @@ -58315,35 +58667,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "range": Array [ - 67, - 72, - ], - "type": "Boolean", - "value": "false", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, + "column": 20, + "line": 3, }, "start": Object { - "column": 23, - "line": 4, + "column": 19, + "line": 3, }, }, "range": Array [ - 72, - 73, + 50, + 51, ], "type": "Punctuator", "value": ")", @@ -58351,71 +58685,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 78, - 84, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 5, + "column": 22, + "line": 3, }, "start": Object { - "column": 11, - "line": 5, + "column": 21, + "line": 3, }, }, "range": Array [ - 85, - 90, + 52, + 53, ], - "type": "Identifier", - "value": "prop2", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 23, + "line": 3, }, "start": Object { - "column": 16, - "line": 5, + "column": 22, + "line": 3, }, }, "range": Array [ - 90, - 91, + 53, + 54, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 6, + "line": 4, }, }, "range": Array [ - 92, - 93, + 55, + 56, ], "type": "Punctuator", "value": "}", @@ -58425,7 +58741,7 @@ Object { } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-instance-member.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = ` Object { "body": Array [ Object { @@ -58436,9 +58752,48 @@ Object { "decorators": Array [ Object { "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 24, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 2, }, "start": Object { @@ -58446,16 +58801,15 @@ Object { "line": 2, }, }, - "name": "foo", "range": Array [ 15, - 18, + 25, ], - "type": "Identifier", + "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 2, }, "start": Object { @@ -58465,7 +58819,7 @@ Object { }, "range": Array [ 14, - 18, + 25, ], "type": "Decorator", }, @@ -58473,25 +58827,26 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 23, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 11, + "line": 3, }, }, - "name": "x", + "name": "staticMethod", "range": Array [ - 19, - 20, + 37, + 49, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 28, + "line": 3, }, "start": Object { "column": 4, @@ -58500,92 +58855,56 @@ Object { }, "range": Array [ 14, - 21, + 54, ], - "static": false, - "type": "ClassProperty", - "value": null, - }, - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 8, + "column": 28, "line": 3, }, "start": Object { - "column": 4, + "column": 26, "line": 3, }, }, "range": Array [ - 26, - 30, + 52, + 54, ], - "type": "Decorator", + "type": "BlockStatement", }, - ], - "key": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 28, + "line": 3, }, "start": Object { - "column": 4, - "line": 4, + "column": 23, + "line": 3, }, }, - "name": "y", + "params": Array [], "range": Array [ - 35, - 36, + 49, + 54, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "type": "FunctionExpression", }, - "range": Array [ - 26, - 37, - ], - "static": false, - "type": "ClassProperty", - "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 8, @@ -58594,7 +58913,7 @@ Object { }, "range": Array [ 8, - 39, + 56, ], "type": "ClassBody", }, @@ -58609,7 +58928,7 @@ Object { "line": 1, }, }, - "name": "B", + "name": "C", "range": Array [ 6, 7, @@ -58619,7 +58938,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -58628,7 +58947,7 @@ Object { }, "range": Array [ 0, - 39, + 56, ], "superClass": null, "type": "ClassDeclaration", @@ -58636,7 +58955,7 @@ Object { ], "loc": Object { "end": Object { - "column": 1, + "column": 0, "line": 5, }, "start": Object { @@ -58646,7 +58965,7 @@ Object { }, "range": Array [ 0, - 39, + 57, ], "sourceType": "script", "tokens": Array [ @@ -58684,7 +59003,7 @@ Object { 7, ], "type": "Identifier", - "value": "B", + "value": "C", }, Object { "loc": Object { @@ -58738,12 +59057,30 @@ Object { 18, ], "type": "Identifier", - "value": "foo", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, "line": 2, }, "start": Object { @@ -58753,33 +59090,33 @@ Object { }, "range": Array [ 19, - 20, + 24, ], - "type": "Identifier", - "value": "x", + "type": "Boolean", + "value": "false", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 2, }, "start": Object { - "column": 10, + "column": 14, "line": 2, }, }, "range": Array [ - 20, - 21, + 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 10, "line": 3, }, "start": Object { @@ -58788,80 +59125,116 @@ Object { }, }, "range": Array [ - 26, - 27, + 30, + 36, ], - "type": "Punctuator", - "value": "@", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 23, "line": 3, }, "start": Object { - "column": 5, + "column": 11, "line": 3, }, }, "range": Array [ - 27, - 30, + 37, + 49, ], "type": "Identifier", - "value": "bar", + "value": "staticMethod", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 24, + "line": 3, }, "start": Object { - "column": 4, - "line": 4, + "column": 23, + "line": 3, }, }, "range": Array [ - 35, - 36, + 49, + 50, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 4, + "column": 25, + "line": 3, }, "start": Object { - "column": 5, - "line": 4, + "column": 24, + "line": 3, }, }, "range": Array [ - 36, - 37, + 50, + 51, ], "type": "Punctuator", - "value": ";", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, - "line": 5, + "line": 4, }, }, "range": Array [ - 38, - 39, + 55, + 56, ], "type": "Punctuator", "value": "}", @@ -58871,7 +59244,7 @@ Object { } `; -exports[`typescript fixtures/decorators/property-decorators/property-decorator-static-member.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-instance-member.src 1`] = ` Object { "body": Array [ Object { @@ -58884,7 +59257,7 @@ Object { "expression": Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 2, }, "start": Object { @@ -58892,16 +59265,16 @@ Object { "line": 2, }, }, - "name": "baz", + "name": "onlyRead", "range": Array [ 15, - 18, + 23, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 2, }, "start": Object { @@ -58911,7 +59284,7 @@ Object { }, "range": Array [ 14, - 18, + 23, ], "type": "Decorator", }, @@ -58919,25 +59292,26 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 18, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 4, + "line": 3, }, }, - "name": "a", + "name": "instanceMethod", "range": Array [ - 26, - 27, + 28, + 42, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 23, + "line": 3, }, "start": Object { "column": 4, @@ -58946,92 +59320,56 @@ Object { }, "range": Array [ 14, - 28, + 47, ], - "static": true, - "type": "ClassProperty", - "value": null, - }, - Object { - "computed": false, - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "name": "qux", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 8, + "column": 23, "line": 3, }, "start": Object { - "column": 4, + "column": 21, "line": 3, }, }, "range": Array [ - 33, - 37, + 45, + 47, ], - "type": "Decorator", + "type": "BlockStatement", }, - ], - "key": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 23, + "line": 3, }, "start": Object { - "column": 11, - "line": 4, + "column": 18, + "line": 3, }, }, - "name": "b", + "params": Array [], "range": Array [ - 49, - 50, + 42, + 47, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "type": "FunctionExpression", }, - "range": Array [ - 33, - 51, - ], - "static": true, - "type": "ClassProperty", - "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 8, @@ -59040,7 +59378,7 @@ Object { }, "range": Array [ 8, - 53, + 49, ], "type": "ClassBody", }, @@ -59055,7 +59393,7 @@ Object { "line": 1, }, }, - "name": "C", + "name": "A", "range": Array [ 6, 7, @@ -59065,7 +59403,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -59074,7 +59412,7 @@ Object { }, "range": Array [ 0, - 53, + 49, ], "superClass": null, "type": "ClassDeclaration", @@ -59083,7 +59421,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 5, }, "start": Object { "column": 0, @@ -59092,7 +59430,7 @@ Object { }, "range": Array [ 0, - 54, + 50, ], "sourceType": "script", "tokens": Array [ @@ -59130,7 +59468,7 @@ Object { 7, ], "type": "Identifier", - "value": "C", + "value": "A", }, Object { "loc": Object { @@ -59171,7 +59509,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 2, }, "start": Object { @@ -59181,169 +59519,115 @@ Object { }, "range": Array [ 15, - 18, - ], - "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 25, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 27, + 23, ], "type": "Identifier", - "value": "a", + "value": "onlyRead", }, Object { "loc": Object { "end": Object { "column": 18, - "line": 2, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 27, 28, + 42, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "instanceMethod", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 19, "line": 3, }, "start": Object { - "column": 4, + "column": 18, "line": 3, }, }, "range": Array [ - 33, - 34, + 42, + 43, ], "type": "Punctuator", - "value": "@", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 20, "line": 3, }, "start": Object { - "column": 5, + "column": 19, "line": 3, }, }, "range": Array [ - 34, - 37, - ], - "type": "Identifier", - "value": "qux", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 42, - 48, + 43, + 44, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 22, + "line": 3, }, "start": Object { - "column": 11, - "line": 4, + "column": 21, + "line": 3, }, }, "range": Array [ - 49, - 50, + 45, + 46, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 23, + "line": 3, }, "start": Object { - "column": 12, - "line": 4, + "column": 22, + "line": 3, }, }, "range": Array [ - 50, - 51, + 46, + 47, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, - "line": 5, + "line": 4, }, }, "range": Array [ - 52, - 53, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -59353,32 +59637,148 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` +exports[`typescript fixtures/decorators/method-decorators/method-decorator-static-member.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "name": "staticMethod", + "range": Array [ + 30, + 42, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 47, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 45, + 47, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 42, + 47, + ], + "type": "FunctionExpression", + }, + }, + ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { - "column": 18, + "column": 8, "line": 1, }, }, "range": Array [ - 18, - 22, + 8, + 49, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -59386,17 +59786,17 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "D", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -59405,7 +59805,7 @@ Object { }, "range": Array [ 0, - 22, + 49, ], "superClass": null, "type": "ClassDeclaration", @@ -59414,7 +59814,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -59423,7 +59823,7 @@ Object { }, "range": Array [ 0, - 23, + 50, ], "sourceType": "script", "tokens": Array [ @@ -59448,7 +59848,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -59458,43 +59858,25 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 17, - ], - "type": "Keyword", - "value": "extends", + "value": "D", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 9, "line": 1, }, "start": Object { - "column": 18, + "column": 8, "line": 1, }, }, "range": Array [ - 18, - 19, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -59502,169 +59884,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 5, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 4, + "line": 2, }, }, "range": Array [ - 21, - 22, + 14, + 15, ], "type": "Punctuator", - "value": "}", + "value": "@", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 37, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 29, - 32, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 32, - ], - "type": "ClassImplements", - }, - ], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 8, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 37, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 38, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + "line": 2, }, }, "range": Array [ - 6, - 9, + 15, + 18, ], "type": "Identifier", "value": "Foo", @@ -59672,312 +59920,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 17, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 18, - 28, + 23, + 29, ], "type": "Keyword", - "value": "implements", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 23, + "line": 3, }, "start": Object { - "column": 29, - "line": 1, + "column": 11, + "line": 3, }, }, "range": Array [ - 29, - 32, + 30, + 42, ], "type": "Identifier", - "value": "Bar", + "value": "staticMethod", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 24, + "line": 3, }, "start": Object { - "column": 33, - "line": 1, + "column": 23, + "line": 3, }, }, "range": Array [ - 33, - 34, + 42, + 43, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 25, "line": 3, }, "start": Object { - "column": 0, + "column": 24, "line": 3, }, }, "range": Array [ - 36, - 37, + 43, + 44, ], "type": "Punctuator", - "value": "}", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/errorRecovery/class-extends-empty-implements.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 37, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "implements": Array [], "loc": Object { "end": Object { - "column": 1, + "column": 27, "line": 3, }, "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 37, - ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 38, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 17, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - "value": "Bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, + "column": 26, + "line": 3, }, }, "range": Array [ - 22, - 32, + 45, + 46, ], - "type": "Keyword", - "value": "implements", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 28, + "line": 3, }, "start": Object { - "column": 33, - "line": 1, + "column": 27, + "line": 3, }, }, "range": Array [ - 33, - 34, + 46, + 47, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 4, }, }, "range": Array [ - 36, - 37, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -59987,87 +60048,435 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = ` Object { "body": Array [ Object { - "decorators": Array [ - Object { - "expression": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 20, + 31, + ], + "type": "Identifier", + }, + "kind": "constructor", "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 1, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "dec", "range": Array [ - 1, - 4, + 20, + 113, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 81, + 85, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "title", + "range": Array [ + 86, + 91, + ], + "type": "Identifier", + }, + "range": Array [ + 81, + 91, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "operator": "=", + "range": Array [ + 81, + 106, + ], + "right": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "name": "config", + "range": Array [ + 94, + 100, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "name": "title", + "range": Array [ + 101, + 106, + ], + "type": "Identifier", + }, + "range": Array [ + 94, + 106, + ], + "type": "MemberExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 81, + 107, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 55, + "line": 2, + }, + }, + "range": Array [ + 71, + 113, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "APP_CONFIG", + "range": Array [ + 40, + 50, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "Inject", + "range": Array [ + 33, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 33, + 51, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 51, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "name": "config", + "range": Array [ + 52, + 69, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 58, + 69, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 60, + 69, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "name": "AppConfig", + "range": Array [ + 60, + 69, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 31, + 113, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 0, - 4, - ], - "type": "Decorator", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, - ], + "range": Array [ + 14, + 115, + ], + "type": "ClassBody", + }, "id": Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 10, + "column": 6, "line": 1, }, }, - "name": "E", + "name": "Service", "range": Array [ - 10, - 11, + 6, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, "line": 1, }, }, - "members": Array [], "range": Array [ 0, - 14, + 115, ], - "type": "TSEnumDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -60076,14 +60485,14 @@ Object { }, "range": Array [ 0, - 14, + 116, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -60093,357 +60502,259 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "@", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 13, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 4, + 6, + 13, ], "type": "Identifier", - "value": "dec", + "value": "Service", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 15, "line": 1, }, "start": Object { - "column": 5, + "column": 14, "line": 1, }, }, "range": Array [ - 5, - 9, + 14, + 15, ], - "type": "Keyword", - "value": "enum", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 10, - 11, + 20, + 31, ], "type": "Identifier", - "value": "E", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 12, - 13, + 31, + 32, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 13, - 14, + 32, + 33, ], "type": "Punctuator", - "value": "}", + "value": "@", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, }, - "range": Array [ - 20, - 22, - ], - "type": "TSInterfaceBody", }, - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "deco", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 7, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 7, - ], - "type": "Decorator", - }, + "range": Array [ + 33, + 39, ], - "heritage": Array [], - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "name": "M", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, + "type": "Identifier", + "value": "Inject", + }, + Object { "loc": Object { "end": Object { - "column": 14, + "column": 24, "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 23, + "line": 2, }, }, "range": Array [ - 0, - 22, + 39, + 40, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "(", }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 34, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 0, - 1, + 40, + 50, ], - "type": "Punctuator", - "value": "@", + "type": "Identifier", + "value": "APP_CONFIG", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 1, - "line": 1, + "column": 34, + "line": 2, }, }, "range": Array [ - 1, - 5, + 50, + 51, ], - "type": "Identifier", - "value": "deco", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 42, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 36, + "line": 2, }, }, "range": Array [ - 5, - 6, + 52, + 58, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "config", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 43, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 42, + "line": 2, }, }, "range": Array [ - 6, - 7, + 58, + 59, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 53, "line": 2, }, "start": Object { - "column": 0, + "column": 44, "line": 2, }, }, "range": Array [ - 8, - 17, + 60, + 69, ], - "type": "Keyword", - "value": "interface", + "type": "Identifier", + "value": "AppConfig", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 54, "line": 2, }, "start": Object { - "column": 10, + "column": 53, "line": 2, }, }, "range": Array [ - 18, - 19, + 69, + 70, ], - "type": "Identifier", - "value": "M", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 56, "line": 2, }, "start": Object { - "column": 12, + "column": 55, "line": 2, }, }, "range": Array [ - 20, - 21, + 71, + 72, ], "type": "Punctuator", "value": "{", @@ -60451,450 +60762,439 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ - 21, - 22, + 81, + 85, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "this", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 6, - 16, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 16, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 16, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 14, - 16, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, }, + }, + "range": Array [ + 85, + 86, ], - "kind": "const", + "type": "Punctuator", + "value": ".", + }, + Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 18, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 13, + "line": 3, }, }, "range": Array [ - 0, - 16, + 86, + 91, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "title", }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 20, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 19, + "line": 3, }, }, "range": Array [ - 0, - 5, + 92, + 93, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 27, + "line": 3, }, "start": Object { - "column": 6, - "line": 1, + "column": 21, + "line": 3, }, }, "range": Array [ - 6, - 9, + 94, + 100, ], "type": "Identifier", - "value": "foo", + "value": "config", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 28, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 27, + "line": 3, }, }, "range": Array [ - 9, - 10, + 100, + 101, ], "type": "Punctuator", - "value": ":", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 33, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 28, + "line": 3, }, }, "range": Array [ - 11, - 14, + 101, + 106, ], "type": "Identifier", - "value": "Foo", + "value": "title", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 34, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 33, + "line": 3, }, }, "range": Array [ - 14, - 15, + 106, + 107, ], "type": "Punctuator", - "value": "<", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 15, - 16, + 112, + 113, ], "type": "Punctuator", - "value": ">", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 114, + 115, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 69, - "line": 1, - }, - "start": Object { - "column": 68, - "line": 1, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", }, - }, - "name": "X", - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 72, - "line": 1, - }, - "start": Object { - "column": 63, - "line": 1, - }, - }, - "members": Array [], - "modifiers": Array [ - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 14, - ], - "type": "TSPrivateKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 21, - ], - "type": "TSPublicKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 31, - ], - "type": "TSProtectedKeyword", - }, - Object { + "kind": "method", "loc": Object { "end": Object { "column": 38, - "line": 1, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 32, - 38, + 16, + 50, ], - "type": "TSStaticKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 1, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 48, + 50, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 39, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 29, + 33, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "special", + "range": Array [ + 21, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 21, + 34, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 20, + 34, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 35, + 46, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 46, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 19, + 50, + ], + "type": "FunctionExpression", }, - "range": Array [ - 39, - 47, - ], - "type": "TSReadonlyKeyword", }, - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 48, - "line": 1, - }, - }, - "range": Array [ - 48, - 56, - ], - "type": "TSAbstractKeyword", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "start": Object { - "column": 57, - "line": 1, - }, - }, - "range": Array [ - 57, - 62, - ], - "type": "TSAsyncKeyword", + "start": Object { + "column": 10, + "line": 1, }, + }, + "range": Array [ + 10, + 52, ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", "range": Array [ - 63, - 72, + 6, + 9, ], - "type": "TSEnumDeclaration", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 72, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -60903,17 +61203,16 @@ Object { }, "range": Array [ 0, - 72, + 52, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 72, - "line": 1, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -60922,14 +61221,14 @@ Object { }, "range": Array [ 0, - 72, + 53, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 5, "line": 1, }, "start": Object { @@ -60939,205 +61238,295 @@ Object { }, "range": Array [ 0, - 6, + 5, ], "type": "Keyword", - "value": "export", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ - 7, - 14, + 6, + 9, ], - "type": "Keyword", - "value": "private", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 10, "line": 1, }, }, "range": Array [ - 15, - 21, + 10, + 11, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 22, - 31, + 16, + 19, ], - "type": "Keyword", - "value": "protected", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 32, - 38, + 19, + 20, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 39, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 39, - 47, + 20, + 21, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": "@", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 48, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 48, - 56, + 21, + 28, ], "type": "Identifier", - "value": "abstract", + "value": "special", }, Object { "loc": Object { "end": Object { - "column": 62, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 57, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 57, - 62, + 28, + 29, ], - "type": "Identifier", - "value": "async", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 67, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 63, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 63, - 67, + 29, + 33, ], - "type": "Keyword", - "value": "enum", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 69, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 68, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 68, - 69, + 33, + 34, ], - "type": "Identifier", - "value": "X", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 71, - "line": 1, + "column": 26, + "line": 2, }, "start": Object { - "column": 70, - "line": 1, + "column": 23, + "line": 2, }, }, "range": Array [ - 70, - 71, + 35, + 38, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 72, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 71, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 71, - 72, + 38, + 39, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, ], "type": "Punctuator", "value": "}", @@ -61147,44 +61536,250 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 63, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 61, + 63, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 42, + 46, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "special", + "range": Array [ + 34, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 34, + 47, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 33, + 47, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 48, + 59, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 51, + 59, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 32, + 63, + ], + "type": "FunctionExpression", + }, + }, + ], "loc": Object { "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 26, + 16, + 65, ], - "type": "TSInterfaceBody", + "type": "ClassBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 6, "line": 1, }, }, - "name": "Foo", + "name": "StaticFoo", "range": Array [ - 10, - 13, + 6, + 15, ], "type": "Identifier", }, @@ -61200,9 +61795,10 @@ Object { }, "range": Array [ 0, - 26, + 65, ], - "type": "TSInterfaceDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { @@ -61217,14 +61813,14 @@ Object { }, "range": Array [ 0, - 27, + 66, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { @@ -61234,119 +61830,334 @@ Object { }, "range": Array [ 0, - 9, + 5, ], "type": "Keyword", - "value": "interface", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 6, "line": 1, }, }, "range": Array [ - 10, - 13, + 6, + 15, ], "type": "Identifier", - "value": "Foo", + "value": "StaticFoo", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 17, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, - 21, + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, ], "type": "Keyword", - "value": "extends", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "@", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 1, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 22, - 23, + 34, + 41, + ], + "type": "Identifier", + "value": "special", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 28, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 24, + "line": 2, }, }, "range": Array [ - 25, - 26, + 42, + 46, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, ], "type": "Punctuator", - "value": "}", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/errorRecovery/interface-property-modifiers.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "initializer": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 34, - 37, - ], - "raw": "'a'", - "type": "Literal", - "value": "a", - }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 48, + 51, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 43, + "line": 2, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 2, }, "start": Object { @@ -61354,17 +62165,18 @@ Object { "line": 2, }, }, - "name": "bar", + "name": "greet", "range": Array [ 20, - 23, + 25, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { "column": 4, @@ -61373,1917 +62185,16952 @@ Object { }, "range": Array [ 20, - 38, + 95, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 23, - 31, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 67, + 75, + ], + "raw": "\\"Hello \\"", + "type": "Literal", + "value": "Hello ", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 67, + 82, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 78, + 82, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 67, + 88, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 85, + 88, + ], + "raw": "\\"!\\"", + "type": "Literal", + "value": "!", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 60, + 89, + ], + "type": "ReturnStatement", + }, + ], "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 9, + "column": 34, "line": 2, }, }, "range": Array [ - 25, - 31, + 50, + 95, ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "public", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + "type": "BlockStatement", }, - }, - "range": Array [ - 43, - 60, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 5, + "line": 4, }, "start": Object { - "column": 12, - "line": 3, + "column": 9, + "line": 2, }, }, - "range": Array [ - 51, - 59, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "required", + "range": Array [ + 27, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 35, + ], + "type": "Decorator", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, }, - "start": Object { - "column": 14, - "line": 3, + "name": "name", + "range": Array [ + 36, + 48, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSStringKeyword", + }, }, }, - "range": Array [ - 53, - 59, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "name": "b", + ], "range": Array [ - 73, - 74, + 25, + 95, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 65, - 83, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "range": Array [ - 74, - 82, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 4, - }, - }, - "range": Array [ - 76, - 82, - ], - "type": "TSStringKeyword", - }, + "type": "FunctionExpression", }, }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 97, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Greeter", + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 97, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 98, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + "value": "Greeter", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 25, + ], + "type": "Identifier", + "value": "greet", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "Identifier", + "value": "required", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 36, + 40, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 67, + 75, + ], + "type": "String", + "value": "\\"Hello \\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 78, + 82, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 85, + 88, + ], + "type": "String", + "value": "\\"!\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { - "accessibility": "protected", "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 16, + "line": 2, }, "start": Object { - "column": 14, - "line": 5, + "column": 11, + "line": 2, }, }, - "name": "c", + "name": "greet", "range": Array [ - 98, - 99, + 33, + 38, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 24, - "line": 5, + "column": 5, + "line": 4, }, "start": Object { "column": 4, - "line": 5, + "line": 2, }, }, "range": Array [ - 88, + 26, 108, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 5, - }, - }, - "range": Array [ - 99, - 107, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "range": Array [ - 101, - 107, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 11, - "line": 6, - }, - }, - "name": "d", - "range": Array [ - 120, - 121, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 113, - 130, - ], "static": true, - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 121, - 129, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 6, - }, - "start": Object { - "column": 14, - "line": 6, - }, - }, - "range": Array [ - 123, - 129, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "computed": false, - "export": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 11, - "line": 7, - }, - }, - "name": "e", - "range": Array [ - 142, - 143, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 135, - 152, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "range": Array [ - 143, - 151, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 14, - "line": 7, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 80, + 88, + ], + "raw": "\\"Hello \\"", + "type": "Literal", + "value": "Hello ", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 80, + 95, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 91, + 95, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "operator": "+", + "range": Array [ + 80, + 101, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 98, + 101, + ], + "raw": "\\"!\\"", + "type": "Literal", + "value": "!", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 73, + 102, + ], + "type": "ReturnStatement", }, - }, - "range": Array [ - 145, - 151, ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 13, - "line": 8, - }, - }, - "name": "f", - "range": Array [ - 166, - 167, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 157, - 176, - ], - "readonly": true, - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 8, - }, - "start": Object { - "column": 14, - "line": 8, - }, - }, - "range": Array [ - 167, - 175, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 22, - "line": 8, + "column": 5, + "line": 4, }, "start": Object { - "column": 16, - "line": 8, + "column": 41, + "line": 2, }, }, "range": Array [ - 169, - 175, + 63, + 108, ], - "type": "TSStringKeyword", + "type": "BlockStatement", }, - }, - }, - Object { - "accessibility": "public", - "index": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 23, - "line": 10, + "column": 5, + "line": 4, }, "start": Object { - "column": 12, - "line": 10, + "column": 16, + "line": 2, }, }, - "name": "baz", - "range": Array [ - 190, - 201, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 10, - }, - "start": Object { - "column": 15, - "line": 10, - }, - }, - "range": Array [ - 193, - 201, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "params": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "required", + "range": Array [ + 40, + 48, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 48, + ], + "type": "Decorator", + }, + ], "loc": Object { "end": Object { - "column": 23, - "line": 10, + "column": 39, + "line": 2, }, "start": Object { - "column": 17, - "line": 10, + "column": 27, + "line": 2, }, }, + "name": "name", "range": Array [ - 195, - 201, + 49, + 61, ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 10, - }, - }, - "range": Array [ - 182, - 211, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 10, - }, - "start": Object { - "column": 24, - "line": 10, + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 53, + 61, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 55, + 61, + ], + "type": "TSStringKeyword", + }, + }, }, - }, + ], "range": Array [ - 202, - 210, + 38, + 108, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 10, - }, - "start": Object { - "column": 26, - "line": 10, - }, - }, - "range": Array [ - 204, - 210, - ], - "type": "TSStringKeyword", - }, + "type": "FunctionExpression", }, }, - Object { - "accessibility": "private", - "index": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 11, - }, - "start": Object { - "column": 13, - "line": 11, - }, - }, - "name": "baz", - "range": Array [ - 225, - 236, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 11, - }, - "start": Object { - "column": 16, - "line": 11, - }, - }, - "range": Array [ - 228, - 236, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 11, - }, - "start": Object { - "column": 18, - "line": 11, - }, - }, - "range": Array [ - 230, - 236, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "range": Array [ - 216, - 246, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 11, - }, - "start": Object { - "column": 25, - "line": 11, - }, - }, - "range": Array [ - 237, - 245, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 11, - }, - "start": Object { - "column": 27, - "line": 11, - }, - }, - "range": Array [ - 239, - 245, - ], - "type": "TSStringKeyword", - }, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, }, - Object { - "accessibility": "protected", - "index": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 12, - }, - "start": Object { - "column": 15, - "line": 12, - }, - }, - "name": "baz", - "range": Array [ - 262, - 273, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 12, - }, - "start": Object { - "column": 18, - "line": 12, - }, - }, - "range": Array [ - 265, - 273, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 12, - }, - "start": Object { - "column": 20, - "line": 12, - }, - }, - "range": Array [ - 267, - 273, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 12, - }, - "start": Object { - "column": 4, - "line": 12, - }, - }, - "range": Array [ - 251, - 283, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 12, - }, - "start": Object { - "column": 27, - "line": 12, - }, - }, - "range": Array [ - 274, - 282, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 12, - }, - "start": Object { - "column": 29, - "line": 12, - }, - }, - "range": Array [ - 276, - 282, - ], - "type": "TSStringKeyword", - }, - }, + "start": Object { + "column": 20, + "line": 1, }, - Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 12, - "line": 13, - }, - }, - "name": "baz", - "range": Array [ - 296, - 307, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 15, - "line": 13, - }, - }, - "range": Array [ - 299, - 307, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 17, - "line": 13, - }, - }, - "range": Array [ - 301, - 307, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 13, - }, - "start": Object { - "column": 4, - "line": 13, - }, - }, - "range": Array [ - 288, - 317, - ], - "static": true, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 13, - }, - "start": Object { - "column": 24, - "line": 13, - }, - }, - "range": Array [ - 308, - 316, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 13, - }, - "start": Object { - "column": 26, - "line": 13, - }, - }, - "range": Array [ - 310, - 316, - ], - "type": "TSStringKeyword", - }, - }, + }, + "range": Array [ + 20, + 110, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, }, - Object { - "export": true, - "index": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 14, - }, - "start": Object { - "column": 12, - "line": 14, - }, - }, - "name": "baz", - "range": Array [ - 330, - 341, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 14, - }, - "start": Object { - "column": 15, - "line": 14, - }, - }, - "range": Array [ - 333, - 341, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 14, - }, - "start": Object { - "column": 17, - "line": 14, - }, - }, - "range": Array [ - 335, - 341, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 14, - }, - "start": Object { - "column": 4, - "line": 14, - }, - }, - "range": Array [ - 322, - 351, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 14, - }, - "start": Object { - "column": 24, - "line": 14, - }, - }, - "range": Array [ - 342, - 350, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 14, - }, - "start": Object { - "column": 26, - "line": 14, - }, - }, - "range": Array [ - 344, - 350, - ], - "type": "TSStringKeyword", - }, - }, + "start": Object { + "column": 6, + "line": 1, }, - Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 15, - }, - "start": Object { - "column": 14, - "line": 15, - }, - }, - "name": "baz", - "range": Array [ - 366, - 377, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 15, - }, - "start": Object { - "column": 17, - "line": 15, - }, - }, - "range": Array [ - 369, - 377, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 15, - }, - "start": Object { - "column": 19, - "line": 15, - }, - }, - "range": Array [ - 371, - 377, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 15, - }, - "start": Object { - "column": 4, - "line": 15, + }, + "name": "StaticGreeter", + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 110, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 111, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + "value": "StaticGreeter", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 33, + 38, + ], + "type": "Identifier", + "value": "greet", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "Identifier", + "value": "required", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 49, + 53, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 55, + 61, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 39, + "line": 2, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 73, + 79, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 80, + 88, + ], + "type": "String", + "value": "\\"Hello \\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 89, + 90, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 91, + 95, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": "+", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 98, + 101, + ], + "type": "String", + "value": "\\"!\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 101, + 102, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Input", + "range": Array [ + 27, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 27, + 34, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "Decorator", }, - }, - "range": Array [ - 356, - 387, ], - "readonly": true, - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { + "key": Object { "loc": Object { "end": Object { - "column": 34, - "line": 15, + "column": 17, + "line": 2, }, "start": Object { - "column": 26, - "line": 15, + "column": 13, + "line": 2, }, }, + "name": "data", "range": Array [ - 378, - 386, + 35, + 39, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 40, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "Output", + "range": Array [ + 46, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 46, + 54, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 34, - "line": 15, + "column": 13, + "line": 3, }, "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 45, + 54, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "click", + "range": Array [ + 59, + 64, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 45, + 86, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { "column": 28, - "line": 15, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, }, }, + "name": "EventEmitter", "range": Array [ - 380, - 386, + 71, + 83, ], - "type": "TSStringKeyword", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, }, + "range": Array [ + 67, + 85, + ], + "type": "NewExpression", }, }, - Object { - "accessibility": "public", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 17, - }, - "start": Object { - "column": 11, - "line": 17, - }, - }, - "name": "g", - "range": Array [ - 400, - 401, - ], - "type": "Identifier", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 88, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "SomeComponent", + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 88, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 88, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 19, + ], + "type": "Identifier", + "value": "SomeComponent", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "Identifier", + "value": "Input", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "Identifier", + "value": "data", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "Identifier", + "value": "Output", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 59, + 64, + ], + "type": "Identifier", + "value": "click", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 67, + 70, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 71, + 83, + ], + "type": "Identifier", + "value": "EventEmitter", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 87, + 88, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 32, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "configurable", + "range": Array [ + 15, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 33, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 33, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "name": "prop1", + "range": Array [ + 41, + 46, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 47, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 67, + 72, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "name": "configurable", + "range": Array [ + 54, + 66, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 54, + 73, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 73, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "name": "prop2", + "range": Array [ + 85, + 90, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 91, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 93, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 93, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 93, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 27, + ], + "type": "Identifier", + "value": "configurable", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 32, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 41, + 46, + ], + "type": "Identifier", + "value": "prop1", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 54, + 66, + ], + "type": "Identifier", + "value": "configurable", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 67, + 72, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 78, + 84, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 85, + 90, + ], + "type": "Identifier", + "value": "prop2", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-instance-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "y", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 26, + 37, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/decorators/property-decorators/property-decorator-static-member.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 28, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "qux", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "Decorator", + }, + ], + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 33, + 51, + ], + "static": true, + "type": "ClassProperty", + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 53, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 53, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 54, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/class-empty-extends.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/class-empty-extends-implements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "ClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 28, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/class-extends-empty-implements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "implements": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 17, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 32, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "dec", + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "E", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 0, + 14, + ], + "type": "TSEnumDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + "value": "dec", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "E", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "TSInterfaceBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "deco", + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "M", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + "value": "deco", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 17, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "M", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/empty-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 16, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 14, + 16, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ">", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/enum-with-keywords.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 68, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "members": Array [], + "modifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "TSPrivateKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "TSPublicKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 31, + ], + "type": "TSProtectedKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStaticKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 47, + ], + "type": "TSReadonlyKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "TSAbstractKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 62, + ], + "type": "TSAsyncKeyword", + }, + ], + "range": Array [ + 63, + 72, + ], + "type": "TSEnumDeclaration", + }, + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 31, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 47, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "Identifier", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 62, + ], + "type": "Identifier", + "value": "async", + }, + Object { + "loc": Object { + "end": Object { + "column": 67, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "range": Array [ + 63, + 67, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 68, + "line": 1, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 70, + "line": 1, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 71, + "line": 1, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-modifiers.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "raw": "'a'", + "type": "Literal", + "value": "a", + }, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 38, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 31, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 60, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 59, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 65, + 83, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 74, + 82, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "name": "c", + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 88, + 108, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 99, + 107, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "name": "d", + "range": Array [ + 120, + 121, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 113, + 130, + ], + "static": true, + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 121, + 129, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 123, + 129, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "export": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "name": "e", + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 135, + 152, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 143, + 151, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 145, + 151, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "name": "f", + "range": Array [ + 166, + 167, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 157, + 176, + ], + "readonly": true, + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 8, + }, + "start": Object { + "column": 14, + "line": 8, + }, + }, + "range": Array [ + 167, + 175, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 8, + }, + "start": Object { + "column": 16, + "line": 8, + }, + }, + "range": Array [ + 169, + 175, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "public", + "index": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "name": "baz", + "range": Array [ + 190, + 201, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 10, + }, + }, + "range": Array [ + 193, + 201, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "range": Array [ + 195, + 201, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 182, + 211, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 10, + }, + "start": Object { + "column": 24, + "line": 10, + }, + }, + "range": Array [ + 202, + 210, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 10, + }, + "start": Object { + "column": 26, + "line": 10, + }, + }, + "range": Array [ + 204, + 210, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "private", + "index": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 13, + "line": 11, + }, + }, + "name": "baz", + "range": Array [ + 225, + 236, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 16, + "line": 11, + }, + }, + "range": Array [ + 228, + 236, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 230, + 236, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 216, + 246, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 11, + }, + "start": Object { + "column": 25, + "line": 11, + }, + }, + "range": Array [ + 237, + 245, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 11, + }, + "start": Object { + "column": 27, + "line": 11, + }, + }, + "range": Array [ + 239, + 245, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "protected", + "index": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "name": "baz", + "range": Array [ + 262, + 273, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 18, + "line": 12, + }, + }, + "range": Array [ + 265, + 273, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 20, + "line": 12, + }, + }, + "range": Array [ + 267, + 273, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "range": Array [ + 251, + 283, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 12, + }, + "start": Object { + "column": 27, + "line": 12, + }, + }, + "range": Array [ + 274, + 282, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 12, + }, + "start": Object { + "column": 29, + "line": 12, + }, + }, + "range": Array [ + 276, + 282, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "name": "baz", + "range": Array [ + 296, + 307, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "range": Array [ + 299, + 307, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 17, + "line": 13, + }, + }, + "range": Array [ + 301, + 307, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 288, + 317, + ], + "static": true, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 13, + }, + "start": Object { + "column": 24, + "line": 13, + }, + }, + "range": Array [ + 308, + 316, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 13, + }, + "start": Object { + "column": 26, + "line": 13, + }, + }, + "range": Array [ + 310, + 316, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "export": true, + "index": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 12, + "line": 14, + }, + }, + "name": "baz", + "range": Array [ + 330, + 341, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 15, + "line": 14, + }, + }, + "range": Array [ + 333, + 341, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 17, + "line": 14, + }, + }, + "range": Array [ + 335, + 341, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 322, + 351, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 14, + }, + "start": Object { + "column": 24, + "line": 14, + }, + }, + "range": Array [ + 342, + 350, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 14, + }, + "start": Object { + "column": 26, + "line": 14, + }, + }, + "range": Array [ + 344, + 350, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 14, + "line": 15, + }, + }, + "name": "baz", + "range": Array [ + 366, + 377, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 17, + "line": 15, + }, + }, + "range": Array [ + 369, + 377, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 19, + "line": 15, + }, + }, + "range": Array [ + 371, + 377, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 15, + }, + "start": Object { + "column": 4, + "line": 15, + }, + }, + "range": Array [ + 356, + 387, + ], + "readonly": true, + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 15, + }, + "start": Object { + "column": 26, + "line": 15, + }, + }, + "range": Array [ + 378, + 386, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 15, + }, + "start": Object { + "column": 28, + "line": 15, + }, + }, + "range": Array [ + 380, + 386, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 17, + }, + "start": Object { + "column": 11, + "line": 17, + }, + }, + "name": "g", + "range": Array [ + 400, + 401, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 17, + }, + "start": Object { + "column": 4, + "line": 17, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 13, + "line": 17, + }, + }, + "name": "bar", + "range": Array [ + 402, + 413, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 16, + "line": 17, + }, + }, + "range": Array [ + 405, + 413, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 18, + "line": 17, + }, + }, + "range": Array [ + 407, + 413, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 393, + 421, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 17, + }, + "start": Object { + "column": 25, + "line": 17, + }, + }, + "range": Array [ + 414, + 420, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 17, + }, + "start": Object { + "column": 27, + "line": 17, + }, + }, + "range": Array [ + 416, + 420, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 18, + }, + "start": Object { + "column": 12, + "line": 18, + }, + }, + "name": "h", + "range": Array [ + 434, + 435, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 18, + }, + "start": Object { + "column": 4, + "line": 18, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 14, + "line": 18, + }, + }, + "name": "bar", + "range": Array [ + 436, + 447, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 17, + "line": 18, + }, + }, + "range": Array [ + 439, + 447, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 19, + "line": 18, + }, + }, + "range": Array [ + 441, + 447, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 426, + 455, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 18, + }, + "start": Object { + "column": 26, + "line": 18, + }, + }, + "range": Array [ + 448, + 454, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 18, + }, + "start": Object { + "column": 28, + "line": 18, + }, + }, + "range": Array [ + 450, + 454, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 19, + }, + "start": Object { + "column": 14, + "line": 19, + }, + }, + "name": "i", + "range": Array [ + 470, + 471, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 19, + }, + "start": Object { + "column": 4, + "line": 19, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 16, + "line": 19, + }, + }, + "name": "bar", + "range": Array [ + 472, + 483, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 19, + "line": 19, + }, + }, + "range": Array [ + 475, + 483, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 21, + "line": 19, + }, + }, + "range": Array [ + 477, + 483, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 460, + 491, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 19, + }, + "start": Object { + "column": 28, + "line": 19, + }, + }, + "range": Array [ + 484, + 490, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 19, + }, + "start": Object { + "column": 30, + "line": 19, + }, + }, + "range": Array [ + 486, + 490, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 20, + }, + "start": Object { + "column": 11, + "line": 20, + }, + }, + "name": "j", + "range": Array [ + 503, + 504, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 20, + }, + "start": Object { + "column": 4, + "line": 20, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 13, + "line": 20, + }, + }, + "name": "bar", + "range": Array [ + 505, + 516, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 16, + "line": 20, + }, + }, + "range": Array [ + 508, + 516, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 18, + "line": 20, + }, + }, + "range": Array [ + 510, + 516, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 496, + 524, + ], + "static": true, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 20, + }, + "start": Object { + "column": 25, + "line": 20, + }, + }, + "range": Array [ + 517, + 523, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 20, + }, + "start": Object { + "column": 27, + "line": 20, + }, + }, + "range": Array [ + 519, + 523, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "export": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 21, + }, + "start": Object { + "column": 11, + "line": 21, + }, + }, + "name": "k", + "range": Array [ + 536, + 537, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 21, + }, + "start": Object { + "column": 4, + "line": 21, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 13, + "line": 21, + }, + }, + "name": "bar", + "range": Array [ + 538, + 549, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 16, + "line": 21, + }, + }, + "range": Array [ + 541, + 549, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 18, + "line": 21, + }, + }, + "range": Array [ + 543, + 549, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 529, + 557, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 21, + }, + "start": Object { + "column": 25, + "line": 21, + }, + }, + "range": Array [ + 550, + 556, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 21, + }, + "start": Object { + "column": 27, + "line": 21, + }, + }, + "range": Array [ + 552, + 556, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 22, + }, + "start": Object { + "column": 13, + "line": 22, + }, + }, + "name": "l", + "range": Array [ + 571, + 572, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 22, + }, + "start": Object { + "column": 4, + "line": 22, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 15, + "line": 22, + }, + }, + "name": "bar", + "range": Array [ + 573, + 584, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 18, + "line": 22, + }, + }, + "range": Array [ + 576, + 584, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 20, + "line": 22, + }, + }, + "range": Array [ + 578, + 584, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 562, + 592, + ], + "readonly": true, + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 22, + }, + "start": Object { + "column": 27, + "line": 22, + }, + }, + "range": Array [ + 585, + 591, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 22, + }, + "start": Object { + "column": 29, + "line": 22, + }, + }, + "range": Array [ + 587, + 591, + ], + "type": "TSVoidKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 23, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 594, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 23, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 594, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 25, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 596, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "String", + "value": "'a'", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 65, + 72, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 88, + 97, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 99, + 100, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 101, + 107, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 23, + "line": 5, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 113, + 119, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 120, + 121, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 121, + 122, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 123, + 129, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 20, + "line": 6, + }, + }, + "range": Array [ + 129, + 130, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "range": Array [ + 145, + 151, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 151, + 152, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 157, + 165, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 13, + "line": 8, + }, + }, + "range": Array [ + 166, + 167, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 14, + "line": 8, + }, + }, + "range": Array [ + 167, + 168, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 8, + }, + "start": Object { + "column": 16, + "line": 8, + }, + }, + "range": Array [ + 169, + 175, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 8, + }, + "start": Object { + "column": 22, + "line": 8, + }, + }, + "range": Array [ + 175, + 176, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 182, + 188, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, + }, + "start": Object { + "column": 11, + "line": 10, + }, + }, + "range": Array [ + 189, + 190, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "range": Array [ + 190, + 193, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 10, + }, + }, + "range": Array [ + 193, + 194, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "range": Array [ + 195, + 201, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 10, + }, + "start": Object { + "column": 23, + "line": 10, + }, + }, + "range": Array [ + 201, + 202, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 24, + "line": 10, + }, + }, + "range": Array [ + 202, + 203, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 10, + }, + "start": Object { + "column": 26, + "line": 10, + }, + }, + "range": Array [ + 204, + 210, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 10, + }, + "start": Object { + "column": 32, + "line": 10, + }, + }, + "range": Array [ + 210, + 211, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 216, + 223, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 11, + }, + "start": Object { + "column": 12, + "line": 11, + }, + }, + "range": Array [ + 224, + 225, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 11, + }, + "start": Object { + "column": 13, + "line": 11, + }, + }, + "range": Array [ + 225, + 228, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 16, + "line": 11, + }, + }, + "range": Array [ + 228, + 229, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 230, + 236, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 11, + }, + "start": Object { + "column": 24, + "line": 11, + }, + }, + "range": Array [ + 236, + 237, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 25, + "line": 11, + }, + }, + "range": Array [ + 237, + 238, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 11, + }, + "start": Object { + "column": 27, + "line": 11, + }, + }, + "range": Array [ + 239, + 245, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 11, + }, + "start": Object { + "column": 33, + "line": 11, + }, + }, + "range": Array [ + 245, + 246, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 12, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "range": Array [ + 251, + 260, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 12, + }, + "start": Object { + "column": 14, + "line": 12, + }, + }, + "range": Array [ + 261, + 262, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 12, + }, + "start": Object { + "column": 15, + "line": 12, + }, + }, + "range": Array [ + 262, + 265, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 12, + }, + "start": Object { + "column": 18, + "line": 12, + }, + }, + "range": Array [ + 265, + 266, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 12, + }, + "start": Object { + "column": 20, + "line": 12, + }, + }, + "range": Array [ + 267, + 273, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 12, + }, + "start": Object { + "column": 26, + "line": 12, + }, + }, + "range": Array [ + 273, + 274, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 12, + }, + "start": Object { + "column": 27, + "line": 12, + }, + }, + "range": Array [ + 274, + 275, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 12, + }, + "start": Object { + "column": 29, + "line": 12, + }, + }, + "range": Array [ + 276, + 282, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 12, + }, + "start": Object { + "column": 35, + "line": 12, + }, + }, + "range": Array [ + 282, + 283, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 288, + 294, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 13, + }, + "start": Object { + "column": 11, + "line": 13, + }, + }, + "range": Array [ + 295, + 296, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "range": Array [ + 296, + 299, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "range": Array [ + 299, + 300, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 17, + "line": 13, + }, + }, + "range": Array [ + 301, + 307, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 13, + }, + "start": Object { + "column": 23, + "line": 13, + }, + }, + "range": Array [ + 307, + 308, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 13, + }, + "start": Object { + "column": 24, + "line": 13, + }, + }, + "range": Array [ + 308, + 309, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 13, + }, + "start": Object { + "column": 26, + "line": 13, + }, + }, + "range": Array [ + 310, + 316, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 13, + }, + "start": Object { + "column": 32, + "line": 13, + }, + }, + "range": Array [ + 316, + 317, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 322, + 328, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 14, + }, + "start": Object { + "column": 11, + "line": 14, + }, + }, + "range": Array [ + 329, + 330, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 14, + }, + "start": Object { + "column": 12, + "line": 14, + }, + }, + "range": Array [ + 330, + 333, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 14, + }, + "start": Object { + "column": 15, + "line": 14, + }, + }, + "range": Array [ + 333, + 334, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 14, + }, + "start": Object { + "column": 17, + "line": 14, + }, + }, + "range": Array [ + 335, + 341, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 14, + }, + "start": Object { + "column": 23, + "line": 14, + }, + }, + "range": Array [ + 341, + 342, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 14, + }, + "start": Object { + "column": 24, + "line": 14, + }, + }, + "range": Array [ + 342, + 343, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 14, + }, + "start": Object { + "column": 26, + "line": 14, + }, + }, + "range": Array [ + 344, + 350, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 14, + }, + "start": Object { + "column": 32, + "line": 14, + }, + }, + "range": Array [ + 350, + 351, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 15, + }, + "start": Object { + "column": 4, + "line": 15, + }, + }, + "range": Array [ + 356, + 364, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 15, + }, + "start": Object { + "column": 13, + "line": 15, + }, + }, + "range": Array [ + 365, + 366, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 15, + }, + "start": Object { + "column": 14, + "line": 15, + }, + }, + "range": Array [ + 366, + 369, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 15, + }, + "start": Object { + "column": 17, + "line": 15, + }, + }, + "range": Array [ + 369, + 370, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 15, + }, + "start": Object { + "column": 19, + "line": 15, + }, + }, + "range": Array [ + 371, + 377, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 15, + }, + "start": Object { + "column": 25, + "line": 15, + }, + }, + "range": Array [ + 377, + 378, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 15, + }, + "start": Object { + "column": 26, + "line": 15, + }, + }, + "range": Array [ + 378, + 379, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 15, + }, + "start": Object { + "column": 28, + "line": 15, + }, + }, + "range": Array [ + 380, + 386, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 15, + }, + "start": Object { + "column": 34, + "line": 15, + }, + }, + "range": Array [ + 386, + 387, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 17, + }, + "start": Object { + "column": 4, + "line": 17, + }, + }, + "range": Array [ + 393, + 399, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 17, + }, + "start": Object { + "column": 11, + "line": 17, + }, + }, + "range": Array [ + 400, + 401, + ], + "type": "Identifier", + "value": "g", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 17, + }, + "start": Object { + "column": 12, + "line": 17, + }, + }, + "range": Array [ + 401, + 402, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 17, + }, + "start": Object { + "column": 13, + "line": 17, + }, + }, + "range": Array [ + 402, + 405, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 17, + }, + "start": Object { + "column": 16, + "line": 17, + }, + }, + "range": Array [ + 405, + 406, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 18, + "line": 17, + }, + }, + "range": Array [ + 407, + 413, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 17, + }, + "start": Object { + "column": 24, + "line": 17, + }, + }, + "range": Array [ + 413, + 414, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 17, + }, + "start": Object { + "column": 25, + "line": 17, + }, + }, + "range": Array [ + 414, + 415, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 17, + }, + "start": Object { + "column": 27, + "line": 17, + }, + }, + "range": Array [ + 416, + 420, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 17, + }, + "start": Object { + "column": 31, + "line": 17, + }, + }, + "range": Array [ + 420, + 421, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 18, + }, + "start": Object { + "column": 4, + "line": 18, + }, + }, + "range": Array [ + 426, + 433, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 18, + }, + "start": Object { + "column": 12, + "line": 18, + }, + }, + "range": Array [ + 434, + 435, + ], + "type": "Identifier", + "value": "h", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 18, + }, + "start": Object { + "column": 13, + "line": 18, + }, + }, + "range": Array [ + 435, + 436, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 18, + }, + "start": Object { + "column": 14, + "line": 18, + }, + }, + "range": Array [ + 436, + 439, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 18, + }, + "start": Object { + "column": 17, + "line": 18, + }, + }, + "range": Array [ + 439, + 440, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 19, + "line": 18, + }, + }, + "range": Array [ + 441, + 447, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 18, + }, + "start": Object { + "column": 25, + "line": 18, + }, + }, + "range": Array [ + 447, + 448, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 18, + }, + "start": Object { + "column": 26, + "line": 18, + }, + }, + "range": Array [ + 448, + 449, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 18, + }, + "start": Object { + "column": 28, + "line": 18, + }, + }, + "range": Array [ + 450, + 454, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 18, + }, + "start": Object { + "column": 32, + "line": 18, + }, + }, + "range": Array [ + 454, + 455, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 19, + }, + "start": Object { + "column": 4, + "line": 19, + }, + }, + "range": Array [ + 460, + 469, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 19, + }, + "start": Object { + "column": 14, + "line": 19, + }, + }, + "range": Array [ + 470, + 471, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 19, + }, + "start": Object { + "column": 15, + "line": 19, + }, + }, + "range": Array [ + 471, + 472, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 19, + }, + "start": Object { + "column": 16, + "line": 19, + }, + }, + "range": Array [ + 472, + 475, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 19, + }, + "start": Object { + "column": 19, + "line": 19, + }, + }, + "range": Array [ + 475, + 476, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 19, + }, + "start": Object { + "column": 21, + "line": 19, + }, + }, + "range": Array [ + 477, + 483, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 19, + }, + "start": Object { + "column": 27, + "line": 19, + }, + }, + "range": Array [ + 483, + 484, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 19, + }, + "start": Object { + "column": 28, + "line": 19, + }, + }, + "range": Array [ + 484, + 485, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 19, + }, + "start": Object { + "column": 30, + "line": 19, + }, + }, + "range": Array [ + 486, + 490, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 19, + }, + "start": Object { + "column": 34, + "line": 19, + }, + }, + "range": Array [ + 490, + 491, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 20, + }, + "start": Object { + "column": 4, + "line": 20, + }, + }, + "range": Array [ + 496, + 502, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 20, + }, + "start": Object { + "column": 11, + "line": 20, + }, + }, + "range": Array [ + 503, + 504, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 20, + }, + "start": Object { + "column": 12, + "line": 20, + }, + }, + "range": Array [ + 504, + 505, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 20, + }, + "start": Object { + "column": 13, + "line": 20, + }, + }, + "range": Array [ + 505, + 508, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 20, + }, + "start": Object { + "column": 16, + "line": 20, + }, + }, + "range": Array [ + 508, + 509, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 20, + }, + "start": Object { + "column": 18, + "line": 20, + }, + }, + "range": Array [ + 510, + 516, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 20, + }, + "start": Object { + "column": 24, + "line": 20, + }, + }, + "range": Array [ + 516, + 517, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 20, + }, + "start": Object { + "column": 25, + "line": 20, + }, + }, + "range": Array [ + 517, + 518, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 20, + }, + "start": Object { + "column": 27, + "line": 20, + }, + }, + "range": Array [ + 519, + 523, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 20, + }, + "start": Object { + "column": 31, + "line": 20, + }, + }, + "range": Array [ + 523, + 524, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 21, + }, + "start": Object { + "column": 4, + "line": 21, + }, + }, + "range": Array [ + 529, + 535, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 21, + }, + "start": Object { + "column": 11, + "line": 21, + }, + }, + "range": Array [ + 536, + 537, + ], + "type": "Identifier", + "value": "k", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 21, + }, + "start": Object { + "column": 12, + "line": 21, + }, + }, + "range": Array [ + 537, + 538, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 21, + }, + "start": Object { + "column": 13, + "line": 21, + }, + }, + "range": Array [ + 538, + 541, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 21, + }, + "start": Object { + "column": 16, + "line": 21, + }, + }, + "range": Array [ + 541, + 542, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 21, + }, + "start": Object { + "column": 18, + "line": 21, + }, + }, + "range": Array [ + 543, + 549, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 21, + }, + "start": Object { + "column": 24, + "line": 21, + }, + }, + "range": Array [ + 549, + 550, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 21, + }, + "start": Object { + "column": 25, + "line": 21, + }, + }, + "range": Array [ + 550, + 551, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 21, + }, + "start": Object { + "column": 27, + "line": 21, + }, + }, + "range": Array [ + 552, + 556, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 21, + }, + "start": Object { + "column": 31, + "line": 21, + }, + }, + "range": Array [ + 556, + 557, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 22, + }, + "start": Object { + "column": 4, + "line": 22, + }, + }, + "range": Array [ + 562, + 570, + ], + "type": "Identifier", + "value": "readonly", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 22, + }, + "start": Object { + "column": 13, + "line": 22, + }, + }, + "range": Array [ + 571, + 572, + ], + "type": "Identifier", + "value": "l", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 22, + }, + "start": Object { + "column": 14, + "line": 22, + }, + }, + "range": Array [ + 572, + 573, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 22, + }, + "start": Object { + "column": 15, + "line": 22, + }, + }, + "range": Array [ + 573, + 576, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 22, + }, + "start": Object { + "column": 18, + "line": 22, + }, + }, + "range": Array [ + 576, + 577, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 20, + "line": 22, + }, + }, + "range": Array [ + 578, + 584, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 22, + }, + "start": Object { + "column": 26, + "line": 22, + }, + }, + "range": Array [ + 584, + 585, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 22, + }, + "start": Object { + "column": 27, + "line": 22, + }, + }, + "range": Array [ + 585, + 586, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 22, + }, + "start": Object { + "column": 29, + "line": 22, + }, + }, + "range": Array [ + 587, + 591, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 22, + }, + "start": Object { + "column": 33, + "line": 22, + }, + }, + "range": Array [ + 591, + 592, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 23, + }, + "start": Object { + "column": 0, + "line": 23, + }, + }, + "range": Array [ + 593, + 594, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/expressions/call-expression-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 3, + 6, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 23, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "TSNumberKeyword", + }, + ], + "range": Array [ + 13, + 21, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/expressions/new-expression-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 20, + ], + "type": "NewExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 20, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/expressions/tagged-template-expression-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasi": Object { + "expressions": Array [], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "baz", + "raw": "baz", + }, + }, + ], + "range": Array [ + 8, + 13, + ], + "type": "TemplateLiteral", + }, + "range": Array [ + 0, + 13, + ], + "tag": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "type": "TaggedTemplateExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 3, + 8, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Template", + "value": "\`baz\`", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 34, + 54, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 49, + 53, + ], + "raw": "'fs'", + "type": "Literal", + "value": "fs", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "fs", + "range": Array [ + 41, + 43, + ], + "type": "Identifier", + }, + "range": Array [ + 41, + 43, + ], + "type": "ImportDefaultSpecifier", + }, + ], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 56, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 29, + ], + "raw": "\\"i-use-things\\"", + "type": "Literal", + "value": "i-use-things", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 57, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 29, + ], + "type": "String", + "value": "\\"i-use-things\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 41, + 43, + ], + "type": "Identifier", + "value": "fs", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 49, + 53, + ], + "type": "String", + "value": "'fs'", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "select", + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 59, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "selector", + "range": Array [ + 48, + 64, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 56, + 64, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 32, + 82, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 65, + 81, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 67, + 81, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "name": "Selection", + "range": Array [ + 67, + 76, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 54, + "line": 2, + }, + }, + "range": Array [ + 77, + 80, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 76, + 81, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 59, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 25, + 82, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 84, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "d3", + "range": Array [ + 18, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 84, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 84, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 17, + ], + "type": "Identifier", + "value": "namespace", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "Identifier", + "value": "d3", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 32, + 40, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + "value": "select", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "Identifier", + "value": "selector", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 67, + 76, + ], + "type": "Identifier", + "value": "Selection", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 2, + }, + "start": Object { + "column": 53, + "line": 2, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 2, + }, + "start": Object { + "column": 54, + "line": 2, + }, + }, + "range": Array [ + 77, + 80, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 2, + }, + "start": Object { + "column": 57, + "line": 2, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 2, + }, + "start": Object { + "column": 58, + "line": 2, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/global-module-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 43, + 51, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "global", + "range": Array [ + 36, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 51, + ], + "type": "TSModuleDeclaration", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 29, + "line": 5, + }, + }, + "range": Array [ + 81, + 89, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "name": "global", + "range": Array [ + 74, + 80, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 56, + 89, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 91, + ], + "type": "TSModuleBlock", + }, + "declare": true, + "global": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "global", + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 91, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 92, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Keyword", + "value": "global", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "Keyword", + "value": "global", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 56, + 63, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 64, + 73, + ], + "type": "Identifier", + "value": "namespace", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 74, + 80, + ], + "type": "Keyword", + "value": "global", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 5, + }, + "start": Object { + "column": 29, + "line": 5, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "method", + "range": Array [ + 52, + 58, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 52, + 66, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 64, + 66, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 58, + 66, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 60, + 63, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "name": "C", + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + }, + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 42, + 73, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "C", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 34, + 73, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 73, + ], + "type": "ExportDefaultDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 34, + "line": 5, + }, + }, + "range": Array [ + 108, + 110, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "name": "bar", + "range": Array [ + 102, + 105, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "params": Array [], + "range": Array [ + 93, + 110, + ], + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 78, + 110, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 112, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 112, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 114, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 52, + 58, + ], + "type": "Identifier", + "value": "method", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 78, + 84, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 85, + 92, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 93, + 101, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "range": Array [ + 102, + 105, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 5, + }, + "start": Object { + "column": 31, + "line": 5, + }, + }, + "range": Array [ + 105, + 106, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 5, + }, + "start": Object { + "column": 32, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 5, + }, + "start": Object { + "column": 34, + "line": 5, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 35, + "line": 5, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 111, + 112, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 31, + 44, + ], + "raw": "'hello world'", + "type": "Literal", + "value": "hello world", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 27, + 44, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 23, + 44, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 16, + 44, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": "constructor", + "range": Array [ + 78, + 89, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 129, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 56, + "line": 5, + }, + }, + "range": Array [ + 126, + 129, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "params": Array [ + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 27, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 97, + 106, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "range": Array [ + 98, + 106, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "range": Array [ + 90, + 106, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 38, + "line": 5, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 45, + "line": 5, + }, + }, + "name": "y", + "range": Array [ + 115, + 124, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 46, + "line": 5, + }, + }, + "range": Array [ + 116, + 124, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 48, + "line": 5, + }, + }, + "range": Array [ + 118, + 124, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "range": Array [ + 108, + 124, + ], + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 89, + 129, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 68, + 135, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "name": "Point", + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 56, + 135, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 49, + 135, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "name": "name", + "range": Array [ + 200, + 204, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "range": Array [ + 200, + 213, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 204, + 212, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 18, + "line": 9, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 28, + "line": 8, + }, + }, + "range": Array [ + 186, + 223, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 8, + }, + "start": Object { + "column": 25, + "line": 8, + }, + }, + "name": "Id", + "range": Array [ + 183, + 185, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 173, + 223, + ], + "type": "TSInterfaceDeclaration", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 166, + 223, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 156, + 229, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "name": "B", + "range": Array [ + 154, + 155, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 147, + 229, + ], + "type": "TSModuleDeclaration", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 140, + 229, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 231, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 231, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 231, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 31, + 44, + ], + "type": "String", + "value": "'hello world'", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 49, + 55, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + "value": "Point", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 89, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 89, + 90, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "range": Array [ + 90, + 96, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 27, + "line": 5, + }, + }, + "range": Array [ + 97, + 98, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 5, + }, + "start": Object { + "column": 36, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 5, + }, + "start": Object { + "column": 38, + "line": 5, + }, + }, + "range": Array [ + 108, + 114, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 45, + "line": 5, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 5, + }, + "start": Object { + "column": 46, + "line": 5, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 48, + "line": 5, + }, + }, + "range": Array [ + 118, + 124, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 5, + }, + "start": Object { + "column": 54, + "line": 5, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 56, + "line": 5, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 5, + }, + "start": Object { + "column": 58, + "line": 5, + }, + }, + "range": Array [ + 128, + 129, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 134, + 135, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 140, + 146, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 147, + 153, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "range": Array [ + 154, + 155, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 166, + 172, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 173, + 182, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 8, + }, + "start": Object { + "column": 25, + "line": 8, + }, + }, + "range": Array [ + 183, + 185, + ], + "type": "Identifier", + "value": "Id", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 8, + }, + "start": Object { + "column": 28, + "line": 8, + }, + }, + "range": Array [ + 186, + 187, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "range": Array [ + 200, + 204, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 18, + "line": 9, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 9, + }, + "start": Object { + "column": 24, + "line": 9, + }, + }, + "range": Array [ + 212, + 213, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 222, + 223, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 228, + 229, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 12, + }, + }, + "range": Array [ + 230, + 231, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 31, + ], + "raw": "\\"hot-new-module\\"", + "type": "Literal", + "value": "hot-new-module", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 31, + ], + "type": "String", + "value": "\\"hot-new-module\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/array-type.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 32, - "line": 17, - }, - "start": Object { - "column": 4, - "line": 17, - }, + "start": Object { + "column": 11, + "line": 1, }, - "optional": false, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 17, - }, - "start": Object { - "column": 13, - "line": 17, - }, - }, - "name": "bar", - "range": Array [ - 402, - 413, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 17, - }, - "start": Object { - "column": 16, - "line": 17, - }, - }, - "range": Array [ - 405, - 413, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 17, - }, - "start": Object { - "column": 18, - "line": 17, - }, - }, - "range": Array [ - 407, - 413, - ], - "type": "TSStringKeyword", - }, - }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 19, + ], + "type": "TSArrayType", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/conditional.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, }, - ], + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", "range": Array [ - 393, - 421, + 4, + 47, ], - "static": false, - "type": "TSMethodSignature", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 17, + "column": 47, + "line": 1, }, "start": Object { - "column": 25, - "line": 17, + "column": 5, + "line": 1, }, }, "range": Array [ - 414, - 420, + 5, + 47, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 17, - }, - "start": Object { - "column": 27, - "line": 17, - }, - }, - "range": Array [ - 416, - 420, - ], - "type": "TSVoidKeyword", - }, - }, - }, - Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 18, - }, - "start": Object { - "column": 12, - "line": 18, - }, - }, - "name": "h", - "range": Array [ - 434, - 435, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 18, - }, - "start": Object { - "column": 4, - "line": 18, - }, - }, - "optional": false, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 18, - }, - "start": Object { - "column": 14, - "line": 18, + "checkType": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, }, + "range": Array [ + 7, + 13, + ], + "type": "TSNumberKeyword", }, - "name": "bar", - "range": Array [ - 436, - 447, - ], - "type": "Identifier", - "typeAnnotation": Object { + "extendsType": Object { "loc": Object { "end": Object { - "column": 25, - "line": 18, + "column": 28, + "line": 1, }, "start": Object { - "column": 17, - "line": 18, + "column": 22, + "line": 1, }, }, "range": Array [ - 439, - 447, + 22, + 28, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 18, - }, - "start": Object { - "column": 19, - "line": 18, - }, + "type": "TSStringKeyword", + }, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, }, - "range": Array [ - 441, - 447, - ], - "type": "TSStringKeyword", }, + "range": Array [ + 41, + 47, + ], + "type": "TSStringKeyword", }, - }, - ], - "range": Array [ - 426, - 455, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 18, - }, - "start": Object { - "column": 26, - "line": 18, - }, - }, - "range": Array [ - 448, - 454, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, - "line": 18, + "column": 47, + "line": 1, }, "start": Object { - "column": 28, - "line": 18, + "column": 7, + "line": 1, }, }, "range": Array [ - 450, - 454, + 7, + 47, ], - "type": "TSVoidKeyword", + "trueType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "TSBooleanKeyword", + }, + "type": "TSConditionalType", }, }, }, - Object { - "accessibility": "protected", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 19, - }, - "start": Object { - "column": 14, - "line": 19, - }, - }, - "name": "i", - "range": Array [ - 470, - 471, - ], - "type": "Identifier", + "init": null, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, + }, + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/conditional-with-null.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 35, - "line": 19, + "column": 45, + "line": 1, }, "start": Object { "column": 4, - "line": 19, + "line": 1, }, }, - "optional": false, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 19, - }, - "start": Object { - "column": 16, - "line": 19, - }, - }, - "name": "bar", - "range": Array [ - 472, - 483, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 19, - }, - "start": Object { - "column": 19, - "line": 19, - }, - }, - "range": Array [ - 475, - 483, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 19, - }, - "start": Object { - "column": 21, - "line": 19, - }, - }, - "range": Array [ - 477, - 483, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], + "name": "x", "range": Array [ - 460, - 491, + 4, + 45, ], - "static": false, - "type": "TSMethodSignature", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 34, - "line": 19, + "column": 45, + "line": 1, }, "start": Object { - "column": 28, - "line": 19, + "column": 5, + "line": 1, }, }, "range": Array [ - 484, - 490, + 5, + 45, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 19, - }, - "start": Object { - "column": 30, - "line": 19, + "checkType": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, }, + "range": Array [ + 7, + 13, + ], + "type": "TSNumberKeyword", }, - "range": Array [ - 486, - 490, - ], - "type": "TSVoidKeyword", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 20, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", }, - "start": Object { - "column": 11, - "line": 20, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "TSNullKeyword", }, - }, - "name": "j", - "range": Array [ - 503, - 504, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 20, - }, - "start": Object { - "column": 4, - "line": 20, - }, - }, - "optional": false, - "params": Array [ - Object { "loc": Object { "end": Object { - "column": 24, - "line": 20, + "column": 45, + "line": 1, }, "start": Object { - "column": 13, - "line": 20, + "column": 7, + "line": 1, }, }, - "name": "bar", "range": Array [ - 505, - 516, + 7, + 45, ], - "type": "Identifier", - "typeAnnotation": Object { + "trueType": Object { "loc": Object { "end": Object { - "column": 24, - "line": 20, + "column": 38, + "line": 1, }, "start": Object { - "column": 16, - "line": 20, + "column": 31, + "line": 1, }, }, "range": Array [ - 508, - 516, + 31, + 38, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 20, - }, - "start": Object { - "column": 18, - "line": 20, - }, - }, - "range": Array [ - 510, - 516, - ], - "type": "TSStringKeyword", - }, + "type": "TSBooleanKeyword", }, + "type": "TSConditionalType", }, - ], + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/indexed.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", "range": Array [ - 496, - 524, + 4, + 11, ], - "static": true, - "type": "TSMethodSignature", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 20, + "column": 11, + "line": 1, }, "start": Object { - "column": 25, - "line": 20, + "column": 5, + "line": 1, }, }, "range": Array [ - 517, - 523, + 5, + 11, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 20, + "indexType": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, - "start": Object { - "column": 27, - "line": 20, + "range": Array [ + 9, + 10, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "K", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, }, - "range": Array [ - 519, - 523, - ], - "type": "TSVoidKeyword", - }, - }, - }, - Object { - "computed": false, - "export": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 21, - }, - "start": Object { - "column": 11, - "line": 21, - }, - }, - "name": "k", - "range": Array [ - 536, - 537, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 21, - }, - "start": Object { - "column": 4, - "line": 21, - }, - }, - "optional": false, - "params": Array [ - Object { "loc": Object { "end": Object { - "column": 24, - "line": 21, + "column": 11, + "line": 1, }, "start": Object { - "column": 13, - "line": 21, + "column": 7, + "line": 1, }, }, - "name": "bar", - "range": Array [ - 538, - 549, - ], - "type": "Identifier", - "typeAnnotation": Object { + "objectType": Object { "loc": Object { "end": Object { - "column": 24, - "line": 21, + "column": 8, + "line": 1, }, "start": Object { - "column": 16, - "line": 21, + "column": 7, + "line": 1, }, }, "range": Array [ - 541, - 549, + 7, + 8, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 24, - "line": 21, + "column": 8, + "line": 1, }, "start": Object { - "column": 18, - "line": 21, + "column": 7, + "line": 1, }, }, + "name": "T", "range": Array [ - 543, - 549, + 7, + 8, ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 529, - 557, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 21, - }, - "start": Object { - "column": 25, - "line": 21, - }, - }, - "range": Array [ - 550, - 556, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 21, - }, - "start": Object { - "column": 27, - "line": 21, + "type": "Identifier", }, }, "range": Array [ - 552, - 556, + 7, + 11, ], - "type": "TSVoidKeyword", + "type": "TSIndexedAccessType", }, }, }, + "init": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "K", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/intersection-type.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "LinkedList", + "range": Array [ + 5, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 49, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 48, + ], + "type": "TSIntersectionType", + "types": Array [ Object { - "computed": false, - "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 14, - "line": 22, + "column": 22, + "line": 1, }, "start": Object { - "column": 13, - "line": 22, + "column": 21, + "line": 1, }, }, - "name": "l", + "name": "T", "range": Array [ - 571, - 572, + 21, + 22, ], "type": "Identifier", }, + }, + Object { "loc": Object { "end": Object { - "column": 34, - "line": 22, + "column": 48, + "line": 1, }, "start": Object { - "column": 4, - "line": 22, + "column": 25, + "line": 1, }, }, - "optional": false, - "params": Array [ + "members": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "next", + "range": Array [ + 27, + 31, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 46, + "line": 1, }, "start": Object { - "column": 15, - "line": 22, + "column": 27, + "line": 1, }, }, - "name": "bar", "range": Array [ - 573, - 584, + 27, + 46, ], - "type": "Identifier", + "type": "TSPropertySignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 46, + "line": 1, }, "start": Object { - "column": 18, - "line": 22, + "column": 31, + "line": 1, }, }, "range": Array [ - 576, - 584, + 31, + 46, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 46, + "line": 1, }, "start": Object { - "column": 20, - "line": 22, + "column": 33, + "line": 1, }, }, "range": Array [ - 578, - 584, + 33, + 46, ], - "type": "TSStringKeyword", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "LinkedList", + "range": Array [ + 33, + 43, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 43, + 46, + ], + "type": "TSTypeParameterInstantiation", + }, }, }, }, ], "range": Array [ - 562, - 592, + 25, + 48, ], - "readonly": true, - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 22, - }, - "start": Object { - "column": 27, - "line": 22, - }, - }, - "range": Array [ - 585, - 591, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 22, - }, - "start": Object { - "column": 29, - "line": 22, - }, - }, - "range": Array [ - 587, - 591, - ], - "type": "TSVoidKeyword", - }, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 23, - }, - "start": Object { - "column": 14, - "line": 1, + "type": "TSTypeLiteral", }, - }, - "range": Array [ - 14, - 594, ], - "type": "TSInterfaceBody", }, - "heritage": Array [], - "id": Object { + "typeParameters": Object { "loc": Object { "end": Object { - "column": 13, + "column": 18, "line": 1, }, "start": Object { - "column": 10, + "column": 15, "line": 1, }, }, - "name": "Foo", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "TSTypeParameter", + }, + ], "range": Array [ - 10, - 13, + 15, + 18, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 23, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 0, - 594, - ], - "type": "TSInterfaceDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 25, + "line": 2, }, "start": Object { "column": 0, @@ -63292,14 +79139,14 @@ Object { }, "range": Array [ 0, - 596, + 50, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 4, "line": 1, }, "start": Object { @@ -63309,295 +79156,187 @@ Object { }, "range": Array [ 0, - 9, + 4, ], - "type": "Keyword", - "value": "interface", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 5, "line": 1, }, }, "range": Array [ - 10, - 13, + 5, + 15, ], "type": "Identifier", - "value": "Foo", + "value": "LinkedList", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, + 16, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 20, - 23, + 16, + 17, ], "type": "Identifier", - "value": "bar", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 23, - 24, + 17, + 18, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 25, - 31, - ], - "type": "Identifier", - "value": "string", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 32, - 33, + 19, + 20, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 34, - 37, - ], - "type": "String", - "value": "'a'", - }, Object { "loc": Object { "end": Object { "column": 22, - "line": 2, + "line": 1, }, "start": Object { "column": 21, - "line": 2, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 43, - 49, - ], - "type": "Keyword", - "value": "public", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, + "line": 1, }, }, "range": Array [ - 50, - 51, + 21, + 22, ], "type": "Identifier", - "value": "a", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 12, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 51, - 52, + 23, + 24, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 53, - 59, - ], - "type": "Identifier", - "value": "string", + "value": "&", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 20, - "line": 3, + "column": 25, + "line": 1, }, }, "range": Array [ - 59, - 60, + 25, + 26, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 65, - 72, - ], - "type": "Keyword", - "value": "private", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 31, + "line": 1, }, "start": Object { - "column": 12, - "line": 4, + "column": 27, + "line": 1, }, }, "range": Array [ - 73, - 74, + 27, + 31, ], "type": "Identifier", - "value": "b", + "value": "next", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 32, + "line": 1, }, "start": Object { - "column": 13, - "line": 4, + "column": 31, + "line": 1, }, }, "range": Array [ - 74, - 75, + 31, + 32, ], "type": "Punctuator", "value": ":", @@ -63605,359 +79344,454 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 43, + "line": 1, }, "start": Object { - "column": 15, - "line": 4, + "column": 33, + "line": 1, }, }, "range": Array [ - 76, - 82, + 33, + 43, ], "type": "Identifier", - "value": "string", + "value": "LinkedList", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 4, + "column": 44, + "line": 1, }, "start": Object { - "column": 21, - "line": 4, + "column": 43, + "line": 1, }, }, "range": Array [ - 82, - 83, + 43, + 44, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 88, - 97, - ], - "type": "Keyword", - "value": "protected", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 45, + "line": 1, }, "start": Object { - "column": 14, - "line": 5, + "column": 44, + "line": 1, }, }, "range": Array [ - 98, - 99, + 44, + 45, ], "type": "Identifier", - "value": "c", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 46, + "line": 1, }, "start": Object { - "column": 15, - "line": 5, + "column": 45, + "line": 1, }, }, "range": Array [ - 99, - 100, + 45, + 46, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "range": Array [ - 101, - 107, - ], - "type": "Identifier", - "value": "string", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 5, + "column": 48, + "line": 1, }, "start": Object { - "column": 23, - "line": 5, + "column": 47, + "line": 1, }, }, "range": Array [ - 107, - 108, + 47, + 48, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 6, + "column": 49, + "line": 1, }, "start": Object { - "column": 4, - "line": 6, + "column": 48, + "line": 1, }, }, "range": Array [ - 113, - 119, + 48, + 49, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/mapped.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "map", + "range": Array [ + 4, + 35, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 35, + ], + "type": "TSMappedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSNumberKeyword", + }, + "typeParameter": Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 12, + 23, + ], + "type": "TSTypeParameter", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 35, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 36, + "line": 1, }, "start": Object { - "column": 11, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 120, - 121, + 0, + 36, ], - "type": "Identifier", - "value": "d", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 3, + "line": 1, }, "start": Object { - "column": 12, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 121, - 122, + 0, + 3, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 6, + "column": 7, + "line": 1, }, "start": Object { - "column": 14, - "line": 6, + "column": 4, + "line": 1, }, }, "range": Array [ - 123, - 129, + 4, + 7, ], "type": "Identifier", - "value": "string", + "value": "map", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 6, + "column": 8, + "line": 1, }, "start": Object { - "column": 20, - "line": 6, + "column": 7, + "line": 1, }, }, "range": Array [ - 129, - 130, + 7, + 8, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 7, + "line": 1, }, "start": Object { - "column": 4, - "line": 7, + "column": 9, + "line": 1, }, }, "range": Array [ - 135, - 141, + 9, + 10, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 7, + "line": 1, }, "start": Object { "column": 11, - "line": 7, + "line": 1, }, }, "range": Array [ - 142, - 143, + 11, + 12, ], - "type": "Identifier", - "value": "e", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 7, + "line": 1, }, "start": Object { "column": 12, - "line": 7, - }, - }, - "range": Array [ - 143, - 144, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 14, - "line": 7, + "line": 1, }, }, "range": Array [ - 145, - 151, + 12, + 13, ], "type": "Identifier", - "value": "string", + "value": "P", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 16, + "line": 1, }, "start": Object { - "column": 20, - "line": 7, + "column": 14, + "line": 1, }, }, "range": Array [ - 151, - 152, + 14, + 16, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 8, + "column": 23, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 17, + "line": 1, }, }, "range": Array [ - 157, - 165, + 17, + 23, ], "type": "Identifier", - "value": "readonly", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 24, + "line": 1, }, "start": Object { - "column": 13, - "line": 8, + "column": 23, + "line": 1, }, }, "range": Array [ - 166, - 167, + 23, + 24, ], - "type": "Identifier", - "value": "f", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 8, + "column": 25, + "line": 1, }, "start": Object { - "column": 14, - "line": 8, + "column": 24, + "line": 1, }, }, "range": Array [ - 167, - 168, + 24, + 25, ], "type": "Punctuator", "value": ":", @@ -63965,35 +79799,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 8, + "column": 32, + "line": 1, }, "start": Object { - "column": 16, - "line": 8, + "column": 26, + "line": 1, }, }, "range": Array [ - 169, - 175, + 26, + 32, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 8, + "column": 33, + "line": 1, }, "start": Object { - "column": 22, - "line": 8, + "column": 32, + "line": 1, }, }, "range": Array [ - 175, - 176, + 32, + 33, ], "type": "Punctuator", "value": ";", @@ -64001,305 +79835,366 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 10, + "column": 35, + "line": 1, }, "start": Object { - "column": 4, - "line": 10, + "column": 34, + "line": 1, }, }, "range": Array [ - 182, - 188, + 34, + 35, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 10, + "column": 36, + "line": 1, }, "start": Object { - "column": 11, - "line": 10, + "column": 35, + "line": 1, }, }, "range": Array [ - 189, - 190, + 35, + 36, ], "type": "Punctuator", - "value": "[", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/mapped-readonly.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 10, - }, - "start": Object { - "column": 12, - "line": 10, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "map", + "range": Array [ + 4, + 45, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "optional": true, + "range": Array [ + 9, + 45, + ], + "readonly": true, + "type": "TSMappedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "TSNumberKeyword", + }, + "typeParameter": Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 21, + 32, + ], + "type": "TSTypeParameter", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 45, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 190, - 193, ], - "type": "Identifier", - "value": "baz", - }, - Object { + "kind": "let", "loc": Object { "end": Object { - "column": 16, - "line": 10, + "column": 46, + "line": 1, }, "start": Object { - "column": 15, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 193, - 194, + 0, + 46, ], - "type": "Punctuator", - "value": ":", + "type": "VariableDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 10, - }, - "start": Object { - "column": 17, - "line": 10, - }, - }, - "range": Array [ - 195, - 201, - ], - "type": "Identifier", - "value": "string", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 10, - }, - "start": Object { - "column": 23, - "line": 10, - }, - }, - "range": Array [ - 201, - 202, - ], - "type": "Punctuator", - "value": "]", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 47, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, - "line": 10, + "column": 3, + "line": 1, }, "start": Object { - "column": 24, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 202, - 203, + 0, + 3, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 10, + "column": 7, + "line": 1, }, "start": Object { - "column": 26, - "line": 10, + "column": 4, + "line": 1, }, }, "range": Array [ - 204, - 210, + 4, + 7, ], "type": "Identifier", - "value": "string", + "value": "map", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 10, + "column": 8, + "line": 1, }, "start": Object { - "column": 32, - "line": 10, + "column": 7, + "line": 1, }, }, "range": Array [ - 210, - 211, + 7, + 8, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "range": Array [ - 216, - 223, - ], - "type": "Keyword", - "value": "private", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 11, + "column": 10, + "line": 1, }, "start": Object { - "column": 12, - "line": 11, + "column": 9, + "line": 1, }, }, "range": Array [ - 224, - 225, + 9, + 10, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 11, + "column": 19, + "line": 1, }, "start": Object { - "column": 13, - "line": 11, + "column": 11, + "line": 1, }, }, "range": Array [ - 225, - 228, + 11, + 19, ], "type": "Identifier", - "value": "baz", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 11, + "column": 21, + "line": 1, }, "start": Object { - "column": 16, - "line": 11, + "column": 20, + "line": 1, }, }, "range": Array [ - 228, - 229, + 20, + 21, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 11, + "column": 22, + "line": 1, }, "start": Object { - "column": 18, - "line": 11, + "column": 21, + "line": 1, }, }, "range": Array [ - 230, - 236, + 21, + 22, ], "type": "Identifier", - "value": "string", + "value": "P", }, Object { "loc": Object { "end": Object { "column": 25, - "line": 11, - }, - "start": Object { - "column": 24, - "line": 11, - }, - }, - "range": Array [ - 236, - 237, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 11, + "line": 1, }, "start": Object { - "column": 25, - "line": 11, + "column": 23, + "line": 1, }, }, "range": Array [ - 237, - 238, + 23, + 25, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 11, + "column": 32, + "line": 1, }, "start": Object { - "column": 27, - "line": 11, + "column": 26, + "line": 1, }, }, "range": Array [ - 239, - 245, + 26, + 32, ], "type": "Identifier", "value": "string", @@ -64307,89 +80202,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, - "line": 11, - }, - "start": Object { "column": 33, - "line": 11, - }, - }, - "range": Array [ - 245, - 246, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 12, - }, - "start": Object { - "column": 4, - "line": 12, - }, - }, - "range": Array [ - 251, - 260, - ], - "type": "Keyword", - "value": "protected", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 12, + "line": 1, }, "start": Object { - "column": 14, - "line": 12, + "column": 32, + "line": 1, }, }, "range": Array [ - 261, - 262, + 32, + 33, ], "type": "Punctuator", - "value": "[", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 12, + "column": 34, + "line": 1, }, "start": Object { - "column": 15, - "line": 12, + "column": 33, + "line": 1, }, }, "range": Array [ - 262, - 265, + 33, + 34, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 12, + "column": 35, + "line": 1, }, "start": Object { - "column": 18, - "line": 12, + "column": 34, + "line": 1, }, }, "range": Array [ - 265, - 266, + 34, + 35, ], "type": "Punctuator", "value": ":", @@ -64397,161 +80256,294 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 12, + "column": 42, + "line": 1, }, "start": Object { - "column": 20, - "line": 12, + "column": 36, + "line": 1, }, }, "range": Array [ - 267, - 273, + 36, + 42, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 12, + "column": 43, + "line": 1, }, "start": Object { - "column": 26, - "line": 12, + "column": 42, + "line": 1, }, }, "range": Array [ - 273, - 274, + 42, + 43, ], "type": "Punctuator", - "value": "]", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 12, + "column": 45, + "line": 1, }, "start": Object { - "column": 27, - "line": 12, + "column": 44, + "line": 1, }, }, "range": Array [ - 274, - 275, + 44, + 45, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 12, + "column": 46, + "line": 1, }, "start": Object { - "column": 29, - "line": 12, + "column": 45, + "line": 1, }, }, "range": Array [ - 276, - 282, + 45, + 46, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/mapped-readonly-minus.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 12, - }, - "start": Object { - "column": 35, - "line": 12, - }, - }, - "range": Array [ - 282, - 283, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "map", + "range": Array [ + 4, + 46, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 46, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "optional": "-", + "range": Array [ + 9, + 46, + ], + "readonly": "-", + "type": "TSMappedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSNumberKeyword", + }, + "typeParameter": Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 22, + 33, + ], + "type": "TSTypeParameter", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 46, + ], + "type": "VariableDeclarator", + }, ], - "type": "Punctuator", - "value": ";", - }, - Object { + "kind": "let", "loc": Object { "end": Object { - "column": 10, - "line": 13, + "column": 47, + "line": 1, }, "start": Object { - "column": 4, - "line": 13, + "column": 0, + "line": 1, }, }, "range": Array [ - 288, - 294, + 0, + 47, ], - "type": "Keyword", - "value": "static", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 13, + "column": 3, + "line": 1, }, "start": Object { - "column": 11, - "line": 13, + "column": 0, + "line": 1, }, }, "range": Array [ - 295, - 296, + 0, + 3, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 13, + "column": 7, + "line": 1, }, "start": Object { - "column": 12, - "line": 13, + "column": 4, + "line": 1, }, }, "range": Array [ - 296, - 299, + 4, + 7, ], "type": "Identifier", - "value": "baz", + "value": "map", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 13, + "column": 8, + "line": 1, }, "start": Object { - "column": 15, - "line": 13, + "column": 7, + "line": 1, }, }, "range": Array [ - 299, - 300, + 7, + 8, ], "type": "Punctuator", "value": ":", @@ -64559,215 +80551,197 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 17, - "line": 13, - }, - }, - "range": Array [ - 301, - 307, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 13, + "column": 10, + "line": 1, }, "start": Object { - "column": 23, - "line": 13, + "column": 9, + "line": 1, }, }, "range": Array [ - 307, - 308, + 9, + 10, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 13, + "column": 12, + "line": 1, }, "start": Object { - "column": 24, - "line": 13, + "column": 11, + "line": 1, }, }, "range": Array [ - 308, - 309, + 11, + 12, ], "type": "Punctuator", - "value": ":", + "value": "-", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 13, + "column": 20, + "line": 1, }, "start": Object { - "column": 26, - "line": 13, + "column": 12, + "line": 1, }, }, "range": Array [ - 310, - 316, + 12, + 20, ], "type": "Identifier", - "value": "string", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 13, + "column": 22, + "line": 1, }, "start": Object { - "column": 32, - "line": 13, + "column": 21, + "line": 1, }, }, "range": Array [ - 316, - 317, + 21, + 22, ], "type": "Punctuator", - "value": ";", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 14, + "column": 23, + "line": 1, }, "start": Object { - "column": 4, - "line": 14, + "column": 22, + "line": 1, }, }, "range": Array [ - 322, - 328, + 22, + 23, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "P", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 14, + "column": 26, + "line": 1, }, "start": Object { - "column": 11, - "line": 14, + "column": 24, + "line": 1, }, }, "range": Array [ - 329, - 330, + 24, + 26, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 14, + "column": 33, + "line": 1, }, "start": Object { - "column": 12, - "line": 14, + "column": 27, + "line": 1, }, }, "range": Array [ - 330, - 333, + 27, + 33, ], "type": "Identifier", - "value": "baz", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 14, + "column": 34, + "line": 1, }, "start": Object { - "column": 15, - "line": 14, + "column": 33, + "line": 1, }, }, "range": Array [ - 333, - 334, + 33, + 34, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 14, + "column": 35, + "line": 1, }, "start": Object { - "column": 17, - "line": 14, + "column": 34, + "line": 1, }, }, "range": Array [ - 335, - 341, + 34, + 35, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "-", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 14, + "column": 36, + "line": 1, }, "start": Object { - "column": 23, - "line": 14, + "column": 35, + "line": 1, }, }, "range": Array [ - 341, - 342, + 35, + 36, ], "type": "Punctuator", - "value": "]", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 14, + "column": 37, + "line": 1, }, "start": Object { - "column": 24, - "line": 14, + "column": 36, + "line": 1, }, }, "range": Array [ - 342, - 343, + 36, + 37, ], "type": "Punctuator", "value": ":", @@ -64775,341 +80749,474 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, - "line": 14, + "column": 44, + "line": 1, }, "start": Object { - "column": 26, - "line": 14, + "column": 38, + "line": 1, }, }, "range": Array [ - 344, - 350, + 38, + 44, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 14, + "column": 46, + "line": 1, }, "start": Object { - "column": 32, - "line": 14, + "column": 45, + "line": 1, }, }, "range": Array [ - 350, - 351, + 45, + 46, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 15, + "column": 47, + "line": 1, }, "start": Object { - "column": 4, - "line": 15, + "column": 46, + "line": 1, }, }, "range": Array [ - 356, - 364, + 46, + 47, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/mapped-readonly-plus.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 15, - }, - "start": Object { - "column": 13, - "line": 15, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "map", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "optional": "+", + "range": Array [ + 9, + 47, + ], + "readonly": "+", + "type": "TSMappedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSNumberKeyword", + }, + "typeParameter": Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 22, + 33, + ], + "type": "TSTypeParameter", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 365, - 366, ], - "type": "Punctuator", - "value": "[", - }, - Object { + "kind": "let", "loc": Object { "end": Object { - "column": 17, - "line": 15, + "column": 48, + "line": 1, }, "start": Object { - "column": 14, - "line": 15, + "column": 0, + "line": 1, }, }, "range": Array [ - 366, - 369, + 0, + 48, ], - "type": "Identifier", - "value": "baz", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 15, + "column": 3, + "line": 1, }, "start": Object { - "column": 17, - "line": 15, + "column": 0, + "line": 1, }, }, "range": Array [ - 369, - 370, + 0, + 3, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 15, + "column": 7, + "line": 1, }, "start": Object { - "column": 19, - "line": 15, + "column": 4, + "line": 1, }, }, "range": Array [ - 371, - 377, + 4, + 7, ], "type": "Identifier", - "value": "string", + "value": "map", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 15, + "column": 8, + "line": 1, }, "start": Object { - "column": 25, - "line": 15, + "column": 7, + "line": 1, }, }, "range": Array [ - 377, - 378, + 7, + 8, ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 15, + "column": 10, + "line": 1, }, "start": Object { - "column": 26, - "line": 15, + "column": 9, + "line": 1, }, }, "range": Array [ - 378, - 379, + 9, + 10, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 15, + "column": 12, + "line": 1, }, "start": Object { - "column": 28, - "line": 15, + "column": 11, + "line": 1, }, }, "range": Array [ - 380, - 386, + 11, + 12, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 15, + "column": 20, + "line": 1, }, "start": Object { - "column": 34, - "line": 15, + "column": 12, + "line": 1, }, }, "range": Array [ - 386, - 387, + 12, + 20, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 17, + "column": 22, + "line": 1, }, "start": Object { - "column": 4, - "line": 17, + "column": 21, + "line": 1, }, }, "range": Array [ - 393, - 399, + 21, + 22, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 17, + "column": 23, + "line": 1, }, "start": Object { - "column": 11, - "line": 17, + "column": 22, + "line": 1, }, }, "range": Array [ - 400, - 401, + 22, + 23, ], "type": "Identifier", - "value": "g", + "value": "P", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 17, + "column": 26, + "line": 1, }, "start": Object { - "column": 12, - "line": 17, + "column": 24, + "line": 1, }, }, "range": Array [ - 401, - 402, + 24, + 26, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 17, + "column": 33, + "line": 1, }, "start": Object { - "column": 13, - "line": 17, + "column": 27, + "line": 1, }, }, "range": Array [ - 402, - 405, + 27, + 33, ], "type": "Identifier", - "value": "bar", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 17, + "column": 34, + "line": 1, }, "start": Object { - "column": 16, - "line": 17, + "column": 33, + "line": 1, }, }, "range": Array [ - 405, - 406, + 33, + 34, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 17, + "column": 35, + "line": 1, }, "start": Object { - "column": 18, - "line": 17, + "column": 34, + "line": 1, }, }, "range": Array [ - 407, - 413, + 34, + 35, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 17, + "column": 36, + "line": 1, }, "start": Object { - "column": 24, - "line": 17, + "column": 35, + "line": 1, }, }, "range": Array [ - 413, - 414, + 35, + 36, ], "type": "Punctuator", - "value": ")", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 17, + "column": 37, + "line": 1, }, "start": Object { - "column": 25, - "line": 17, + "column": 36, + "line": 1, }, }, "range": Array [ - 414, - 415, + 36, + 37, ], "type": "Punctuator", "value": ":", @@ -65117,35 +81224,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, - "line": 17, + "column": 44, + "line": 1, }, "start": Object { - "column": 27, - "line": 17, + "column": 38, + "line": 1, }, }, "range": Array [ - 416, - 420, + 38, + 44, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 17, + "column": 45, + "line": 1, }, "start": Object { - "column": 31, - "line": 17, + "column": 44, + "line": 1, }, }, "range": Array [ - 420, - 421, + 44, + 45, ], "type": "Punctuator", "value": ";", @@ -65153,287 +81260,560 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 18, + "column": 47, + "line": 1, }, "start": Object { - "column": 4, - "line": 18, + "column": 46, + "line": 1, }, }, "range": Array [ - 426, - 433, + 46, + 47, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 18, + "column": 48, + "line": 1, }, "start": Object { - "column": 12, - "line": 18, + "column": 47, + "line": 1, }, }, "range": Array [ - 434, - 435, + 47, + 48, ], - "type": "Identifier", - "value": "h", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/nested-types.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 14, - "line": 18, + "column": 80, + "line": 1, }, "start": Object { - "column": 13, - "line": 18, + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 80, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "range": Array [ + 11, + 80, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "elementTypes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 18, + ], + "type": "TSNumberKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 27, + ], + "type": "TSOptionalType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 26, + ], + "type": "TSStringKeyword", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSOptionalType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "TSBooleanKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 38, + ], + "type": "TSTupleType", + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 80, + ], + "type": "TSIntersectionType", + "types": Array [ + Object { + "elementTypes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 42, + 44, + ], + "type": "TSTypeLiteral", + }, + Object { + "loc": Object { + "end": Object { + "column": 74, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 74, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "elementTypes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 54, + ], + "type": "TSOptionalType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 53, + ], + "type": "TSNumberKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 55, + ], + "type": "TSTupleType", + }, + Object { + "loc": Object { + "end": Object { + "column": 74, + "line": 1, + }, + "start": Object { + "column": 58, + "line": 1, + }, + }, + "range": Array [ + 58, + 74, + ], + "type": "TSIntersectionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 58, + "line": 1, + }, + }, + "range": Array [ + 58, + 62, + ], + "type": "TSNullKeyword", + }, + Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "range": Array [ + 65, + 72, + ], + "type": "TSBooleanKeyword", + }, + "loc": Object { + "end": Object { + "column": 74, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "range": Array [ + 65, + 74, + ], + "type": "TSArrayType", + }, + ], + }, + ], + }, + ], + "loc": Object { + "end": Object { + "column": 75, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 75, + ], + "type": "TSTupleType", + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 78, + 80, + ], + "type": "TSTypeLiteral", + }, + ], + }, + ], }, - "range": Array [ - 435, - 436, - ], - "type": "Punctuator", - "value": "(", }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 18, - }, - "start": Object { - "column": 14, - "line": 18, - }, - }, - "range": Array [ - 436, - 439, - ], - "type": "Identifier", - "value": "bar", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 18, - }, - "start": Object { - "column": 17, - "line": 18, - }, - }, - "range": Array [ - 439, - 440, - ], - "type": "Punctuator", - "value": ":", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 81, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, - "line": 18, + "column": 4, + "line": 1, }, "start": Object { - "column": 19, - "line": 18, + "column": 0, + "line": 1, }, }, "range": Array [ - 441, - 447, + 0, + 4, ], "type": "Identifier", - "value": "string", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 18, + "column": 8, + "line": 1, }, "start": Object { - "column": 25, - "line": 18, + "column": 5, + "line": 1, }, }, "range": Array [ - 447, - 448, + 5, + 8, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 18, + "column": 10, + "line": 1, }, "start": Object { - "column": 26, - "line": 18, + "column": 9, + "line": 1, }, }, "range": Array [ - 448, - 449, + 9, + 10, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 18, - }, - "start": Object { - "column": 28, - "line": 18, - }, - }, - "range": Array [ - 450, - 454, - ], - "type": "Keyword", - "value": "void", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 18, + "column": 12, + "line": 1, }, "start": Object { - "column": 32, - "line": 18, + "column": 11, + "line": 1, }, }, "range": Array [ - 454, - 455, + 11, + 12, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 19, - }, - "start": Object { - "column": 4, - "line": 19, - }, - }, - "range": Array [ - 460, - 469, - ], - "type": "Keyword", - "value": "protected", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 19, + "column": 18, + "line": 1, }, "start": Object { - "column": 14, - "line": 19, + "column": 12, + "line": 1, }, }, "range": Array [ - 470, - 471, + 12, + 18, ], "type": "Identifier", - "value": "i", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 19, - }, - "start": Object { - "column": 15, - "line": 19, - }, - }, - "range": Array [ - 471, - 472, - ], - "type": "Punctuator", - "value": "(", + "value": "number", }, Object { "loc": Object { "end": Object { "column": 19, - "line": 19, - }, - "start": Object { - "column": 16, - "line": 19, - }, - }, - "range": Array [ - 472, - 475, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 19, + "line": 1, }, "start": Object { - "column": 19, - "line": 19, + "column": 18, + "line": 1, }, }, "range": Array [ - 475, - 476, + 18, + 19, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 19, + "column": 26, + "line": 1, }, "start": Object { - "column": 21, - "line": 19, + "column": 20, + "line": 1, }, }, "range": Array [ - 477, - 483, + 20, + 26, ], "type": "Identifier", "value": "string", @@ -65441,841 +81821,829 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 19, + "column": 27, + "line": 1, }, "start": Object { - "column": 27, - "line": 19, + "column": 26, + "line": 1, }, }, "range": Array [ - 483, - 484, + 26, + 27, ], "type": "Punctuator", - "value": ")", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 19, + "column": 28, + "line": 1, }, "start": Object { - "column": 28, - "line": 19, + "column": 27, + "line": 1, }, }, "range": Array [ - 484, - 485, + 27, + 28, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 19, + "column": 36, + "line": 1, }, "start": Object { - "column": 30, - "line": 19, + "column": 29, + "line": 1, }, }, "range": Array [ - 486, - 490, + 29, + 36, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 19, + "column": 37, + "line": 1, }, "start": Object { - "column": 34, - "line": 19, + "column": 36, + "line": 1, }, }, "range": Array [ - 490, - 491, + 36, + 37, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 20, - }, - "start": Object { - "column": 4, - "line": 20, - }, - }, - "range": Array [ - 496, - 502, - ], - "type": "Keyword", - "value": "static", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 20, + "column": 38, + "line": 1, }, "start": Object { - "column": 11, - "line": 20, + "column": 37, + "line": 1, }, }, "range": Array [ - 503, - 504, + 37, + 38, ], - "type": "Identifier", - "value": "j", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 20, + "column": 40, + "line": 1, }, "start": Object { - "column": 12, - "line": 20, + "column": 39, + "line": 1, }, }, "range": Array [ - 504, - 505, + 39, + 40, ], "type": "Punctuator", - "value": "(", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 20, + "column": 42, + "line": 1, }, "start": Object { - "column": 13, - "line": 20, + "column": 41, + "line": 1, }, }, "range": Array [ - 505, - 508, + 41, + 42, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 20, + "column": 43, + "line": 1, }, "start": Object { - "column": 16, - "line": 20, + "column": 42, + "line": 1, }, }, "range": Array [ - 508, - 509, + 42, + 43, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 20, + "column": 44, + "line": 1, }, "start": Object { - "column": 18, - "line": 20, + "column": 43, + "line": 1, }, }, "range": Array [ - 510, - 516, + 43, + 44, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 20, + "column": 45, + "line": 1, }, "start": Object { - "column": 24, - "line": 20, + "column": 44, + "line": 1, }, }, "range": Array [ - 516, - 517, + 44, + 45, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 20, + "column": 47, + "line": 1, }, "start": Object { - "column": 25, - "line": 20, + "column": 46, + "line": 1, }, }, "range": Array [ - 517, - 518, + 46, + 47, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 20, + "column": 53, + "line": 1, }, "start": Object { - "column": 27, - "line": 20, + "column": 47, + "line": 1, }, }, "range": Array [ - 519, - 523, + 47, + 53, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 20, + "column": 54, + "line": 1, }, "start": Object { - "column": 31, - "line": 20, + "column": 53, + "line": 1, }, }, "range": Array [ - 523, - 524, + 53, + 54, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 21, - }, - "start": Object { - "column": 4, - "line": 21, - }, - }, - "range": Array [ - 529, - 535, - ], - "type": "Keyword", - "value": "export", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 21, + "column": 55, + "line": 1, }, "start": Object { - "column": 11, - "line": 21, + "column": 54, + "line": 1, }, }, "range": Array [ - 536, - 537, + 54, + 55, ], - "type": "Identifier", - "value": "k", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 21, + "column": 57, + "line": 1, }, "start": Object { - "column": 12, - "line": 21, + "column": 56, + "line": 1, }, }, "range": Array [ - 537, - 538, + 56, + 57, ], "type": "Punctuator", - "value": "(", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 21, + "column": 62, + "line": 1, }, "start": Object { - "column": 13, - "line": 21, + "column": 58, + "line": 1, }, }, "range": Array [ - 538, - 541, + 58, + 62, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 21, + "column": 64, + "line": 1, }, "start": Object { - "column": 16, - "line": 21, + "column": 63, + "line": 1, }, }, "range": Array [ - 541, - 542, + 63, + 64, ], "type": "Punctuator", - "value": ":", + "value": "&", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 21, + "column": 72, + "line": 1, }, "start": Object { - "column": 18, - "line": 21, + "column": 65, + "line": 1, }, }, "range": Array [ - 543, - 549, + 65, + 72, ], "type": "Identifier", - "value": "string", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 21, + "column": 73, + "line": 1, }, "start": Object { - "column": 24, - "line": 21, + "column": 72, + "line": 1, }, }, "range": Array [ - 549, - 550, + 72, + 73, ], "type": "Punctuator", - "value": ")", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 21, + "column": 74, + "line": 1, }, "start": Object { - "column": 25, - "line": 21, + "column": 73, + "line": 1, }, }, "range": Array [ - 550, - 551, + 73, + 74, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 21, + "column": 75, + "line": 1, }, "start": Object { - "column": 27, - "line": 21, + "column": 74, + "line": 1, }, }, "range": Array [ - 552, - 556, + 74, + 75, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 21, + "column": 77, + "line": 1, }, "start": Object { - "column": 31, - "line": 21, + "column": 76, + "line": 1, }, }, "range": Array [ - 556, - 557, + 76, + 77, ], "type": "Punctuator", - "value": ";", + "value": "&", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 22, + "column": 79, + "line": 1, }, "start": Object { - "column": 4, - "line": 22, + "column": 78, + "line": 1, }, }, "range": Array [ - 562, - 570, + 78, + 79, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 22, + "column": 80, + "line": 1, }, "start": Object { - "column": 13, - "line": 22, + "column": 79, + "line": 1, }, }, "range": Array [ - 571, - 572, + 79, + 80, ], - "type": "Identifier", - "value": "l", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/parenthesized-type.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 15, - "line": 22, + "column": 28, + "line": 1, }, "start": Object { - "column": 14, - "line": 22, + "column": 0, + "line": 1, }, }, "range": Array [ - 572, - 573, + 0, + 28, ], - "type": "Punctuator", - "value": "(", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 28, + ], + "type": "TSParenthesizedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 27, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 18, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "TSNumberKeyword", + }, + ], + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 22, + "column": 4, + "line": 1, }, "start": Object { - "column": 15, - "line": 22, + "column": 0, + "line": 1, }, }, "range": Array [ - 573, - 576, + 0, + 4, ], "type": "Identifier", - "value": "bar", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 22, + "column": 8, + "line": 1, }, "start": Object { - "column": 18, - "line": 22, + "column": 5, + "line": 1, }, }, "range": Array [ - 576, - 577, + 5, + 8, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 10, + "line": 1, }, "start": Object { - "column": 20, - "line": 22, + "column": 9, + "line": 1, }, }, "range": Array [ - 578, - 584, + 9, + 10, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 22, + "column": 12, + "line": 1, }, "start": Object { - "column": 26, - "line": 22, + "column": 11, + "line": 1, }, }, "range": Array [ - 584, - 585, + 11, + 12, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 22, + "column": 18, + "line": 1, }, "start": Object { - "column": 27, - "line": 22, + "column": 12, + "line": 1, }, }, "range": Array [ - 585, - 586, + 12, + 18, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 22, + "column": 20, + "line": 1, }, "start": Object { - "column": 29, - "line": 22, + "column": 19, + "line": 1, }, }, "range": Array [ - 587, - 591, + 19, + 20, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 22, + "column": 27, + "line": 1, }, "start": Object { - "column": 33, - "line": 22, + "column": 21, + "line": 1, }, }, "range": Array [ - 591, - 592, + 21, + 27, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 23, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 23, + "column": 27, + "line": 1, }, }, "range": Array [ - 593, - 594, + 27, + 28, ], "type": "Punctuator", - "value": "}", + "value": ")", }, ], "type": "Program", } `; -exports[`typescript fixtures/expressions/call-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/types/reference.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, - }, - "params": Array [ - Object { + "name": "x", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, 5, + 8, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, - "name": "A", "range": Array [ - 4, - 5, + 7, + 8, ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 3, - 6, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + }, }, }, - "name": "foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 10, - 23, - ], - "type": "CallExpression", - "typeParameters": Object { + "init": null, "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 3, - "line": 2, + "column": 4, + "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 20, - ], - "type": "TSNumberKeyword", - }, - ], "range": Array [ - 13, - 21, + 4, + 8, ], - "type": "TSTypeParameterInstantiation", + "type": "VariableDeclarator", }, - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 10, - 24, + 0, + 9, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 14, + "column": 0, "line": 2, }, "start": Object { @@ -66285,7 +82653,7 @@ Object { }, "range": Array [ 0, - 24, + 10, ], "sourceType": "script", "tokens": Array [ @@ -66304,26 +82672,8 @@ Object { 0, 3, ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 4, - ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { @@ -66341,7 +82691,7 @@ Object { 5, ], "type": "Identifier", - "value": "A", + "value": "x", }, Object { "loc": Object { @@ -66359,184 +82709,353 @@ Object { 6, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, 8, + 9, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/reference-generic.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 20, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 20, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 20, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 19, + ], + "type": "TSNumberKeyword", + }, + ], + "range": Array [ + 12, + 20, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 20, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 9, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 0, "line": 1, }, }, "range": Array [ - 8, - 9, + 0, + 21, ], - "type": "Punctuator", - "value": ";", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 3, - "line": 2, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 10, - 13, + 0, + 3, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { "column": 4, - "line": 2, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, "start": Object { - "column": 3, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 13, - 14, + 5, + 6, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 14, - 20, + 7, + 12, ], "type": "Identifier", - "value": "number", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 20, - 21, + 12, + 13, ], "type": "Punctuator", - "value": ">", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 21, - 22, + 13, + 19, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 22, - 23, + 19, + 20, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 23, - 24, + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -66546,7 +83065,7 @@ Object { } `; -exports[`typescript fixtures/expressions/new-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/types/reference-generic-nested.src 1`] = ` Object { "body": Array [ Object { @@ -66555,132 +83074,185 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 27, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, - "name": "a", + "name": "x", "range": Array [ - 6, - 7, + 4, + 27, ], "type": "Identifier", - }, - "init": Object { - "arguments": Array [], - "callee": Object { + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, + "column": 27, "line": 1, }, "start": Object { - "column": 14, + "column": 5, "line": 1, }, }, - "name": "A", "range": Array [ - 14, - 15, + 5, + 27, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 20, - ], - "type": "NewExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, }, - }, - "params": Array [ - Object { + "range": Array [ + 7, + 27, + ], + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 17, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 7, "line": 1, }, }, + "name": "Array", "range": Array [ - 16, - 17, + 7, + 12, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", }, - "start": Object { - "column": 16, - "line": 1, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSNumberKeyword", + }, + ], + "range": Array [ + 18, + 26, + ], + "type": "TSTypeParameterInstantiation", }, }, - "name": "B", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, + ], + "range": Array [ + 12, + 27, + ], + "type": "TSTypeParameterInstantiation", }, - ], - "range": Array [ - 15, - 18, - ], - "type": "TSTypeParameterInstantiation", + }, }, }, + "init": null, "loc": Object { "end": Object { - "column": 20, + "column": 27, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 20, + 4, + 27, ], "type": "VariableDeclarator", }, ], - "kind": "const", + "kind": "let", "loc": Object { "end": Object { - "column": 21, + "column": 28, "line": 1, }, "start": Object { @@ -66690,15 +83262,15 @@ Object { }, "range": Array [ 0, - 21, + 28, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -66707,14 +83279,14 @@ Object { }, "range": Array [ 0, - 21, + 29, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -66724,187 +83296,187 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "const", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 5, ], "type": "Identifier", - "value": "a", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 1, }, "start": Object { - "column": 8, + "column": 5, "line": 1, }, }, "range": Array [ - 8, - 9, + 5, + 6, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 10, + "column": 7, "line": 1, }, }, "range": Array [ - 10, - 13, + 7, + 12, ], - "type": "Keyword", - "value": "new", + "type": "Identifier", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 14, + "column": 12, "line": 1, }, }, "range": Array [ - 14, - 15, + 12, + 13, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 16, + 13, + 18, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { - "column": 16, + "column": 18, "line": 1, }, }, "range": Array [ - 16, - 17, + 18, + 19, ], - "type": "Identifier", - "value": "B", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 25, "line": 1, }, "start": Object { - "column": 17, + "column": 19, "line": 1, }, }, "range": Array [ - 17, - 18, + 19, + 25, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 26, "line": 1, }, "start": Object { - "column": 18, + "column": 25, "line": 1, }, }, "range": Array [ - 18, - 19, + 25, + 26, ], "type": "Punctuator", - "value": "(", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 27, "line": 1, }, "start": Object { - "column": 19, + "column": 26, "line": 1, }, }, "range": Array [ - 19, - 20, + 26, + 27, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 28, "line": 1, }, "start": Object { - "column": 20, + "column": 27, "line": 1, }, }, "range": Array [ - 20, - 21, + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -66914,144 +83486,139 @@ Object { } `; -exports[`typescript fixtures/expressions/tagged-template-expression-type-arguments.src 1`] = ` +exports[`typescript fixtures/types/tuple.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "quasi": Object { - "expressions": Array [], - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "quasis": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, }, - "range": Array [ - 8, - 13, - ], - "tail": true, - "type": "TemplateElement", - "value": Object { - "cooked": "baz", - "raw": "baz", + "start": Object { + "column": 4, + "line": 1, }, }, - ], - "range": Array [ - 8, - 13, - ], - "type": "TemplateLiteral", - }, - "range": Array [ - 0, - 13, - ], - "tag": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 0, - 3, - ], - "type": "Identifier", - }, - "type": "TaggedTemplateExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "params": Array [ - Object { + "name": "x", + "range": Array [ + 4, + 31, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 7, + "column": 31, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, - 7, + 5, + 31, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementTypes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "TSNumberKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "TSNumberKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "TSNumberKeyword", + }, + ], "loc": Object { "end": Object { - "column": 7, + "column": 31, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, - "name": "bar", "range": Array [ - 4, 7, + 31, ], - "type": "Identifier", + "type": "TSTupleType", }, }, - ], + }, + "init": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ - 3, - 8, + 4, + 31, ], - "type": "TSTypeParameterInstantiation", + "type": "VariableDeclarator", }, - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 14, + "column": 32, "line": 1, }, "start": Object { @@ -67061,15 +83628,15 @@ Object { }, "range": Array [ 0, - 14, + 32, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -67078,7 +83645,7 @@ Object { }, "range": Array [ 0, - 14, + 33, ], "sourceType": "script", "tokens": Array [ @@ -67097,95 +83664,185 @@ Object { 0, 3, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { - "column": 3, + "column": 4, "line": 1, }, }, "range": Array [ - 3, 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "range": Array [ - 4, 7, + 8, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, ], "type": "Identifier", - "value": "bar", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 30, "line": 1, }, "start": Object { - "column": 7, + "column": 24, "line": 1, }, }, "range": Array [ - 7, - 8, + 24, + 30, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 31, "line": 1, }, "start": Object { - "column": 8, + "column": 30, "line": 1, }, }, "range": Array [ - 8, - 13, + 30, + 31, ], - "type": "Template", - "value": "\`baz\`", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 32, "line": 1, }, "start": Object { - "column": 13, + "column": 31, "line": 1, }, }, "range": Array [ - 13, - 14, + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -67195,126 +83852,88 @@ Object { } `; -exports[`typescript fixtures/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = ` +exports[`typescript fixtures/types/tuple-empty.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 4, + "line": 1, }, }, + "name": "x", "range": Array [ - 34, - 54, + 4, + 9, ], - "source": Object { + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 49, - 53, + 5, + 9, ], - "raw": "'fs'", - "type": "Literal", - "value": "fs", - }, - "specifiers": Array [ - Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementTypes": Array [], "loc": Object { "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { "column": 9, - "line": 2, + "line": 1, }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, + "start": Object { + "column": 7, + "line": 1, }, - "name": "fs", - "range": Array [ - 41, - 43, - ], - "type": "Identifier", }, "range": Array [ - 41, - 43, + 7, + 9, ], - "type": "ImportDefaultSpecifier", + "type": "TSTupleType", }, - ], - "type": "ImportDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 56, - ], - "type": "TSModuleBlock", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, + }, }, - "start": Object { - "column": 15, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", }, - "range": Array [ - 15, - 29, - ], - "raw": "\\"i-use-things\\"", - "type": "Literal", - "value": "i-use-things", - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { "column": 0, @@ -67323,15 +83942,15 @@ Object { }, "range": Array [ 0, - 56, + 10, ], - "type": "TSModuleDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -67340,14 +83959,14 @@ Object { }, "range": Array [ 0, - 57, + 11, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { @@ -67357,423 +83976,327 @@ Object { }, "range": Array [ 0, - 7, + 3, ], - "type": "Identifier", - "value": "declare", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 5, "line": 1, }, "start": Object { - "column": 8, + "column": 4, "line": 1, }, }, "range": Array [ - 8, - 14, + 4, + 5, ], "type": "Identifier", - "value": "module", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 6, "line": 1, }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, "range": Array [ - 15, - 29, + 5, + 6, ], - "type": "String", - "value": "\\"i-use-things\\"", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 8, "line": 1, }, "start": Object { - "column": 30, + "column": 7, "line": 1, }, }, "range": Array [ - 30, - 31, + 7, + 8, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 34, - 40, - ], - "type": "Keyword", - "value": "import", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { "column": 9, - "line": 2, - }, - }, - "range": Array [ - 41, - 43, - ], - "type": "Identifier", - "value": "fs", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 44, - 48, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 49, - 53, - ], - "type": "String", - "value": "'fs'", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, + "line": 1, }, "start": Object { - "column": 21, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 53, - 54, + 8, + 9, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 55, - 56, + 9, + 10, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = ` +exports[`typescript fixtures/types/tuple-optional.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "declaration": Object { - "async": false, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "name": "select", - "range": Array [ - 41, - 47, - ], - "type": "Identifier", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 59, - "line": 2, + "column": 44, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 5, + "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, + "range": Array [ + 5, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementTypes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, + "range": Array [ + 8, + 14, + ], + "type": "TSStringKeyword", }, - "name": "selector", - "range": Array [ - 48, - 64, - ], - "type": "Identifier", - "typeAnnotation": Object { + Object { "loc": Object { "end": Object { - "column": 41, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 33, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 56, - 64, + 16, + 23, ], - "type": "TSTypeAnnotation", + "type": "TSOptionalType", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 41, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 35, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 58, - 64, + 16, + 22, ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 32, - 82, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 2, - }, - "start": Object { - "column": 42, - "line": 2, - }, - }, - "range": Array [ - 65, - 81, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 2, - }, - "start": Object { - "column": 44, - "line": 2, + "type": "TSNumberKeyword", }, }, - "range": Array [ - 67, - 81, - ], - "type": "TSTypeReference", - "typeName": Object { + Object { "loc": Object { "end": Object { - "column": 53, - "line": 2, + "column": 43, + "line": 1, }, "start": Object { - "column": 44, - "line": 2, + "column": 25, + "line": 1, }, }, - "name": "Selection", "range": Array [ - 67, - 76, + 25, + 43, ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 2, - }, - "start": Object { - "column": 53, - "line": 2, + "type": "TSOptionalType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, }, - }, - "params": Array [ - Object { + "range": Array [ + 25, + 42, + ], + "type": "TSParenthesizedType", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 57, - "line": 2, + "column": 41, + "line": 1, }, "start": Object { - "column": 54, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ - 77, - 80, + 26, + 41, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSNumberKeyword", + }, ], - "type": "TSAnyKeyword", }, - ], - "range": Array [ - 76, - 81, - ], - "type": "TSTypeParameterInstantiation", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, }, - }, - "type": "FunctionDeclaration", - }, - "loc": Object { - "end": Object { - "column": 59, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, + "range": Array [ + 7, + 44, + ], + "type": "TSTupleType", }, }, - "range": Array [ - 25, - 82, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 84, - ], - "type": "TSModuleBlock", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, }, - "start": Object { - "column": 18, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", }, - "name": "d3", - "range": Array [ - 18, - 20, - ], - "type": "Identifier", - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { "column": 0, @@ -67782,15 +84305,15 @@ Object { }, "range": Array [ 0, - 84, + 44, ], - "type": "TSModuleDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -67799,14 +84322,14 @@ Object { }, "range": Array [ 0, - 84, + 45, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { @@ -67816,46 +84339,100 @@ Object { }, "range": Array [ 0, - 7, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Identifier", - "value": "declare", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 6, "line": 1, }, "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { "column": 8, "line": 1, }, + "start": Object { + "column": 7, + "line": 1, + }, }, "range": Array [ + 7, 8, - 17, ], - "type": "Identifier", - "value": "namespace", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 14, "line": 1, }, "start": Object { - "column": 18, + "column": 8, "line": 1, }, }, "range": Array [ - 18, - 20, + 8, + 14, ], "type": "Identifier", - "value": "d3", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -67864,464 +84441,680 @@ Object { "line": 1, }, "start": Object { - "column": 21, + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, "line": 1, }, }, "range": Array [ - 21, 22, + 23, ], "type": "Punctuator", - "value": "{", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, }, }, "range": Array [ 25, - 31, + 26, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ + 26, 32, - 40, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 34, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "]", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/tuple-rest.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementTypes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 27, + ], + "type": "TSRestType", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSNumberKeyword", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 27, + ], + "type": "TSArrayType", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 28, + ], + "type": "TSTupleType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 41, - 47, ], - "type": "Identifier", - "value": "select", - }, - Object { + "kind": "let", "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 47, - 48, + 0, + 28, ], - "type": "Punctuator", - "value": "(", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 3, + "line": 1, }, "start": Object { - "column": 25, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 48, - 56, + 0, + 3, ], - "type": "Identifier", - "value": "selector", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 33, - "line": 2, + "column": 4, + "line": 1, }, }, "range": Array [ - 56, - 57, + 4, + 5, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 2, + "column": 6, + "line": 1, }, "start": Object { - "column": 35, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 58, - 64, + 5, + 6, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 41, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 64, - 65, + 7, + 8, ], "type": "Punctuator", - "value": ")", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 42, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 65, - 66, + 8, + 14, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 53, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 44, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 67, - 76, + 14, + 15, ], - "type": "Identifier", - "value": "Selection", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 54, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 53, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 76, - 77, + 16, + 19, ], "type": "Punctuator", - "value": "<", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 57, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 54, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 77, - 80, + 19, + 25, ], "type": "Identifier", - "value": "any", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 58, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { - "column": 57, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ - 80, - 81, + 25, + 26, ], "type": "Punctuator", - "value": ">", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 59, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { - "column": 58, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ - 81, - 82, + 26, + 27, ], "type": "Punctuator", - "value": ";", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 83, - 84, + 27, + 28, ], "type": "Punctuator", - "value": "}", + "value": "]", }, ], "type": "Program", } `; -exports[`typescript fixtures/namespaces-and-modules/global-module-declaration.src 1`] = ` +exports[`typescript fixtures/types/tuple-type.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "elementTypes": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 43, - 51, - ], - "type": "TSModuleBlock", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": "global", - "range": Array [ - 36, - 42, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 21, - 51, + 12, + 18, ], - "type": "TSModuleDeclaration", + "type": "TSStringKeyword", }, Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 7, - }, - "start": Object { - "column": 29, - "line": 5, - }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, }, - "range": Array [ - 81, - 89, - ], - "type": "TSModuleBlock", }, - "declare": true, - "id": Object { + "range": Array [ + 20, + 27, + ], + "type": "TSOptionalType", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, - "line": 5, + "column": 26, + "line": 1, }, "start": Object { - "column": 22, - "line": 5, + "column": 20, + "line": 1, }, }, - "name": "global", "range": Array [ - 74, - 80, + 20, + 26, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 5, - }, + "type": "TSStringKeyword", }, - "range": Array [ - 56, - 89, - ], - "type": "TSModuleDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 8, - }, - "start": Object { - "column": 15, - "line": 1, }, - }, - "range": Array [ - 15, - 91, ], - "type": "TSModuleBlock", - }, - "declare": true, - "global": true, - "id": Object { "loc": Object { "end": Object { - "column": 14, + "column": 28, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, - "name": "global", "range": Array [ - 8, - 14, + 11, + 28, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "TSTupleType", }, - "range": Array [ - 0, - 91, - ], - "type": "TSModuleDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 9, + "line": 2, }, "start": Object { "column": 0, @@ -68330,14 +85123,14 @@ Object { }, "range": Array [ 0, - 92, + 29, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { @@ -68347,1158 +85140,1575 @@ Object { }, "range": Array [ 0, - 7, + 4, ], "type": "Identifier", - "value": "declare", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { "column": 8, "line": 1, }, - }, - "range": Array [ - 8, - 14, - ], - "type": "Keyword", - "value": "global", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 28, - ], - "type": "Identifier", - "value": "declare", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 29, - 35, + 5, + 8, ], "type": "Identifier", - "value": "module", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 36, - 42, - ], - "type": "Keyword", - "value": "global", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 43, - 44, - ], - "type": "Punctuator", - "value": "{", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 9, + "line": 1, }, }, "range": Array [ - 50, - 51, + 9, + 10, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 5, + "column": 12, + "line": 1, }, "start": Object { - "column": 4, - "line": 5, + "column": 11, + "line": 1, }, }, "range": Array [ - 56, - 63, + 11, + 12, ], - "type": "Identifier", - "value": "declare", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 5, + "column": 18, + "line": 1, }, "start": Object { "column": 12, - "line": 5, + "line": 1, }, }, "range": Array [ - 64, - 73, + 12, + 18, ], "type": "Identifier", - "value": "namespace", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 5, + "column": 19, + "line": 1, }, "start": Object { - "column": 22, - "line": 5, + "column": 18, + "line": 1, }, }, "range": Array [ - 74, - 80, + 18, + 19, ], - "type": "Keyword", - "value": "global", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 5, + "column": 26, + "line": 1, }, "start": Object { - "column": 29, - "line": 5, + "column": 20, + "line": 1, }, }, "range": Array [ - 81, - 82, + 20, + 26, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 7, + "column": 27, + "line": 1, }, "start": Object { - "column": 4, - "line": 7, + "column": 26, + "line": 1, }, }, "range": Array [ - 88, - 89, + 26, + 27, ], "type": "Punctuator", - "value": "}", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 8, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 8, + "column": 27, + "line": 1, }, }, "range": Array [ - 90, - 91, + 27, + 28, ], "type": "Punctuator", - "value": "}", + "value": "]", }, ], "type": "Program", } `; -exports[`typescript fixtures/namespaces-and-modules/module-with-default-exports.src 1`] = ` +exports[`typescript fixtures/types/type-literal.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "declaration": Object { - "body": Object { - "body": Array [ + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 4, + 22, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "members": Array [ Object { "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 11, + "line": 1, }, }, - "name": "method", + "name": "x", "range": Array [ - 52, - 58, + 11, + 12, ], "type": "Identifier", }, - "kind": "method", "loc": Object { "end": Object { - "column": 22, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 52, - 66, + 11, + 20, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "range": Array [ - 64, - 66, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "type": "TSPropertySignature", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 22, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 12, + "line": 1, }, }, - "params": Array [], "range": Array [ - 58, - 66, + 12, + 20, ], - "returnType": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 14, + "line": 1, }, }, "range": Array [ - 60, - 63, + 14, + 20, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "name": "C", - "range": Array [ - 62, - 63, - ], - "type": "Identifier", - }, - }, + "type": "TSNumberKeyword", }, - "type": "FunctionExpression", }, }, ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 27, - "line": 2, - }, - }, - "range": Array [ - 42, - 73, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "name": "C", "range": Array [ - 40, - 41, + 9, + 22, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 34, - 73, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, + "type": "TSTypeLiteral", }, }, - "range": Array [ - 19, - 73, - ], - "type": "ExportDefaultDeclaration", }, - Object { - "declaration": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 34, - "line": 5, - }, - }, - "range": Array [ - 108, - 110, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 5, - }, - "start": Object { - "column": 28, - "line": 5, - }, - }, - "name": "bar", - "range": Array [ - 102, - 105, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 19, - "line": 5, - }, - }, - "params": Array [], - "range": Array [ - 93, - 110, - ], - "type": "FunctionDeclaration", + "init": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, + "start": Object { + "column": 4, + "line": 1, }, - "range": Array [ - 78, - 110, - ], - "type": "ExportDefaultDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 13, - "line": 1, }, + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "range": Array [ - 13, - 112, - ], - "type": "TSModuleBlock", }, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "obj", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, - "range": Array [ - 7, - 12, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 10, + "line": 1, }, "start": Object { - "column": 0, + "column": 9, "line": 1, }, }, "range": Array [ - 0, - 112, + 9, + 10, ], - "type": "TSModuleDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "{", }, - }, - "range": Array [ - 0, - 114, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 12, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 6, + 11, + 12, ], "type": "Identifier", - "value": "module", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 12, "line": 1, }, }, "range": Array [ - 7, 12, + 13, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 20, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 19, - 25, + 22, + 23, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/type-operator.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 14, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 14, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "operator": "keyof", + "range": Array [ + 7, + 14, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 26, - 33, + 0, + 15, ], - "type": "Keyword", - "value": "default", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 20, + 36, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 21, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "operator": "unique", + "range": Array [ + 23, + 36, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSSymbolKeyword", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 36, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 2, }, "start": Object { - "column": 19, + "column": 0, "line": 2, }, }, "range": Array [ - 34, - 39, + 16, + 37, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, ], "type": "Keyword", - "value": "class", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 25, - "line": 2, + "column": 4, + "line": 1, }, }, "range": Array [ - 40, - 41, + 4, + 5, ], "type": "Identifier", - "value": "C", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 6, + "line": 1, }, "start": Object { - "column": 27, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 42, - 43, + 5, + 6, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 7, + "line": 1, }, }, "range": Array [ - 52, - 58, + 7, + 12, ], "type": "Identifier", - "value": "method", + "value": "keyof", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 13, + "line": 1, }, }, "range": Array [ - 58, - 59, + 13, + 14, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 14, + "line": 1, }, }, "range": Array [ - 59, - 60, + 14, + 15, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 3, + "line": 2, }, "start": Object { - "column": 16, - "line": 3, + "column": 0, + "line": 2, }, }, "range": Array [ - 60, - 61, + 16, + 19, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 5, + "line": 2, }, "start": Object { - "column": 18, - "line": 3, + "column": 4, + "line": 2, }, }, "range": Array [ - 62, - 63, + 20, + 21, ], "type": "Identifier", - "value": "C", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 6, + "line": 2, }, "start": Object { - "column": 20, - "line": 3, + "column": 5, + "line": 2, }, }, "range": Array [ - 64, - 65, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 3, + "column": 13, + "line": 2, }, "start": Object { - "column": 21, - "line": 3, + "column": 7, + "line": 2, }, }, "range": Array [ - 65, - 66, + 23, + 29, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "unique", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 20, + "line": 2, }, "start": Object { - "column": 22, - "line": 3, + "column": 14, + "line": 2, }, }, "range": Array [ - 66, - 67, + 30, + 36, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "symbol", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 21, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 20, + "line": 2, }, }, "range": Array [ - 72, - 73, + 36, + 37, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/typeof.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 17, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 17, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "exprName": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "type": "TSQualifiedName", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "TSTypeQuery", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 17, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 78, - 84, + 0, + 18, ], - "type": "Keyword", - "value": "export", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 3, + "line": 1, }, "start": Object { - "column": 11, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 85, - 92, + 0, + 3, ], "type": "Keyword", - "value": "default", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 5, + "column": 5, + "line": 1, }, "start": Object { - "column": 19, - "line": 5, + "column": 4, + "line": 1, }, }, "range": Array [ - 93, - 101, + 4, + 5, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 5, + "column": 6, + "line": 1, }, "start": Object { - "column": 28, - "line": 5, + "column": 5, + "line": 1, }, }, "range": Array [ - 102, - 105, + 5, + 6, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 5, + "column": 13, + "line": 1, }, "start": Object { - "column": 31, - "line": 5, + "column": 7, + "line": 1, }, }, "range": Array [ - 105, - 106, + 7, + 13, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "typeof", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 5, + "column": 15, + "line": 1, }, "start": Object { - "column": 32, - "line": 5, + "column": 14, + "line": 1, }, }, "range": Array [ - 106, - 107, + 14, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 34, - "line": 5, + "column": 15, + "line": 1, }, }, "range": Array [ - 108, - 109, + 15, + 16, ], "type": "Punctuator", - "value": "{", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 5, + "column": 17, + "line": 1, }, "start": Object { - "column": 35, - "line": 5, + "column": 16, + "line": 1, }, }, "range": Array [ - 109, - 110, + 16, + 17, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 18, + "line": 1, }, "start": Object { - "column": 0, - "line": 6, + "column": 17, + "line": 1, }, }, "range": Array [ - 111, - 112, + 17, + 18, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/namespaces-and-modules/nested-internal-module.src 1`] = ` +exports[`typescript fixtures/types/union-intersection.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "declaration": Object { - "declarations": Array [ - Object { - "id": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "union", + "range": Array [ + 4, + 36, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 36, + ], + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 11, + "line": 1, }, }, - "name": "x", "range": Array [ - 27, - 28, + 11, + 17, ], - "type": "Identifier", + "type": "TSNumberKeyword", }, - "init": Object { + Object { "loc": Object { "end": Object { - "column": 32, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 19, - "line": 3, + "column": 20, + "line": 1, }, }, "range": Array [ - 31, - 44, + 20, + 24, ], - "raw": "'hello world'", - "type": "Literal", - "value": "hello world", + "type": "TSNullKeyword", }, - "loc": Object { - "end": Object { - "column": 32, - "line": 3, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, }, - "start": Object { - "column": 15, - "line": 3, + "range": Array [ + 27, + 36, + ], + "type": "TSUndefinedKeyword", + }, + ], + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 36, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "intersection", + "range": Array [ + 42, + 71, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 54, + 71, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 56, + 71, + ], + "type": "TSIntersectionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 56, + 62, + ], + "type": "TSNumberKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, }, + "range": Array [ + 65, + 71, + ], + "type": "TSStringKeyword", }, - "range": Array [ - 27, - 44, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 32, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, + ], }, - "range": Array [ - 23, - 44, - ], - "type": "VariableDeclaration", }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 42, + 71, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 38, + 72, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 32, + "column": 42, "line": 3, }, "start": Object { @@ -69506,580 +86716,321 @@ Object { "line": 3, }, }, + "name": "precedence1", "range": Array [ - 16, - 44, + 77, + 115, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - Object { - "declaration": Object { - "body": Object { - "body": Array [ + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 88, + 115, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 90, + 115, + ], + "type": "TSUnionType", + "types": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, }, - "name": "constructor", - "range": Array [ - 78, - 89, - ], - "type": "Identifier", }, - "kind": "constructor", + "range": Array [ + 90, + 96, + ], + "type": "TSNumberKeyword", + }, + Object { "loc": Object { "end": Object { - "column": 59, - "line": 5, + "column": 42, + "line": 3, }, "start": Object { - "column": 8, - "line": 5, + "column": 26, + "line": 3, }, }, "range": Array [ - 78, - 129, + 99, + 115, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "TSIntersectionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 59, - "line": 5, + "column": 32, + "line": 3, }, "start": Object { - "column": 56, - "line": 5, + "column": 26, + "line": 3, }, }, "range": Array [ - 126, - 129, + 99, + 105, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 59, - "line": 5, - }, - "start": Object { - "column": 19, - "line": 5, - }, + "type": "TSStringKeyword", }, - "params": Array [ - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 20, - "line": 5, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 27, - "line": 5, - }, - }, - "name": "x", - "range": Array [ - 97, - 106, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 28, - "line": 5, - }, - }, - "range": Array [ - 98, - 106, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 30, - "line": 5, - }, - }, - "range": Array [ - 100, - 106, - ], - "type": "TSNumberKeyword", - }, - }, - }, - "range": Array [ - 90, - 106, - ], - "type": "TSParameterProperty", - }, - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 38, - "line": 5, - }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 3, }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 45, - "line": 5, - }, - }, - "name": "y", - "range": Array [ - 115, - 124, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 46, - "line": 5, - }, - }, - "range": Array [ - 116, - 124, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 48, - "line": 5, - }, - }, - "range": Array [ - 118, - 124, - ], - "type": "TSNumberKeyword", - }, - }, + "start": Object { + "column": 35, + "line": 3, }, - "range": Array [ - 108, - 124, - ], - "type": "TSParameterProperty", }, - ], - "range": Array [ - 89, - 129, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 23, - "line": 4, - }, - }, - "range": Array [ - 68, - 135, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, + "range": Array [ + 108, + 115, + ], + "type": "TSBooleanKeyword", + }, + ], }, - }, - "name": "Point", - "range": Array [ - 62, - 67, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 11, - "line": 4, - }, }, - "range": Array [ - 56, - 135, - ], - "superClass": null, - "type": "ClassDeclaration", }, - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 4, - }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, }, - "range": Array [ - 49, - 135, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", }, - Object { - "declaration": Object { - "body": Object { - "body": Array [ - Object { - "declaration": Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 9, - }, - "start": Object { - "column": 12, - "line": 9, - }, - }, - "name": "name", - "range": Array [ - 200, - 204, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 9, - }, - "start": Object { - "column": 12, - "line": 9, - }, - }, - "range": Array [ - 200, - 213, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 9, - }, - "start": Object { - "column": 16, - "line": 9, - }, - }, - "range": Array [ - 204, - 212, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 9, - }, - "start": Object { - "column": 18, - "line": 9, - }, - }, - "range": Array [ - 206, - 212, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], + "range": Array [ + 77, + 115, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 43, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 73, + 116, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "precedence2", + "range": Array [ + 121, + 159, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 132, + 159, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 134, + 159, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 134, + 149, + ], + "type": "TSIntersectionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 9, - "line": 10, + "column": 23, + "line": 4, }, "start": Object { - "column": 28, - "line": 8, + "column": 17, + "line": 4, }, }, "range": Array [ - 186, - 223, + 134, + 140, ], - "type": "TSInterfaceBody", + "type": "TSNumberKeyword", }, - "heritage": Array [], - "id": Object { + Object { "loc": Object { "end": Object { - "column": 27, - "line": 8, + "column": 32, + "line": 4, }, "start": Object { - "column": 25, - "line": 8, + "column": 26, + "line": 4, }, }, - "name": "Id", "range": Array [ - 183, - 185, + 143, + 149, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 10, - }, - "start": Object { - "column": 15, - "line": 8, - }, + "type": "TSStringKeyword", }, - "range": Array [ - 173, - 223, - ], - "type": "TSInterfaceDeclaration", - }, + ], + }, + Object { "loc": Object { "end": Object { - "column": 9, - "line": 10, + "column": 42, + "line": 4, }, "start": Object { - "column": 8, - "line": 8, + "column": 35, + "line": 4, }, }, "range": Array [ - 166, - 223, + 152, + 159, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 20, - "line": 7, - }, - }, - "range": Array [ - 156, - 229, - ], - "type": "TSModuleBlock", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 7, + "type": "TSBooleanKeyword", }, - "start": Object { - "column": 18, - "line": 7, - }, - }, - "name": "B", - "range": Array [ - 154, - 155, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 11, - "line": 7, - }, - }, - "range": Array [ - 147, - 229, - ], - "type": "TSModuleDeclaration", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 7, }, }, - "range": Array [ - 140, - 229, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 12, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 231, - ], - "type": "TSModuleBlock", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, }, - "start": Object { - "column": 7, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, }, + "range": Array [ + 121, + 159, + ], + "type": "VariableDeclarator", }, - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 1, - "line": 12, + "column": 43, + "line": 4, }, "start": Object { "column": 0, - "line": 1, + "line": 4, }, }, "range": Array [ - 0, - 231, + 117, + 160, ], - "type": "TSModuleDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 12, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -70088,14 +87039,14 @@ Object { }, "range": Array [ 0, - 231, + 161, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -70105,28 +87056,28 @@ Object { }, "range": Array [ 0, - 6, + 3, ], - "type": "Identifier", - "value": "module", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, "range": Array [ - 7, - 8, + 4, + 9, ], "type": "Identifier", - "value": "A", + "value": "union", }, Object { "loc": Object { @@ -70144,346 +87095,166 @@ Object { 10, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 16, - 22, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, - }, - "range": Array [ - 23, - 26, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Identifier", - "value": "x", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { "column": 17, - "line": 3, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 3, - }, - }, - "range": Array [ - 31, - 44, - ], - "type": "String", - "value": "'hello world'", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 49, - 55, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 4, + "line": 1, }, "start": Object { "column": 11, - "line": 4, - }, - }, - "range": Array [ - 56, - 61, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, + "line": 1, }, }, "range": Array [ - 62, - 67, + 11, + 17, ], "type": "Identifier", - "value": "Point", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 23, - "line": 4, - }, - }, - "range": Array [ - 68, - 69, - ], - "type": "Punctuator", - "value": "{", + "value": "number", }, Object { "loc": Object { "end": Object { "column": 19, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 78, - 89, - ], - "type": "Identifier", - "value": "constructor", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 5, + "line": 1, }, "start": Object { - "column": 19, - "line": 5, + "column": 18, + "line": 1, }, }, "range": Array [ - 89, - 90, + 18, + 19, ], "type": "Punctuator", - "value": "(", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 5, + "column": 24, + "line": 1, }, "start": Object { "column": 20, - "line": 5, + "line": 1, }, }, "range": Array [ - 90, - 96, + 20, + 24, ], "type": "Keyword", - "value": "public", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 5, - }, - "start": Object { - "column": 27, - "line": 5, - }, - }, - "range": Array [ - 97, - 98, - ], - "type": "Identifier", - "value": "x", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 5, + "column": 26, + "line": 1, }, "start": Object { - "column": 28, - "line": 5, + "column": 25, + "line": 1, }, }, "range": Array [ - 98, - 99, + 25, + 26, ], "type": "Punctuator", - "value": ":", + "value": "|", }, Object { "loc": Object { "end": Object { "column": 36, - "line": 5, + "line": 1, }, "start": Object { - "column": 30, - "line": 5, + "column": 27, + "line": 1, }, }, - "range": Array [ - 100, - 106, + "range": Array [ + 27, + 36, ], "type": "Identifier", - "value": "number", + "value": "undefined", }, Object { "loc": Object { "end": Object { "column": 37, - "line": 5, + "line": 1, }, "start": Object { "column": 36, - "line": 5, + "line": 1, }, }, "range": Array [ - 106, - 107, + 36, + 37, ], "type": "Punctuator", - "value": ",", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 5, + "column": 3, + "line": 2, }, "start": Object { - "column": 38, - "line": 5, + "column": 0, + "line": 2, }, }, "range": Array [ - 108, - 114, + 38, + 41, ], "type": "Keyword", - "value": "public", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 5, + "column": 16, + "line": 2, }, "start": Object { - "column": 45, - "line": 5, + "column": 4, + "line": 2, }, }, "range": Array [ - 115, - 116, + 42, + 54, ], "type": "Identifier", - "value": "y", + "value": "intersection", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 5, + "column": 17, + "line": 2, }, "start": Object { - "column": 46, - "line": 5, + "column": 16, + "line": 2, }, }, "range": Array [ - 116, - 117, + 54, + 55, ], "type": "Punctuator", "value": ":", @@ -70491,17 +87262,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 54, - "line": 5, + "column": 24, + "line": 2, }, "start": Object { - "column": 48, - "line": 5, + "column": 18, + "line": 2, }, }, "range": Array [ - 118, - 124, + 56, + 62, ], "type": "Identifier", "value": "number", @@ -70509,251 +87280,269 @@ Object { Object { "loc": Object { "end": Object { - "column": 55, - "line": 5, + "column": 26, + "line": 2, }, "start": Object { - "column": 54, - "line": 5, + "column": 25, + "line": 2, }, }, "range": Array [ - 124, - 125, + 63, + 64, ], "type": "Punctuator", - "value": ")", + "value": "&", }, Object { "loc": Object { "end": Object { - "column": 57, - "line": 5, + "column": 33, + "line": 2, }, "start": Object { - "column": 56, - "line": 5, + "column": 27, + "line": 2, }, }, "range": Array [ - 126, - 127, + 65, + 71, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 59, - "line": 5, + "column": 34, + "line": 2, }, "start": Object { - "column": 58, - "line": 5, + "column": 33, + "line": 2, }, }, "range": Array [ - 128, - 129, + 71, + 72, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 6, + "column": 3, + "line": 3, }, "start": Object { - "column": 4, - "line": 6, + "column": 0, + "line": 3, }, }, "range": Array [ - 134, - 135, + 73, + 76, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 15, + "line": 3, }, "start": Object { "column": 4, - "line": 7, + "line": 3, }, }, "range": Array [ - 140, - 146, + 77, + 88, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "precedence1", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 16, + "line": 3, }, "start": Object { - "column": 11, - "line": 7, + "column": 15, + "line": 3, }, }, "range": Array [ - 147, - 153, + 88, + 89, ], - "type": "Identifier", - "value": "module", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 23, + "line": 3, }, "start": Object { - "column": 18, - "line": 7, + "column": 17, + "line": 3, }, }, "range": Array [ - 154, - 155, + 90, + 96, ], "type": "Identifier", - "value": "B", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 25, + "line": 3, }, "start": Object { - "column": 20, - "line": 7, + "column": 24, + "line": 3, }, }, "range": Array [ - 156, - 157, + 97, + 98, ], "type": "Punctuator", - "value": "{", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 32, + "line": 3, }, "start": Object { - "column": 8, - "line": 8, + "column": 26, + "line": 3, }, }, "range": Array [ - 166, - 172, + 99, + 105, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 8, + "column": 34, + "line": 3, }, "start": Object { - "column": 15, - "line": 8, + "column": 33, + "line": 3, }, }, "range": Array [ - 173, - 182, + 106, + 107, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "&", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 8, + "column": 42, + "line": 3, }, "start": Object { - "column": 25, - "line": 8, + "column": 35, + "line": 3, }, }, "range": Array [ - 183, - 185, + 108, + 115, ], "type": "Identifier", - "value": "Id", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 8, + "column": 43, + "line": 3, }, "start": Object { - "column": 28, - "line": 8, + "column": 42, + "line": 3, }, }, "range": Array [ - 186, - 187, + 115, + 116, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 9, + "column": 3, + "line": 4, }, "start": Object { - "column": 12, - "line": 9, + "column": 0, + "line": 4, }, }, "range": Array [ - 200, - 204, + 117, + 120, ], - "type": "Identifier", - "value": "name", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 9, + "column": 15, + "line": 4, }, "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 121, + 132, + ], + "type": "Identifier", + "value": "precedence2", + }, + Object { + "loc": Object { + "end": Object { "column": 16, - "line": 9, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, }, }, "range": Array [ - 204, - 205, + 132, + 133, ], "type": "Punctuator", "value": ":", @@ -70761,125 +87550,141 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, - "line": 9, + "column": 23, + "line": 4, }, "start": Object { - "column": 18, - "line": 9, + "column": 17, + "line": 4, }, }, "range": Array [ - 206, - 212, + 134, + 140, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { "end": Object { "column": 25, - "line": 9, + "line": 4, }, "start": Object { "column": 24, - "line": 9, + "line": 4, }, }, "range": Array [ - 212, - 213, + 141, + 142, ], "type": "Punctuator", - "value": ";", + "value": "&", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 10, + "column": 32, + "line": 4, }, "start": Object { - "column": 8, - "line": 10, + "column": 26, + "line": 4, }, }, "range": Array [ - 222, - 223, + 143, + 149, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 11, + "column": 34, + "line": 4, }, "start": Object { - "column": 4, - "line": 11, + "column": 33, + "line": 4, }, }, "range": Array [ - 228, - 229, + 150, + 151, ], "type": "Punctuator", - "value": "}", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 12, + "column": 42, + "line": 4, }, "start": Object { - "column": 0, - "line": 12, + "column": 35, + "line": 4, }, }, "range": Array [ - 230, - 231, + 152, + 159, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 4, + }, + "start": Object { + "column": 42, + "line": 4, + }, + }, + "range": Array [ + 159, + 160, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` +exports[`typescript fixtures/types/union-type.src 1`] = ` Object { "body": Array [ Object { - "declare": true, "id": Object { "loc": Object { "end": Object { - "column": 31, + "column": 8, "line": 1, }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, + "name": "Foo", "range": Array [ - 15, - 31, + 5, + 8, ], - "raw": "\\"hot-new-module\\"", - "type": "Literal", - "value": "hot-new-module", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 32, + "column": 26, "line": 1, }, "start": Object { @@ -70889,9 +87694,62 @@ Object { }, "range": Array [ 0, - 32, + 26, ], - "type": "TSModuleDeclaration", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 26, + ], + "type": "TSIntersectionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 26, + ], + "type": "TSNumberKeyword", + }, + ], + }, }, ], "loc": Object { @@ -70906,14 +87764,14 @@ Object { }, "range": Array [ 0, - 33, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { @@ -70923,64 +87781,100 @@ Object { }, "range": Array [ 0, - 7, + 4, ], "type": "Identifier", - "value": "declare", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { - "column": 8, + "column": 5, "line": 1, }, }, "range": Array [ + 5, 8, - 14, ], "type": "Identifier", - "value": "module", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 31, + 9, + 10, ], - "type": "String", - "value": "\\"hot-new-module\\"", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 17, "line": 1, }, "start": Object { - "column": 31, + "column": 11, "line": 1, }, }, "range": Array [ - 31, - 32, + 11, + 17, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, ], "type": "Punctuator", - "value": ";", + "value": "&", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 26, + ], + "type": "Identifier", + "value": "number", }, ], "type": "Program", diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 25ccc125d945..9333764f9313 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -10,17 +10,17 @@ "@babel/highlight" "^7.0.0" "@babel/core@^7.0.0": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.6.tgz#3733cbee4317429bc87c62b29cf8587dba7baeb3" - integrity sha512-Hz6PJT6e44iUNpAn8AoyAs6B3bl60g7MJQaI0rZEar6ECzh6+srYO1xlIdssio34mPaUtAb1y+XlkkSJzok3yw== + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" + integrity sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.1.6" - "@babel/helpers" "^7.1.5" - "@babel/parser" "^7.1.6" - "@babel/template" "^7.1.2" - "@babel/traverse" "^7.1.6" - "@babel/types" "^7.1.6" + "@babel/generator" "^7.2.2" + "@babel/helpers" "^7.2.0" + "@babel/parser" "^7.2.2" + "@babel/template" "^7.2.2" + "@babel/traverse" "^7.2.2" + "@babel/types" "^7.2.2" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" @@ -29,12 +29,12 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.1.6": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.1.6.tgz#001303cf87a5b9d093494a4bf251d7b5d03d3999" - integrity sha512-brwPBtVvdYdGxtenbQgfCdDPmtkmUBZPjUoK5SXJEBuHaA5BCubh9ly65fzXz7R6o5rA76Rs22ES8Z+HCc0YIQ== +"@babel/generator@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.2.2.tgz#18c816c70962640eab42fe8cae5f3947a5c65ccc" + integrity sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg== dependencies: - "@babel/types" "^7.1.6" + "@babel/types" "^7.2.2" jsesc "^2.5.1" lodash "^4.17.10" source-map "^0.5.0" @@ -119,15 +119,15 @@ "@babel/types" "^7.0.0" "@babel/helper-module-transforms@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.1.0.tgz#470d4f9676d9fad50b324cdcce5fbabbc3da5787" - integrity sha512-0JZRd2yhawo79Rcm4w0LwSMILFmFXjugG3yqf+P/UsKsRS1mJCmMwwlHDlMg7Avr9LrvSpp4ZSULO9r8jpCzcw== + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.2.2.tgz#ab2f8e8d231409f8370c883d20c335190284b963" + integrity sha512-YRD7I6Wsv+IHuTPkAmAS4HhY0dkPobgLftHp0cRGZSdrRvmZY8rFvae/GVu3bD00qscuvK3WPHB3YdNpBXUqrA== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/template" "^7.2.2" + "@babel/types" "^7.2.2" lodash "^4.17.10" "@babel/helper-optimise-call-expression@^7.0.0": @@ -161,13 +161,13 @@ "@babel/types" "^7.0.0" "@babel/helper-replace-supers@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.1.0.tgz#5fc31de522ec0ef0899dc9b3e7cf6a5dd655f362" - integrity sha512-BvcDWYZRWVuDeXTYZWxekQNO5D4kO55aArwZOTFXw6rlLQA8ZaDicJR1sO47h+HrnCiDFiww0fSPV0d713KBGQ== + version "7.2.3" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.2.3.tgz#19970020cf22677d62b3a689561dbd9644d8c5e5" + integrity sha512-GyieIznGUfPXPWu0yLS6U55Mz67AZD9cUk0BfirOWlPrXlBcan9Gz+vHGz+cPfuoweZSnPzPIm67VtQM0OWZbA== dependencies: "@babel/helper-member-expression-to-functions" "^7.0.0" "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.1.0" + "@babel/traverse" "^7.2.3" "@babel/types" "^7.0.0" "@babel/helper-simple-access@^7.1.0": @@ -186,23 +186,23 @@ "@babel/types" "^7.0.0" "@babel/helper-wrap-function@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz#8cf54e9190706067f016af8f75cb3df829cc8c66" - integrity sha512-R6HU3dete+rwsdAfrOzTlE9Mcpk4RjU3aX3gi9grtmugQY0u79X7eogUvfXA5sI81Mfq1cn6AgxihfN33STjJA== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" + integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/template" "^7.1.0" "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/types" "^7.2.0" -"@babel/helpers@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.1.5.tgz#68bfc1895d685f2b8f1995e788dbfe1f6ccb1996" - integrity sha512-2jkcdL02ywNBry1YNFAH/fViq4fXG0vdckHqeJk+75fpQ2OH+Az6076tX/M0835zA45E0Cqa6pV5Kiv9YOqjEg== +"@babel/helpers@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.2.0.tgz#8335f3140f3144270dc63c4732a4f8b0a50b7a21" + integrity sha512-Fr07N+ea0dMcMN8nFpuK6dUIT7/ivt9yKQdEEnjVS83tG2pHwPi03gYmk/tyuwONnZ+sY+GFFPlWGgCtW1hF9A== dependencies: "@babel/template" "^7.1.2" "@babel/traverse" "^7.1.5" - "@babel/types" "^7.1.5" + "@babel/types" "^7.2.0" "@babel/highlight@^7.0.0": version "7.0.0" @@ -213,116 +213,116 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@7.1.6", "@babel/parser@^7.1.2", "@babel/parser@^7.1.6": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.6.tgz#16e97aca1ec1062324a01c5a6a7d0df8dd189854" - integrity sha512-dWP6LJm9nKT6ALaa+bnL247GHHMWir3vSlZ2+IHgHgktZQx0L3Uvq2uAWcuzIe+fujRsYWBW2q622C5UvGK9iQ== +"@babel/parser@7.2.3", "@babel/parser@^7.2.2", "@babel/parser@^7.2.3": + version "7.2.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.2.3.tgz#32f5df65744b70888d17872ec106b02434ba1489" + integrity sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA== -"@babel/plugin-proposal-async-generator-functions@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.1.0.tgz#41c1a702e10081456e23a7b74d891922dd1bb6ce" - integrity sha512-Fq803F3Jcxo20MXUSDdmZZXrPe6BWyGcWBPPNB/M7WaUYESKDeKMOGIxEzQOjGSmW/NWb6UaPZrtTB2ekhB/ew== +"@babel/plugin-proposal-async-generator-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" + integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-remap-async-to-generator" "^7.1.0" - "@babel/plugin-syntax-async-generators" "^7.0.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" -"@babel/plugin-proposal-json-strings@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.0.0.tgz#3b4d7b5cf51e1f2e70f52351d28d44fc2970d01e" - integrity sha512-kfVdUkIAGJIVmHmtS/40i/fg/AGnw/rsZBCaapY5yjeO5RA9m165Xbw9KMOu2nqXP5dTFjEjHdfNdoVcHv133Q== +"@babel/plugin-proposal-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" + integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-json-strings" "^7.0.0" + "@babel/plugin-syntax-json-strings" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0.tgz#9a17b547f64d0676b6c9cecd4edf74a82ab85e7e" - integrity sha512-14fhfoPcNu7itSen7Py1iGN0gEm87hX/B+8nZPqkdmANyyYWYMY2pjA3r8WXbWVKMzfnSNS0xY8GVS0IjXi/iw== +"@babel/plugin-proposal-object-rest-spread@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.2.0.tgz#88f5fec3e7ad019014c97f7ee3c992f0adbf7fb8" + integrity sha512-1L5mWLSvR76XYUQJXkd/EEQgjq8HHRP6lQuZTTg0VA4tTGPpGemmCdAfQIz1rzEuWAm+ecP8PyyEm30jC1eQCg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" -"@babel/plugin-proposal-optional-catch-binding@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0.tgz#b610d928fe551ff7117d42c8bb410eec312a6425" - integrity sha512-JPqAvLG1s13B/AuoBjdBYvn38RqW6n1TzrQO839/sIpqLpbnXKacsAgpZHzLD83Sm8SDXMkkrAvEnJ25+0yIpw== +"@babel/plugin-proposal-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" + integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" -"@babel/plugin-proposal-unicode-property-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz#498b39cd72536cd7c4b26177d030226eba08cd33" - integrity sha512-tM3icA6GhC3ch2SkmSxv7J/hCWKISzwycub6eGsDrFDgukD4dZ/I+x81XgW0YslS6mzNuQ1Cbzh5osjIMgepPQ== +"@babel/plugin-proposal-unicode-property-regex@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.2.0.tgz#abe7281fe46c95ddc143a65e5358647792039520" + integrity sha512-LvRVYb7kikuOtIoUeWTkOxQEV1kYvL5B6U3iWEGCzPNRus1MzJweFqORTj+0jkxozkTSYNJozPOddxmqdqsRpw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" regexpu-core "^4.2.0" -"@babel/plugin-syntax-async-generators@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0.tgz#bf0891dcdbf59558359d0c626fdc9490e20bc13c" - integrity sha512-im7ged00ddGKAjcZgewXmp1vxSZQQywuQXe2B1A7kajjZmDeY/ekMPmWr9zJgveSaQH0k7BcGrojQhcK06l0zA== +"@babel/plugin-syntax-async-generators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" + integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-json-strings@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.0.0.tgz#0d259a68090e15b383ce3710e01d5b23f3770cbd" - integrity sha512-UlSfNydC+XLj4bw7ijpldc1uZ/HB84vw+U6BTuqMdIEmz/LDe63w/GHtpQMdXWdqQZFeAI9PjnHe/vDhwirhKA== +"@babel/plugin-syntax-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" + integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-object-rest-spread@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz#37d8fbcaf216bd658ea1aebbeb8b75e88ebc549b" - integrity sha512-5A0n4p6bIiVe5OvQPxBnesezsgFJdHhSs3uFSvaPdMqtsovajLZ+G2vZyvNe10EzJBWWo3AcHGKhAFUxqwp2dw== +"@babel/plugin-syntax-object-rest-spread@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-optional-catch-binding@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0.tgz#886f72008b3a8b185977f7cb70713b45e51ee475" - integrity sha512-Wc+HVvwjcq5qBg1w5RG9o9RVzmCaAg/Vp0erHCKpAYV8La6I94o4GQAmFYNmkzoMO6gzoOSulpKeSSz6mPEoZw== +"@babel/plugin-syntax-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" + integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-arrow-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz#a6c14875848c68a3b4b3163a486535ef25c7e749" - integrity sha512-2EZDBl1WIO/q4DIkIp4s86sdp4ZifL51MoIviLY/gG/mLSuOIEg7J8o6mhbxOTvUJkaN50n+8u41FVsr5KLy/w== +"@babel/plugin-transform-arrow-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" + integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-async-to-generator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.1.0.tgz#109e036496c51dd65857e16acab3bafdf3c57811" - integrity sha512-rNmcmoQ78IrvNCIt/R9U+cixUHeYAzgusTFgIAv+wQb9HJU4szhpDD6e5GCACmj/JP5KxuCwM96bX3L9v4ZN/g== +"@babel/plugin-transform-async-to-generator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.2.0.tgz#68b8a438663e88519e65b776f8938f3445b1a2ff" + integrity sha512-CEHzg4g5UraReozI9D4fblBYABs7IM6UerAVG7EJVrTLC5keh00aEuLUT+O40+mJCEzaXkYfTCUKIyeDfMOFFQ== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-remap-async-to-generator" "^7.1.0" -"@babel/plugin-transform-block-scoped-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0.tgz#482b3f75103927e37288b3b67b65f848e2aa0d07" - integrity sha512-AOBiyUp7vYTqz2Jibe1UaAWL0Hl9JUXEgjFvvvcSc9MVDItv46ViXFw2F7SVt1B5k+KWjl44eeXOAk3UDEaJjQ== +"@babel/plugin-transform-block-scoped-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" + integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.1.5.tgz#3e8e0bc9a5104519923302a24f748f72f2f61f37" - integrity sha512-jlYcDrz+5ayWC7mxgpn1Wj8zj0mmjCT2w0mPIMSwO926eXBRxpEgoN/uQVRBfjtr8ayjcmS+xk2G1jaP8JjMJQ== +"@babel/plugin-transform-block-scoping@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.2.0.tgz#f17c49d91eedbcdf5dd50597d16f5f2f770132d4" + integrity sha512-vDTgf19ZEV6mx35yiPJe4fS02mPQUUcBNwWQSZFXSzTSbsJFQvHt7DqyS3LK8oOWALFOsJ+8bbqBgkirZteD5Q== dependencies: "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.10" -"@babel/plugin-transform-classes@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.1.0.tgz#ab3f8a564361800cbc8ab1ca6f21108038432249" - integrity sha512-rNaqoD+4OCBZjM7VaskladgqnZ1LO6o2UxuWSDzljzW21pN1KXkB7BstAVweZdxQkHAujps5QMNOTWesBciKFg== +"@babel/plugin-transform-classes@^7.2.0": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.2.2.tgz#6c90542f210ee975aa2aa8c8b5af7fa73a126953" + integrity sha512-gEZvgTy1VtcDOaQty1l10T3jQmJKlNVxLDCs+3rCVPr6nMkODLELxViq5X9l+rfxbie3XrfrMCYYY6eX3aOcOQ== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-define-map" "^7.1.0" @@ -333,95 +333,95 @@ "@babel/helper-split-export-declaration" "^7.0.0" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0.tgz#2fbb8900cd3e8258f2a2ede909b90e7556185e31" - integrity sha512-ubouZdChNAv4AAWAgU7QKbB93NU5sHwInEWfp+/OzJKA02E6Woh9RVoX4sZrbRwtybky/d7baTUqwFx+HgbvMA== +"@babel/plugin-transform-computed-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" + integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@^7.0.0": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.1.3.tgz#e69ff50ca01fac6cb72863c544e516c2b193012f" - integrity sha512-Mb9M4DGIOspH1ExHOUnn2UUXFOyVTiX84fXCd+6B5iWrQg/QMeeRmSwpZ9lnjYLSXtZwiw80ytVMr3zue0ucYw== +"@babel/plugin-transform-destructuring@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.2.0.tgz#e75269b4b7889ec3a332cd0d0c8cff8fed0dc6f3" + integrity sha512-coVO2Ayv7g0qdDbrNiadE4bU7lvCd9H539m2gMknyVjjMdwF/iCOM7R+E8PkntoqLkltO0rk+3axhpp/0v68VQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-dotall-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0.tgz#73a24da69bc3c370251f43a3d048198546115e58" - integrity sha512-00THs8eJxOJUFVx1w8i1MBF4XH4PsAjKjQ1eqN/uCH3YKwP21GCKfrn6YZFZswbOk9+0cw1zGQPHVc1KBlSxig== +"@babel/plugin-transform-dotall-regex@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.2.0.tgz#f0aabb93d120a8ac61e925ea0ba440812dbe0e49" + integrity sha512-sKxnyHfizweTgKZf7XsXu/CNupKhzijptfTM+bozonIuyVrLWVUvYjE2bhuSBML8VQeMxq4Mm63Q9qvcvUcciQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" regexpu-core "^4.1.3" -"@babel/plugin-transform-duplicate-keys@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0.tgz#a0601e580991e7cace080e4cf919cfd58da74e86" - integrity sha512-w2vfPkMqRkdxx+C71ATLJG30PpwtTpW7DDdLqYt2acXU7YjztzeWW2Jk1T6hKqCLYCcEA5UQM/+xTAm+QCSnuQ== +"@babel/plugin-transform-duplicate-keys@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz#d952c4930f312a4dbfff18f0b2914e60c35530b3" + integrity sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-exponentiation-operator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.1.0.tgz#9c34c2ee7fd77e02779cfa37e403a2e1003ccc73" - integrity sha512-uZt9kD1Pp/JubkukOGQml9tqAeI8NkE98oZnHZ2qHRElmeKCodbTZgOEUtujSCSLhHSBWbzNiFSDIMC4/RBTLQ== +"@babel/plugin-transform-exponentiation-operator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" + integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== dependencies: "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-for-of@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz#f2ba4eadb83bd17dc3c7e9b30f4707365e1c3e39" - integrity sha512-TlxKecN20X2tt2UEr2LNE6aqA0oPeMT1Y3cgz8k4Dn1j5ObT8M3nl9aA37LLklx0PBZKETC9ZAf9n/6SujTuXA== +"@babel/plugin-transform-for-of@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.2.0.tgz#ab7468befa80f764bb03d3cb5eef8cc998e1cad9" + integrity sha512-Kz7Mt0SsV2tQk6jG5bBv5phVbkd0gd27SgYD4hH1aLMJRchM0dzHaXvrWhVZ+WxAlDoAKZ7Uy3jVTW2mKXQ1WQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-function-name@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.1.0.tgz#29c5550d5c46208e7f730516d41eeddd4affadbb" - integrity sha512-VxOa1TMlFMtqPW2IDYZQaHsFrq/dDoIjgN098NowhexhZcz3UGlvPgZXuE1jEvNygyWyxRacqDpCZt+par1FNg== +"@babel/plugin-transform-function-name@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.2.0.tgz#f7930362829ff99a3174c39f0afcc024ef59731a" + integrity sha512-kWgksow9lHdvBC2Z4mxTsvc7YdY7w/V6B2vy9cTIPtLEE9NhwoWivaxdNM/S37elu5bqlLP/qOY906LukO9lkQ== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-literals@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0.tgz#2aec1d29cdd24c407359c930cdd89e914ee8ff86" - integrity sha512-1NTDBWkeNXgpUcyoVFxbr9hS57EpZYXpje92zv0SUzjdu3enaRwF/l3cmyRnXLtIdyJASyiS6PtybK+CgKf7jA== +"@babel/plugin-transform-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" + integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-amd@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.1.0.tgz#f9e0a7072c12e296079b5a59f408ff5b97bf86a8" - integrity sha512-wt8P+xQ85rrnGNr2x1iV3DW32W8zrB6ctuBkYBbf5/ZzJY99Ob4MFgsZDFgczNU76iy9PWsy4EuxOliDjdKw6A== +"@babel/plugin-transform-modules-amd@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz#82a9bce45b95441f617a24011dc89d12da7f4ee6" + integrity sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-commonjs@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.1.0.tgz#0a9d86451cbbfb29bd15186306897c67f6f9a05c" - integrity sha512-wtNwtMjn1XGwM0AXPspQgvmE6msSJP15CX2RVfpTSTNPLhKhaOjaIfBaVfj4iUZ/VrFSodcFedwtPg/NxwQlPA== +"@babel/plugin-transform-modules-commonjs@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.2.0.tgz#c4f1933f5991d5145e9cfad1dfd848ea1727f404" + integrity sha512-V6y0uaUQrQPXUrmj+hgnks8va2L0zcZymeU7TtWEgdRLNkceafKXEduv7QzgQAE4lT+suwooG9dC7LFhdRAbVQ== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" -"@babel/plugin-transform-modules-systemjs@^7.0.0": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.1.3.tgz#2119a3e3db612fd74a19d88652efbfe9613a5db0" - integrity sha512-PvTxgjxQAq4pvVUZF3mD5gEtVDuId8NtWkJsZLEJZMZAW3TvgQl1pmydLLN1bM8huHFVVU43lf0uvjQj9FRkKw== +"@babel/plugin-transform-modules-systemjs@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.2.0.tgz#912bfe9e5ff982924c81d0937c92d24994bb9068" + integrity sha512-aYJwpAhoK9a+1+O625WIjvMY11wkB/ok0WClVwmeo3mCjcNRjt+/8gHWrB5i+00mUju0gWsBkQnPpdvQ7PImmQ== dependencies: "@babel/helper-hoist-variables" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-umd@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.1.0.tgz#a29a7d85d6f28c3561c33964442257cc6a21f2a8" - integrity sha512-enrRtn5TfRhMmbRwm7F8qOj0qEYByqUvTttPEGimcBH4CJHphjyK1Vg7sdU7JjeEmgSpM890IT/efS2nMHwYig== +"@babel/plugin-transform-modules-umd@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" + integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -433,18 +433,18 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-super@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.1.0.tgz#b1ae194a054b826d8d4ba7ca91486d4ada0f91bb" - integrity sha512-/O02Je1CRTSk2SSJaq0xjwQ8hG4zhZGNjE8psTsSNPXyLRCODv7/PBozqT5AmQMzp7MI3ndvMhGdqp9c96tTEw== +"@babel/plugin-transform-object-super@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" + integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-replace-supers" "^7.1.0" -"@babel/plugin-transform-parameters@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.1.0.tgz#44f492f9d618c9124026e62301c296bf606a7aed" - integrity sha512-vHV7oxkEJ8IHxTfRr3hNGzV446GAb+0hgbA7o/0Jd76s+YzccdWuTU296FOCOl/xweU4t/Ya4g41yWz80RFCRw== +"@babel/plugin-transform-parameters@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.2.0.tgz#0d5ad15dc805e2ea866df4dd6682bfe76d1408c2" + integrity sha512-kB9+hhUidIgUoBQ0MsxMewhzr8i60nMa2KgeJKQWYrqQpqcBYtnpR+JgkadZVZoaEZ/eKu9mclFaVwhRpLNSzA== dependencies: "@babel/helper-call-delegate" "^7.1.0" "@babel/helper-get-function-arity" "^7.0.0" @@ -457,103 +457,103 @@ dependencies: regenerator-transform "^0.13.3" -"@babel/plugin-transform-shorthand-properties@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0.tgz#85f8af592dcc07647541a0350e8c95c7bf419d15" - integrity sha512-g/99LI4vm5iOf5r1Gdxq5Xmu91zvjhEG5+yZDJW268AZELAu4J1EiFLnkSG3yuUsZyOipVOVUKoGPYwfsTymhw== +"@babel/plugin-transform-shorthand-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" + integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-spread@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0.tgz#93583ce48dd8c85e53f3a46056c856e4af30b49b" - integrity sha512-L702YFy2EvirrR4shTj0g2xQp7aNwZoWNCkNu2mcoU0uyzMl0XRwDSwzB/xp6DSUFiBmEXuyAyEN16LsgVqGGQ== +"@babel/plugin-transform-spread@^7.2.0": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" + integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-sticky-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0.tgz#30a9d64ac2ab46eec087b8530535becd90e73366" - integrity sha512-LFUToxiyS/WD+XEWpkx/XJBrUXKewSZpzX68s+yEOtIbdnsRjpryDw9U06gYc6klYEij/+KQVRnD3nz3AoKmjw== +"@babel/plugin-transform-sticky-regex@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" + integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" -"@babel/plugin-transform-template-literals@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0.tgz#084f1952efe5b153ddae69eb8945f882c7a97c65" - integrity sha512-vA6rkTCabRZu7Nbl9DfLZE1imj4tzdWcg5vtdQGvj+OH9itNNB6hxuRMHuIY8SGnEt1T9g5foqs9LnrHzsqEFg== +"@babel/plugin-transform-template-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.2.0.tgz#d87ed01b8eaac7a92473f608c97c089de2ba1e5b" + integrity sha512-FkPix00J9A/XWXv4VoKJBMeSkyY9x/TqIh76wzcdfl57RJJcf8CehQ08uwfhCDNtRQYtHQKBTwKZDEyjE13Lwg== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-typeof-symbol@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0.tgz#4dcf1e52e943e5267b7313bff347fdbe0f81cec9" - integrity sha512-1r1X5DO78WnaAIvs5uC48t41LLckxsYklJrZjNKcevyz83sF2l4RHbw29qrCPr/6ksFsdfRpT/ZgxNWHXRnffg== +"@babel/plugin-transform-typeof-symbol@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" + integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-unicode-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz#c6780e5b1863a76fe792d90eded9fcd5b51d68fc" - integrity sha512-uJBrJhBOEa3D033P95nPHu3nbFwFE9ZgXsfEitzoIXIwqAZWk7uXcg06yFKXz9FSxBH5ucgU/cYdX0IV8ldHKw== +"@babel/plugin-transform-unicode-regex@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.2.0.tgz#4eb8db16f972f8abb5062c161b8b115546ade08b" + integrity sha512-m48Y0lMhrbXEJnVUaYly29jRXbQ3ksxPrS1Tg8t+MHqzXhtBYAvI51euOBaoAlZLPHsieY9XPVMf80a5x0cPcA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" regexpu-core "^4.1.3" "@babel/polyfill@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.0.0.tgz#c8ff65c9ec3be6a1ba10113ebd40e8750fb90bff" - integrity sha512-dnrMRkyyr74CRelJwvgnnSUDh2ge2NCTyHVwpOdvRMHtJUyxLtMAfhBN3s64pY41zdw0kgiLPh6S20eb1NcX6Q== + version "7.2.5" + resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.2.5.tgz#6c54b964f71ad27edddc567d065e57e87ed7fa7d" + integrity sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug== dependencies: core-js "^2.5.7" - regenerator-runtime "^0.11.1" + regenerator-runtime "^0.12.0" "@babel/preset-env@^7.0.0": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.6.tgz#a0bf4b96b6bfcf6e000afc5b72b4abe7cc13ae97" - integrity sha512-YIBfpJNQMBkb6MCkjz/A9J76SNCSuGVamOVBgoUkLzpJD/z8ghHi9I42LQ4pulVX68N/MmImz6ZTixt7Azgexw== + version "7.2.3" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.2.3.tgz#948c8df4d4609c99c7e0130169f052ea6a7a8933" + integrity sha512-AuHzW7a9rbv5WXmvGaPX7wADxFkZIqKlbBh1dmZUQp4iwiPpkE/Qnrji6SC4UQCQzvWY/cpHET29eUhXS9cLPw== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.1.0" - "@babel/plugin-proposal-json-strings" "^7.0.0" - "@babel/plugin-proposal-object-rest-spread" "^7.0.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.0.0" - "@babel/plugin-syntax-async-generators" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" - "@babel/plugin-transform-arrow-functions" "^7.0.0" - "@babel/plugin-transform-async-to-generator" "^7.1.0" - "@babel/plugin-transform-block-scoped-functions" "^7.0.0" - "@babel/plugin-transform-block-scoping" "^7.1.5" - "@babel/plugin-transform-classes" "^7.1.0" - "@babel/plugin-transform-computed-properties" "^7.0.0" - "@babel/plugin-transform-destructuring" "^7.0.0" - "@babel/plugin-transform-dotall-regex" "^7.0.0" - "@babel/plugin-transform-duplicate-keys" "^7.0.0" - "@babel/plugin-transform-exponentiation-operator" "^7.1.0" - "@babel/plugin-transform-for-of" "^7.0.0" - "@babel/plugin-transform-function-name" "^7.1.0" - "@babel/plugin-transform-literals" "^7.0.0" - "@babel/plugin-transform-modules-amd" "^7.1.0" - "@babel/plugin-transform-modules-commonjs" "^7.1.0" - "@babel/plugin-transform-modules-systemjs" "^7.0.0" - "@babel/plugin-transform-modules-umd" "^7.1.0" + "@babel/plugin-proposal-async-generator-functions" "^7.2.0" + "@babel/plugin-proposal-json-strings" "^7.2.0" + "@babel/plugin-proposal-object-rest-spread" "^7.2.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.2.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + "@babel/plugin-transform-arrow-functions" "^7.2.0" + "@babel/plugin-transform-async-to-generator" "^7.2.0" + "@babel/plugin-transform-block-scoped-functions" "^7.2.0" + "@babel/plugin-transform-block-scoping" "^7.2.0" + "@babel/plugin-transform-classes" "^7.2.0" + "@babel/plugin-transform-computed-properties" "^7.2.0" + "@babel/plugin-transform-destructuring" "^7.2.0" + "@babel/plugin-transform-dotall-regex" "^7.2.0" + "@babel/plugin-transform-duplicate-keys" "^7.2.0" + "@babel/plugin-transform-exponentiation-operator" "^7.2.0" + "@babel/plugin-transform-for-of" "^7.2.0" + "@babel/plugin-transform-function-name" "^7.2.0" + "@babel/plugin-transform-literals" "^7.2.0" + "@babel/plugin-transform-modules-amd" "^7.2.0" + "@babel/plugin-transform-modules-commonjs" "^7.2.0" + "@babel/plugin-transform-modules-systemjs" "^7.2.0" + "@babel/plugin-transform-modules-umd" "^7.2.0" "@babel/plugin-transform-new-target" "^7.0.0" - "@babel/plugin-transform-object-super" "^7.1.0" - "@babel/plugin-transform-parameters" "^7.1.0" + "@babel/plugin-transform-object-super" "^7.2.0" + "@babel/plugin-transform-parameters" "^7.2.0" "@babel/plugin-transform-regenerator" "^7.0.0" - "@babel/plugin-transform-shorthand-properties" "^7.0.0" - "@babel/plugin-transform-spread" "^7.0.0" - "@babel/plugin-transform-sticky-regex" "^7.0.0" - "@babel/plugin-transform-template-literals" "^7.0.0" - "@babel/plugin-transform-typeof-symbol" "^7.0.0" - "@babel/plugin-transform-unicode-regex" "^7.0.0" - browserslist "^4.1.0" + "@babel/plugin-transform-shorthand-properties" "^7.2.0" + "@babel/plugin-transform-spread" "^7.2.0" + "@babel/plugin-transform-sticky-regex" "^7.2.0" + "@babel/plugin-transform-template-literals" "^7.2.0" + "@babel/plugin-transform-typeof-symbol" "^7.2.0" + "@babel/plugin-transform-unicode-regex" "^7.2.0" + browserslist "^4.3.4" invariant "^2.2.2" js-levenshtein "^1.1.3" semver "^5.3.0" @@ -571,34 +571,34 @@ pirates "^4.0.0" source-map-support "^0.5.9" -"@babel/template@^7.1.0", "@babel/template@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.2.tgz#090484a574fef5a2d2d7726a674eceda5c5b5644" - integrity sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag== +"@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" + integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.1.2" - "@babel/types" "^7.1.2" + "@babel/parser" "^7.2.2" + "@babel/types" "^7.2.2" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.1.6": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.6.tgz#c8db9963ab4ce5b894222435482bd8ea854b7b5c" - integrity sha512-CXedit6GpISz3sC2k2FsGCUpOhUqKdyL0lqNrImQojagnUMXf8hex4AxYFRuMkNGcvJX5QAFGzB5WJQmSv8SiQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2", "@babel/traverse@^7.2.3": + version "7.2.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" + integrity sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.1.6" + "@babel/generator" "^7.2.2" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.1.6" - "@babel/types" "^7.1.6" + "@babel/parser" "^7.2.3" + "@babel/types" "^7.2.2" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.10" -"@babel/types@^7.0.0", "@babel/types@^7.1.2", "@babel/types@^7.1.5", "@babel/types@^7.1.6": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.1.6.tgz#0adb330c3a281348a190263aceb540e10f04bcce" - integrity sha512-DMiUzlY9DSjVsOylJssxLHSgj6tWM9PRFJOGW/RaOglVOK9nzTxoOMfTfRQXGUCUQ/HmlG2efwC+XqUEJ5ay4w== +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" + integrity sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg== dependencies: esutils "^2.0.2" lodash "^4.17.10" @@ -775,11 +775,11 @@ integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== "@octokit/endpoint@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-3.1.0.tgz#ec60152d018d75d4eed5d8a5fd68c9a1e99f3b50" - integrity sha512-ANAOhyEY40qzOjQPEYXqg3GDGLYTjLDjqQqcG1wgqRoE7qFLnvx5a0upzxpes83UK/YHUu6qTymZl/yTu4GvKg== + version "3.1.1" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-3.1.1.tgz#ede9afefaa4d6b7584169e12346425c6fbb45cc3" + integrity sha512-KPkoTvKwCTetu/UqonLs1pfwFO5HAqTv/Ksp9y4NAg//ZgUCpvJsT4Hrst85uEzJvkB8+LxKyR4Bfv2X8O4cmQ== dependencies: - deepmerge "2.2.1" + deepmerge "3.0.0" is-plain-object "^2.0.4" universal-user-agent "^2.0.1" url-template "^2.0.8" @@ -795,9 +795,9 @@ universal-user-agent "^2.0.1" "@octokit/rest@^16.0.1": - version "16.1.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.1.0.tgz#43bee0f58821b6c6a4c9d63e14919a1fb67a71b5" - integrity sha512-/D1XokSycOE+prxxI2r9cxssiLMqcr+BsEUjdruC67puEEjNJjJoRIkuA1b20jOkX5Ue3Rz99Mu9rTnNmjetUA== + version "16.3.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.3.0.tgz#98a24a3334312a87fff8a2a54c1dca4d0900d54d" + integrity sha512-u0HkROLB0nOSfJhkF5FKMg6I12m6cN5S3S73Lwtfgrs9u4LhgUCZN2hC2KDyIaT7nhvNe9Kx0PgxhhD6li6QsA== dependencies: "@octokit/request" "2.2.0" before-after-hook "^1.2.0" @@ -835,9 +835,9 @@ integrity sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg== "@semantic-release/github@^5.1.0": - version "5.2.5" - resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-5.2.5.tgz#14e53d99f1e84c76b5674b7506f235a7a4cae302" - integrity sha512-myO00q84CyfyzaEZ4OdA7GOMCQKd+juZd5g2Cloh4jV6CyiMyWflZ629RH99wjAVUiwMKnvX2SQ5XPFvO1+FCw== + version "5.2.7" + resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-5.2.7.tgz#d9eb8bcc9332a02b85458ddb0988a17023e2b460" + integrity sha512-cWQhM9bdBv8KAwClmwM64Mo3vsOHVM2aJAGI6K3qbJfJ3GsLJLh1hTi+rMd5EkZ2DA8zUUHCiAJZ3ujMvUB0yg== dependencies: "@octokit/rest" "^16.0.1" "@semantic-release/error" "^2.2.0" @@ -853,14 +853,14 @@ lodash "^4.17.4" mime "^2.0.3" p-filter "^1.0.0" - p-retry "^2.0.0" + p-retry "^3.0.0" parse-github-url "^1.0.1" url-join "^4.0.0" "@semantic-release/npm@^5.0.5": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@semantic-release/npm/-/npm-5.1.1.tgz#f05d50ad174b7b90d71367799780e6dedb7797d8" - integrity sha512-5OnV0od1HKp2QjToXxQufvHNG8n+IQlp7h3FjqmZYH7DAHzAGx4NCf/R4p3RhyX5YJEfQl4ZflX9219JVNsuJg== + version "5.1.2" + resolved "https://registry.yarnpkg.com/@semantic-release/npm/-/npm-5.1.2.tgz#96dda235677c628059abb35f5e8f447f1c5c4d64" + integrity sha512-hAt8Q86jjp0AiykihhZ7vuCFKYz0j8v3W6Jae8b+RCLi8IUofrPF1ZImx3oY0rRu8ZZSb4aU9uxtFmeOYZebjg== dependencies: "@semantic-release/error" "^2.2.0" aggregate-error "^1.0.0" @@ -889,12 +889,10 @@ into-stream "^4.0.0" lodash "^4.17.4" -"@sindresorhus/is@^0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.12.0.tgz#55c37409c809e802efea25911a579731adfc6e07" - integrity sha512-9ve22cGrAKlSRvi8Vb2JIjzcaaQg79531yQHnF+hi/kOpsSj3Om8AyR1wcHrgl0u7U3vYQ7gmF5erZzOp4+51Q== - dependencies: - symbol-observable "^1.2.0" +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== "@szmarczak/http-timer@^1.1.0": version "1.1.1" @@ -942,9 +940,9 @@ "@types/lodash" "*" "@types/lodash@*": - version "4.14.118" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.118.tgz#247bab39bfcc6d910d4927c6e06cbc70ec376f27" - integrity sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw== + version "4.14.119" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.119.tgz#be847e5f4bc3e35e46d041c394ead8b603ad8b39" + integrity sha512-Z3TNyBL8Vd/M9D9Ms2S3LmFq2sSMzahodD6rCS9V2N44HUMINb75jNkSuwAx7eo2ufqTdfOdtGQpNbieUjPQmw== "@types/minimatch@*": version "3.0.3" @@ -952,9 +950,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*", "@types/node@^10.12.2": - version "10.12.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.11.tgz#715c476c99a5f6898a1ae61caf9825e43c03912e" - integrity sha512-3iIOhNiPGTdcUNVCv9e5G7GotfvJJe2pc9w2UgDXlUwnxSZ3RgcUocIU+xYm+rTU54jIKih998QE4dMOyMN1NQ== + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== "@types/semver@^5.5.0": version "5.5.0" @@ -962,9 +960,9 @@ integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== "@types/shelljs@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.0.tgz#0caa56b68baae4f68f44e0dd666ab30b098e3632" - integrity sha512-vs1hCC8RxLHRu2bwumNyYRNrU3o8BtZhLysH5A4I98iYmA2APl6R3uNQb5ihl+WiwH0xdC9LLO+vRrXLs/Kyxg== + version "0.8.1" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.1.tgz#133e874b5fb816a2e1c8647839c82d76760b1191" + integrity sha512-1lQw+48BuVgp6c1+z8EMipp18IdnV2dLh6KQGwOm+kJy9nPjEkaqRKmwbDNEYf//EKBvKcwOC6V2cDrNxVoQeQ== dependencies: "@types/glob" "*" "@types/node" "*" @@ -1033,9 +1031,9 @@ aggregate-error@^1.0.0: indent-string "^3.0.0" ajv@^6.5.5: - version "6.6.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.1.tgz#6360f5ed0d80f232cc2b294c362d5dc2e538dd61" - integrity sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww== + version "6.6.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" + integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -1487,15 +1485,15 @@ block-stream@*: dependencies: inherits "~2.0.0" -bluebird@^3.5.0, bluebird@^3.5.1, bluebird@~3.5.1: +bluebird@^3.5.0, bluebird@^3.5.1, bluebird@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== bottleneck@^2.0.1: - version "2.13.0" - resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.13.0.tgz#875df17df9e62c76bea42b62af3a45c73a995c4f" - integrity sha512-9YmZ0aiKta2OAxTujKCS/INjGWCIGWK4Ff1nQpgHnR4CTjlk9jcnpaHOjPnMZPtqRXkqwKdtxZgvJ9udsXylaw== + version "2.14.1" + resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.14.1.tgz#3134b3dabbdafa19abbb0531c03529858d029190" + integrity sha512-FAZr9OekUbx/lCGY/Sok2QOFOy3exRWRcjVJfmHrh3J9UoIaLHT0E+TwhXTIPmKS8JHuX6i/eH/kmhhHBEx7DQ== boxen@^1.2.1: version "1.3.0" @@ -1555,14 +1553,14 @@ browser-resolve@^1.11.3: dependencies: resolve "1.1.7" -browserslist@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.3.4.tgz#4477b737db6a1b07077275b24791e680d4300425" - integrity sha512-u5iz+ijIMUlmV8blX82VGFrB9ecnUg5qEt55CMZ/YJEhha+d8qpBfOFuutJ6F/VKRXjZoD33b6uvarpPxcl3RA== +browserslist@^4.3.4: + version "4.3.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.3.6.tgz#0f9d9081afc66b36f477c6bdf3813f784f42396a" + integrity sha512-kMGKs4BTzRWviZ8yru18xBpx+CyHG9eqgRbj9XbE3IMgtczf4aiA0Y1YCpVdvUieKGZ03kolSPXqTcscBCb9qw== dependencies: - caniuse-lite "^1.0.30000899" - electron-to-chromium "^1.3.82" - node-releases "^1.0.1" + caniuse-lite "^1.0.30000921" + electron-to-chromium "^1.3.92" + node-releases "^1.1.1" bs-logger@0.x: version "0.2.6" @@ -1628,23 +1626,23 @@ cacache@^10.0.4: y18n "^4.0.0" cacache@^11.0.1, cacache@^11.0.2, cacache@^11.2.0: - version "11.3.1" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.1.tgz#d09d25f6c4aca7a6d305d141ae332613aa1d515f" - integrity sha512-2PEw4cRRDu+iQvBTTuttQifacYjLPhET+SYO/gEFMy8uhi+jlJREDAjSF5FWSdV/Aw5h18caHA7vMTw2c+wDzA== + version "11.3.2" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa" + integrity sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg== dependencies: - bluebird "^3.5.1" - chownr "^1.0.1" - figgy-pudding "^3.1.0" - glob "^7.1.2" - graceful-fs "^4.1.11" - lru-cache "^4.1.3" + bluebird "^3.5.3" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.3" + graceful-fs "^4.1.15" + lru-cache "^5.1.1" mississippi "^3.0.0" mkdirp "^0.5.1" move-concurrently "^1.0.1" promise-inflight "^1.0.1" rimraf "^2.6.2" - ssri "^6.0.0" - unique-filename "^1.1.0" + ssri "^6.0.1" + unique-filename "^1.1.1" y18n "^4.0.0" cache-base@^1.0.1: @@ -1663,9 +1661,9 @@ cache-base@^1.0.1: unset-value "^1.0.0" cacheable-request@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-5.2.0.tgz#00c87097835af4caf92a97390660ecadce51187d" - integrity sha512-h1n0vjpFaByTvU6PiyTKk2kx4OnuV1aVUynCUd/FiKl4icpPSceowk3rHczwFEBuZvz+E1EU4KExR0MCPeQfaQ== + version "5.2.1" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-5.2.1.tgz#41814b0460b68b9baf74f57f5a6046224d55d71e" + integrity sha512-+dLut9zvvuIM/MrtdHBVSh/QYJ9+uCKYoqww9cOYrndQH4O4rD/qH0IAwFhD5WJKfmWE6WgCOrLQPd/H5YJRVQ== dependencies: clone-response "^1.0.2" get-stream "^4.0.0" @@ -1735,10 +1733,10 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA== -caniuse-lite@^1.0.30000899: - version "1.0.30000912" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000912.tgz#08e650d4090a9c0ab06bfd2b46b7d3ad6dcaea28" - integrity sha512-M3zAtV36U+xw5mMROlTXpAHClmPAor6GPKAMD5Yi7glCB5sbMPFtnQ3rGpk4XqPdUrrTIaVYSJZxREZWNy8QJg== +caniuse-lite@^1.0.30000921: + version "1.0.30000923" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000923.tgz#148f9bda508024b5ce957b463ae2e8302b451bb2" + integrity sha512-j5ur7eeluOFjjPUkydtXP4KFAsmH3XaQNch5tvWSO+dLHYt5PE+VgJZLWtbVOodfWij6m6zas28T4gB/cLYq1w== capture-exit@^1.2.0: version "1.2.0" @@ -1804,7 +1802,7 @@ chownr@~1.0.1: resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" integrity sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE= -ci-info@^1.4.0, ci-info@^1.5.0: +ci-info@^1.5.0, ci-info@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== @@ -1941,9 +1939,9 @@ colors@1.0.3: integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= colors@^1.1.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.2.tgz#2df8ff573dfbf255af562f8ce7181d6b971a359b" - integrity sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ== + version "1.3.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" + integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== columnify@~1.5.4: version "1.5.4" @@ -2003,7 +2001,7 @@ concat-stream@^1.5.0, concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -config-chain@~1.1.11: +config-chain@^1.1.12: version "1.1.12" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== @@ -2124,9 +2122,9 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.7: - version "2.5.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== + version "2.6.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.1.tgz#87416ae817de957a3f249b3b5ca475d4aaed6042" + integrity sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -2244,9 +2242,9 @@ data-urls@^1.0.0: whatwg-url "^7.0.0" date-fns@^1.27.2: - version "1.29.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" - integrity sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw== + version "1.30.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" + integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== dateformat@^3.0.0: version "3.0.3" @@ -2275,9 +2273,9 @@ debug@^3.1.0: ms "^2.1.1" debug@^4.0.0, debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" @@ -2326,10 +2324,10 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deepmerge@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" - integrity sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA== +deepmerge@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.0.0.tgz#ca7903b34bfa1f8c2eab6779280775a411bfc6ba" + integrity sha512-a8z8bkgHsAML+uHLqmMS83HHlpy3PvZOOuiTQqaa3wu8ZVg3h0hqHk6aCsGdOnZV2XMM/FRimNGjUh0KCcmHBw== default-require-extensions@^1.0.0: version "1.0.0" @@ -2493,10 +2491,10 @@ editor@~1.0.0: resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742" integrity sha1-YMf4e9YrzGqJT6jM1q+3gjok90I= -electron-to-chromium@^1.3.82: - version "1.3.86" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.86.tgz#a45ea01da5b26500d12bca5e0f194ebb3e1fd14e" - integrity sha512-BcmXOu37FCPxrrh0wyKgKi5dAjIu2ohxN5ptapkLPKRC3IBK2NeIwh9n1x/8HzSRQiEKamJkDce1ZgOGgEX9iw== +electron-to-chromium@^1.3.92: + version "1.3.96" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.96.tgz#25770ec99b8b07706dedf3a5f43fa50cb54c4f9a" + integrity sha512-ZUXBUyGLeoJxp4Nt6G/GjBRLnyz8IKQGexZ2ndWaoegThgMGFO1tdDYID5gBV32/1S83osjJHyfzvanE/8HY4Q== elegant-spinner@^1.0.1: version "1.0.1" @@ -2518,9 +2516,9 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: once "^1.4.0" env-ci@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/env-ci/-/env-ci-3.1.2.tgz#ee3c78cd24f61ee12aca8b69ecdf0a97ca3ceb5b" - integrity sha512-qJ+ug5OEHEK6HyjhEB0z2tPJCmdvemQE3WUUYEe7qj7teZIJGjZK9elWB4kxE8qRdVHWl4aBvyVmX0Y5xlMbBw== + version "3.1.3" + resolved "https://registry.yarnpkg.com/env-ci/-/env-ci-3.1.3.tgz#17626015676d35bfb64d6f2945a178d559c0d23d" + integrity sha512-4NudFu3oUCNprsGkt/LmvqAwJlzX9QT8289AavXiDH1pBJuEd4n0ty98yUOWN3uFtjOhOGrmt1/FDKFxCewejw== dependencies: execa "^1.0.0" java-properties "^0.2.9" @@ -3159,7 +3157,7 @@ glob@7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.2: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== @@ -3219,11 +3217,11 @@ got@^6.7.1: url-parse-lax "^1.0.0" got@^9.1.0: - version "9.3.2" - resolved "https://registry.yarnpkg.com/got/-/got-9.3.2.tgz#f6e3bd063aa8f461ccd924afa2ba2b61deab3989" - integrity sha512-OyKOUg71IKvwb8Uj0KP6EN3+qVVvXmYsFznU1fnwUnKtDbZnwSlAi7muNlu4HhBfN9dImtlgg9e7H0g5qVdaeQ== + version "9.5.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.5.0.tgz#6fd0312c6b694c0a11d9119d95fd7daed174eb49" + integrity sha512-N+4kb6i9t1lauJ4NwLVVoFVLxZNa6i+iivtNzCSVw7+bVbTXoq0qXctdd8i9rj3lrI0zDk5NGzcO4bfpEP6Uuw== dependencies: - "@sindresorhus/is" "^0.12.0" + "@sindresorhus/is" "^0.14.0" "@szmarczak/http-timer" "^1.1.0" cacheable-request "^5.1.0" decompress-response "^3.3.0" @@ -3235,7 +3233,7 @@ got@^9.1.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@~4.1.11: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6: version "4.1.15" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== @@ -4940,6 +4938,13 @@ lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.3: pseudomap "^1.0.2" yallist "^2.1.2" +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + macos-release@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.0.0.tgz#7dddf4caf79001a851eb4fba7fb6034f251276ab" @@ -5220,9 +5225,9 @@ minipass@^2.2.1, minipass@^2.3.3, minipass@^2.3.4: yallist "^3.0.0" minizlib@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42" - integrity sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg== + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== dependencies: minipass "^2.2.1" @@ -5306,9 +5311,9 @@ mute-stream@~0.0.4: integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= nan@^2.9.2: - version "2.11.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" - integrity sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA== + version "2.12.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" + integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== nanomatch@^1.2.9: version "1.2.13" @@ -5426,10 +5431,10 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -node-releases@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.5.tgz#a641adcc968b039a27345d92ef10b093e5cbd41d" - integrity sha512-Ky7q0BO1BBkG/rQz6PkEZ59rwo+aSfhczHP1wwq8IowoVdN/FpiP7qp0XW0P2+BVCWe5fQUBozdbVd54q1RbCQ== +node-releases@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.2.tgz#93c17fba5eec8650ad908de5433fa8763baebe4d" + integrity sha512-j1gEV/zX821yxdWp/1vBMN0pSUjuH9oGUdLCb4PfUko6ZW7KdRs3Z+QGGwDUhYtSpQvdVVyLd2V0YvLsmdg5jQ== dependencies: semver "^5.3.0" @@ -5476,14 +5481,14 @@ normalize-url@^3.1.0: integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== normalize-url@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.0.0.tgz#6c2214dde2fc8ea88509ec79774ccbd1d426c1ea" - integrity sha512-OrtNzJOeI9+UaF8KfvPoqh8ZVjLiun+fggtLzrpPsmdOU01eIp3vYXDfeFv4KwqJxcmmrW/ubNCN+9iIQRVtfw== + version "4.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.1.0.tgz#307e74c87473efa81969ad1b4bb91f1990178904" + integrity sha512-X781mkWeK6PDMAZJfGn/wnwil4dV6pIdF9euiNqtA89uJvZuNDJO2YyJxiwpPhTQcF5pYUU1v+kcOxzYV6rZlA== npm-audit-report@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/npm-audit-report/-/npm-audit-report-1.3.1.tgz#e79ea1fcb5ffaf3031102b389d5222c2b0459632" - integrity sha512-SjTF8ZP4rOu3JiFrTMi4M1CmVo2tni2sP4TzhyCMHwnMGf6XkdGLZKt9cdZ12esKf0mbQqFyU9LtY0SoeahL7g== + version "1.3.2" + resolved "https://registry.yarnpkg.com/npm-audit-report/-/npm-audit-report-1.3.2.tgz#303bc78cd9e4c226415076a4f7e528c89fc77018" + integrity sha512-abeqS5ONyXNaZJPGAf6TOUMNdSe1Y6cpc9MLBRn+CuUoYbfdca6AxOyXVlfIv9OgKX+cacblbG5w7A6ccwoTPw== dependencies: cli-table3 "^0.5.0" console-control-strings "^1.1.0" @@ -5534,7 +5539,7 @@ npm-logical-tree@^1.2.1: semver "^5.5.0" validate-npm-package-name "^3.0.0" -npm-packlist@^1.1.10, npm-packlist@^1.1.11, npm-packlist@^1.1.6: +npm-packlist@^1.1.10, npm-packlist@^1.1.12, npm-packlist@^1.1.6: version "1.1.12" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a" integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g== @@ -5631,9 +5636,9 @@ npm-which@^3.0.1: which "^1.2.10" npm@^6.3.0: - version "6.4.1" - resolved "https://registry.yarnpkg.com/npm/-/npm-6.4.1.tgz#4f39f9337b557a28faed4a771d5c8802d6b4288b" - integrity sha512-mXJL1NTVU136PtuopXCUQaNWuHlXCTp4McwlSW8S9/Aj8OEPAlSBgo8og7kJ01MjCDrkmqFQTvN5tTEhBMhXQg== + version "6.5.0" + resolved "https://registry.yarnpkg.com/npm/-/npm-6.5.0.tgz#30ed48d4cd4d17d68ee04a5fcf9fa2ca9167d819" + integrity sha512-SPq8zG2Kto+Xrq55E97O14Jla13PmQT5kSnvwBj88BmJZ5Nvw++OmlWfhjkB67pcgP5UEXljEtnGFKZtOgt6MQ== dependencies: JSONStream "^1.3.4" abbrev "~1.1.1" @@ -5642,28 +5647,28 @@ npm@^6.3.0: aproba "~1.2.0" archy "~1.0.0" bin-links "^1.1.2" - bluebird "~3.5.1" + bluebird "^3.5.3" byte-size "^4.0.3" cacache "^11.2.0" call-limit "~1.1.0" chownr "~1.0.1" - ci-info "^1.4.0" + ci-info "^1.6.0" cli-columns "^3.1.2" cli-table3 "^0.5.0" cmd-shim "~2.0.2" columnify "~1.5.4" - config-chain "~1.1.11" + config-chain "^1.1.12" detect-indent "~5.0.0" detect-newline "^2.1.0" dezalgo "~1.0.3" editor "~1.0.0" - figgy-pudding "^3.4.1" + figgy-pudding "^3.5.1" find-npm-prefix "^1.0.2" fs-vacuum "~1.2.10" fs-write-stream-atomic "~1.0.10" gentle-fs "^2.0.1" - glob "~7.1.2" - graceful-fs "~4.1.11" + glob "^7.1.3" + graceful-fs "^4.1.15" has-unicode "~2.0.1" hosted-git-info "^2.7.1" iferr "^1.0.2" @@ -5697,7 +5702,7 @@ npm@^6.3.0: npm-install-checks "~3.0.0" npm-lifecycle "^2.1.0" npm-package-arg "^6.1.0" - npm-packlist "^1.1.11" + npm-packlist "^1.1.12" npm-pick-manifest "^2.1.0" npm-profile "^3.0.2" npm-registry-client "^8.6.0" @@ -5705,7 +5710,7 @@ npm@^6.3.0: npm-user-validate "~1.0.0" npmlog "~4.1.2" once "~1.4.0" - opener "^1.5.0" + opener "^1.5.1" osenv "^0.1.5" pacote "^8.1.6" path-is-inside "~1.0.2" @@ -5723,14 +5728,14 @@ npm@^6.3.0: retry "^0.12.0" rimraf "~2.6.2" safe-buffer "^5.1.2" - semver "^5.5.0" + semver "^5.5.1" sha "~2.0.1" slide "~1.1.6" sorted-object "~2.0.1" sorted-union-stream "~2.1.3" - ssri "^6.0.0" + ssri "^6.0.1" stringify-package "^1.0.0" - tar "^4.4.6" + tar "^4.4.8" text-table "~0.2.0" tiny-relative-date "^1.3.0" uid-number "0.0.6" @@ -5838,7 +5843,7 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" -opener@^1.5.0: +opener@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA== @@ -5982,10 +5987,10 @@ p-reduce@^1.0.0: resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= -p-retry@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-2.0.0.tgz#b97f1f4d6d81a3c065b2b40107b811e995c1bfba" - integrity sha512-ZbCuzAmiwJ45q4evp/IG9D+5MUllGSUeCWwPt3j/tdYSi1KPkSD+46uqmAA1LhccDhOXv8kYZKNb8x78VflzfA== +p-retry@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-3.0.0.tgz#f1a09233417dd40b42a7a4a3ed0f4780f23b90d8" + integrity sha512-fAB7bebxaj8nylNAsxPNkwPZ/48bXFdFnWrz0v2sV+H5BsGfVL7Ap7KgONqy7rOK4ZI1I+SU+lmettO3hM+2HQ== dependencies: retry "^0.12.0" @@ -6121,7 +6126,7 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.5: +path-parse@^1.0.5, path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== @@ -6302,9 +6307,9 @@ pseudomap@^1.0.2: integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24, psl@^1.1.28: - version "1.1.29" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" - integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== pump@^2.0.0, pump@^2.0.1: version "2.0.1" @@ -6574,11 +6579,16 @@ regenerator-runtime@^0.10.5: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= -regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1: +regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== +regenerator-runtime@^0.12.0: + version "0.12.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" + integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== + regenerator-transform@^0.13.3: version "0.13.3" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" @@ -6602,14 +6612,14 @@ regex-not@^1.0.0, regex-not@^1.0.2: safe-regex "^1.1.0" regexpu-core@^4.1.3, regexpu-core@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" - integrity sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw== + version "4.4.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.4.0.tgz#8d43e0d1266883969720345e70c275ee0aec0d32" + integrity sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA== dependencies: regenerate "^1.4.0" regenerate-unicode-properties "^7.0.0" - regjsgen "^0.4.0" - regjsparser "^0.3.0" + regjsgen "^0.5.0" + regjsparser "^0.6.0" unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.0.2" @@ -6628,15 +6638,15 @@ registry-url@^3.0.3: dependencies: rc "^1.0.1" -regjsgen@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" - integrity sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA== +regjsgen@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" + integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== -regjsparser@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.3.0.tgz#3c326da7fcfd69fa0d332575a41c8c0cdf588c96" - integrity sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA== +regjsparser@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" + integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== dependencies: jsesc "~0.5.0" @@ -6767,11 +6777,11 @@ resolve@1.1.7: integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= resolve@1.x, resolve@^1.1.6, resolve@^1.3.2: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== + version "1.9.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06" + integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ== dependencies: - path-parse "^1.0.5" + path-parse "^1.0.6" responselike@^1.0.2: version "1.0.2" @@ -6873,9 +6883,9 @@ sax@^1.2.4: integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== semantic-release@^15.9.16: - version "15.12.3" - resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.12.3.tgz#9f7c5a8ac55624a6418e0bf95bf53c2030487c12" - integrity sha512-3HCKD2ORxi6jItIoP9WeYJjjHsZqozSf6WUGcLClnRH553OVNKf4mLdOwo9UHJe6dVNSk5z7oDfGWKGwVy63BA== + version "15.13.1" + resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-15.13.1.tgz#18541032504aa0b443d011083685c9b42eb38c9f" + integrity sha512-bkrfQ10BhbJRMeq/Ih9DZ9FO4ffDwFYsRR134JP9JvQSf8GVX4sg3SnFFd7Q10C6pKwjKqMZ4+ZNB5uQYMLPEg== dependencies: "@semantic-release/commit-analyzer" "^6.1.0" "@semantic-release/error" "^2.2.0" @@ -6921,7 +6931,7 @@ semver-regex@^2.0.0: resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw== -"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@5.6.0, "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0: +"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@5.6.0, "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== @@ -7161,9 +7171,9 @@ spawn-error-forwarder@~1.0.0: integrity sha1-Gv2Uc46ZmwNG17n8NzvlXgdXcCk= spdx-correct@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" - integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" @@ -7182,9 +7192,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz#a59efc09784c2a5bada13cfeaf5c75dd214044d2" - integrity sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg== + version "3.0.3" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e" + integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -7220,9 +7230,9 @@ sprintf-js@~1.0.2: integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.2.tgz#c946d6bd9b1a39d0e8635763f5242d6ed6dcb629" - integrity sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA== + version "1.16.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.0.tgz#1d4963a2fbffe58050aa9084ca20be81741c07de" + integrity sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -7241,7 +7251,7 @@ ssri@^5.2.4: dependencies: safe-buffer "^5.1.1" -ssri@^6.0.0: +ssri@^6.0.0, ssri@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== @@ -7421,7 +7431,7 @@ supports-color@^5.2.0, supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -symbol-observable@^1.1.0, symbol-observable@^1.2.0: +symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== @@ -7440,7 +7450,7 @@ tar@^2.0.0: fstream "^1.0.2" inherits "2" -tar@^4, tar@^4.4.3, tar@^4.4.6: +tar@^4, tar@^4.4.3, tar@^4.4.8: version "4.4.8" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== @@ -7583,9 +7593,9 @@ traverse@~0.6.6: integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc= travis-deploy-once@^5.0.8: - version "5.0.9" - resolved "https://registry.yarnpkg.com/travis-deploy-once/-/travis-deploy-once-5.0.9.tgz#c5a2f639e17d8fd542f66d25ade126179d5e8acf" - integrity sha512-cyHFErzq0HTEGY29RAq1clqFdt/IkCrlcOmyM1cGoGnEyukrrFi1fpy6JH3Mlf+88XsFwvluqKVWzj2bdz3k8A== + version "5.0.11" + resolved "https://registry.yarnpkg.com/travis-deploy-once/-/travis-deploy-once-5.0.11.tgz#32665480f82ee43b7936f19371f839cdc9b30202" + integrity sha512-iyctEtFvgXxin3Ur6jqqM9QdUqUKU8DShdVlRMDFwhLZ8+IGt3PnYPNZDSW45iDKCiUNJ0tGVidNpVDBG2ioKQ== dependencies: "@babel/core" "^7.0.0" "@babel/polyfill" "^7.0.0" @@ -7594,7 +7604,7 @@ travis-deploy-once@^5.0.8: chalk "^2.1.0" execa "^1.0.0" got "^9.1.0" - p-retry "^2.0.0" + p-retry "^3.0.0" semver "^5.4.1" update-notifier "^2.3.0" url-join "^4.0.0" @@ -7715,7 +7725,7 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^0.4.3" -unique-filename@^1.1.0, unique-filename@~1.1.0: +unique-filename@^1.1.0, unique-filename@^1.1.1, unique-filename@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== From a3da24f6f386e48353aa6c0141ac0d8a94871e0e Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 28 Dec 2018 22:19:14 +0400 Subject: [PATCH 32/84] feat: add errorOnTypeScriptSyntaticAndSemanticIssues option (#57) --- .../typescript-estree/src/ast-converter.ts | 15 +- packages/typescript-estree/src/convert.ts | 13 + packages/typescript-estree/src/parser.ts | 46 +- .../typescript-estree/src/semantic-errors.ts | 59 + .../src/temp-types-based-on-js-source.ts | 2 + .../tests/ast-alignment/fixtures-to-test.ts | 6 +- ...ed.src.xjs => param-object-wrapped.src.js} | 0 ...s => invalid-not-final-array-empty.src.js} | 0 ...l-array.src.xjs => not-final-array.src.js} | 0 .../errorRecovery/solo-const.src.ts | 1 + .../lib/__snapshots__/javascript.ts.snap | 3133 ++++++++++++----- .../semantic-diagnostics-enabled.ts.snap | 1929 ++++++++++ .../lib/__snapshots__/typescript.ts.snap | 62 + .../tests/lib/semantic-diagnostics-enabled.ts | 52 + .../tests/lib/semanticInfo.ts | 2 - 15 files changed, 4369 insertions(+), 951 deletions(-) create mode 100644 packages/typescript-estree/src/semantic-errors.ts rename packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/{param-object-wrapped.src.xjs => param-object-wrapped.src.js} (100%) rename packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/{invalid-not-final-array-empty.src.xjs => invalid-not-final-array-empty.src.js} (100%) rename packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/{not-final-array.src.xjs => not-final-array.src.js} (100%) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/solo-const.src.ts create mode 100644 packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap create mode 100644 packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 04df089ba410..5ceece050e7a 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -5,25 +5,12 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ -import convert, { getASTMaps, resetASTMaps } from './convert'; +import convert, { getASTMaps, resetASTMaps, convertError } from './convert'; import { convertComments } from './convert-comments'; import nodeUtils from './node-utils'; import ts from 'typescript'; import { Extra } from './temp-types-based-on-js-source'; -/** - * Extends and formats a given error object - * @param {Object} error the error object - * @returns {Object} converted error object - */ -function convertError(error: any) { - return nodeUtils.createError( - error.file, - error.start, - error.message || error.messageText - ); -} - export default ( ast: ts.SourceFile, extra: Extra, diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 5ccc6f4e9f5c..f03ae7910082 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -39,6 +39,19 @@ interface ConvertConfig { additionalOptions: ConvertAdditionalOptions; } +/** + * Extends and formats a given error object + * @param {Object} error the error object + * @returns {Object} converted error object + */ +export function convertError(error: any) { + return nodeUtils.createError( + error.file, + error.start, + error.message || error.messageText + ); +} + /** * Converts a TypeScript node into an ESTree node * @param {Object} config configuration options for the conversion diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 64d6c88e7899..b4a7eb763eb3 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -12,14 +12,16 @@ import { import semver from 'semver'; import ts from 'typescript'; import convert from './ast-converter'; +import { convertError } from './convert'; +import { Program } from './estree/spec'; +import util from './node-utils'; import { - Extra, - ParserOptions, + ESTreeComment, ESTreeToken, - ESTreeComment + Extra, + ParserOptions } from './temp-types-based-on-js-source'; -import { Program } from './estree/spec'; -import util from './node-utils'; +import { getFirstSemanticOrSyntacticError } from './semantic-errors'; const packageJSON = require('../package.json'); @@ -59,6 +61,7 @@ function resetExtra(): void { log: console.log, projects: [], errorOnUnknownASTType: false, + errorOnTypeScriptSyntaticAndSemanticIssues: false, code: '', tsconfigRootDir: process.cwd(), extraFileExtensions: [] @@ -246,6 +249,18 @@ function generateAST( extra.errorOnUnknownASTType = true; } + /** + * Retrieve semantic and syntactic diagnostics from the underlying TypeScript Program + * and turn them into parse errors + */ + if ( + shouldGenerateServices && + typeof options.errorOnTypeScriptSyntaticAndSemanticIssues === 'boolean' && + options.errorOnTypeScriptSyntaticAndSemanticIssues + ) { + extra.errorOnTypeScriptSyntaticAndSemanticIssues = true; + } + if (typeof options.useJSXTextNode === 'boolean' && options.useJSXTextNode) { extra.useJSXTextNode = true; } @@ -304,7 +319,23 @@ function generateAST( ); extra.code = code; + + /** + * Convert the AST + */ const { estree, astMaps } = convert(ast, extra, shouldProvideParserServices); + + /** + * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, + * there may be other syntactic or semantic issues in the code that we can optionally report on. + */ + if (program && extra.errorOnTypeScriptSyntaticAndSemanticIssues) { + const error = getFirstSemanticOrSyntacticError(program, ast); + if (error) { + throw convertError(error); + } + } + return { estree, program: shouldProvideParserServices ? program : undefined, @@ -327,6 +358,11 @@ export function parse( code: string, options?: T ) { + if (options && options.errorOnTypeScriptSyntaticAndSemanticIssues) { + throw new Error( + `"errorOnTypeScriptSyntaticAndSemanticIssues" is only supported for parseAndGenerateServices()` + ); + } return generateAST(code, options).estree; } diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts new file mode 100644 index 000000000000..e481236e9131 --- /dev/null +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -0,0 +1,59 @@ +import ts from 'typescript'; + +interface SemanticOrSyntacticError extends ts.Diagnostic { + message: string; +} + +/** + * By default, diagnostics from the TypeScript compiler contain all errors - regardless of whether + * they are related to generic ECMAScript standards, or TypeScript-specific constructs. + * + * Therefore, we filter out all diagnostics, except for the ones we explicitly want to consider when + * the user opts in to throwing errors on semantic issues. + */ +export function getFirstSemanticOrSyntacticError( + program: ts.Program, + ast: ts.SourceFile +): SemanticOrSyntacticError | undefined { + const supportedSyntacticDiagnostics = whitelistSupportedDiagnostics( + program.getSyntacticDiagnostics(ast) + ); + if (supportedSyntacticDiagnostics.length) { + return convertDiagnosticToSemanticOrSyntacticError( + supportedSyntacticDiagnostics[0] + ); + } + const supportedSemanticDiagnostics = whitelistSupportedDiagnostics( + program.getSemanticDiagnostics(ast) + ); + if (supportedSemanticDiagnostics.length) { + return convertDiagnosticToSemanticOrSyntacticError( + supportedSemanticDiagnostics[0] + ); + } + return undefined; +} + +function whitelistSupportedDiagnostics( + diagnostics: ReadonlyArray +): ReadonlyArray { + return diagnostics.filter(diagnostic => { + switch (diagnostic.code) { + case 1123: // ts 3.2: "Variable declaration list cannot be empty." + return true; + } + return false; + }); +} + +function convertDiagnosticToSemanticOrSyntacticError( + diagnostic: ts.Diagnostic +): SemanticOrSyntacticError { + return { + ...diagnostic, + message: ts.flattenDiagnosticMessageText( + diagnostic.messageText, + ts.sys.newLine + ) + }; +} diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index c3819efc6f0d..8ee48b917f9d 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -58,6 +58,7 @@ export interface ESTreeNodeLoc { export interface Extra { errorOnUnknownASTType: boolean; + errorOnTypeScriptSyntaticAndSemanticIssues: boolean; useJSXTextNode: boolean; tokens: null | ESTreeToken[]; comment: boolean; @@ -80,6 +81,7 @@ export interface ParserOptions { comment?: boolean; jsx?: boolean; errorOnUnknownASTType?: boolean; + errorOnTypeScriptSyntaticAndSemanticIssues?: boolean; useJSXTextNode?: boolean; loggerFn?: Function | false; project?: string | string[]; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 53175a95e14d..b0cd1f8cf572 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -190,7 +190,8 @@ let fixturePatternConfigsToTest = [ * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. */ - 'error-complex-destructured-spread-first' // babel parse errors + 'error-complex-destructured-spread-first', // babel parse errors + 'not-final-array' // babel parse errors ] }), @@ -446,7 +447,8 @@ let fixturePatternConfigsToTest = [ 'decorator-on-enum-declaration', // babel parse errors 'decorator-on-interface-declaration', // babel parse errors 'interface-property-modifiers', // babel parse errors - 'enum-with-keywords' // babel parse errors + 'enum-with-keywords', // babel parse errors + 'solo-const' // babel parse errors ] }), diff --git a/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.xjs b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.xjs rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js diff --git a/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.xjs b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.xjs rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js diff --git a/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/not-final-array.src.xjs b/packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/not-final-array.src.js similarity index 100% rename from packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/not-final-array.src.xjs rename to packages/typescript-estree/tests/fixtures/javascript/destructuring-and-spread/not-final-array.src.js diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/solo-const.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/solo-const.src.ts new file mode 100644 index 000000000000..8baacf4ea544 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/solo-const.src.ts @@ -0,0 +1 @@ +const \ No newline at end of file diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 2e5e8458034d..809b88c05508 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -60629,68 +60629,1202 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-forOf/loop.src 1`] = ` +exports[`javascript fixtures/destructuring-and-defaultParams/param-object-wrapped.src 1`] = ` Object { "body": Array [ Object { - "await": false, - "body": Object { + "expression": Object { "loc": Object { "end": Object { - "column": 17, + "column": 32, "line": 1, }, "start": Object { - "column": 16, + "column": 1, "line": 1, }, }, - "range": Array [ - 16, - 17, - ], - "type": "EmptyStatement", - }, - "left": Object { - "elements": Array [ + "properties": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 7, + "column": 31, + "line": 1, + }, + "start": Object { + "column": 2, "line": 1, }, - "start": Object { - "column": 6, - "line": 1, + }, + "method": false, + "range": Array [ + 2, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 15, + 16, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 14, + 17, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 27, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 21, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], + "range": Array [ + 20, + 27, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 5, + 31, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 1, + 32, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 13, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-forOf/loop.src 1`] = ` +Object { + "body": Array [ + Object { + "await": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "EmptyStatement", + }, + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 4, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 1, + 9, + ], + "type": "ObjectPattern", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "range": Array [ + 11, + 15, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", }, - ], + "range": Array [ + 0, + 16, + ], + "type": "ArrayPattern", + }, "loc": Object { "end": Object { - "column": 8, + "column": 20, "line": 1, }, "start": Object { - "column": 5, + "column": 0, "line": 1, }, }, + "operator": "=", "range": Array [ - 5, - 8, + 0, + 20, ], - "type": "ArrayPattern", + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { @@ -60700,33 +61834,15 @@ Object { }, "range": Array [ 0, - 17, + 21, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { "column": 0, @@ -60735,14 +61851,14 @@ Object { }, "range": Array [ 0, - 18, + 21, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -60752,46 +61868,64 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "for", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, "line": 1, }, "start": Object { - "column": 4, + "column": 1, "line": 1, }, }, "range": Array [ - 4, - 5, + 1, + 2, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 4, "line": 1, }, "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { "column": 5, "line": 1, }, + "start": Object { + "column": 4, + "line": 1, + }, }, "range": Array [ + 4, 5, - 6, ], "type": "Punctuator", - "value": "[", + "value": ",", }, Object { "loc": Object { @@ -60809,30 +61943,30 @@ Object { 7, ], "type": "Identifier", - "value": "a", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, 8, + 9, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { @@ -60842,10 +61976,28 @@ Object { }, "range": Array [ 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ 11, + 14, ], - "type": "Identifier", - "value": "of", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { @@ -60854,16 +62006,16 @@ Object { "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, + 14, 15, ], "type": "Identifier", - "value": "foo", + "value": "c", }, Object { "loc": Object { @@ -60877,26 +62029,62 @@ Object { }, }, "range": Array [ - 15, - 16, + 15, + 16, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "d", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 17, + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -60906,7 +62094,7 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` Object { "body": Array [ Object { @@ -60916,7 +62104,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 2, "line": 1, }, "start": Object { @@ -60924,167 +62112,89 @@ Object { "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 3, - 4, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "name": "b", "range": Array [ - 6, - 7, + 8, + 9, ], "type": "Identifier", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 6, - 7, - ], - "shorthand": true, - "type": "Property", - "value": Object { + Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 1, }, "start": Object { - "column": 6, + "column": 11, "line": 1, }, }, - "name": "b", + "name": "c", "range": Array [ - 6, - 7, + 11, + 12, ], "type": "Identifier", }, - }, - ], - "range": Array [ - 1, - 9, - ], - "type": "ObjectPattern", - }, - Object { - "argument": Object { + ], "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 14, + "column": 7, "line": 1, }, }, - "name": "c", "range": Array [ - 14, - 15, + 7, + 13, ], - "type": "Identifier", + "type": "ArrayPattern", }, "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 4, "line": 1, }, }, "range": Array [ - 11, - 15, + 4, + 13, ], "type": "RestElement", }, ], "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { @@ -61094,13 +62204,13 @@ Object { }, "range": Array [ 0, - 16, + 14, ], "type": "ArrayPattern", }, "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { @@ -61111,23 +62221,23 @@ Object { "operator": "=", "range": Array [ 0, - 20, + 18, ], "right": Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { - "column": 19, + "column": 17, "line": 1, }, }, "name": "d", "range": Array [ - 19, - 20, + 17, + 18, ], "type": "Identifier", }, @@ -61135,7 +62245,7 @@ Object { }, "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { @@ -61145,15 +62255,15 @@ Object { }, "range": Array [ 0, - 21, + 19, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -61162,7 +62272,7 @@ Object { }, "range": Array [ 0, - 21, + 20, ], "sourceType": "script", "tokens": Array [ @@ -61199,31 +62309,31 @@ Object { 1, 2, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 3, "line": 1, }, "start": Object { - "column": 3, + "column": 2, "line": 1, }, }, "range": Array [ + 2, 3, - 4, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -61233,28 +62343,28 @@ Object { }, "range": Array [ 4, - 5, + 7, ], "type": "Punctuator", - "value": ",", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 8, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { @@ -61271,8 +62381,8 @@ Object { 8, 9, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -61295,7 +62405,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { @@ -61305,43 +62415,43 @@ Object { }, "range": Array [ 11, - 14, + 12, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 14, + "column": 12, "line": 1, }, }, "range": Array [ - 14, - 15, + 12, + 13, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 16, + 13, + 14, ], "type": "Punctuator", "value": "]", @@ -61349,17 +62459,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, "range": Array [ - 17, - 18, + 15, + 16, ], "type": "Punctuator", "value": "=", @@ -61367,17 +62477,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { - "column": 19, + "column": 17, "line": 1, }, }, "range": Array [ - 19, - 20, + 17, + 18, ], "type": "Identifier", "value": "d", @@ -61385,17 +62495,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 20, + "column": 18, "line": 1, }, }, "range": Array [ - 20, - 21, + 18, + 19, ], "type": "Punctuator", "value": ";", @@ -61405,28 +62515,95 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { "elements": Array [ Object { "loc": Object { "end": Object { - "column": 2, + "column": 13, "line": 1, }, "start": Object { - "column": 1, + "column": 12, "line": 1, }, }, "name": "a", "range": Array [ - 1, - 2, + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 15, + 16, ], "type": "Identifier", }, @@ -61436,171 +62613,180 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, + "column": 24, "line": 1, }, "start": Object { - "column": 11, + "column": 22, "line": 1, }, }, - "name": "c", + "name": "ok", "range": Array [ - 11, - 12, + 22, + 24, ], "type": "Identifier", }, ], "loc": Object { "end": Object { - "column": 13, + "column": 25, "line": 1, }, "start": Object { - "column": 7, + "column": 21, "line": 1, }, }, "range": Array [ - 7, - 13, + 21, + 25, ], "type": "ArrayPattern", }, "loc": Object { "end": Object { - "column": 13, + "column": 25, "line": 1, }, "start": Object { - "column": 4, + "column": 18, "line": 1, }, }, "range": Array [ - 4, - 13, + 18, + 25, ], "type": "RestElement", }, ], "loc": Object { "end": Object { - "column": 14, + "column": 26, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 14, + 11, + 26, ], "type": "ArrayPattern", }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 0, + 30, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, }, - "operator": "=", - "range": Array [ - 0, - 18, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "d", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, }, - "type": "AssignmentExpression", }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { "loc": Object { "end": Object { - "column": 19, + "column": 11, "line": 1, }, "start": Object { - "column": 0, + "column": 10, "line": 1, }, }, "range": Array [ - 0, - 19, + 10, + 11, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "(", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 12, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 1, + 11, + 12, ], "type": "Punctuator", "value": "[", @@ -61608,17 +62794,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, + "column": 13, "line": 1, }, "start": Object { - "column": 1, + "column": 12, "line": 1, }, }, "range": Array [ - 1, - 2, + 12, + 13, ], "type": "Identifier", "value": "a", @@ -61626,17 +62812,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 14, "line": 1, }, "start": Object { - "column": 2, + "column": 13, "line": 1, }, }, "range": Array [ - 2, - 3, + 13, + 14, ], "type": "Punctuator", "value": ",", @@ -61644,107 +62830,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 16, "line": 1, }, "start": Object { - "column": 4, + "column": 15, "line": 1, }, }, "range": Array [ - 4, - 7, + 15, + 16, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 17, "line": 1, }, "start": Object { - "column": 7, + "column": 16, "line": 1, }, }, "range": Array [ - 7, - 8, + 16, + 17, ], "type": "Punctuator", - "value": "[", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 18, "line": 1, }, }, "range": Array [ - 8, - 9, + 18, + 21, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 1, }, "start": Object { - "column": 9, + "column": 21, "line": 1, }, }, "range": Array [ - 9, - 10, + 21, + 22, ], "type": "Punctuator", - "value": ",", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 24, "line": 1, }, "start": Object { - "column": 11, + "column": 22, "line": 1, }, }, "range": Array [ - 11, - 12, + 22, + 24, ], "type": "Identifier", - "value": "c", + "value": "ok", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 25, "line": 1, }, "start": Object { - "column": 12, + "column": 24, "line": 1, }, }, "range": Array [ - 12, - 13, + 24, + 25, ], "type": "Punctuator", "value": "]", @@ -61752,17 +62938,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 26, "line": 1, }, "start": Object { - "column": 13, + "column": 25, "line": 1, }, }, "range": Array [ - 13, - 14, + 25, + 26, ], "type": "Punctuator", "value": "]", @@ -61770,266 +62956,412 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 27, "line": 1, }, "start": Object { - "column": 15, + "column": 26, "line": 1, }, }, "range": Array [ - 15, - 16, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 29, "line": 1, }, "start": Object { - "column": 17, + "column": 28, "line": 1, }, }, "range": Array [ - 17, - 18, + 28, + 29, ], - "type": "Identifier", - "value": "d", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 30, "line": 1, }, "start": Object { - "column": 18, + "column": 29, "line": 1, }, }, "range": Array [ - 18, - 19, + 29, + 30, ], "type": "Punctuator", - "value": ";", + "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 30, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 30, + "column": 31, "line": 1, }, "start": Object { - "column": 0, + "column": 30, "line": 1, }, }, - "params": Array [ - Object { + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { "elements": Array [ Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 13, + "column": 5, "line": 1, }, "start": Object { - "column": 12, + "column": 1, "line": 1, }, }, - "name": "a", "range": Array [ - 12, - 13, + 1, + 5, ], - "type": "Identifier", + "type": "RestElement", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 7, "line": 1, }, }, - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - Object { - "argument": Object { - "elements": Array [ - Object { + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 24, + "column": 10, "line": 1, }, "start": Object { - "column": 22, + "column": 9, "line": 1, }, }, - "name": "ok", + "name": "a", "range": Array [ - 22, - 24, + 9, + 10, ], "type": "Identifier", }, - ], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, - "start": Object { - "column": 21, - "line": 1, + "method": false, + "range": Array [ + 9, + 10, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, }, - "range": Array [ - 21, - 25, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, }, - }, + ], "range": Array [ - 18, - 25, + 7, + 15, ], - "type": "RestElement", + "type": "ObjectPattern", }, ], "loc": Object { "end": Object { - "column": 26, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 0, "line": 1, }, }, "range": Array [ - 11, - 26, + 0, + 16, ], "type": "ArrayPattern", }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ - 0, - 30, + 4, + 5, ], - "type": "FunctionDeclaration", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 6, "line": 1, }, "start": Object { - "column": 30, + "column": 5, "line": 1, }, }, "range": Array [ - 30, - 31, + 5, + 6, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 31, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { @@ -62037,16 +63369,16 @@ Object { "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, + 7, 8, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -62082,184 +63414,334 @@ Object { 11, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 13, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 15, "line": 1, }, }, "range": Array [ - 12, - 13, + 15, + 16, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "range": Array [ - 13, - 14, + 17, + 18, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 15, + "column": 19, "line": 1, }, }, "range": Array [ - 15, - 16, + 19, + 20, ], "type": "Identifier", - "value": "b", + "value": "d", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 17, + 20, + 21, ], "type": "Punctuator", - "value": ",", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-spread/invalid-not-final-array-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 12, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 21, + "column": 1, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 21, + 0, + 1, ], "type": "Punctuator", - "value": "...", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 4, "line": 1, }, "start": Object { - "column": 21, + "column": 1, "line": 1, }, }, "range": Array [ - 21, - 22, + 1, + 4, ], "type": "Punctuator", - "value": "[", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 5, "line": 1, }, "start": Object { - "column": 22, + "column": 4, "line": 1, }, }, "range": Array [ - 22, - 24, + 4, + 5, ], "type": "Identifier", - "value": "ok", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 6, "line": 1, }, "start": Object { - "column": 24, + "column": 5, "line": 1, }, }, "range": Array [ - 24, - 25, + 5, + 6, ], "type": "Punctuator", - "value": "]", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 8, "line": 1, }, "start": Object { - "column": 25, + "column": 7, "line": 1, }, }, "range": Array [ - 25, - 26, + 7, + 8, ], "type": "Punctuator", "value": "]", @@ -62267,71 +63749,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, + "column": 10, "line": 1, }, "start": Object { - "column": 28, + "column": 9, "line": 1, }, }, "range": Array [ - 28, - 29, + 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 12, "line": 1, }, "start": Object { - "column": 29, + "column": 11, "line": 1, }, }, "range": Array [ - 29, - 30, + 11, + 12, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 13, "line": 1, }, "start": Object { - "column": 30, + "column": 12, "line": 1, }, }, "range": Array [ - 30, - 31, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -62341,7 +63805,7 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -62349,27 +63813,9 @@ Object { "left": Object { "elements": Array [ Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 5, + "column": 2, "line": 1, }, "start": Object { @@ -62377,149 +63823,52 @@ Object { "line": 1, }, }, + "name": "a", "range": Array [ 1, - 5, + 2, ], - "type": "RestElement", + "type": "Identifier", }, Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "argument": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, }, - "method": false, - "range": Array [ - 9, - 10, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "start": Object { + "column": 7, + "line": 1, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 12, - 13, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, + "name": "b", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, }, - ], + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ - 7, - 15, + 4, + 8, ], - "type": "ObjectPattern", + "type": "RestElement", }, ], "loc": Object { "end": Object { - "column": 16, + "column": 9, "line": 1, }, "start": Object { @@ -62529,13 +63878,13 @@ Object { }, "range": Array [ 0, - 16, + 9, ], "type": "ArrayPattern", }, "loc": Object { "end": Object { - "column": 20, + "column": 13, "line": 1, }, "start": Object { @@ -62546,23 +63895,23 @@ Object { "operator": "=", "range": Array [ 0, - 20, + 13, ], "right": Object { "loc": Object { "end": Object { - "column": 20, + "column": 13, "line": 1, }, "start": Object { - "column": 19, + "column": 12, "line": 1, }, }, - "name": "d", + "name": "c", "range": Array [ - 19, - 20, + 12, + 13, ], "type": "Identifier", }, @@ -62570,7 +63919,7 @@ Object { }, "loc": Object { "end": Object { - "column": 21, + "column": 14, "line": 1, }, "start": Object { @@ -62580,15 +63929,15 @@ Object { }, "range": Array [ 0, - 21, + 14, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { "column": 0, @@ -62597,7 +63946,7 @@ Object { }, "range": Array [ 0, - 22, + 14, ], "sourceType": "script", "tokens": Array [ @@ -62622,7 +63971,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 4, + "column": 2, "line": 1, }, "start": Object { @@ -62632,46 +63981,46 @@ Object { }, "range": Array [ 1, - 4, + 2, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { - "column": 4, + "column": 2, "line": 1, }, }, "range": Array [ - 4, - 5, + 2, + 3, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 4, "line": 1, }, }, "range": Array [ - 5, - 6, + 4, + 7, ], "type": "Punctuator", - "value": ",", + "value": "...", }, Object { "loc": Object { @@ -62688,26 +64037,26 @@ Object { 7, 8, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 10, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { @@ -62725,7 +64074,7 @@ Object { 11, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { @@ -62743,94 +64092,22 @@ Object { 13, ], "type": "Identifier", - "value": "b", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { "column": 14, "line": 1, }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - "value": "d", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, "start": Object { - "column": 20, + "column": 13, "line": 1, }, }, "range": Array [ - 20, - 21, + 13, + 14, ], "type": "Punctuator", "value": ";", @@ -62840,7 +64117,7 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/not-final-array.src 1`] = ` Object { "body": Array [ Object { @@ -62848,9 +64125,27 @@ Object { "left": Object { "elements": Array [ Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 2, + "column": 5, "line": 1, }, "start": Object { @@ -62858,47 +64153,29 @@ Object { "line": 1, }, }, - "name": "a", "range": Array [ 1, - 2, + 5, ], - "type": "Identifier", + "type": "RestElement", }, Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, + "name": "b", "range": Array [ - 4, + 7, 8, ], - "type": "RestElement", + "type": "Identifier", }, ], "loc": Object { @@ -63006,7 +64283,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, + "column": 4, "line": 1, }, "start": Object { @@ -63016,46 +64293,46 @@ Object { }, "range": Array [ 1, - 2, + 4, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { - "column": 2, + "column": 4, "line": 1, }, }, "range": Array [ - 2, - 3, + 4, + 5, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, - 7, + 5, + 6, ], "type": "Punctuator", - "value": "...", + "value": ",", }, Object { "loc": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap new file mode 100644 index 000000000000..e4efa0a55902 --- /dev/null +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -0,0 +1,1929 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/block-trailing-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/comment-within-condition.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/export-default-anonymous-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsdoc-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-block-comment.src.js.src 1`] = ` +Object { + "column": 10, + "index": 84, + "lineNumber": 5, + "message": "Unterminated regular expression literal.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comments.src.js.src 1`] = ` +Object { + "column": 9, + "index": 113, + "lineNumber": 7, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/line-comment-with-block-syntax.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/mix-line-and-block-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/no-comment-regex.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/no-comment-template.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-call-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-debugger-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-return-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-throw-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-while-loop-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment-in-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-nested-functions.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/template-string-block.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param-with-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body-not-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-dup-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-missing-paren.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-not-arrow.src.js.src 1`] = ` +Object { + "column": 26, + "index": 26, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-names.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-two-lines.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-wrapped-param.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/iife.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/multiple-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/no-auto-return.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-arrow-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-sequence.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-parens.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/delete-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/do-while-statements.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/identifiers-double-underscore.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/instanceof.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/new-with-member-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/new-without-parens.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/typeof-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/update-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/void-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/binary.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/decimal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/hex.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/invalid.src.js.src 1`] = ` +Object { + "column": 4, + "index": 4, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/lowercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/blockBindings/const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let-in-switchcase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-accessor-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-computed-static-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-prototype.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-static.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-with-space.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method-super.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-prototype.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-static.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-computed-static-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-computed-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-three-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-two-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-parameters.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-with-space.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-assign-to-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-double-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-literal-derived-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-setter-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-two-super-classes.src.js.src 1`] = ` +Object { + "column": 18, + "index": 18, + "lineNumber": 1, + "message": "Classes can only extend a single class.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/named-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/named-derived-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/not-all-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-member.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-to-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-var-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-assign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-array-catch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-object-catch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/named-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-multi-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/sparse-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-forOf/loop.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/complex-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructuring-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/multi-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/not-final-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/single-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/block.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/directive-in-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/function-non-strict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/non-directive-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/program.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/program-order.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/raw.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-generators.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js.src 1`] = ` +Object { + "column": 18, + "index": 18, + "lineNumber": 1, + "message": "',' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/exponentiationOperators/exponential-operators.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/anonymous-generator.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/double-yield.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/empty-generator-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/generator-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-delegation.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-in-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-no-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-no-arg.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-true.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/importMeta/simple-import-meta.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-delete.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-strict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-value.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-batch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-anonymous-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-as.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-jquery.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-module.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-namespace-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-null-as-nil.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-await.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js.src 1`] = ` +Object { + "column": 0, + "index": 9, + "lineNumber": 2, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-token.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default.src.js.src 1`] = ` +Object { + "column": 20, + "index": 20, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-equal.src.js.src 1`] = ` +Object { + "column": 15, + "index": 15, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-token.src.js.src 1`] = ` +Object { + "column": 17, + "index": 17, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-extra-comma.src.js.src 1`] = ` +Object { + "column": 16, + "index": 16, + "lineNumber": 1, + "message": "Identifier expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-middle-comma.src.js.src 1`] = ` +Object { + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "Identifier expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default.src.js.src 1`] = ` +Object { + "column": 7, + "index": 7, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named.src.js.src 1`] = ` +Object { + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js.src 1`] = ` +Object { + "column": 17, + "index": 17, + "lineNumber": 1, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js.src 1`] = ` +Object { + "column": 0, + "index": 11, + "lineNumber": 2, + "message": "'=' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js.src 1`] = ` +Object { + "column": 0, + "index": 20, + "lineNumber": 2, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-named.src.js.src 1`] = ` +Object { + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-namespace.src.js.src 1`] = ` +Object { + "column": 15, + "index": 15, + "lineNumber": 1, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js.src 1`] = ` +Object { + "column": 0, + "index": 24, + "lineNumber": 2, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-extra-comma.src.js.src 1`] = ` +Object { + "column": 16, + "index": 16, + "lineNumber": 1, + "message": "Identifier expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-middle-comma.src.js.src 1`] = ` +Object { + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "Identifier expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-after-named.src.js.src 1`] = ` +Object { + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "'from' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "'as' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-unknown-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/newTarget/simple-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js.src 1`] = ` +Object { + "column": 0, + "index": 20, + "lineNumber": 3, + "message": "':' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "':' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js.src 1`] = ` +Object { + "column": 13, + "index": 19, + "lineNumber": 2, + "message": "'{' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/invalid.src.js.src 1`] = ` +Object { + "column": 4, + "index": 4, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/lowercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/strict-uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regex/regexp-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexYFlag/regexp-y-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/basic-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/class-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/class-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/error-no-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/error-not-last.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/invalid-rest-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/single-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float-negative.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-null.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number-negative.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-if.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-sequence.src.js.src 1`] = ` +Object { + "column": 4, + "index": 4, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/multi-function-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/not-final-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/simple-function-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/deeply-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/error-octal-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/escape-characters.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/expressions.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/multi-line-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/simple-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/single-dollar-sign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-no-placeholders.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js.src 1`] = ` +Object { + "column": 4, + "index": 4, + "lineNumber": 1, + "message": "Hexadecimal digit expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js.src 1`] = ` +Object { + "column": 10, + "index": 10, + "lineNumber": 1, + "message": "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/attributes.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/element-keyword-name.src.js.src 1`] = ` +Object { + "column": 12, + "index": 18, + "lineNumber": 2, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-comment.src.js.src 1`] = ` +Object { + "column": 30, + "index": 30, + "lineNumber": 1, + "message": "Unterminated regular expression literal.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-conditional.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-invalid-js-identifier.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-tags.src.js.src 1`] = ` +Object { + "column": 11, + "index": 11, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/empty-placeholder.src.js.src 1`] = ` +Object { + "column": 7, + "index": 7, + "lineNumber": 1, + "message": "Unterminated regular expression literal.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/escape-patterns.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute-missing-equals.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-broken-tag.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-end-tag-name.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-string-end-tag-name.src.js.src 1`] = ` +Object { + "column": 11, + "index": 11, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-embedded-expression.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "':' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-leading-dot-tag-name.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tag.src.js.src 1`] = ` +Object { + "column": 4, + "index": 4, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tags.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-dot-tag-name.src.js.src 1`] = ` +Object { + "column": 8, + "index": 8, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-namespace-tag.src.js.src 1`] = ` +Object { + "column": 2, + "index": 2, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-name.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-value.src.js.src 1`] = ` +Object { + "column": 2, + "index": 2, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-spread-operator.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-name-with-docts.src.js.src 1`] = ` +Object { + "column": 4, + "index": 4, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-value-with-dots.src.js.src 1`] = ` +Object { + "column": 2, + "index": 2, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent.src.js.src 1`] = ` +Object { + "column": 36, + "index": 36, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent-with-comment.src.js.src 1`] = ` +Object { + "column": 38, + "index": 38, + "lineNumber": 1, + "message": "',' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-no-tag-name.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-placeholder-in-closing-tag.src.js.src 1`] = ` +Object { + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "Unterminated regular expression literal.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-trailing-dot-tag-name.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "Identifier expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-unexpected-comma.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/japanese-characters.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/less-than-operator.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/member-expression.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/member-expression-this.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/multiple-blank-spaces.src.js.src 1`] = ` +Object { + "column": 8, + "index": 8, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/namespaced-attribute-and-value-inserted.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/namespaced-name-and-attribute.src.js.src 1`] = ` +Object { + "column": 2, + "index": 2, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/newslines-and-entities.src.js.src 1`] = ` +Object { + "column": 4, + "index": 4, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-inside-tag.src.js.src 1`] = ` +Object { + "column": 9, + "index": 15, + "lineNumber": 2, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-with-newline.src.js.src 1`] = ` +Object { + "column": 2, + "index": 2, + "lineNumber": 1, + "message": "Invalid character.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment-with-child.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/spread-child.src.js.src 1`] = ` +Object { + "column": 15, + "index": 15, + "lineNumber": 1, + "message": "Unterminated regular expression literal.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attributes.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-dots.src.js.src 1`] = ` +Object { + "column": 6, + "index": 6, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-multi-dots.src.js.src 1`] = ` +Object { + "column": 8, + "index": 8, + "lineNumber": 1, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/test-content.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/trailing-spread-operator-attribute.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/unknown-escape-pattern.src.js.src 1`] = ` +Object { + "column": 3, + "index": 3, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js.src 1`] = ` +Object { + "column": 9, + "index": 15, + "lineNumber": 2, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/test-content.src.js.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/semanticInfo/export-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/semanticInfo/import-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/semanticInfo/isolated-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/tsx/generic-jsx-element.src.tsx.src 1`] = ` +Object { + "column": 21, + "index": 21, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/tsx/react-typed-props.src.tsx.src 1`] = ` +Object { + "column": 12, + "index": 141, + "lineNumber": 9, + "message": "',' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-optional-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-with-var-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-and-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method-default.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-and-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-computed-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-methods.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-property-undefined.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-private-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-public-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-static-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-default.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/const-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/declare-class-with-optional-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/declare-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-object.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-alias-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-class-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-function-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-await.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types-assignation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-all-property-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-jsdoc.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-without-type-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/keyof-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/nested-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/never-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/non-null-assertion-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-escaped-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/symbol-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-object-without-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-parameters-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-reference-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-bigint.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-boolean.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-false.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-never.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-number.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-object.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-string.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-symbol.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-true.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-undefined.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-unknown.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-void.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-this.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/unique-symbol.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/unknown-type-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-dotted-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/abstract-class.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/class.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/type-alias.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/variable.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/enum-with-keywords.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/solo-const.src.ts.src 1`] = ` +Object { + "column": 5, + "index": 5, + "lineNumber": 1, + "message": "Variable declaration list cannot be empty.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/expressions/call-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/expressions/new-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/array-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-with-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-minus.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-plus.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/nested-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/parenthesized-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-empty.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-optional.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-rest.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/type-literal.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/type-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/typeof.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/union-intersection.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/union-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 619756633c98..41a5132d01f4 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -72629,6 +72629,68 @@ Object { } `; +exports[`typescript fixtures/errorRecovery/solo-const.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [], + "kind": "const", + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/expressions/call-expression-type-arguments.src 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts new file mode 100644 index 000000000000..498acd025a06 --- /dev/null +++ b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts @@ -0,0 +1,52 @@ +/** + * @fileoverview Tests for optional semantic diagnostics + * @author James Henry + * @copyright jQuery Foundation and other contributors, https://jquery.org/ + * MIT License + */ +import path from 'path'; +import shelljs from 'shelljs'; +import * as parser from '../../src/parser'; + +//------------------------------------------------------------------------------ +// Setup +//------------------------------------------------------------------------------ + +/** + * Process all fixtures, we will only snapshot the ones that have semantic errors + * which are ignored by default parsing logic. + */ +const FIXTURES_DIR = './tests/fixtures/'; + +const testFiles = shelljs + .find(FIXTURES_DIR) + .filter(filename => filename.includes('.src.')) + .map(filename => filename.substring(FIXTURES_DIR.length - 2)); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +describe('Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled', () => { + testFiles.forEach(filename => { + const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}`); + const config = { + loc: true, + range: true, + tokens: true, + errorOnUnknownASTType: true, + errorOnTypeScriptSyntaticAndSemanticIssues: true + }; + it(`fixtures/${filename}.src`, () => { + expect.assertions(1); + try { + parser.parseAndGenerateServices(code, config); + expect( + 'TEST OUTPUT: No semantic or syntactic issues found' + ).toMatchSnapshot(); + } catch (err) { + expect(err).toMatchSnapshot(); + } + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 6abda989da9c..96ae8428b76e 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -55,8 +55,6 @@ function createOptions(fileName: string): ParserOptions & { cwd?: string } { describe('semanticInfo', () => { // test all AST snapshots testFiles.forEach(filename => { - // Uncomment and fill in filename to focus on a single file - // var filename = "jsx/invalid-matching-placeholder-in-closing-tag"; const fullFileName = `${path.resolve(FIXTURES_DIR, filename)}.src.ts`; const code = shelljs.cat(fullFileName); test( From 3e1f8c7af22f014c1a40786d5a933c6d112f39b5 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 1 Jan 2019 20:10:57 +0100 Subject: [PATCH 33/84] fix: add missing TSInferType node (#68) --- .../typescript-estree/src/ast-node-types.ts | 1 + packages/typescript-estree/src/convert.ts | 8 +- .../types/conditional-infer-nested.src.ts | 5 + .../types/conditional-infer-simple.src.ts | 1 + .../typescript/types/conditional-infer.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 6 + .../lib/__snapshots__/typescript.ts.snap | 2692 +++++++++++++++++ 7 files changed, 2713 insertions(+), 1 deletion(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-nested.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-simple.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index 59b684f79620..592dc438d1da 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -115,6 +115,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSExportAssignment: 'TSExportAssignment', TSExportKeyword: 'TSExportKeyword', TSImportType: 'TSImportType', + TSInferType: 'TSInferType', TSLiteralType: 'TSLiteralType', TSIndexedAccessType: 'TSIndexedAccessType', TSIndexSignature: 'TSIndexSignature', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index f03ae7910082..15f939a3aab9 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2690,7 +2690,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); break; } - + case SyntaxKind.InferType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSInferType, + typeParameter: convertChildType(node.typeParameter) + }); + break; + } default: deeplyCopy(); } diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-nested.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-nested.src.ts new file mode 100644 index 000000000000..be2b56659de4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-nested.src.ts @@ -0,0 +1,5 @@ +type Unpacked = + T extends (infer U)[] ? U : + T extends infer U ? U : + T extends Promise ? U : + T; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-simple.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-simple.src.ts new file mode 100644 index 000000000000..5da42481fd3d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer-simple.src.ts @@ -0,0 +1 @@ +type Foo = T extends { a: infer U, b: infer U } ? U : never; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer.src.ts new file mode 100644 index 000000000000..fc9bc48546e6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/conditional-infer.src.ts @@ -0,0 +1 @@ +type Element = T extends (infer U)[] ? U : T; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index e4efa0a55902..367a39031001 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1884,6 +1884,12 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-simple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-with-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 41a5132d01f4..a0ad01bcb643 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -78188,6 +78188,2698 @@ Object { } `; +exports[`typescript fixtures/types/conditional-infer.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Element", + "range": Array [ + 5, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 37, + ], + "type": "TSParenthesizedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 35, + 36, + ], + "type": "TSTypeParameter", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 39, + ], + "type": "TSArrayType", + }, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 46, + 47, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 47, + ], + "trueType": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + }, + "type": "TSConditionalType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 12, + 15, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 12, + ], + "type": "Identifier", + "value": "Element", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 27, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Unpacked", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 126, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 31, + 40, + ], + "type": "TSParenthesizedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 32, + 39, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "U", + "range": Array [ + 38, + 39, + ], + "type": "TSTypeParameter", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 31, + 42, + ], + "type": "TSArrayType", + }, + "falseType": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 63, + 70, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "name": "U", + "range": Array [ + 69, + 70, + ], + "type": "TSTypeParameter", + }, + }, + "falseType": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "name": "T", + "range": Array [ + 83, + 84, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 93, + 109, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "Promise", + "range": Array [ + 93, + 100, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 101, + 108, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "name": "U", + "range": Array [ + 107, + 108, + ], + "type": "TSTypeParameter", + }, + }, + ], + "range": Array [ + 100, + 109, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": "T", + "range": Array [ + 124, + 125, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 83, + 125, + ], + "trueType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "name": "U", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, + }, + "type": "TSConditionalType", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 53, + 125, + ], + "trueType": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "name": "U", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, + }, + "type": "TSConditionalType", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 21, + 125, + ], + "trueType": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "name": "U", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + }, + "type": "TSConditionalType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 127, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + "value": "Unpacked", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 23, + 30, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 32, + 37, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 55, + 62, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 63, + 68, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 85, + 92, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 93, + 100, + ], + "type": "Identifier", + "value": "Promise", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 100, + 101, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 101, + 106, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 31, + "line": 4, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 33, + "line": 4, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 37, + "line": 4, + }, + }, + "range": Array [ + 114, + 115, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 125, + 126, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 63, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 37, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 35, + 36, + ], + "type": "TSTypeParameter", + }, + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 48, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "TSTypeParameter", + }, + }, + }, + }, + ], + "range": Array [ + 24, + 50, + ], + "type": "TSTypeLiteral", + }, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 62, + ], + "type": "TSNeverKeyword", + }, + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 62, + ], + "trueType": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + }, + "type": "TSConditionalType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 9, + 10, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 8, + 11, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 64, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 46, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 62, + ], + "type": "Identifier", + "value": "never", + }, + Object { + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/types/conditional-with-null.src 1`] = ` Object { "body": Array [ From 12cb5ee82fa1cbafa012fe96613e42989f5e0258 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 1 Jan 2019 20:21:31 +0100 Subject: [PATCH 34/84] test: refactor omitDeep function to support name changes (#70) --- .../tests/ast-alignment/fixtures-to-test.ts | 12 - .../tests/ast-alignment/utils.ts | 187 ++++---- .../typescript/types/literal-number.src.ts | 1 + .../typescript/types/literal-string.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 4 + .../lib/__snapshots__/typescript.ts.snap | 448 ++++++++++++++++++ packages/typescript-estree/yarn.lock | 38 +- 7 files changed, 559 insertions(+), 132 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/literal-number.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/literal-string.src.ts diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index b0cd1f8cf572..01525c4165e3 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -377,18 +377,6 @@ let fixturePatternConfigsToTest = [ * tsep: TSBigIntKeyword */ 'typed-keyword-bigint', - /** - * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/9228 - * Babel: BooleanLiteral - * tsep: Literal - */ - 'typed-keyword-true', - /** - * Not yet supported in Babel https://github.com/babel/babel/issues/9228 - * Babel: BooleanLiteral - * tsep: Literal - */ - 'typed-keyword-false', /** * Not yet supported in Babel https://github.com/babel/babel/issues/9228 * Directive field is not added to module and namespace diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 8dbf44128a4f..0345ab5f1a38 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -14,59 +14,56 @@ export function normalizeNodeTypes(ast: any): any { /** * Removes the given keys from the given AST object recursively - * @param {Object} obj A JavaScript object to remove keys from - * @param {Object[]} keysToOmit Names and predicate functions use to determine what keys to omit from the final object + * @param root A JavaScript object to remove keys from + * @param keysToOmit Names and predicate functions use to determine what keys to omit from the final object + * @param nodes advance ast modifications * @returns {Object} formatted object */ export function omitDeep( - obj: any, - keysToOmit: { key: string; predicate: Function }[] -): any { - keysToOmit = keysToOmit || []; - function shouldOmit(keyName: string, val: any) { - if (!keysToOmit || !keysToOmit.length) { - return false; - } - for (const keyConfig of keysToOmit) { - if (keyConfig.key !== keyName) { - continue; - } - return keyConfig.predicate(val); + root: any, + keysToOmit: { key: string; predicate: Function }[], + nodes: Record void> = {} +) { + function shouldOmit(keyName: string, val: any): boolean { + if (keysToOmit && keysToOmit.length) { + return keysToOmit.some( + keyConfig => keyConfig.key === keyName && keyConfig.predicate(val) + ); } return false; } - for (const key in obj) { - if (!obj.hasOwnProperty(key)) { - continue; + function visit(node: any, parent: any) { + if (!node) { + return; } - const val = (obj as any)[key]; - if (isPlainObject(val)) { - if (shouldOmit(key, val)) { - delete (obj as any)[key]; - // re-run with the same arguments - // in case the object has multiple keys to omit - return omitDeep(obj, keysToOmit); - } - omitDeep(val, keysToOmit); - } else if (Array.isArray(val)) { - if (shouldOmit(key, val)) { - delete (obj as any)[key]; - // re-run with the same arguments - // in case the object has multiple keys to omit - return omitDeep(obj, keysToOmit); - } - for (const i of val) { - omitDeep(i, keysToOmit); + + for (const prop in node) { + if (node.hasOwnProperty(prop)) { + if (shouldOmit(prop, node[prop])) { + delete node[prop]; + continue; + } + + const child = node[prop]; + + if (Array.isArray(child)) { + for (const el of child) { + visit(el, node); + } + } else if (isPlainObject(child)) { + visit(child, node); + } } - } else if (shouldOmit(key, val)) { - delete (obj as any)[key]; - // re-run with the same arguments - // in case the object has multiple keys to omit - return omitDeep(obj, keysToOmit); + } + + if (typeof node.type === 'string' && node.type in nodes) { + nodes[node.type](node, parent); } } - return obj; + + visit(root, null); + return root; } /** @@ -84,50 +81,70 @@ const ifNumber = (val: any) => typeof val === 'number'; * @returns {Object} processed babylon AST */ export function preprocessBabylonAST(ast: any): any { - return omitDeep(ast.program, [ - { - key: 'start', - // only remove the "start" number (not the "start" object within loc) - predicate: ifNumber - }, - { - key: 'end', - // only remove the "end" number (not the "end" object within loc) - predicate: ifNumber - }, - { - key: 'identifierName', - predicate: always - }, - { - key: 'extra', - predicate: always - }, - { - key: 'directives', - predicate: always - }, - { - key: 'innerComments', - predicate: always - }, - { - key: 'leadingComments', - predicate: always - }, - { - key: 'trailingComments', - predicate: always - }, - { - key: 'guardedHandlers', - predicate: always - }, + return omitDeep( + ast.program, + [ + { + key: 'start', + // only remove the "start" number (not the "start" object within loc) + predicate: ifNumber + }, + { + key: 'end', + // only remove the "end" number (not the "end" object within loc) + predicate: ifNumber + }, + { + key: 'identifierName', + predicate: always + }, + { + key: 'extra', + predicate: always + }, + { + key: 'innerComments', + predicate: always + }, + { + key: 'leadingComments', + predicate: always + }, + { + key: 'trailingComments', + predicate: always + }, + { + key: 'guardedHandlers', + predicate: always + }, + { + key: 'interpreter', + predicate: always + } + ], { - key: 'interpreter', - predicate: always + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + */ + StringLiteral(node: any) { + node.type = 'Literal'; + }, + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + */ + NumericLiteral(node: any) { + node.type = 'Literal'; + }, + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + */ + BooleanLiteral(node: any) { + node.type = 'Literal'; + node.raw = String(node.value); + } } - ]); + ); } /** @@ -135,7 +152,7 @@ export function preprocessBabylonAST(ast: any): any { * between different parsers in the ecosystem. Hack around this by removing the data * before comparing the ASTs. * - * See: https://github.com/babel/babylon/issues/673 + * See: https://github.com/babel/babel/issues/6681 * * @param {Object} ast the raw AST with a Program node at its top level * @param {boolean} ignoreSourceType fix for issues with unambiguous type detection diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/literal-number.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/literal-number.src.ts new file mode 100644 index 000000000000..1e234e36b898 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/literal-number.src.ts @@ -0,0 +1 @@ +let x: 0; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/literal-string.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/literal-string.src.ts new file mode 100644 index 000000000000..926a42ae7e30 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/literal-string.src.ts @@ -0,0 +1 @@ +let x: "foo"; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 367a39031001..c83f2742bd5f 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1896,6 +1896,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/literal-number.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/literal-string.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index a0ad01bcb643..6058064a560e 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -82208,6 +82208,454 @@ Object { } `; +exports[`typescript fixtures/types/literal-number.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 8, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "TSLiteralType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/literal-string.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 12, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 12, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "TSLiteralType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/types/mapped.src 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 9333764f9313..65a041df9821 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -2279,7 +2279,7 @@ debug@^4.0.0, debug@^4.1.0: dependencies: ms "^2.1.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= @@ -3470,7 +3470,7 @@ import-local@^1.0.0: pkg-dir "^2.0.0" resolve-cwd "^2.0.0" -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= @@ -4677,11 +4677,6 @@ lockfile@^1.0.4: dependencies: signal-exit "^3.0.2" -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw= - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -4690,33 +4685,11 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4= - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI= - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM= - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -4797,11 +4770,6 @@ lodash.pick@4.4.0, lodash.pick@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM= -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - lodash.set@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" @@ -6523,7 +6491,7 @@ readable-stream@~1.1.10: isarray "0.0.1" string_decoder "~0.10.x" -readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0: +readdir-scoped-modules@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" integrity sha1-n6+jfShr5dksuuve4DDcm19AZ0c= From d9036136c52ca1f40f684c4b7b91016f73794911 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 1 Jan 2019 20:34:38 +0100 Subject: [PATCH 35/84] fix: add missing TSThisType no known nodes (#73) --- .../typescript-estree/src/ast-node-types.ts | 1 + packages/typescript-estree/src/convert.ts | 3 +- .../types/this-type-expanded.src.ts | 29 + .../typescript/types/this-type.src.ts | 5 + .../semantic-diagnostics-enabled.ts.snap | 4 + .../lib/__snapshots__/typescript.ts.snap | 4565 +++++++++++++++++ 6 files changed, 4606 insertions(+), 1 deletion(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/this-type-expanded.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/this-type.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index 592dc438d1da..bb014371fa9a 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -145,6 +145,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSStaticKeyword: 'TSStaticKeyword', TSStringKeyword: 'TSStringKeyword', TSSymbolKeyword: 'TSSymbolKeyword', + TSThisType: 'TSThisType', TSTypeAnnotation: 'TSTypeAnnotation', TSTypeAliasDeclaration: 'TSTypeAliasDeclaration', TSTypeLiteral: 'TSTypeLiteral', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 15f939a3aab9..d72b5c8b4cda 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2268,6 +2268,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; } + case SyntaxKind.ThisType: case SyntaxKind.AnyKeyword: case SyntaxKind.BigIntKeyword: case SyntaxKind.BooleanKeyword: @@ -2280,7 +2281,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.VoidKeyword: case SyntaxKind.UndefinedKeyword: { Object.assign(result, { - type: `TS${SyntaxKind[node.kind]}` + type: AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`] }); break; } diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/this-type-expanded.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/this-type-expanded.src.ts new file mode 100644 index 000000000000..0c442178cb15 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/this-type-expanded.src.ts @@ -0,0 +1,29 @@ +class A { + public a: number; + + public method(this: this): number { + return this.a; + } + + public method2(this: A): this { + return this.a; + } + + public method3(this: this): number { + var fn = () => this.a; + return fn(); + } + + public method4(this: A): number { + var fn = () => this.a; + return fn(); + } + + static staticMethod(this: A): number { + return this.a; + } + + static typeof(this: A): this { + return typeof this; + } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/this-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/this-type.src.ts new file mode 100644 index 000000000000..d5f87a9f84a2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/this-type.src.ts @@ -0,0 +1,5 @@ +class Message { + clone(): this { + return this; + } +} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index c83f2742bd5f..13dd7f96c613 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1918,6 +1918,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/this-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/this-type-expanded.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-empty.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 6058064a560e..43338f2e4ca7 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -86688,6 +86688,4571 @@ Object { } `; +exports[`typescript fixtures/types/this-type.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "clone", + "range": Array [ + 18, + 23, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 54, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 45, + 49, + ], + "type": "ThisExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 38, + 50, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 54, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 23, + 54, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "TSThisType", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 56, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Message", + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 57, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 13, + ], + "type": "Identifier", + "value": "Message", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 23, + ], + "type": "Identifier", + "value": "clone", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 45, + 49, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/this-type-expanded.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 29, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSNumberKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "method", + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 33, + 91, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 80, + 84, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "name": "a", + "range": Array [ + 85, + 86, + ], + "type": "Identifier", + }, + "range": Array [ + 80, + 86, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 73, + 87, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 36, + "line": 4, + }, + }, + "range": Array [ + 67, + 91, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "this", + "range": Array [ + 47, + 57, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 51, + 57, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 4, + }, + }, + "range": Array [ + 53, + 57, + ], + "type": "TSThisType", + }, + }, + }, + ], + "range": Array [ + 46, + 91, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 58, + 66, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "name": "method2", + "range": Array [ + 102, + 109, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 95, + 149, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 9, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 9, + }, + }, + "range": Array [ + 138, + 142, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "name": "a", + "range": Array [ + 143, + 144, + ], + "type": "Identifier", + }, + "range": Array [ + 138, + 144, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 131, + 145, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 32, + "line": 8, + }, + }, + "range": Array [ + 125, + 149, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 16, + "line": 8, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 8, + }, + "start": Object { + "column": 17, + "line": 8, + }, + }, + "name": "this", + "range": Array [ + 110, + 117, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 8, + }, + "start": Object { + "column": 21, + "line": 8, + }, + }, + "range": Array [ + 114, + 117, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 8, + }, + "start": Object { + "column": 23, + "line": 8, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 8, + }, + "start": Object { + "column": 23, + "line": 8, + }, + }, + "name": "A", + "range": Array [ + 116, + 117, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 109, + 149, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 8, + }, + "start": Object { + "column": 25, + "line": 8, + }, + }, + "range": Array [ + 118, + 124, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 8, + }, + "start": Object { + "column": 27, + "line": 8, + }, + }, + "range": Array [ + 120, + 124, + ], + "type": "TSThisType", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 12, + }, + }, + "name": "method3", + "range": Array [ + 160, + 167, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "range": Array [ + 153, + 237, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "name": "fn", + "range": Array [ + 198, + 200, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 25, + "line": 13, + }, + "start": Object { + "column": 19, + "line": 13, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 19, + "line": 13, + }, + }, + "range": Array [ + 209, + 213, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 13, + }, + "start": Object { + "column": 24, + "line": 13, + }, + }, + "name": "a", + "range": Array [ + 214, + 215, + ], + "type": "Identifier", + }, + "range": Array [ + 209, + 215, + ], + "type": "MemberExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 13, + }, + "start": Object { + "column": 13, + "line": 13, + }, + }, + "params": Array [], + "range": Array [ + 203, + 215, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 198, + 215, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 194, + 216, + ], + "type": "VariableDeclaration", + }, + Object { + "argument": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 14, + }, + "start": Object { + "column": 11, + "line": 14, + }, + }, + "name": "fn", + "range": Array [ + 228, + 230, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 14, + }, + "start": Object { + "column": 11, + "line": 14, + }, + }, + "range": Array [ + 228, + 232, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 221, + 233, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 15, + }, + "start": Object { + "column": 37, + "line": 12, + }, + }, + "range": Array [ + 188, + 237, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 15, + }, + "start": Object { + "column": 16, + "line": 12, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "name": "this", + "range": Array [ + 168, + 178, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 12, + }, + "start": Object { + "column": 21, + "line": 12, + }, + }, + "range": Array [ + 172, + 178, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 12, + }, + "start": Object { + "column": 23, + "line": 12, + }, + }, + "range": Array [ + 174, + 178, + ], + "type": "TSThisType", + }, + }, + }, + ], + "range": Array [ + 167, + 237, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 12, + }, + "start": Object { + "column": 28, + "line": 12, + }, + }, + "range": Array [ + 179, + 187, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 12, + }, + "start": Object { + "column": 30, + "line": 12, + }, + }, + "range": Array [ + 181, + 187, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 17, + }, + "start": Object { + "column": 9, + "line": 17, + }, + }, + "name": "method4", + "range": Array [ + 248, + 255, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 20, + }, + "start": Object { + "column": 2, + "line": 17, + }, + }, + "range": Array [ + 241, + 322, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 18, + }, + "start": Object { + "column": 8, + "line": 18, + }, + }, + "name": "fn", + "range": Array [ + 283, + 285, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 19, + "line": 18, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 18, + }, + "start": Object { + "column": 19, + "line": 18, + }, + }, + "range": Array [ + 294, + 298, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 24, + "line": 18, + }, + }, + "name": "a", + "range": Array [ + 299, + 300, + ], + "type": "Identifier", + }, + "range": Array [ + 294, + 300, + ], + "type": "MemberExpression", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 13, + "line": 18, + }, + }, + "params": Array [], + "range": Array [ + 288, + 300, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 8, + "line": 18, + }, + }, + "range": Array [ + 283, + 300, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 26, + "line": 18, + }, + "start": Object { + "column": 4, + "line": 18, + }, + }, + "range": Array [ + 279, + 301, + ], + "type": "VariableDeclaration", + }, + Object { + "argument": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 19, + }, + "start": Object { + "column": 11, + "line": 19, + }, + }, + "name": "fn", + "range": Array [ + 313, + 315, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 19, + }, + "start": Object { + "column": 11, + "line": 19, + }, + }, + "range": Array [ + 313, + 317, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 19, + }, + "start": Object { + "column": 4, + "line": 19, + }, + }, + "range": Array [ + 306, + 318, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 20, + }, + "start": Object { + "column": 34, + "line": 17, + }, + }, + "range": Array [ + 273, + 322, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 20, + }, + "start": Object { + "column": 16, + "line": 17, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 17, + "line": 17, + }, + }, + "name": "this", + "range": Array [ + 256, + 263, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 21, + "line": 17, + }, + }, + "range": Array [ + 260, + 263, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 23, + "line": 17, + }, + }, + "range": Array [ + 262, + 263, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 23, + "line": 17, + }, + }, + "name": "A", + "range": Array [ + 262, + 263, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 255, + 322, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 17, + }, + "start": Object { + "column": 25, + "line": 17, + }, + }, + "range": Array [ + 264, + 272, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 17, + }, + "start": Object { + "column": 27, + "line": 17, + }, + }, + "range": Array [ + 266, + 272, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 22, + }, + "start": Object { + "column": 9, + "line": 22, + }, + }, + "name": "staticMethod", + "range": Array [ + 333, + 345, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 24, + }, + "start": Object { + "column": 2, + "line": 22, + }, + }, + "range": Array [ + 326, + 387, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 17, + "line": 23, + }, + "start": Object { + "column": 11, + "line": 23, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 23, + }, + "start": Object { + "column": 11, + "line": 23, + }, + }, + "range": Array [ + 376, + 380, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 23, + }, + "start": Object { + "column": 16, + "line": 23, + }, + }, + "name": "a", + "range": Array [ + 381, + 382, + ], + "type": "Identifier", + }, + "range": Array [ + 376, + 382, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 23, + }, + "start": Object { + "column": 4, + "line": 23, + }, + }, + "range": Array [ + 369, + 383, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 24, + }, + "start": Object { + "column": 39, + "line": 22, + }, + }, + "range": Array [ + 363, + 387, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 24, + }, + "start": Object { + "column": 21, + "line": 22, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 22, + }, + "start": Object { + "column": 22, + "line": 22, + }, + }, + "name": "this", + "range": Array [ + 346, + 353, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 22, + }, + "start": Object { + "column": 26, + "line": 22, + }, + }, + "range": Array [ + 350, + 353, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 22, + }, + "start": Object { + "column": 28, + "line": 22, + }, + }, + "range": Array [ + 352, + 353, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 22, + }, + "start": Object { + "column": 28, + "line": 22, + }, + }, + "name": "A", + "range": Array [ + 352, + 353, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 345, + 387, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 22, + }, + "start": Object { + "column": 30, + "line": 22, + }, + }, + "range": Array [ + 354, + 362, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 22, + }, + "start": Object { + "column": 32, + "line": 22, + }, + }, + "range": Array [ + 356, + 362, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 26, + }, + "start": Object { + "column": 9, + "line": 26, + }, + }, + "name": "typeof", + "range": Array [ + 398, + 404, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 28, + }, + "start": Object { + "column": 2, + "line": 26, + }, + }, + "range": Array [ + 391, + 449, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 27, + }, + "start": Object { + "column": 18, + "line": 27, + }, + }, + "range": Array [ + 440, + 444, + ], + "type": "ThisExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 27, + }, + "start": Object { + "column": 11, + "line": 27, + }, + }, + "operator": "typeof", + "prefix": true, + "range": Array [ + 433, + 444, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 27, + }, + "start": Object { + "column": 4, + "line": 27, + }, + }, + "range": Array [ + 426, + 445, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 28, + }, + "start": Object { + "column": 31, + "line": 26, + }, + }, + "range": Array [ + 420, + 449, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 28, + }, + "start": Object { + "column": 15, + "line": 26, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 26, + }, + "start": Object { + "column": 16, + "line": 26, + }, + }, + "name": "this", + "range": Array [ + 405, + 412, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 26, + }, + "start": Object { + "column": 20, + "line": 26, + }, + }, + "range": Array [ + 409, + 412, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 26, + }, + "start": Object { + "column": 22, + "line": 26, + }, + }, + "range": Array [ + 411, + 412, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 26, + }, + "start": Object { + "column": 22, + "line": 26, + }, + }, + "name": "A", + "range": Array [ + 411, + 412, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 404, + 449, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 26, + }, + "start": Object { + "column": 24, + "line": 26, + }, + }, + "range": Array [ + 413, + 419, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 26, + }, + "start": Object { + "column": 26, + "line": 26, + }, + }, + "range": Array [ + 415, + 419, + ], + "type": "TSThisType", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 29, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 451, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 29, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 451, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 30, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 452, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 18, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "method", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 47, + 51, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 22, + "line": 4, + }, + }, + "range": Array [ + 53, + 57, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 60, + 66, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 4, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 73, + 79, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 80, + 84, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 95, + 101, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 102, + 109, + ], + "type": "Identifier", + "value": "method2", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 8, + }, + "start": Object { + "column": 16, + "line": 8, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 8, + }, + "start": Object { + "column": 17, + "line": 8, + }, + }, + "range": Array [ + 110, + 114, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 8, + }, + "start": Object { + "column": 21, + "line": 8, + }, + }, + "range": Array [ + 114, + 115, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 8, + }, + "start": Object { + "column": 23, + "line": 8, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 8, + }, + "start": Object { + "column": 24, + "line": 8, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 8, + }, + "start": Object { + "column": 25, + "line": 8, + }, + }, + "range": Array [ + 118, + 119, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 8, + }, + "start": Object { + "column": 27, + "line": 8, + }, + }, + "range": Array [ + 120, + 124, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 8, + }, + "start": Object { + "column": 32, + "line": 8, + }, + }, + "range": Array [ + 125, + 126, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 131, + 137, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 9, + }, + }, + "range": Array [ + 138, + 142, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, + }, + "range": Array [ + 142, + 143, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "range": Array [ + 144, + 145, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "range": Array [ + 148, + 149, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "range": Array [ + 153, + 159, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 12, + }, + "start": Object { + "column": 9, + "line": 12, + }, + }, + "range": Array [ + 160, + 167, + ], + "type": "Identifier", + "value": "method3", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 12, + }, + "start": Object { + "column": 16, + "line": 12, + }, + }, + "range": Array [ + 167, + 168, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "range": Array [ + 168, + 172, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 12, + }, + "start": Object { + "column": 21, + "line": 12, + }, + }, + "range": Array [ + 172, + 173, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 12, + }, + "start": Object { + "column": 23, + "line": 12, + }, + }, + "range": Array [ + 174, + 178, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 12, + }, + "start": Object { + "column": 27, + "line": 12, + }, + }, + "range": Array [ + 178, + 179, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 12, + }, + "start": Object { + "column": 28, + "line": 12, + }, + }, + "range": Array [ + 179, + 180, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 12, + }, + "start": Object { + "column": 30, + "line": 12, + }, + }, + "range": Array [ + 181, + 187, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 12, + }, + "start": Object { + "column": 37, + "line": 12, + }, + }, + "range": Array [ + 188, + 189, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 194, + 197, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 198, + 200, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 13, + }, + "start": Object { + "column": 11, + "line": 13, + }, + }, + "range": Array [ + 201, + 202, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 13, + }, + "start": Object { + "column": 13, + "line": 13, + }, + }, + "range": Array [ + 203, + 204, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 13, + }, + "start": Object { + "column": 14, + "line": 13, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 13, + }, + "start": Object { + "column": 16, + "line": 13, + }, + }, + "range": Array [ + 206, + 208, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 13, + }, + "start": Object { + "column": 19, + "line": 13, + }, + }, + "range": Array [ + 209, + 213, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 13, + }, + "start": Object { + "column": 23, + "line": 13, + }, + }, + "range": Array [ + 213, + 214, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 13, + }, + "start": Object { + "column": 24, + "line": 13, + }, + }, + "range": Array [ + 214, + 215, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 13, + }, + "start": Object { + "column": 25, + "line": 13, + }, + }, + "range": Array [ + 215, + 216, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 221, + 227, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 14, + }, + "start": Object { + "column": 11, + "line": 14, + }, + }, + "range": Array [ + 228, + 230, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 14, + }, + "start": Object { + "column": 13, + "line": 14, + }, + }, + "range": Array [ + 230, + 231, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 14, + }, + "start": Object { + "column": 14, + "line": 14, + }, + }, + "range": Array [ + 231, + 232, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 14, + }, + "start": Object { + "column": 15, + "line": 14, + }, + }, + "range": Array [ + 232, + 233, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + "range": Array [ + 236, + 237, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 17, + }, + "start": Object { + "column": 2, + "line": 17, + }, + }, + "range": Array [ + 241, + 247, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 17, + }, + "start": Object { + "column": 9, + "line": 17, + }, + }, + "range": Array [ + 248, + 255, + ], + "type": "Identifier", + "value": "method4", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 17, + }, + "start": Object { + "column": 16, + "line": 17, + }, + }, + "range": Array [ + 255, + 256, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 17, + }, + "start": Object { + "column": 17, + "line": 17, + }, + }, + "range": Array [ + 256, + 260, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 17, + }, + "start": Object { + "column": 21, + "line": 17, + }, + }, + "range": Array [ + 260, + 261, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 17, + }, + "start": Object { + "column": 23, + "line": 17, + }, + }, + "range": Array [ + 262, + 263, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 17, + }, + "start": Object { + "column": 24, + "line": 17, + }, + }, + "range": Array [ + 263, + 264, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 17, + }, + "start": Object { + "column": 25, + "line": 17, + }, + }, + "range": Array [ + 264, + 265, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 17, + }, + "start": Object { + "column": 27, + "line": 17, + }, + }, + "range": Array [ + 266, + 272, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 17, + }, + "start": Object { + "column": 34, + "line": 17, + }, + }, + "range": Array [ + 273, + 274, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 18, + }, + "start": Object { + "column": 4, + "line": 18, + }, + }, + "range": Array [ + 279, + 282, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 18, + }, + "start": Object { + "column": 8, + "line": 18, + }, + }, + "range": Array [ + 283, + 285, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 18, + }, + "start": Object { + "column": 11, + "line": 18, + }, + }, + "range": Array [ + 286, + 287, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 18, + }, + "start": Object { + "column": 13, + "line": 18, + }, + }, + "range": Array [ + 288, + 289, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 18, + }, + "start": Object { + "column": 14, + "line": 18, + }, + }, + "range": Array [ + 289, + 290, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 18, + }, + "start": Object { + "column": 16, + "line": 18, + }, + }, + "range": Array [ + 291, + 293, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 18, + }, + "start": Object { + "column": 19, + "line": 18, + }, + }, + "range": Array [ + 294, + 298, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 18, + }, + "start": Object { + "column": 23, + "line": 18, + }, + }, + "range": Array [ + 298, + 299, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 18, + }, + "start": Object { + "column": 24, + "line": 18, + }, + }, + "range": Array [ + 299, + 300, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 18, + }, + "start": Object { + "column": 25, + "line": 18, + }, + }, + "range": Array [ + 300, + 301, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 19, + }, + "start": Object { + "column": 4, + "line": 19, + }, + }, + "range": Array [ + 306, + 312, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 19, + }, + "start": Object { + "column": 11, + "line": 19, + }, + }, + "range": Array [ + 313, + 315, + ], + "type": "Identifier", + "value": "fn", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 19, + }, + "start": Object { + "column": 13, + "line": 19, + }, + }, + "range": Array [ + 315, + 316, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 19, + }, + "start": Object { + "column": 14, + "line": 19, + }, + }, + "range": Array [ + 316, + 317, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 19, + }, + "start": Object { + "column": 15, + "line": 19, + }, + }, + "range": Array [ + 317, + 318, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 20, + }, + "start": Object { + "column": 2, + "line": 20, + }, + }, + "range": Array [ + 321, + 322, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 22, + }, + "start": Object { + "column": 2, + "line": 22, + }, + }, + "range": Array [ + 326, + 332, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 22, + }, + "start": Object { + "column": 9, + "line": 22, + }, + }, + "range": Array [ + 333, + 345, + ], + "type": "Identifier", + "value": "staticMethod", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 22, + }, + "start": Object { + "column": 21, + "line": 22, + }, + }, + "range": Array [ + 345, + 346, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 22, + }, + "start": Object { + "column": 22, + "line": 22, + }, + }, + "range": Array [ + 346, + 350, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 22, + }, + "start": Object { + "column": 26, + "line": 22, + }, + }, + "range": Array [ + 350, + 351, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 22, + }, + "start": Object { + "column": 28, + "line": 22, + }, + }, + "range": Array [ + 352, + 353, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 22, + }, + "start": Object { + "column": 29, + "line": 22, + }, + }, + "range": Array [ + 353, + 354, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 22, + }, + "start": Object { + "column": 30, + "line": 22, + }, + }, + "range": Array [ + 354, + 355, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 22, + }, + "start": Object { + "column": 32, + "line": 22, + }, + }, + "range": Array [ + 356, + 362, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 22, + }, + "start": Object { + "column": 39, + "line": 22, + }, + }, + "range": Array [ + 363, + 364, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 23, + }, + "start": Object { + "column": 4, + "line": 23, + }, + }, + "range": Array [ + 369, + 375, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 23, + }, + "start": Object { + "column": 11, + "line": 23, + }, + }, + "range": Array [ + 376, + 380, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 23, + }, + "start": Object { + "column": 15, + "line": 23, + }, + }, + "range": Array [ + 380, + 381, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 23, + }, + "start": Object { + "column": 16, + "line": 23, + }, + }, + "range": Array [ + 381, + 382, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 23, + }, + "start": Object { + "column": 17, + "line": 23, + }, + }, + "range": Array [ + 382, + 383, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 24, + }, + "start": Object { + "column": 2, + "line": 24, + }, + }, + "range": Array [ + 386, + 387, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 26, + }, + "start": Object { + "column": 2, + "line": 26, + }, + }, + "range": Array [ + 391, + 397, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 26, + }, + "start": Object { + "column": 9, + "line": 26, + }, + }, + "range": Array [ + 398, + 404, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 26, + }, + "start": Object { + "column": 15, + "line": 26, + }, + }, + "range": Array [ + 404, + 405, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 26, + }, + "start": Object { + "column": 16, + "line": 26, + }, + }, + "range": Array [ + 405, + 409, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 26, + }, + "start": Object { + "column": 20, + "line": 26, + }, + }, + "range": Array [ + 409, + 410, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 26, + }, + "start": Object { + "column": 22, + "line": 26, + }, + }, + "range": Array [ + 411, + 412, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 26, + }, + "start": Object { + "column": 23, + "line": 26, + }, + }, + "range": Array [ + 412, + 413, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 26, + }, + "start": Object { + "column": 24, + "line": 26, + }, + }, + "range": Array [ + 413, + 414, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 26, + }, + "start": Object { + "column": 26, + "line": 26, + }, + }, + "range": Array [ + 415, + 419, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 26, + }, + "start": Object { + "column": 31, + "line": 26, + }, + }, + "range": Array [ + 420, + 421, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 27, + }, + "start": Object { + "column": 4, + "line": 27, + }, + }, + "range": Array [ + 426, + 432, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 27, + }, + "start": Object { + "column": 11, + "line": 27, + }, + }, + "range": Array [ + 433, + 439, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 27, + }, + "start": Object { + "column": 18, + "line": 27, + }, + }, + "range": Array [ + 440, + 444, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 27, + }, + "start": Object { + "column": 22, + "line": 27, + }, + }, + "range": Array [ + 444, + 445, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 28, + }, + "start": Object { + "column": 2, + "line": 28, + }, + }, + "range": Array [ + 448, + 449, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 29, + }, + "start": Object { + "column": 0, + "line": 29, + }, + }, + "range": Array [ + 450, + 451, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/types/tuple.src 1`] = ` Object { "body": Array [ From 90a691b95ec7c06b4bb1a28bce901cecfedd8cf8 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 1 Jan 2019 20:42:40 +0100 Subject: [PATCH 36/84] fix: change incorrect FirstNode to QualifiedName (#76) --- packages/typescript-estree/src/convert.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index d72b5c8b4cda..36cb26e031a5 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2230,16 +2230,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.JSXSpreadAttribute, argument: convertChild(node.expression) }); - break; - case SyntaxKind.FirstNode: { + case SyntaxKind.QualifiedName: { Object.assign(result, { type: AST_NODE_TYPES.TSQualifiedName, left: convertChild(node.left), right: convertChild(node.right) }); - break; } From 69f8537a77c5b5794d7399ddf900abcda9b08eda Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 1 Jan 2019 20:53:28 +0100 Subject: [PATCH 37/84] refactor: remove convertDecorators helper (#75) --- packages/typescript-estree/src/convert.ts | 47 ++++++++--------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 36cb26e031a5..e1440107a37d 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -282,28 +282,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { return classImplementsNode; } - /** - * Converts a ts.NodeArray of ts.Decorators into an array of ESTreeNode decorators - * @param {ts.NodeArray} decorators A ts.NodeArray of ts.Decorators to be converted - * @returns {ESTreeNode[]} an array of converted ESTreeNode decorators - */ - function convertDecorators( - decorators: ts.NodeArray - ): ESTreeNode[] { - if (!decorators || !decorators.length) { - return []; - } - return decorators.map(decorator => { - const expression = convertChild(decorator.expression); - return { - type: AST_NODE_TYPES.Decorator, - range: [decorator.getStart(ast), decorator.end], - loc: nodeUtils.getLoc(decorator, ast), - expression - }; - }); - } - /** * Converts an array of ts.Node parameters into an array of ESTreeNode params * @param {ts.Node[]} parameters An array of ts.Node params to be converted @@ -319,7 +297,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { return convertedParam; } return Object.assign(convertedParam, { - decorators: convertDecorators(param.decorators) + decorators: param.decorators.map(convertChild) }); }); } @@ -366,9 +344,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ) : null; } else if (key === 'decorators') { - const decorators = convertDecorators((node as any).decorators); - if (decorators && decorators.length) { - result.decorators = decorators; + if (node.decorators && node.decorators.length) { + result.decorators = node.decorators.map(convertChild); } } else { if (Array.isArray((node as any)[key])) { @@ -966,7 +943,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } if (node.decorators) { - result.decorators = convertDecorators(node.decorators); + result.decorators = node.decorators.map(convertChild); } const accessibility = nodeUtils.getTSNodeAccessibility(node); @@ -1071,7 +1048,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); if (node.decorators) { - result.decorators = convertDecorators(node.decorators); + result.decorators = node.decorators.map(convertChild); } const accessibility = nodeUtils.getTSNodeAccessibility(node); @@ -1631,7 +1608,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } if (node.decorators) { - result.decorators = convertDecorators(node.decorators); + result.decorators = node.decorators.map(convertChild); } const filteredMembers = node.members.filter( @@ -1979,6 +1956,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; } + case SyntaxKind.Decorator: { + Object.assign(result, { + type: AST_NODE_TYPES.Decorator, + expression: convertChild(node.expression) + }); + break; + } + // Literals case SyntaxKind.StringLiteral: @@ -2550,7 +2535,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * so we handle them here too. */ if (node.decorators) { - result.decorators = convertDecorators(node.decorators); + result.decorators = node.decorators.map(convertChild); } if (nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)) { result.abstract = true; @@ -2605,7 +2590,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * so we handle them here too. */ if (node.decorators) { - result.decorators = convertDecorators(node.decorators); + result.decorators = node.decorators.map(convertChild); } break; } From e5158d69a108f6d7740309bf6b9e0681a5eab50e Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 1 Jan 2019 21:15:57 +0100 Subject: [PATCH 38/84] feat: add support and tests for TSAsExpression (#69) --- .../typescript-estree/src/ast-node-types.ts | 1 + packages/typescript-estree/src/convert.ts | 8 + .../basics/cast-as-expression.src.ts | 1 + .../basics/cast-as-multi-assign.src.ts | 1 + .../typescript/basics/cast-as-multi.src.ts | 1 + .../typescript/basics/cast-as-operator.src.ts | 1 + .../typescript/basics/cast-as-simple.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 10 + .../lib/__snapshots__/typescript.ts.snap | 1334 +++++++++++++++++ 9 files changed, 1358 insertions(+) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-expression.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi-assign.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-operator.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-simple.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index bb014371fa9a..d4b9455e5012 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -102,6 +102,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSAbstractMethodDefinition: 'TSAbstractMethodDefinition', TSAnyKeyword: 'TSAnyKeyword', TSArrayType: 'TSArrayType', + TSAsExpression: 'TSAsExpression', TSAsyncKeyword: 'TSAsyncKeyword', TSBooleanKeyword: 'TSBooleanKeyword', TSBigIntKeyword: 'TSBigIntKeyword', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index e1440107a37d..438331b736e9 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2674,6 +2674,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); break; } + case SyntaxKind.AsExpression: { + Object.assign(result, { + type: AST_NODE_TYPES.TSAsExpression, + expression: convertChild(node.expression), + typeAnnotation: convertChildType(node.type) + }); + break; + } case SyntaxKind.InferType: { Object.assign(result, { type: AST_NODE_TYPES.TSInferType, diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-expression.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-expression.src.ts new file mode 100644 index 000000000000..20f5214d29d8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-expression.src.ts @@ -0,0 +1 @@ +x < y as boolean; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi-assign.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi-assign.src.ts new file mode 100644 index 000000000000..952b95935afa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi-assign.src.ts @@ -0,0 +1 @@ +(a as number as any) = 42; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi.src.ts new file mode 100644 index 000000000000..38764dd5bb86 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-multi.src.ts @@ -0,0 +1 @@ +x as any as T; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-operator.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-operator.src.ts new file mode 100644 index 000000000000..cc057edc23f8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-operator.src.ts @@ -0,0 +1 @@ +x === 1 as number; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-simple.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-simple.src.ts new file mode 100644 index 000000000000..64a82f8e9f2e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/cast-as-simple.src.ts @@ -0,0 +1 @@ +const foo = x as any; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 13dd7f96c613..450f0dff4e57 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1583,6 +1583,16 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-with-var-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi-assign.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-simple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 43338f2e4ca7..58842984701a 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -4668,6 +4668,1340 @@ Object { } `; +exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 0, + 5, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "TSBooleanKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Identifier", + "value": "boolean", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/cast-as-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "expression": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 4, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/cast-as-multi-assign.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "expression": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 12, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 12, + ], + "type": "TSNumberKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 19, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 12, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/cast-as-operator.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "===", + "range": Array [ + 0, + 17, + ], + "right": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 5, + ], + "type": "Punctuator", + "value": "===", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 10, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/cast-as-simple.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 20, + ], + "type": "TSAsExpression", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 20, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` Object { "body": Array [ From 3d6480bf439fad79f103cdf67e9b69ed6300b185 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 1 Jan 2019 21:36:52 +0100 Subject: [PATCH 39/84] feat: add support for export equal declaration (#71) BREAKING CHANGE: This changes the AST --- .../typescript-estree/src/ast-node-types.ts | 2 + packages/typescript-estree/src/convert.ts | 17 + .../tests/ast-alignment/fixtures-to-test.ts | 4 +- .../basics/import-equal-declaration.src.ts | 1 + .../import-export-equal-declaration.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 4 + .../lib/__snapshots__/typescript.ts.snap | 500 ++++++++++++++++++ 7 files changed, 528 insertions(+), 1 deletion(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/import-equal-declaration.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/import-export-equal-declaration.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index d4b9455e5012..fbe848e3706a 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -115,6 +115,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSEnumMember: 'TSEnumMember', TSExportAssignment: 'TSExportAssignment', TSExportKeyword: 'TSExportKeyword', + TSExternalModuleReference: 'TSExternalModuleReference', TSImportType: 'TSImportType', TSInferType: 'TSInferType', TSLiteralType: 'TSLiteralType', @@ -123,6 +124,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSInterfaceBody: 'TSInterfaceBody', TSInterfaceDeclaration: 'TSInterfaceDeclaration', TSInterfaceHeritage: 'TSInterfaceHeritage', + TSImportEqualsDeclaration: 'TSImportEqualsDeclaration', TSFunctionType: 'TSFunctionType', TSMethodSignature: 'TSMethodSignature', TSModuleBlock: 'TSModuleBlock', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 438331b736e9..0857be51e51f 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2689,6 +2689,23 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); break; } + case SyntaxKind.ImportEqualsDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.TSImportEqualsDeclaration, + id: convertChild(node.name), + moduleReference: convertChild(node.moduleReference), + isExport: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) + }); + break; + } + case SyntaxKind.ExternalModuleReference: { + Object.assign(result, { + type: AST_NODE_TYPES.TSExternalModuleReference, + expression: convertChild(node.expression) + }); + break; + } + default: deeplyCopy(); } diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 01525c4165e3..7ab5572e8e2a 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -390,7 +390,9 @@ let fixturePatternConfigsToTest = [ ], ignoreSourceType: [ // https://github.com/babel/babel/issues/9213 - 'export-assignment' + 'export-assignment', + 'import-equal-declaration', + 'import-export-equal-declaration' ] }), diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/import-equal-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/import-equal-declaration.src.ts new file mode 100644 index 000000000000..8cb59408d93f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/import-equal-declaration.src.ts @@ -0,0 +1 @@ +import foo = require('bar'); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/import-export-equal-declaration.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/import-export-equal-declaration.src.ts new file mode 100644 index 000000000000..0b50a965912a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/import-export-equal-declaration.src.ts @@ -0,0 +1 @@ +export import foo = require('bar'); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 450f0dff4e57..5fd15a36f255 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1699,6 +1699,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types-assignation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-equal-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-export-equal-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 58842984701a..a41f38c0d0bf 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -34609,6 +34609,506 @@ Object { } `; +exports[`typescript fixtures/basics/import-equal-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "isExport": false, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "moduleReference": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 26, + ], + "raw": "'bar'", + "type": "Literal", + "value": "bar", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 27, + ], + "type": "TSExternalModuleReference", + }, + "range": Array [ + 0, + 28, + ], + "type": "TSImportEqualsDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 20, + ], + "type": "Identifier", + "value": "require", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 26, + ], + "type": "String", + "value": "'bar'", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/import-export-equal-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "isExport": true, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "moduleReference": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 33, + ], + "raw": "'bar'", + "type": "Literal", + "value": "bar", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 34, + ], + "type": "TSExternalModuleReference", + }, + "range": Array [ + 0, + 35, + ], + "type": "TSImportEqualsDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 27, + ], + "type": "Identifier", + "value": "require", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 33, + ], + "type": "String", + "value": "'bar'", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/import-type.src 1`] = ` Object { "body": Array [ From dbddd652028409fff44bf64e17a336bade9f58be Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 16:48:12 +0100 Subject: [PATCH 40/84] refactor: improve typing (#83) --- packages/typescript-estree/src/convert.ts | 93 +++++++++---------- packages/typescript-estree/src/node-utils.ts | 33 +++---- .../src/temp-types-based-on-js-source.ts | 4 +- 3 files changed, 59 insertions(+), 71 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 0857be51e51f..96b7715fa6ea 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -494,10 +494,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { convertBodyExpressionsToDirectives(); - (result as any).range[1] = node.endOfFileToken.end; + result.range[1] = node.endOfFileToken.end; result.loc = nodeUtils.getLocFor( node.getStart(ast), - (result as any).range[1], + result.range[1], ast ); break; @@ -702,7 +702,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } // check for exports - result = nodeUtils.fixExports(node, result as any, ast); + result = nodeUtils.fixExports(node, result, ast); break; } @@ -737,7 +737,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } // check for exports - result = nodeUtils.fixExports(node, result as any, ast); + result = nodeUtils.fixExports(node, result, ast); break; // mostly for for-of, for-in @@ -948,7 +948,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - (result as any).accessibility = accessibility; + result.accessibility = accessibility; } if (node.name.kind === SyntaxKind.Identifier && node.questionToken) { @@ -994,13 +994,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { expression: false, async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), body: convertChild(node.body), - range: [node.parameters.pos - 1, (result as any).range[1]], + range: [node.parameters.pos - 1, result.range[1]], loc: { start: { line: methodLoc.line + 1, column: methodLoc.character }, - end: (result as any).loc.end + end: result.loc.end } }; @@ -1053,7 +1053,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - (result as any).accessibility = accessibility; + result.accessibility = accessibility; } } @@ -1110,13 +1110,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { expression: false, async: false, body: convertChild(node.body), - range: [node.parameters.pos - 1, (result as any).range[1]], + range: [node.parameters.pos - 1, result.range[1]], loc: { start: { line: constructorLoc.line + 1, column: constructorLoc.character }, - end: (result as any).loc.end + end: result.loc.end } }; @@ -1188,7 +1188,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - (result as any).accessibility = accessibility; + result.accessibility = accessibility; } break; @@ -1588,7 +1588,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { body: [], // TODO: Fix location info - range: [openBrace.getStart(ast), (result as any).range[1]], + range: [openBrace.getStart(ast), result.range[1]], loc: nodeUtils.getLocFor(openBrace.getStart(ast), node.end, ast) }, superClass: @@ -1620,7 +1620,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } // check for exports - result = nodeUtils.fixExports(node, result as any, ast); + result = nodeUtils.fixExports(node, result, ast); break; } @@ -1644,18 +1644,18 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (node.importClause) { if (node.importClause.name) { - (result as any).specifiers.push(convertChild(node.importClause)); + result.specifiers!.push(convertChild(node.importClause)); } if (node.importClause.namedBindings) { if ( node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport ) { - (result as any).specifiers.push( + result.specifiers!.push( convertChild(node.importClause.namedBindings) ); } else { - result.specifiers = (result as any).specifiers.concat( + result.specifiers = result.specifiers!.concat( node.importClause.namedBindings.elements.map(convertChild) ); } @@ -1686,12 +1686,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); // have to adjust location information due to tree differences - (result as any).range[1] = node.name!.end; - result.loc = nodeUtils.getLocFor( - (result as any).range[0], - (result as any).range[1], - ast - ); + result.range[1] = node.name!.end; + result.loc = nodeUtils.getLocFor(result.range[0], result.range[1], ast); break; case SyntaxKind.NamedImports: @@ -1804,10 +1800,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { expressions: [] }); - const left = convertChild(node.left), - right = convertChild(node.right); + const left = convertChild(node.left)!, + right = convertChild(node.right)!; - if ((left as any).type === AST_NODE_TYPES.SequenceExpression) { + if (left.type === AST_NODE_TYPES.SequenceExpression) { (result as any).expressions = (result as any).expressions.concat( (left as any).expressions ); @@ -1815,7 +1811,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).expressions.push(left); } - if ((right as any).type === AST_NODE_TYPES.SequenceExpression) { + if (right.type === AST_NODE_TYPES.SequenceExpression) { (result as any).expressions = (result as any).expressions.concat( (right as any).expressions ); @@ -1969,7 +1965,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.StringLiteral: Object.assign(result, { type: AST_NODE_TYPES.Literal, - raw: ast.text.slice((result as any).range[0], (result as any).range[1]) + raw: ast.text.slice(result.range[0], result.range[1]) }); if ((parent as any).name && (parent as any).name === node) { (result as any).value = node.text; @@ -1982,15 +1978,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.Literal, value: Number(node.text), - raw: ast.text.slice((result as any).range[0], (result as any).range[1]) + raw: ast.text.slice(result.range[0], result.range[1]) }); break; case SyntaxKind.BigIntLiteral: { - const raw = ast.text.slice( - (result as any).range[0], - (result as any).range[1] - ); + const raw = ast.text.slice(result.range[0], result.range[1]); const value = raw.slice(0, -1); // remove suffix `n` Object.assign(result, { type: AST_NODE_TYPES.BigIntLiteral, @@ -2139,9 +2132,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.JsxExpression: { - const eloc = ast.getLineAndCharacterOfPosition( - (result as any).range[0] + 1 - ); + const eloc = ast.getLineAndCharacterOfPosition(result.range[0] + 1); const expression = node.expression ? convertChild(node.expression) : { @@ -2152,11 +2143,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { column: eloc.character }, end: { - line: (result as any).loc.end.line, - column: (result as any).loc.end.column - 1 + line: result.loc.end.line, + column: result.loc.end.column - 1 } }, - range: [(result as any).range[0] + 1, (result as any).range[1] - 1] + range: [result.range[0] + 1, result.range[1] - 1] }; Object.assign(result, { @@ -2374,13 +2365,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // Process typeParameters if (node.typeParameters && node.typeParameters.length) { - (result as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( node.typeParameters ); } // check for exports - result = nodeUtils.fixExports(node, result as any, ast); + result = nodeUtils.fixExports(node, result, ast); break; } @@ -2401,11 +2392,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - (result as any).accessibility = accessibility; + result.accessibility = accessibility; } if (node.typeParameters) { - (result as any).typeParameters = convertTSTypeParametersToTypeParametersDeclaration( + result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( node.typeParameters ); } @@ -2433,7 +2424,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - (result as any).accessibility = accessibility; + result.accessibility = accessibility; } break; @@ -2453,7 +2444,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { - (result as any).accessibility = accessibility; + result.accessibility = accessibility; } break; @@ -2511,7 +2502,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const interfaceBody = { type: AST_NODE_TYPES.TSInterfaceBody, body: node.members.map((member: any) => convertChild(member)), - range: [interfaceOpenBrace.getStart(ast), (result as any).range[1]], + range: [interfaceOpenBrace.getStart(ast), result.range[1]], loc: nodeUtils.getLocFor( interfaceOpenBrace.getStart(ast), node.end, @@ -2544,7 +2535,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.declare = true; } // check for exports - result = nodeUtils.fixExports(node, result as any, ast); + result = nodeUtils.fixExports(node, result, ast); break; } @@ -2558,8 +2549,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * Specific fix for type-guard location data */ - (result as any).typeAnnotation.loc = (result as any).typeAnnotation.typeAnnotation.loc; - (result as any).typeAnnotation.range = (result as any).typeAnnotation.typeAnnotation.range; + result.typeAnnotation!.loc = result.typeAnnotation!.typeAnnotation!.loc; + result.typeAnnotation!.range = result.typeAnnotation!.typeAnnotation!.range; break; case SyntaxKind.ImportType: @@ -2583,7 +2574,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // apply modifiers first... applyModifiersToResult(node.modifiers); // ...then check for exports - result = nodeUtils.fixExports(node, result as any, ast); + result = nodeUtils.fixExports(node, result, ast); /** * Semantically, decorators are not allowed on enum declarations, * but the TypeScript compiler will parse them and produce a valid AST, @@ -2627,7 +2618,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.global = true; } // ...then check for exports - result = nodeUtils.fixExports(node, result as any, ast); + result = nodeUtils.fixExports(node, result, ast); break; } @@ -2715,5 +2706,5 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { esTreeNodeToTSNodeMap.set(result, node); } - return result as any; + return result; } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 4b016cdf4868..81564e969897 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -357,22 +357,19 @@ function isJSXToken(node: ts.Node): boolean { /** * Returns the declaration kind of the given ts.Node - * @param {ts.Node} node TypeScript AST node + * @param {ts.VariableDeclarationList} node TypeScript AST node * @returns {string} declaration kind */ -function getDeclarationKind(node: ts.Node): 'let' | 'const' | 'var' { - switch (node.kind) { - case SyntaxKind.VariableDeclarationList: - if (node.flags & ts.NodeFlags.Let) { - return 'let'; - } - if (node.flags & ts.NodeFlags.Const) { - return 'const'; - } - return 'var'; - default: - throw 'Unable to determine declaration kind.'; +function getDeclarationKind( + node: ts.VariableDeclarationList +): 'let' | 'const' | 'var' { + if (node.flags & ts.NodeFlags.Let) { + return 'let'; + } + if (node.flags & ts.NodeFlags.Const) { + return 'const'; } + return 'var'; } /** @@ -758,18 +755,18 @@ function convertTokens(ast: ts.SourceFile): ESTreeToken[] { /** * Get container token node between range - * @param {ts.SourceFile} ast the AST object + * @param {ts.SourceFile} ast the AST object * @param {number} start The index at which the comment starts. * @param {number} end The index at which the comment ends. - * @returns {ts.Token} typescript container token + * @returns {ts.Node} typescript container token * @private */ function getNodeContainer( ast: ts.SourceFile, start: number, end: number -): ts.Token { - let container = null; +): ts.Node { + let container: ts.Node | null = null; /** * @param {ts.Node} node the ts.Node @@ -789,7 +786,7 @@ function getNodeContainer( } walk(ast); - return (container as unknown) as ts.Token; + return container!; } /** diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index 8ee48b917f9d..ac4692cffd0c 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -21,7 +21,7 @@ export interface ESTreeToken { export interface ESTreeNode { type: string; loc: ESTreeNodeLoc; - range: number[]; + range: [number, number]; declaration?: ESTreeNode; specifiers?: any[]; source?: any; @@ -36,7 +36,7 @@ export interface ESTreeNode { modifiers?: any; body?: any; params?: any; - accessibility?: any; + accessibility?: 'public' | 'protected' | 'private'; readonly?: boolean; static?: boolean; export?: boolean; From d22223835a3b2e476040bc76a068cbeea425bcbe Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 16:50:56 +0100 Subject: [PATCH 41/84] test: fix issues with collecting coverage from tests (#84) --- packages/typescript-estree/jest.config.js | 13 +++++++++ packages/typescript-estree/package.json | 27 +++---------------- .../tests/ast-alignment/jest.config.js | 10 ------- packages/typescript-estree/yarn.lock | 12 ++++----- 4 files changed, 23 insertions(+), 39 deletions(-) create mode 100644 packages/typescript-estree/jest.config.js delete mode 100644 packages/typescript-estree/tests/ast-alignment/jest.config.js diff --git a/packages/typescript-estree/jest.config.js b/packages/typescript-estree/jest.config.js new file mode 100644 index 000000000000..f9aa158b08e5 --- /dev/null +++ b/packages/typescript-estree/jest.config.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = { + testEnvironment: 'node', + transform: { + '^.+\\.tsx?$': 'ts-jest' + }, + testRegex: './tests/(lib/.*\\.(jsx?|tsx?)|ast-alignment/spec\\.ts)$', + collectCoverage: true, + collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + coverageReporters: ['text-summary'] +}; diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 49b519e2065c..3286b6eb58b5 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -33,7 +33,7 @@ "cz-conventional-changelog": "2.1.0", "glob": "7.1.2", "husky": "0.14.3", - "jest": "23.1.0", + "jest": "23.6.0", "lint-staged": "7.3.0", "lodash.isplainobject": "4.0.6", "prettier": "^1.14.3", @@ -54,9 +54,9 @@ ], "scripts": { "build": "tsc", - "test": "npm run unit-tests && npm run ast-alignment-tests", - "unit-tests": "jest", - "ast-alignment-tests": "jest --config=./tests/ast-alignment/jest.config.js", + "test": "jest", + "unit-tests": "jest \"./tests/lib/.*\"", + "ast-alignment-tests": "jest spec.ts", "precommit": "npm test && lint-staged", "cz": "git-cz", "commitmsg": "commitlint -E GIT_PARAMS", @@ -86,24 +86,5 @@ "extends": [ "@commitlint/config-conventional" ] - }, - "jest": { - "testEnvironment": "node", - "transform": { - "^.+\\.tsx?$": "ts-jest" - }, - "testRegex": "(/tests/lib/.*)\\.(jsx?|tsx?)$", - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "jsx", - "json", - "node" - ], - "collectCoverage": true, - "coverageReporters": [ - "text-summary" - ] } } diff --git a/packages/typescript-estree/tests/ast-alignment/jest.config.js b/packages/typescript-estree/tests/ast-alignment/jest.config.js deleted file mode 100644 index b8b278046367..000000000000 --- a/packages/typescript-estree/tests/ast-alignment/jest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = { - testEnvironment: 'node', - transform: { - '.+\\.tsx?$': 'ts-jest' - }, - testRegex: 'spec\\.ts$', - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'] -}; diff --git a/packages/typescript-estree/yarn.lock b/packages/typescript-estree/yarn.lock index 65a041df9821..8924e5c3c2f8 100644 --- a/packages/typescript-estree/yarn.lock +++ b/packages/typescript-estree/yarn.lock @@ -3987,7 +3987,7 @@ jest-changed-files@^23.4.2: dependencies: throat "^4.0.0" -jest-cli@^23.1.0: +jest-cli@^23.6.0: version "23.6.0" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.6.0.tgz#61ab917744338f443ef2baa282ddffdd658a5da4" integrity sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ== @@ -4289,13 +4289,13 @@ jest-worker@^23.2.0: dependencies: merge-stream "^1.0.1" -jest@23.1.0: - version "23.1.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-23.1.0.tgz#bbb7f893100a11a742dd8bd0d047a54b0968ad1a" - integrity sha1-u7f4kxAKEadC3YvQ0EelSwlorRo= +jest@23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.6.0.tgz#ad5835e923ebf6e19e7a1d7529a432edfee7813d" + integrity sha512-lWzcd+HSiqeuxyhG+EnZds6iO3Y3ZEnMrfZq/OTGvF/C+Z4fPMCdhWTGSAiO2Oym9rbEXfwddHhh6jqrTF3+Lw== dependencies: import-local "^1.0.0" - jest-cli "^23.1.0" + jest-cli "^23.6.0" js-levenshtein@^1.1.3: version "1.1.4" From ea218adfaf2d566b505f42292c1709cb074b99db Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 17:02:21 +0100 Subject: [PATCH 42/84] test: add missing test cases for in and for loop (#85) --- .../tests/ast-alignment/fixtures-to-test.ts | 17 + .../fixtures/javascript/for/for-empty.src.js | 1 + .../fixtures/javascript/for/for-loop.src.js | 1 + .../javascript/for/for-with-coma.src.js | 4 + .../javascript/for/for-with-const.src.js | 3 + .../javascript/for/for-with-function.src.js | 1 + .../javascript/for/for-with-let.src.js | 3 + .../forIn/for-in-bare-nonstrict.src.js | 6 + .../forIn/for-in-destruction.src.js | 1 + .../javascript/forIn/for-in-object.src.js | 1 + .../forIn/for-in-with-assigment.src.js | 1 + .../forIn/for-in-with-bare-assigment.src.js | 1 + .../javascript/forIn/for-in-with-const.src.js | 1 + .../forIn/for-in-with-milti-asigment.src.js | 1 + .../javascript/forIn/for-in-with-var.src.js | 1 + .../lib/__snapshots__/javascript.ts.snap | 6919 +++++++++++++++++ .../semantic-diagnostics-enabled.ts.snap | 35 + 17 files changed, 6997 insertions(+) create mode 100644 packages/typescript-estree/tests/fixtures/javascript/for/for-empty.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/for/for-loop.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/for/for-with-coma.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/for/for-with-const.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/for/for-with-function.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/for/for-with-let.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-assigment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-const.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-var.src.js diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 7ab5572e8e2a..7bdf2a85d1b7 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -200,6 +200,23 @@ let fixturePatternConfigsToTest = [ createFixturePatternConfigFor('javascript/exponentiationOperators'), createFixturePatternConfigFor('javascript/experimentalOptionalCatchBinding'), + createFixturePatternConfigFor('javascript/for'), + createFixturePatternConfigFor('javascript/forIn', { + ignore: [ + /** + * Error: AST difference + * tsep: AssignmentExpression + * babel: AssignmentPattern + */ + 'for-in-with-bare-assigment', + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'for-in-with-assigment' // babel parse errors + ] + }), createFixturePatternConfigFor('javascript/forOf', { ignore: [ /** diff --git a/packages/typescript-estree/tests/fixtures/javascript/for/for-empty.src.js b/packages/typescript-estree/tests/fixtures/javascript/for/for-empty.src.js new file mode 100644 index 000000000000..845fc90ae14e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/for/for-empty.src.js @@ -0,0 +1 @@ +for (;;); diff --git a/packages/typescript-estree/tests/fixtures/javascript/for/for-loop.src.js b/packages/typescript-estree/tests/fixtures/javascript/for/for-loop.src.js new file mode 100644 index 000000000000..4f97f6f71ae4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/for/for-loop.src.js @@ -0,0 +1 @@ +for(var i = 0; i < 10; i++) {} diff --git a/packages/typescript-estree/tests/fixtures/javascript/for/for-with-coma.src.js b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-coma.src.js new file mode 100644 index 000000000000..25e3805b7422 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-coma.src.js @@ -0,0 +1,4 @@ +for (var i = 0, j = 10; i < j; i++, j--) +{ +} + diff --git a/packages/typescript-estree/tests/fixtures/javascript/for/for-with-const.src.js b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-const.src.js new file mode 100644 index 000000000000..ef32a71deec6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-const.src.js @@ -0,0 +1,3 @@ +for (const i = 0; i < j;) +{ +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/for/for-with-function.src.js b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-function.src.js new file mode 100644 index 000000000000..7734dbae9e7e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-function.src.js @@ -0,0 +1 @@ +for (x = 5; x = x.toExponential(); x = 5); diff --git a/packages/typescript-estree/tests/fixtures/javascript/for/for-with-let.src.js b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-let.src.js new file mode 100644 index 000000000000..ef32a71deec6 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/for/for-with-let.src.js @@ -0,0 +1,3 @@ +for (const i = 0; i < j;) +{ +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js new file mode 100644 index 000000000000..6780cbbf0ffa --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js @@ -0,0 +1,6 @@ +var effects = 0; +var iterations = 0; +var stored; +for (var a = (++effects, -1) in stored = a, {a: 0, b: 1, c: 2}) { + ++iterations; +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction.src.js new file mode 100644 index 000000000000..0e07e5c9bf3b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction.src.js @@ -0,0 +1 @@ +for (var [name, value] in obj) {} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object.src.js new file mode 100644 index 000000000000..8a28bcd011a2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object.src.js @@ -0,0 +1 @@ +for ((i in {})); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-assigment.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-assigment.src.js new file mode 100644 index 000000000000..672072d7ded2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-assigment.src.js @@ -0,0 +1 @@ +for (let x = 42 in list) process(x); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js new file mode 100644 index 000000000000..cd2e1aa45931 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js @@ -0,0 +1 @@ +for (x = 0 in arr); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-const.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-const.src.js new file mode 100644 index 000000000000..48da176a2b76 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-const.src.js @@ -0,0 +1 @@ +for (const x in list) process(x); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js new file mode 100644 index 000000000000..01e8d6930a68 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js @@ -0,0 +1 @@ +for (var x = y = z in q); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-var.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-var.src.js new file mode 100644 index 000000000000..f3649e96e120 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-var.src.js @@ -0,0 +1 @@ +for (var x in list) process(x); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 809b88c05508..019314f20abc 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -79659,6 +79659,6925 @@ Object { } `; +exports[`javascript fixtures/for/for-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "EmptyStatement", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "test": null, + "type": "ForStatement", + "update": null, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/for/for-loop.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "init": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 15, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "BinaryExpression", + }, + "type": "ForStatement", + "update": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "operator": "++", + "prefix": false, + "range": Array [ + 23, + 26, + ], + "type": "UpdateExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Punctuator", + "value": "++", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/for/for-with-coma.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "BlockStatement", + }, + "init": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 22, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 24, + 29, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "type": "ForStatement", + "update": Object { + "expressions": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "operator": "++", + "prefix": false, + "range": Array [ + 31, + 34, + ], + "type": "UpdateExpression", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "operator": "--", + "prefix": false, + "range": Array [ + 36, + 39, + ], + "type": "UpdateExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 39, + ], + "type": "SequenceExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 34, + ], + "type": "Punctuator", + "value": "++", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 39, + ], + "type": "Punctuator", + "value": "--", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/for/for-with-const.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "BlockStatement", + }, + "init": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 16, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 18, + 23, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "type": "ForStatement", + "update": null, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/for/for-with-function.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "EmptyStatement", + }, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 5, + 10, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 12, + 33, + ], + "right": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "toExponential", + "range": Array [ + 18, + 31, + ], + "type": "Identifier", + }, + "range": Array [ + 16, + 31, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 33, + ], + "type": "CallExpression", + }, + "type": "AssignmentExpression", + }, + "type": "ForStatement", + "update": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 35, + 40, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "AssignmentExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 31, + ], + "type": "Identifier", + "value": "toExponential", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/for/for-with-let.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "BlockStatement", + }, + "init": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 16, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 18, + 23, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "type": "ForStatement", + "update": null, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-bare-nonstrict.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "effects", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "iterations", + "range": Array [ + 21, + 31, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 35, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 36, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "stored", + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 37, + 48, + ], + "type": "VariableDeclaration", + }, + Object { + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "iterations", + "range": Array [ + 119, + 129, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "operator": "++", + "prefix": true, + "range": Array [ + 117, + 129, + ], + "type": "UpdateExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 117, + 130, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 64, + "line": 4, + }, + }, + "range": Array [ + 113, + 132, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 58, + 59, + ], + "type": "Identifier", + }, + "init": Object { + "expressions": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "effects", + "range": Array [ + 65, + 72, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "operator": "++", + "prefix": true, + "range": Array [ + 63, + 72, + ], + "type": "UpdateExpression", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 75, + 76, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "operator": "-", + "prefix": true, + "range": Array [ + 74, + 76, + ], + "type": "UnaryExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 63, + 76, + ], + "type": "SequenceExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 58, + 77, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 54, + 77, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 49, + 132, + ], + "right": Object { + "expressions": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "name": "stored", + "range": Array [ + 81, + 87, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "operator": "=", + "range": Array [ + 81, + 91, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 41, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 90, + 91, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 4, + }, + "start": Object { + "column": 44, + "line": 4, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 4, + }, + "start": Object { + "column": 45, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 94, + 95, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 49, + "line": 4, + }, + "start": Object { + "column": 45, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 94, + 98, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 4, + }, + "start": Object { + "column": 48, + "line": 4, + }, + }, + "range": Array [ + 97, + 98, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 4, + }, + "start": Object { + "column": 51, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 100, + 101, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 55, + "line": 4, + }, + "start": Object { + "column": 51, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 100, + 104, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 4, + }, + "start": Object { + "column": 54, + "line": 4, + }, + }, + "range": Array [ + 103, + 104, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 4, + }, + "start": Object { + "column": 57, + "line": 4, + }, + }, + "name": "c", + "range": Array [ + 106, + 107, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 61, + "line": 4, + }, + "start": Object { + "column": 57, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 106, + 110, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 4, + }, + "start": Object { + "column": 60, + "line": 4, + }, + }, + "range": Array [ + 109, + 110, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + ], + "range": Array [ + 93, + 111, + ], + "type": "ObjectExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 62, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "range": Array [ + 81, + 111, + ], + "type": "SequenceExpression", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 133, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + "value": "effects", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 31, + ], + "type": "Identifier", + "value": "iterations", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + "value": "stored", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 63, + 65, + ], + "type": "Punctuator", + "value": "++", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 65, + 72, + ], + "type": "Identifier", + "value": "effects", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "-", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 78, + 80, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "range": Array [ + 81, + 87, + ], + "type": "Identifier", + "value": "stored", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 39, + "line": 4, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 41, + "line": 4, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 4, + }, + "start": Object { + "column": 42, + "line": 4, + }, + }, + "range": Array [ + 91, + 92, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 4, + }, + "start": Object { + "column": 44, + "line": 4, + }, + }, + "range": Array [ + 93, + 94, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 4, + }, + "start": Object { + "column": 45, + "line": 4, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 4, + }, + "start": Object { + "column": 46, + "line": 4, + }, + }, + "range": Array [ + 95, + 96, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 4, + }, + "start": Object { + "column": 48, + "line": 4, + }, + }, + "range": Array [ + 97, + 98, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 4, + }, + "start": Object { + "column": 49, + "line": 4, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 4, + }, + "start": Object { + "column": 51, + "line": 4, + }, + }, + "range": Array [ + 100, + 101, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 4, + }, + "start": Object { + "column": 52, + "line": 4, + }, + }, + "range": Array [ + 101, + 102, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 4, + }, + "start": Object { + "column": 54, + "line": 4, + }, + }, + "range": Array [ + 103, + 104, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 4, + }, + "start": Object { + "column": 55, + "line": 4, + }, + }, + "range": Array [ + 104, + 105, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 4, + }, + "start": Object { + "column": 57, + "line": 4, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 4, + }, + "start": Object { + "column": 58, + "line": 4, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 4, + }, + "start": Object { + "column": 60, + "line": 4, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 4, + }, + "start": Object { + "column": 61, + "line": 4, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 63, + "line": 4, + }, + "start": Object { + "column": 62, + "line": 4, + }, + }, + "range": Array [ + 111, + 112, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 65, + "line": 4, + }, + "start": Object { + "column": 64, + "line": 4, + }, + }, + "range": Array [ + 113, + 114, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 117, + 119, + ], + "type": "Punctuator", + "value": "++", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 119, + 129, + ], + "type": "Identifier", + "value": "iterations", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 129, + 130, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-destruction.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 33, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "ArrayPattern", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 22, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + "value": "value", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "obj", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-object.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/forIn/for-in-with-assigment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 25, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 35, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 36, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 15, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "list", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + "value": "list", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 32, + ], + "type": "Identifier", + "value": "process", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-bare-assigment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "EmptyStatement", + }, + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 5, + 10, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "arr", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "arr", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-const.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 22, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 32, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 33, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 12, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "list", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + "value": "list", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "Identifier", + "value": "process", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-milti-asigment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "EmptyStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 13, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 18, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "q", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "q", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-var.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 20, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 30, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 31, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "list", + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + "value": "list", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 27, + ], + "type": "Identifier", + "value": "process", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`javascript fixtures/forOf/for-of-with-function-initializer.src 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 5fd15a36f255..0d2ea6af2051 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -519,6 +519,41 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/exponentiationOperators/exponential-operators.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-loop.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-coma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-let.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-bare-nonstrict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-destruction.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-object.src.js.src 1`] = ` +Object { + "column": 14, + "index": 14, + "lineNumber": 1, + "message": "';' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-bare-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-milti-asigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; From bb89e638c9b3accd85422051804311c645f56d11 Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 17:13:02 +0100 Subject: [PATCH 43/84] fix: set parent nodes correctly for virtual files (#78) --- .../typescript-estree/src/tsconfig-parser.ts | 2 +- .../typescript-estree/tests/lib/semanticInfo.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts index 9995327b48ef..2212c4d0b1d0 100644 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -213,7 +213,7 @@ export function createProgram(code: string, filePath: string, extra: Extra) { return undefined; } - const compilerHost = ts.createCompilerHost(commandLine.options); + const compilerHost = ts.createCompilerHost(commandLine.options, true); const oldReadFile = compilerHost.readFile; compilerHost.readFile = (fileName: string) => path.normalize(fileName) === path.normalize(filePath) diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 96ae8428b76e..db1671c9c15e 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -143,6 +143,23 @@ describe('semanticInfo', () => { ); }); + test('non-existent file should provide parents nodes', () => { + const parseResult = parseCodeAndGenerateServices( + `function M() { return Base }`, + createOptions('') + ); + + // https://github.com/JamesHenry/typescript-estree/issues/77 + expect(parseResult.services.program).toBeDefined(); + expect( + parseResult.services.program!.getSourceFile('') + ).toBeDefined(); + expect( + parseResult.services.program!.getSourceFile('')!.statements[0] + .parent + ).toBeDefined(); + }); + test('non-existent project file', () => { const fileName = path.resolve(FIXTURES_DIR, 'isolated-file.src.ts'); const badConfig = createOptions(fileName); From fb8330a8529c898bddbdab68a5e6d54a2ae2a64f Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 17:16:36 +0100 Subject: [PATCH 44/84] refactor: remove duplicated type ConstructorTypeNode (#81) --- .../typescript-estree/src/temp-types-based-on-js-source.ts | 6 ++++-- packages/typescript-estree/src/ts-nodes.ts | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index ac4692cffd0c..7def7f36a917 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -23,13 +23,13 @@ export interface ESTreeNode { loc: ESTreeNodeLoc; range: [number, number]; declaration?: ESTreeNode; - specifiers?: any[]; + specifiers?: (ESTreeNode | null)[]; source?: any; typeAnnotation?: ESTreeNode | null; typeParameters?: ESTreeNode | null; id?: ESTreeNode | null; expression?: ESTreeNode | null; - decorators?: any; + decorators?: (ESTreeNode | null)[]; const?: boolean; declare?: boolean; global?: boolean; @@ -42,6 +42,8 @@ export interface ESTreeNode { export?: boolean; parameter?: any; abstract?: boolean; + typeName?: ESTreeNode | null; + directive?: string; } export interface ESTreeComment extends ESTreeNode {} diff --git a/packages/typescript-estree/src/ts-nodes.ts b/packages/typescript-estree/src/ts-nodes.ts index 69682cb5291b..b917584cf380 100644 --- a/packages/typescript-estree/src/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-nodes.ts @@ -35,6 +35,7 @@ export type TSNode = ts.Node & | ts.ThisTypeNode // | ts.FunctionOrConstructorTypeNodeBase -> FunctionTypeNode, ConstructorTypeNode | ts.ConstructorTypeNode + | ts.FunctionTypeNode | ts.TypeReferenceNode | ts.TypePredicateNode | ts.TypeQueryNode @@ -50,8 +51,6 @@ export type TSNode = ts.Node & | ts.ParenthesizedTypeNode | ts.TypeOperatorNode | ts.IndexedAccessTypeNode - | ts.FunctionTypeNode - | ts.ConstructorTypeNode | ts.MappedTypeNode | ts.LiteralTypeNode | ts.StringLiteral From c9755654290cb2b736c9670f17efc3ee83378563 Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 17:26:36 +0100 Subject: [PATCH 45/84] BREAKING: add missing TSTypeAssertion node (#79) BREAKING CHANGE: This changes the AST - node `TSTypeAssertionExpression` got renamed to `TSTypeAssertion` --- .../typescript-estree/src/ast-node-types.ts | 1 + packages/typescript-estree/src/convert.ts | 8 + .../tests/ast-alignment/fixtures-to-test.ts | 22 +- .../tests/ast-alignment/parse.ts | 87 +++--- .../tests/ast-alignment/spec.ts | 6 +- .../typescript/basics/type-assertion.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 2 + .../lib/__snapshots__/typescript.ts.snap | 277 ++++++++++++++++++ 8 files changed, 347 insertions(+), 57 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index fbe848e3706a..41ee3fb2b67f 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -151,6 +151,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSThisType: 'TSThisType', TSTypeAnnotation: 'TSTypeAnnotation', TSTypeAliasDeclaration: 'TSTypeAliasDeclaration', + TSTypeAssertion: 'TSTypeAssertion', TSTypeLiteral: 'TSTypeLiteral', TSTypeOperator: 'TSTypeOperator', TSTypeParameter: 'TSTypeParameter', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 96b7715fa6ea..098c3dfb2a15 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2680,6 +2680,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); break; } + case SyntaxKind.TypeAssertionExpression: { + Object.assign(result, { + type: AST_NODE_TYPES.TSTypeAssertion, + typeAnnotation: convertChildType(node.type), + expression: convertChild(node.expression) + }); + break; + } case SyntaxKind.ImportEqualsDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.TSImportEqualsDeclaration, diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 7bdf2a85d1b7..5fc09620b615 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -6,11 +6,13 @@ import jsxKnownIssues from '../jsx-known-issues'; interface Fixture { filename: string; + jsx: boolean; ignoreSourceType: boolean; } interface FixturePatternConfig { pattern: string; + jsx: boolean; ignoreSourceType: boolean; } @@ -69,6 +71,11 @@ function createFixturePatternConfigFor( config.ignore = config.ignore || []; config.fileType = config.fileType || 'js'; config.ignoreSourceType = config.ignoreSourceType || []; + const jsx = + config.fileType === 'js' || + config.fileType === 'jsx' || + config.fileType === 'tsx'; + /** * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". * Babel has similar feature sourceType='unambiguous' but its not perfect, and in some specific cases we sill have to enforce it. @@ -85,7 +92,8 @@ function createFixturePatternConfigFor( fixturesRequiringSourceTypeModule.push({ // It needs to be the full path from within fixtures/ for the pattern pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, - ignoreSourceType: true + ignoreSourceType: true, + jsx }); } } @@ -93,7 +101,8 @@ function createFixturePatternConfigFor( pattern: `${fixturesSubPath}/!(${config.ignore.join('|')}).src.${ config.fileType }`, - ignoreSourceType: false + ignoreSourceType: false, + jsx }; } @@ -403,7 +412,11 @@ let fixturePatternConfigsToTest = [ * Not yet supported in Babel https://github.com/babel/babel/issues/9228 * Directive field is not added to module and namespace */ - 'directive-in-namespace' + 'directive-in-namespace', + /** + * there is difference in range between babel and tsep + */ + 'type-assertion' ], ignoreSourceType: [ // https://github.com/babel/babel/issues/9213 @@ -525,7 +538,8 @@ fixturePatternConfigsToTest.forEach(fixturePatternConfig => { matchingFixtures.forEach(filename => { fixturesToTest.push({ filename, - ignoreSourceType: fixturePatternConfig.ignoreSourceType + ignoreSourceType: fixturePatternConfig.ignoreSourceType, + jsx: fixturePatternConfig.jsx }); }); }); diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index c5df1231339c..c37f5dc19760 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -1,8 +1,7 @@ import codeFrame from 'babel-code-frame'; import * as parser from '../../src/parser'; import * as parseUtils from './utils'; -import { ParserOptions as BabelParserOptions } from '@babel/parser'; -import { ParserOptions } from '../../src/temp-types-based-on-js-source'; +import { ParserPlugin } from '@babel/parser'; function createError(message: string, line: number, column: number) { // Construct an error similar to the ones thrown by Babylon. @@ -14,55 +13,42 @@ function createError(message: string, line: number, column: number) { return error; } -function parseWithBabelParser( - text: string, - parserOptions?: BabelParserOptions -) { - parserOptions = parserOptions || {}; +function parseWithBabelParser(text: string, jsx: boolean = true) { const babel = require('@babel/parser'); - return babel.parse( - text, - Object.assign( - { - sourceType: 'unambiguous', - allowImportExportEverywhere: true, - allowReturnOutsideFunction: true, - ranges: true, - plugins: [ - 'jsx', - 'typescript', - 'objectRestSpread', - 'decorators-legacy', - 'classProperties', - 'asyncGenerators', - 'dynamicImport', - 'estree', - 'bigInt' - ] - }, - parserOptions - ) - ); + const plugins: ParserPlugin[] = [ + 'typescript', + 'objectRestSpread', + 'decorators-legacy', + 'classProperties', + 'asyncGenerators', + 'dynamicImport', + 'estree', + 'bigInt' + ]; + if (jsx) { + plugins.push('jsx'); + } + + return babel.parse(text, { + sourceType: 'unambiguous', + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + ranges: true, + plugins + }); } -function parseWithTypeScriptESTree( - text: string, - parserOptions?: ParserOptions -) { - parserOptions = parserOptions || ({} as ParserOptions); +function parseWithTypeScriptESTree(text: string, jsx: boolean = true) { try { - return parser.parse(text, Object.assign( - { - loc: true, - range: true, - tokens: false, - comment: false, - useJSXTextNode: true, - errorOnUnknownASTType: true, - jsx: true - }, - parserOptions - ) as any); + return parser.parse(text, { + loc: true, + range: true, + tokens: false, + comment: false, + useJSXTextNode: true, + errorOnUnknownASTType: true, + jsx + }); } catch (e) { throw createError(e.message, e.lineNumber, e.column); } @@ -70,8 +56,7 @@ function parseWithTypeScriptESTree( interface ASTComparisonParseOptions { parser: string; - typeScriptESTreeOptions?: ParserOptions; - babelParserOptions?: BabelParserOptions; + jsx?: boolean; } export function parse(text: string, opts: ASTComparisonParseOptions) { @@ -88,12 +73,12 @@ export function parse(text: string, opts: ASTComparisonParseOptions) { switch (opts.parser) { case 'typescript-estree': result.ast = parseUtils.normalizeNodeTypes( - parseWithTypeScriptESTree(text, opts.typeScriptESTreeOptions) + parseWithTypeScriptESTree(text, opts.jsx) ); break; case '@babel/parser': result.ast = parseUtils.normalizeNodeTypes( - parseWithBabelParser(text, opts.babelParserOptions) + parseWithBabelParser(text, opts.jsx) ); break; default: diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index 31814b96ac26..2f27fb2834d7 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -11,14 +11,16 @@ fixturesToTest.forEach(fixture => { * Parse with typescript-estree */ const typeScriptESTreeResult = parse(source, { - parser: 'typescript-estree' + parser: 'typescript-estree', + jsx: fixture.jsx }); /** * Parse the source with @babel/parser typescript-plugin */ const babelParserResult = parse(source, { - parser: '@babel/parser' + parser: '@babel/parser', + jsx: fixture.jsx }); /** diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion.src.ts new file mode 100644 index 000000000000..67e0d6954710 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion.src.ts @@ -0,0 +1 @@ +const foo = 2; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 0d2ea6af2051..504efbba9548 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1782,6 +1782,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-object-without-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-parameters-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index a41f38c0d0bf..bec36dc9e40b 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -48113,6 +48113,283 @@ Object { } `; +exports[`typescript fixtures/basics/type-assertion.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 27, + ], + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/type-guard.src 1`] = ` Object { "body": Array [ From 37260d423f0e1c0a82c70a39a039fa40f8d4fa7d Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 4 Jan 2019 11:34:39 -0500 Subject: [PATCH 46/84] fix: commit message for add missing TSTypeAssertion node (#79) BREAKING CHANGE: This changes the AST - node `TSTypeAssertionExpression` got renamed to `TSTypeAssertion` --- packages/typescript-estree/.prettierignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typescript-estree/.prettierignore b/packages/typescript-estree/.prettierignore index 9da7aa648acc..206eb246b3f9 100644 --- a/packages/typescript-estree/.prettierignore +++ b/packages/typescript-estree/.prettierignore @@ -1 +1 @@ -tests/fixtures/**/* \ No newline at end of file +tests/fixtures/**/* From e64f656f05ea4fa18ea92233c992a5d954b410ca Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 18:47:31 +0100 Subject: [PATCH 47/84] test: add FixturesTester (#67) --- .../tests/ast-alignment/fixtures-to-test.ts | 952 +++++++++--------- 1 file changed, 464 insertions(+), 488 deletions(-) diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 5fc09620b615..17858b471dff 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -24,6 +24,81 @@ interface CreateFixturePatternConfig { const fixturesDirPath = path.join(__dirname, '../fixtures'); +class FixturesTester { + protected fixtures: FixturePatternConfig[] = []; + + constructor() {} + + /** + * Utility to generate a FixturePatternConfig object containing the glob pattern for specific subsections of the fixtures/ directory, + * including the capability to ignore specific nested patterns. + * + * @param {string} fixturesSubPath the sub-path within the fixtures/ directory + * @param {CreateFixturePatternConfig?} config an optional configuration object with optional sub-paths to ignore and/or parse with sourceType: module + */ + public addFixturePatternConfig( + fixturesSubPath: string, + config: CreateFixturePatternConfig = {} + ) { + if (!fs.existsSync(path.join(fixturesDirPath, fixturesSubPath))) { + throw new Error( + `Registered path '${path.join( + __dirname, + fixturesSubPath + )}' was not found` + ); + } + + const ignore = config.ignore || []; + const fileType = config.fileType || 'js'; + const ignoreSourceType = config.ignoreSourceType || []; + const jsx = fileType === 'js' || fileType === 'jsx' || fileType === 'tsx'; + + /** + * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". + * Babel has similar feature sourceType='unambiguous' but its not perfect, and in some specific cases we sill have to enforce it. + * Known issues: + * - https://github.com/babel/babel/issues/9213 + */ + if (ignoreSourceType.length) { + ignore.push(...ignoreSourceType); + for (const fixture of ignoreSourceType) { + this.fixtures.push({ + // It needs to be the full path from within fixtures/ for the pattern + pattern: `${fixturesSubPath}/${fixture}.src.${fileType}`, + ignoreSourceType: true, + jsx + }); + } + } + + this.fixtures.push({ + pattern: `${fixturesSubPath}/!(${ignore.join('|')}).src.${fileType}`, + ignoreSourceType: false, + jsx + }); + } + + public getFixtures(): Fixture[] { + return this.fixtures + .map(fixture => + glob + .sync(`${fixturesDirPath}/${fixture.pattern}`, {}) + .map(filename => ({ + filename, + ignoreSourceType: fixture.ignoreSourceType, + jsx: fixture.jsx + })) + ) + .reduce((acc, x) => acc.concat(x), []); + } +} + +/** + * An class with FixturePatternConfigs + */ +const tester = new FixturesTester(); + /** * JSX fixtures which have known issues for typescript-estree */ @@ -38,510 +113,411 @@ const jsxFilesWithKnownIssues = jsxKnownIssues.map(f => f.replace('jsx/', '')); */ jsxFilesWithKnownIssues.push('invalid-no-tag-name'); -/** - * Globally track which fixtures need to be parsed with sourceType: "module" - * so that they can be added with the correct FixturePatternConfig - */ -let fixturesRequiringSourceTypeModule: FixturePatternConfig[] = []; +tester.addFixturePatternConfig('javascript/basics'); + +tester.addFixturePatternConfig('comments', { + ignore: [ + /** + * Template strings seem to also be affected by the difference in opinion between different parsers in: + * https://github.com/babel/babel/issues/6681 + */ + 'no-comment-template', // Purely AST diffs + 'template-string-block' // Purely AST diffs + ] +}); -/** - * Utility to generate a FixturePatternConfig object containing the glob pattern for specific subsections of the fixtures/ directory, - * including the capability to ignore specific nested patterns. - * - * @param {string} fixturesSubPath the sub-path within the fixtures/ directory - * @param {CreateFixturePatternConfig?} config an optional configuration object with optional sub-paths to ignore and/or parse with sourceType: module - * @returns {FixturePatternConfig} an object containing the glob pattern and optional additional config - */ -function createFixturePatternConfigFor( - fixturesSubPath: string, - config?: CreateFixturePatternConfig -): FixturePatternConfig { - if (!fixturesSubPath) { - throw new Error( - 'fixtureSubPath was not provided for the current fixture pattern' - ); - } - if (!fs.existsSync(path.join(fixturesDirPath, fixturesSubPath))) { - throw new Error( - `Registered path '${path.join(__dirname, fixturesSubPath)}' was not found` - ); - } +tester.addFixturePatternConfig('javascript/templateStrings', { + ignore: ['**/*'] +}); - config = config || ({} as CreateFixturePatternConfig); - config.ignore = config.ignore || []; - config.fileType = config.fileType || 'js'; - config.ignoreSourceType = config.ignoreSourceType || []; - const jsx = - config.fileType === 'js' || - config.fileType === 'jsx' || - config.fileType === 'tsx'; +tester.addFixturePatternConfig('javascript/arrayLiteral'); - /** - * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". - * Babel has similar feature sourceType='unambiguous' but its not perfect, and in some specific cases we sill have to enforce it. - * - * First merge the fixtures which need to be parsed with sourceType: "module" into the - * ignore list, and then add their full config into the global array. - */ - if (config.ignoreSourceType.length) { - config.ignore = ([] as string[]).concat( - config.ignore, - config.ignoreSourceType - ); - for (const fixture of config.ignoreSourceType) { - fixturesRequiringSourceTypeModule.push({ - // It needs to be the full path from within fixtures/ for the pattern - pattern: `${fixturesSubPath}/${fixture}.src.${config.fileType}`, - ignoreSourceType: true, - jsx - }); - } - } - return { - pattern: `${fixturesSubPath}/!(${config.ignore.join('|')}).src.${ - config.fileType - }`, - ignoreSourceType: false, - jsx - }; -} +tester.addFixturePatternConfig('javascript/simple-literals'); -/** - * An array of FixturePatternConfigs - */ -let fixturePatternConfigsToTest = [ - createFixturePatternConfigFor('javascript/basics'), - - createFixturePatternConfigFor('comments', { - ignore: [ - /** - * Template strings seem to also be affected by the difference in opinion between different parsers in: - * https://github.com/babel/babel/issues/6681 - */ - 'no-comment-template', // Purely AST diffs - 'template-string-block' // Purely AST diffs - ] - }), - - createFixturePatternConfigFor('javascript/templateStrings', { - ignore: ['**/*'] - }), - - createFixturePatternConfigFor('javascript/simple-literals'), - - createFixturePatternConfigFor('javascript/directives'), - - createFixturePatternConfigFor('javascript/experimentalObjectRestSpread', { - ignore: [ - /** - * Trailing comma is not permitted after a "RestElement" in Babel - */ - 'invalid-rest-trailing-comma' - ] - }), - - createFixturePatternConfigFor('javascript/arrowFunctions', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'error-dup-params', // babel parse errors - 'error-strict-dup-params', // babel parse errors - 'error-strict-octal', // babel parse errors - 'error-two-lines' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/bigIntLiterals'), - createFixturePatternConfigFor('javascript/binaryLiterals'), - createFixturePatternConfigFor('javascript/blockBindings'), - - createFixturePatternConfigFor('javascript/classes', { - ignore: [ - /** - * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. - */ - 'class-one-method-super', // babel parse errors - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'invalid-class-declaration', // babel parse errors - 'invalid-class-setter-declaration' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/defaultParams'), - - createFixturePatternConfigFor('javascript/destructuring', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'invalid-defaults-object-assign' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/destructuring-and-arrowFunctions'), - createFixturePatternConfigFor('javascript/destructuring-and-blockBindings'), - createFixturePatternConfigFor('javascript/destructuring-and-defaultParams'), - createFixturePatternConfigFor('javascript/destructuring-and-forOf'), - - createFixturePatternConfigFor('javascript/destructuring-and-spread', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'error-complex-destructured-spread-first', // babel parse errors - 'not-final-array' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/experimentalAsyncIteration'), - createFixturePatternConfigFor('javascript/experimentalDynamicImport'), - createFixturePatternConfigFor('javascript/exponentiationOperators'), - createFixturePatternConfigFor('javascript/experimentalOptionalCatchBinding'), - - createFixturePatternConfigFor('javascript/for'), - createFixturePatternConfigFor('javascript/forIn', { - ignore: [ - /** - * Error: AST difference - * tsep: AssignmentExpression - * babel: AssignmentPattern - */ - 'for-in-with-bare-assigment', - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'for-in-with-assigment' // babel parse errors - ] - }), - createFixturePatternConfigFor('javascript/forOf', { - ignore: [ - /** - * TypeScript, espree and acorn parse this fine - esprima, flow and babel do not... - */ - 'for-of-with-function-initializer' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/generators'), - createFixturePatternConfigFor('javascript/globalReturn'), - - createFixturePatternConfigFor('javascript/modules', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'invalid-export-named-default', // babel parse errors - 'invalid-import-default-module-specifier', // babel parse errors - 'invalid-import-module-specifier' // babel parse errors - ], - ignoreSourceType: ['error-function', 'error-strict', 'error-delete'] - }), - - createFixturePatternConfigFor('javascript/newTarget', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'invalid-new-target', // babel parse errors - 'invalid-unknown-property' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/objectLiteral'), - createFixturePatternConfigFor('javascript/objectLiteralComputedProperties'), - - createFixturePatternConfigFor('javascript/objectLiteralDuplicateProperties', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'error-proto-property', // babel parse errors - 'error-proto-string-property' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/objectLiteralShorthandMethods'), - createFixturePatternConfigFor('javascript/objectLiteralShorthandProperties'), - createFixturePatternConfigFor('javascript/octalLiterals'), - createFixturePatternConfigFor('javascript/regex'), - createFixturePatternConfigFor('javascript/regexUFlag'), - createFixturePatternConfigFor('javascript/regexYFlag'), - - createFixturePatternConfigFor('javascript/restParams', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'error-no-default', // babel parse errors - 'error-not-last' // babel parse errors - ] - }), - - createFixturePatternConfigFor('javascript/spread'), - createFixturePatternConfigFor('javascript/unicodeCodePointEscapes'), - - /* ================================================== */ - - createFixturePatternConfigFor('jsx', { - ignore: jsxFilesWithKnownIssues - }), - createFixturePatternConfigFor('jsx-useJSXTextNode'), - - /* ================================================== */ +tester.addFixturePatternConfig('javascript/directives'); - /** - * TSX-SPECIFIC FILES - */ +tester.addFixturePatternConfig('javascript/experimentalObjectRestSpread', { + ignore: [ + /** + * Trailing comma is not permitted after a "RestElement" in Babel + */ + 'invalid-rest-trailing-comma' + ] +}); - createFixturePatternConfigFor('tsx', { - fileType: 'tsx' - }), +tester.addFixturePatternConfig('javascript/arrowFunctions', { + ignore: [ + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-dup-params', // babel parse errors + 'error-strict-dup-params', // babel parse errors + 'error-strict-octal', // babel parse errors + 'error-two-lines' // babel parse errors + ] +}); - /* ================================================== */ +tester.addFixturePatternConfig('javascript/bigIntLiterals'); +tester.addFixturePatternConfig('javascript/binaryLiterals'); +tester.addFixturePatternConfig('javascript/blockBindings'); + +tester.addFixturePatternConfig('javascript/classes', { + ignore: [ + /** + * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. + */ + 'class-one-method-super', // babel parse errors + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-class-declaration', // babel parse errors + 'invalid-class-setter-declaration' // babel parse errors + ] +}); - /** - * TYPESCRIPT-SPECIFIC FILES - */ +tester.addFixturePatternConfig('javascript/defaultParams'); + +tester.addFixturePatternConfig('javascript/destructuring', { + ignore: [ + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-defaults-object-assign' // babel parse errors + ] +}); - createFixturePatternConfigFor('typescript/babylon-convergence', { - fileType: 'ts' - }), - - createFixturePatternConfigFor('typescript/basics', { - fileType: 'ts', - ignore: [ - /** - * Other babel parse errors relating to invalid syntax. - */ - 'abstract-class-with-abstract-constructor', // babel parse errors - 'class-with-export-parameter-properties', // babel parse errors - 'class-with-implements-and-extends', // babel parse errors - 'class-with-optional-methods', // babel parse errors - 'class-with-static-parameter-properties', // babel parse errors - 'interface-with-all-property-types', // babel parse errors - 'interface-with-construct-signature-with-parameter-accessibility', // babel parse errors - /** - * typescript-estree erroring, but babel not. - */ - 'arrow-function-with-type-parameters', // typescript-estree parse errors - /** - * Babel: ClassDeclaration + abstract: true - * tsep: TSAbstractClassDeclaration - */ - 'abstract-class-with-abstract-properties', - /** - * Babel: ClassProperty + abstract: true - * tsep: TSAbstractClassProperty - */ - 'abstract-class-with-abstract-readonly-property', - /** - * Babel: TSExpressionWithTypeArguments - * tsep: ClassImplements - */ - 'class-with-implements-generic-multiple', - 'class-with-implements-generic', - 'class-with-implements', - 'class-with-extends-and-implements', - /** - * Other major AST differences (e.g. fundamentally different node types) - */ - 'class-with-mixin', - 'function-with-types-assignation', - 'interface-extends-multiple', - 'interface-extends', - 'interface-type-parameters', - 'interface-with-extends-type-parameters', - 'interface-with-generic', - 'interface-with-jsdoc', - 'interface-with-optional-properties', - 'interface-without-type-annotation', - 'typed-this', - 'export-type-function-declaration', - 'abstract-interface', - /** - * Babel bug for optional or abstract methods? - */ - 'abstract-class-with-abstract-method', // babel parse errors - 'abstract-class-with-optional-method', // babel parse errors - 'declare-class-with-optional-method', // babel parse errors - /** - * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/6679 - */ - 'class-with-private-parameter-properties', - 'class-with-protected-parameter-properties', - 'class-with-public-parameter-properties', - 'class-with-readonly-parameter-properties', - /** - * Not yet supported in Babel https://github.com/babel/babel/issues/7749 - */ - 'import-type', - 'import-type-with-type-parameters-in-type-reference', - /** - * babel is not supporting it yet https://github.com/babel/babel/pull/9230 - * Babel: TSTypeReference -> Identifier - * tsep: TSBigIntKeyword - */ - 'typed-keyword-bigint', - /** - * Not yet supported in Babel https://github.com/babel/babel/issues/9228 - * Directive field is not added to module and namespace - */ - 'directive-in-module', - /** - * Not yet supported in Babel https://github.com/babel/babel/issues/9228 - * Directive field is not added to module and namespace - */ - 'directive-in-namespace', - /** - * there is difference in range between babel and tsep - */ - 'type-assertion' - ], - ignoreSourceType: [ - // https://github.com/babel/babel/issues/9213 - 'export-assignment', - 'import-equal-declaration', - 'import-export-equal-declaration' - ] - }), - - createFixturePatternConfigFor('typescript/decorators/accessor-decorators', { - fileType: 'ts' - }), - createFixturePatternConfigFor('typescript/decorators/class-decorators', { - fileType: 'ts' - }), - createFixturePatternConfigFor('typescript/decorators/method-decorators', { - fileType: 'ts' - }), - createFixturePatternConfigFor('typescript/decorators/parameter-decorators', { - fileType: 'ts' - }), - createFixturePatternConfigFor('typescript/decorators/property-decorators', { - fileType: 'ts' - }), - - createFixturePatternConfigFor('typescript/expressions', { - fileType: 'ts', - ignore: [ - /** - * there is difference in range between babel and tsep - */ - 'tagged-template-expression-type-arguments' - ] - }), - - createFixturePatternConfigFor('typescript/errorRecovery', { - fileType: 'ts', - ignore: [ - /** - * AST difference - */ - 'interface-empty-extends', - /** - * TypeScript-specific tests taken from "errorRecovery". Babel is not being as forgiving as the TypeScript compiler here. - */ - 'class-empty-extends-implements', // babel parse errors - 'class-empty-extends', // babel parse errors - 'decorator-on-enum-declaration', // babel parse errors - 'decorator-on-interface-declaration', // babel parse errors - 'interface-property-modifiers', // babel parse errors - 'enum-with-keywords', // babel parse errors - 'solo-const' // babel parse errors - ] - }), - - createFixturePatternConfigFor('typescript/types', { - fileType: 'ts' - }), - - createFixturePatternConfigFor('typescript/declare', { - fileType: 'ts', - ignore: [ - /** - * AST difference - * tsep: heritage = [] - * babel: heritage = undefined - */ - 'interface', - /** - * AST difference - * tsep: TSAbstractClassDeclaration - * babel: ClassDeclaration[abstract=true] - */ - 'abstract-class' - ] - }), - - createFixturePatternConfigFor('typescript/namespaces-and-modules', { - fileType: 'ts', - ignore: [ - /** - * Minor AST difference - */ - 'nested-internal-module', - /** - * Babel: TSDeclareFunction - * tsep: TSNamespaceFunctionDeclaration - */ - 'declare-namespace-with-exported-function' - ], - ignoreSourceType: [ - 'module-with-default-exports', - 'ambient-module-declaration-with-import' - ] - }) -]; +tester.addFixturePatternConfig('javascript/destructuring-and-arrowFunctions'); +tester.addFixturePatternConfig('javascript/destructuring-and-blockBindings'); +tester.addFixturePatternConfig('javascript/destructuring-and-defaultParams'); +tester.addFixturePatternConfig('javascript/destructuring-and-forOf'); + +tester.addFixturePatternConfig('javascript/destructuring-and-spread', { + ignore: [ + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-complex-destructured-spread-first', // babel parse errors + 'not-final-array' // babel parse errors + ] +}); + +tester.addFixturePatternConfig('javascript/experimentalAsyncIteration'); +tester.addFixturePatternConfig('javascript/experimentalDynamicImport'); +tester.addFixturePatternConfig('javascript/exponentiationOperators'); +tester.addFixturePatternConfig('javascript/experimentalOptionalCatchBinding'); + +tester.addFixturePatternConfig('javascript/for'); +tester.addFixturePatternConfig('javascript/forIn', { + ignore: [ + /** + * Error: AST difference + * tsep: AssignmentExpression + * babel: AssignmentPattern + */ + 'for-in-with-bare-assigment', + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'for-in-with-assigment' // babel parse errors + ] +}); +tester.addFixturePatternConfig('javascript/forOf', { + ignore: [ + /** + * TypeScript, espree and acorn parse this fine - esprima, flow and babel do not... + */ + 'for-of-with-function-initializer' // babel parse errors + ] +}); + +tester.addFixturePatternConfig('javascript/generators'); +tester.addFixturePatternConfig('javascript/globalReturn'); + +tester.addFixturePatternConfig('javascript/modules', { + ignore: [ + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-export-named-default', // babel parse errors + 'invalid-import-default-module-specifier', // babel parse errors + 'invalid-import-module-specifier' // babel parse errors + ], + ignoreSourceType: ['error-function', 'error-strict', 'error-delete'] +}); + +tester.addFixturePatternConfig('javascript/newTarget', { + ignore: [ + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'invalid-new-target', // babel parse errors + 'invalid-unknown-property' // babel parse errors + ] +}); + +tester.addFixturePatternConfig('javascript/objectLiteral'); +tester.addFixturePatternConfig('javascript/objectLiteralComputedProperties'); + +tester.addFixturePatternConfig('javascript/objectLiteralDuplicateProperties', { + ignore: [ + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-proto-property', // babel parse errors + 'error-proto-string-property' // babel parse errors + ] +}); + +tester.addFixturePatternConfig('javascript/objectLiteralShorthandMethods'); +tester.addFixturePatternConfig('javascript/objectLiteralShorthandProperties'); +tester.addFixturePatternConfig('javascript/octalLiterals'); +tester.addFixturePatternConfig('javascript/regex'); +tester.addFixturePatternConfig('javascript/regexUFlag'); +tester.addFixturePatternConfig('javascript/regexYFlag'); + +tester.addFixturePatternConfig('javascript/restParams', { + ignore: [ + /** + * Expected babel parse errors - all of these files below produce parse errors in espree + * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree + * does not actually error on them and will produce an AST. + */ + 'error-no-default', // babel parse errors + 'error-not-last' // babel parse errors + ] +}); + +tester.addFixturePatternConfig('javascript/spread'); +tester.addFixturePatternConfig('javascript/unicodeCodePointEscapes'); + +/* ================================================== */ + +tester.addFixturePatternConfig('jsx', { + ignore: jsxFilesWithKnownIssues +}); +tester.addFixturePatternConfig('jsx-useJSXTextNode'); + +/* ================================================== */ /** - * Add in all the fixtures which need to be parsed with sourceType: "module" + * TSX-SPECIFIC FILES */ -fixturePatternConfigsToTest = ([] as FixturePatternConfig[]).concat( - fixturePatternConfigsToTest, - fixturesRequiringSourceTypeModule -); -const fixturesToTest: Fixture[] = []; +tester.addFixturePatternConfig('tsx', { + fileType: 'tsx' +}); + +/* ================================================== */ /** - * Resolve the glob patterns into actual Fixture files that we can run assertions for... + * TYPESCRIPT-SPECIFIC FILES */ -fixturePatternConfigsToTest.forEach(fixturePatternConfig => { - /** - * Find the fixture files which match the given pattern - */ - const matchingFixtures = glob.sync( - `${fixturesDirPath}/${fixturePatternConfig.pattern}`, - {} - ); - matchingFixtures.forEach(filename => { - fixturesToTest.push({ - filename, - ignoreSourceType: fixturePatternConfig.ignoreSourceType, - jsx: fixturePatternConfig.jsx - }); - }); + +tester.addFixturePatternConfig('typescript/babylon-convergence', { + fileType: 'ts' +}); + +tester.addFixturePatternConfig('typescript/basics', { + fileType: 'ts', + ignore: [ + /** + * Other babel parse errors relating to invalid syntax. + */ + 'abstract-class-with-abstract-constructor', // babel parse errors + 'class-with-export-parameter-properties', // babel parse errors + 'class-with-implements-and-extends', // babel parse errors + 'class-with-optional-methods', // babel parse errors + 'class-with-static-parameter-properties', // babel parse errors + 'interface-with-all-property-types', // babel parse errors + 'interface-with-construct-signature-with-parameter-accessibility', // babel parse errors + /** + * there is difference in range between babel and tsep + */ + 'arrow-function-with-type-parameters', // typescript-estree parse errors + /** + * Babel: ClassDeclaration + abstract: true + * tsep: TSAbstractClassDeclaration + */ + 'abstract-class-with-abstract-properties', + /** + * Babel: ClassProperty + abstract: true + * tsep: TSAbstractClassProperty + */ + 'abstract-class-with-abstract-readonly-property', + /** + * Babel: TSExpressionWithTypeArguments + * tsep: ClassImplements + */ + 'class-with-implements-generic-multiple', + 'class-with-implements-generic', + 'class-with-implements', + 'class-with-extends-and-implements', + /** + * Other major AST differences (e.g. fundamentally different node types) + */ + 'class-with-mixin', + 'function-with-types-assignation', + 'interface-extends-multiple', + 'interface-extends', + 'interface-type-parameters', + 'interface-with-extends-type-parameters', + 'interface-with-generic', + 'interface-with-jsdoc', + 'interface-with-optional-properties', + 'interface-without-type-annotation', + 'typed-this', + 'export-type-function-declaration', + 'abstract-interface', + /** + * Babel bug for optional or abstract methods? + */ + 'abstract-class-with-abstract-method', // babel parse errors + 'abstract-class-with-optional-method', // babel parse errors + 'declare-class-with-optional-method', // babel parse errors + /** + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/6679 + */ + 'class-with-private-parameter-properties', + 'class-with-protected-parameter-properties', + 'class-with-public-parameter-properties', + 'class-with-readonly-parameter-properties', + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/7749 + */ + 'import-type', + 'import-type-with-type-parameters-in-type-reference', + /** + * babel is not supporting it yet https://github.com/babel/babel/pull/9230 + * Babel: TSTypeReference -> Identifier + * tsep: TSBigIntKeyword + */ + 'typed-keyword-bigint', + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + * Directive field is not added to module and namespace + */ + 'directive-in-module', + /** + * Not yet supported in Babel https://github.com/babel/babel/issues/9228 + * Directive field is not added to module and namespace + */ + 'directive-in-namespace', + /** + * there is difference in range between babel and tsep + */ + 'type-assertion' + ], + ignoreSourceType: [ + // https://github.com/babel/babel/issues/9213 + 'export-assignment', + 'import-equal-declaration', + 'import-export-equal-declaration' + ] +}); + +tester.addFixturePatternConfig('typescript/decorators/accessor-decorators', { + fileType: 'ts' }); +tester.addFixturePatternConfig('typescript/decorators/class-decorators', { + fileType: 'ts' +}); +tester.addFixturePatternConfig('typescript/decorators/method-decorators', { + fileType: 'ts' +}); +tester.addFixturePatternConfig('typescript/decorators/parameter-decorators', { + fileType: 'ts' +}); +tester.addFixturePatternConfig('typescript/decorators/property-decorators', { + fileType: 'ts' +}); + +tester.addFixturePatternConfig('typescript/expressions', { + fileType: 'ts', + ignore: [ + /** + * there is difference in range between babel and tsep + */ + 'tagged-template-expression-type-arguments' + ] +}); + +tester.addFixturePatternConfig('typescript/errorRecovery', { + fileType: 'ts', + ignore: [ + /** + * AST difference + */ + 'interface-empty-extends', + /** + * TypeScript-specific tests taken from "errorRecovery". Babel is not being as forgiving as the TypeScript compiler here. + */ + 'class-empty-extends-implements', // babel parse errors + 'class-empty-extends', // babel parse errors + 'decorator-on-enum-declaration', // babel parse errors + 'decorator-on-interface-declaration', // babel parse errors + 'interface-property-modifiers', // babel parse errors + 'enum-with-keywords', // babel parse errors + 'solo-const' // babel parse errors + ] +}); + +tester.addFixturePatternConfig('typescript/types', { + fileType: 'ts' +}); + +tester.addFixturePatternConfig('typescript/declare', { + fileType: 'ts', + ignore: [ + /** + * AST difference + * tsep: heritage = [] + * babel: heritage = undefined + */ + 'interface', + /** + * AST difference + * tsep: TSAbstractClassDeclaration + * babel: ClassDeclaration[abstract=true] + */ + 'abstract-class' + ] +}); + +tester.addFixturePatternConfig('typescript/namespaces-and-modules', { + fileType: 'ts', + ignore: [ + /** + * Minor AST difference + */ + 'nested-internal-module', + /** + * Babel: TSDeclareFunction + * tsep: TSNamespaceFunctionDeclaration + */ + 'declare-namespace-with-exported-function' + ], + ignoreSourceType: [ + 'module-with-default-exports', + 'ambient-module-declaration-with-import' + ] +}); + +const fixturesToTest = tester.getFixtures(); export { fixturesToTest }; From 5c34695a7f7d93b4b3ef7979a0b6f8f105a26d47 Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 18:58:56 +0100 Subject: [PATCH 48/84] fix: parsing comments in jsx (#82) --- .../typescript-estree/src/convert-comments.ts | 22 +- .../comments/jsx-comment-after-jsx.src.js | 5 + .../jsx-comment-after-self-closing-jsx.src.js | 5 + ...jsx-text-with-multiline-non-comment.src.js | 9 + .../comments/jsx-text-with-url.src.js | 1 + .../comments/jsx-with-greather-than.src.js | 4 + .../comments/jsx-with-operators.src.js | 4 + .../type-assertion-regression-test.src.ts | 2 + .../tests/lib/__snapshots__/comments.ts.snap | 5873 ++++++++++++++--- .../semantic-diagnostics-enabled.ts.snap | 56 + .../typescript-estree/tests/lib/comments.ts | 21 +- 11 files changed, 5224 insertions(+), 778 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-jsx.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-text-with-multiline-non-comment.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-text-with-url.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-with-greather-than.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/jsx-with-operators.src.js create mode 100644 packages/typescript-estree/tests/fixtures/comments/type-assertion-regression-test.src.ts diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index 25d4287e7d7c..dda9ceb2ac0e 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -107,7 +107,12 @@ export function convertComments( * Create a TypeScript Scanner, with skipTrivia set to false so that * we can parse the comments */ - const triviaScanner = ts.createScanner(ast.languageVersion, false, 0, code); + const triviaScanner = ts.createScanner( + ast.languageVersion, + false, + ast.languageVariant, + code + ); let kind = triviaScanner.scan(); while (kind !== ts.SyntaxKind.EndOfFileToken) { @@ -123,8 +128,21 @@ export function convertComments( comments.push(comment); break; } + case ts.SyntaxKind.GreaterThanToken: + container = nodeUtils.getNodeContainer(ast, start, end); + if ( + container && + container.parent && + container.parent.kind === ts.SyntaxKind.JsxOpeningElement && + container.parent.parent && + container.parent.parent.kind === ts.SyntaxKind.JsxElement + ) { + kind = triviaScanner.reScanJsxToken(); + continue; + } + break; case ts.SyntaxKind.CloseBraceToken: - container = nodeUtils.getNodeContainer(ast, start, end) as ts.Node; + container = nodeUtils.getNodeContainer(ast, start, end); if ( container.kind === ts.SyntaxKind.TemplateMiddle || diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-jsx.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-jsx.src.js new file mode 100644 index 000000000000..32c4c532013a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-jsx.src.js @@ -0,0 +1,5 @@ +const pure = () => { + return ( + // Foo + ); +} diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js new file mode 100644 index 000000000000..ef446a5b6dd2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js @@ -0,0 +1,5 @@ +const pure = () => { + return ( + // Foo + ); +} diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-text-with-multiline-non-comment.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-text-with-multiline-non-comment.src.js new file mode 100644 index 000000000000..c14b0aef7b2b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-text-with-multiline-non-comment.src.js @@ -0,0 +1,9 @@ +const pure = () => { + return ( + + /** + * test + */ + + ); +} diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-text-with-url.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-text-with-url.src.js new file mode 100644 index 000000000000..ab57e8d95dab --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-text-with-url.src.js @@ -0,0 +1 @@ +const link = (http://example.com); diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-with-greather-than.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-with-greather-than.src.js new file mode 100644 index 000000000000..6294ad6b6f01 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-with-greather-than.src.js @@ -0,0 +1,4 @@ +if (1 >/* Test */2) { + test( 2 >> 3); + const foo = // +} diff --git a/packages/typescript-estree/tests/fixtures/comments/jsx-with-operators.src.js b/packages/typescript-estree/tests/fixtures/comments/jsx-with-operators.src.js new file mode 100644 index 000000000000..f14ac6907bb2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/jsx-with-operators.src.js @@ -0,0 +1,4 @@ +if (1 > 3); + const foo = // +} diff --git a/packages/typescript-estree/tests/fixtures/comments/type-assertion-regression-test.src.ts b/packages/typescript-estree/tests/fixtures/comments/type-assertion-regression-test.src.ts new file mode 100644 index 000000000000..5b14e9731acd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/comments/type-assertion-regression-test.src.ts @@ -0,0 +1,2 @@ +const foo = // test + bar; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap index 41309c3f7edc..7c05def7e8f1 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap @@ -1912,7 +1912,7 @@ Object { } `; -exports[`Comments fixtures/jsx-tag-comments.src 1`] = ` +exports[`Comments fixtures/jsx-comment-after-jsx.src 1`] = ` Object { "body": Array [ Object { @@ -1942,68 +1942,46 @@ Object { "body": Array [ Object { "argument": Object { - "children": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 103, - 112, - ], - "raw": " - ", - "type": "Literal", - "value": " - ", - }, - ], + "children": Array [], "closingElement": Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 19, + "line": 3, }, "start": Object { - "column": 8, - "line": 7, + "column": 13, + "line": 3, }, }, "name": Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 18, + "line": 3, }, "start": Object { - "column": 10, - "line": 7, + "column": 15, + "line": 3, }, }, "name": "Foo", "range": Array [ - 114, - 117, + 49, + 52, ], "type": "JSXIdentifier", }, "range": Array [ - 112, - 118, + 47, + 53, ], "type": "JSXClosingElement", }, "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 19, + "line": 3, }, "start": Object { "column": 8, @@ -2014,8 +1992,8 @@ Object { "attributes": Array [], "loc": Object { "end": Object { - "column": 9, - "line": 6, + "column": 13, + "line": 3, }, "start": Object { "column": 8, @@ -2042,21 +2020,21 @@ Object { }, "range": Array [ 42, - 103, + 47, ], "selfClosing": false, "type": "JSXOpeningElement", }, "range": Array [ 42, - 118, + 53, ], "type": "JSXElement", }, "loc": Object { "end": Object { "column": 6, - "line": 8, + "line": 4, }, "start": Object { "column": 4, @@ -2065,7 +2043,7 @@ Object { }, "range": Array [ 25, - 125, + 67, ], "type": "ReturnStatement", }, @@ -2073,7 +2051,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 9, + "line": 5, }, "start": Object { "column": 19, @@ -2082,7 +2060,7 @@ Object { }, "range": Array [ 19, - 127, + 69, ], "type": "BlockStatement", }, @@ -2092,7 +2070,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 9, + "line": 5, }, "start": Object { "column": 13, @@ -2102,14 +2080,14 @@ Object { "params": Array [], "range": Array [ 13, - 127, + 69, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 9, + "line": 5, }, "start": Object { "column": 6, @@ -2118,7 +2096,7 @@ Object { }, "range": Array [ 6, - 127, + 69, ], "type": "VariableDeclarator", }, @@ -2127,7 +2105,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 9, + "line": 5, }, "start": Object { "column": 0, @@ -2136,7 +2114,7 @@ Object { }, "range": Array [ 0, - 127, + 69, ], "type": "VariableDeclaration", }, @@ -2145,44 +2123,26 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 26, + "line": 3, }, "start": Object { - "column": 12, - "line": 4, + "column": 20, + "line": 3, }, }, "range": Array [ - 59, - 68, + 54, + 60, ], "type": "Line", - "value": " single", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 5, - }, - }, - "range": Array [ - 81, - 92, - ], - "type": "Block", - "value": " block ", + "value": " Foo", }, ], "loc": Object { "end": Object { "column": 0, - "line": 11, + "line": 6, }, "start": Object { "column": 0, @@ -2191,7 +2151,7 @@ Object { }, "range": Array [ 0, - 129, + 70, ], "sourceType": "script", "tokens": Array [ @@ -2396,17 +2356,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 6, + "column": 13, + "line": 3, }, "start": Object { - "column": 8, - "line": 6, + "column": 12, + "line": 3, }, }, "range": Array [ - 102, - 103, + 46, + 47, ], "type": "Punctuator", "value": ">", @@ -2414,36 +2374,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 103, - 112, - ], - "type": "JSXText", - "value": " - ", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 7, + "column": 14, + "line": 3, }, "start": Object { - "column": 8, - "line": 7, + "column": 13, + "line": 3, }, }, "range": Array [ - 112, - 113, + 47, + 48, ], "type": "Punctuator", "value": "<", @@ -2451,17 +2392,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 15, + "line": 3, }, "start": Object { - "column": 9, - "line": 7, + "column": 14, + "line": 3, }, }, "range": Array [ - 113, - 114, + 48, + 49, ], "type": "Punctuator", "value": "/", @@ -2469,17 +2410,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 18, + "line": 3, }, "start": Object { - "column": 10, - "line": 7, + "column": 15, + "line": 3, }, }, "range": Array [ - 114, - 117, + 49, + 52, ], "type": "JSXIdentifier", "value": "Foo", @@ -2487,17 +2428,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 19, + "line": 3, }, "start": Object { - "column": 13, - "line": 7, + "column": 18, + "line": 3, }, }, "range": Array [ - 117, - 118, + 52, + 53, ], "type": "Punctuator", "value": ">", @@ -2506,16 +2447,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 8, + "line": 4, }, "start": Object { "column": 4, - "line": 8, + "line": 4, }, }, "range": Array [ - 123, - 124, + 65, + 66, ], "type": "Punctuator", "value": ")", @@ -2524,16 +2465,16 @@ Object { "loc": Object { "end": Object { "column": 6, - "line": 8, + "line": 4, }, "start": Object { "column": 5, - "line": 8, + "line": 4, }, }, "range": Array [ - 124, - 125, + 66, + 67, ], "type": "Punctuator", "value": ";", @@ -2542,16 +2483,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 9, + "line": 5, }, "start": Object { "column": 0, - "line": 9, + "line": 5, }, }, "range": Array [ - 126, - 127, + 68, + 69, ], "type": "Punctuator", "value": "}", @@ -2561,50 +2502,7 @@ Object { } `; -exports[`Comments fixtures/line-comment-with-block-syntax.src 1`] = ` -Object { - "body": Array [], - "comments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 11, - ], - "type": "Line", - "value": " /*test*/", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 12, - 12, - ], - "sourceType": "script", - "tokens": Array [], - "type": "Program", -} -`; - -exports[`Comments fixtures/mix-line-and-block-comments.src 1`] = ` +exports[`Comments fixtures/jsx-comment-after-self-closing-jsx.src 1`] = ` Object { "body": Array [ Object { @@ -2613,71 +2511,166 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, - }, + "column": 6, + "line": 1, + }, }, - "name": "zzz", + "name": "pure", "range": Array [ + 6, 10, - 13, ], "type": "Identifier", }, "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 43, + 46, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 42, + 49, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 42, + 49, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 63, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 65, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 1, + "line": 5, }, "start": Object { - "column": 18, - "line": 2, + "column": 13, + "line": 1, }, }, + "params": Array [], "range": Array [ - 24, - 27, + 13, + 65, ], - "raw": "777", - "type": "Literal", - "value": 777, + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 1, + "line": 5, }, "start": Object { - "column": 4, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 10, - 27, + 6, + 65, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 1, + "line": 5, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 6, - 28, + 0, + 65, ], "type": "VariableDeclaration", }, @@ -2686,124 +2679,88 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Line", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 14, - 21, - ], - "type": "Block", - "value": "aaa", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, + "column": 22, "line": 3, }, "start": Object { - "column": 0, + "column": 16, "line": 3, }, }, "range": Array [ - 29, - 34, + 50, + 56, ], "type": "Line", - "value": "bar", + "value": " Foo", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 6, - 35, + 0, + 66, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 6, - 9, + 0, + 5, ], "type": "Keyword", - "value": "var", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ + 6, 10, - 13, ], "type": "Identifier", - "value": "zzz", + "value": "pure", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 22, - 23, + 11, + 12, ], "type": "Punctuator", "value": "=", @@ -2811,243 +2768,243 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 24, - 27, + 13, + 14, ], - "type": "Numeric", - "value": "777", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 21, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 27, - 28, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/no-comment-regex.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "regex", - "range": Array [ - 6, - 11, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 33, - ], - "raw": "/no comment\\\\/**foo/", - "regex": Object { - "flags": "", - "pattern": "no comment\\\\/**foo", - }, - "type": "Literal", - "value": null, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 33, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 34, + "column": 18, "line": 1, }, "start": Object { - "column": 0, + "column": 16, "line": 1, }, }, "range": Array [ - 0, - 34, + 16, + 18, ], - "type": "VariableDeclaration", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "=>", }, - }, - "range": Array [ - 0, - 35, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 20, "line": 1, }, "start": Object { - "column": 0, + "column": 19, "line": 1, }, }, "range": Array [ - 0, - 5, + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, ], "type": "Keyword", - "value": "const", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 6, - 11, + 32, + 33, ], - "type": "Identifier", - "value": "regex", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { "column": 12, - "line": 1, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, }, }, "range": Array [ - 12, - 13, + 43, + 46, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, ], "type": "Punctuator", - "value": "=", + "value": "/", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { "column": 14, - "line": 1, + "line": 3, }, }, "range": Array [ - 14, - 33, + 48, + 49, ], - "regex": Object { - "flags": "", - "pattern": "no comment\\\\/**foo", + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, }, - "type": "RegularExpression", - "value": "/no comment\\\\/**foo/", + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 6, + "line": 4, }, "start": Object { - "column": 33, - "line": 1, + "column": 5, + "line": 4, }, }, "range": Array [ - 33, - 34, + 62, + 63, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`Comments fixtures/no-comment-template.src 1`] = ` +exports[`Comments fixtures/jsx-tag-comments.src 1`] = ` Object { "body": Array [ Object { @@ -3056,7 +3013,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { @@ -3064,10 +3021,4080 @@ Object { "line": 1, }, }, - "name": "str", + "name": "pure", "range": Array [ 6, - 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 103, + 112, + ], + "raw": " + ", + "type": "Literal", + "value": " + ", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "name": "Foo", + "range": Array [ + 114, + 117, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 112, + 118, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 43, + 46, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 42, + 103, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 42, + 118, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 125, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 127, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 127, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 127, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 127, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 59, + 68, + ], + "type": "Line", + "value": " single", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 81, + 92, + ], + "type": "Block", + "value": " block ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 129, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "pure", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 103, + 112, + ], + "type": "JSXText", + "value": " + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 113, + 114, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 114, + 117, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 13, + "line": 7, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 123, + 124, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 8, + }, + "start": Object { + "column": 5, + "line": 8, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/jsx-text-with-multiline-non-comment.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "pure", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 41, + 80, + ], + "raw": " + /** + * test + */ + ", + "type": "Literal", + "value": " + /** + * test + */ + ", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "name": "Foo", + "range": Array [ + 82, + 85, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 80, + 86, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 37, + 40, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 36, + 41, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 36, + 86, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 91, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 93, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 93, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 93, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 93, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 94, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "pure", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 41, + 80, + ], + "type": "JSXText", + "value": " + /** + * test + */ + ", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 7, + }, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 82, + 85, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 89, + 90, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 8, + }, + "start": Object { + "column": 3, + "line": 8, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/jsx-text-with-url.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "link", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 61, + ], + "raw": "http://example.com", + "type": "Literal", + "value": "http://example.com", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 65, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 63, + 64, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 61, + 65, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 65, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "href", + "range": Array [ + 17, + 21, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 17, + 42, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 42, + ], + "raw": "\\"http://example.com\\"", + "type": "Literal", + "value": "http://example.com", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 15, + 16, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 14, + 43, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 14, + 65, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 66, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 67, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 67, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 68, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "link", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "JSXIdentifier", + "value": "href", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 42, + ], + "type": "JSXText", + "value": "\\"http://example.com\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 61, + ], + "type": "JSXText", + "value": "http://example.com", + }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "JSXIdentifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 65, + "line": 1, + }, + "start": Object { + "column": 64, + "line": 1, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 67, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/jsx-with-greather-than.src 1`] = ` +Object { + "body": Array [ + Object { + "alternate": null, + "consequent": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "operator": ">>", + "range": Array [ + 30, + 36, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "BinaryExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "test", + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 24, + 37, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 24, + 38, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "foo", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 59, + 61, + ], + "raw": "//", + "type": "Literal", + "value": "//", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "name": "test", + "range": Array [ + 63, + 67, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 61, + 68, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "test", + "range": Array [ + 54, + 58, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 53, + 59, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 53, + 68, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 47, + 68, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 41, + 68, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 70, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 70, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "operator": ">", + "range": Array [ + 4, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "BinaryExpression", + }, + "type": "IfStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "Block", + "value": " Test ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 71, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Keyword", + "value": "if", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 32, + 34, + ], + "type": "Punctuator", + "value": ">>", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 41, + 46, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 54, + 58, + ], + "type": "JSXIdentifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 59, + 61, + ], + "type": "JSXText", + "value": "//", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 63, + 67, + ], + "type": "JSXIdentifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/jsx-with-operators.src 1`] = ` +Object { + "body": Array [ + Object { + "alternate": null, + "consequent": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "operator": ">>", + "range": Array [ + 30, + 36, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "BinaryExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "test", + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 24, + 37, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 24, + 38, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "foo", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "init": Object { + "children": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 59, + 61, + ], + "raw": "//", + "type": "Literal", + "value": "//", + }, + ], + "closingElement": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "name": "test", + "range": Array [ + 63, + 67, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 61, + 68, + ], + "type": "JSXClosingElement", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "test", + "range": Array [ + 54, + 58, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 53, + 59, + ], + "selfClosing": false, + "type": "JSXOpeningElement", + }, + "range": Array [ + 53, + 68, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 47, + 68, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 41, + 68, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 70, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 70, + ], + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 4, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "BinaryExpression", + }, + "type": "IfStatement", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "Block", + "value": " Test ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 71, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 2, + ], + "type": "Keyword", + "value": "if", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 32, + 34, + ], + "type": "Punctuator", + "value": ">>", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 41, + 46, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 54, + 58, + ], + "type": "JSXIdentifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 59, + 61, + ], + "type": "JSXText", + "value": "//", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 63, + 67, + ], + "type": "JSXIdentifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/line-comment-with-block-syntax.src 1`] = ` +Object { + "body": Array [], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "type": "Line", + "value": " /*test*/", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 12, + 12, + ], + "sourceType": "script", + "tokens": Array [], + "type": "Program", +} +`; + +exports[`Comments fixtures/mix-line-and-block-comments.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "zzz", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 24, + 27, + ], + "raw": "777", + "type": "Literal", + "value": 777, + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 6, + 28, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Line", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Block", + "value": "aaa", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "Line", + "value": "bar", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 6, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "zzz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Numeric", + "value": "777", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/no-comment-regex.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "regex", + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 33, + ], + "raw": "/no comment\\\\/**foo/", + "regex": Object { + "flags": "", + "pattern": "no comment\\\\/**foo", + }, + "type": "Literal", + "value": null, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 33, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "Identifier", + "value": "regex", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 33, + ], + "regex": Object { + "flags": "", + "pattern": "no comment\\\\/**foo", + }, + "type": "RegularExpression", + "value": "/no comment\\\\/**foo/", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/no-comment-template.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "str", + "range": Array [ + 6, + 9, ], "type": "Identifier", }, @@ -8617,494 +12644,844 @@ Object { "line": 6, }, "start": Object { - "column": 56, - "line": 6, + "column": 56, + "line": 6, + }, + }, + "range": Array [ + 194, + 205, + ], + "type": "Identifier", + "value": "expressions", + }, + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 6, + }, + "start": Object { + "column": 67, + "line": 6, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 74, + "line": 6, + }, + "start": Object { + "column": 68, + "line": 6, + }, + }, + "range": Array [ + 206, + 212, + ], + "type": "Identifier", + "value": "length", + }, + Object { + "loc": Object { + "end": Object { + "column": 76, + "line": 6, + }, + "start": Object { + "column": 75, + "line": 6, + }, + }, + "range": Array [ + 213, + 214, + ], + "type": "Punctuator", + "value": "-", + }, + Object { + "loc": Object { + "end": Object { + "column": 78, + "line": 6, + }, + "start": Object { + "column": 77, + "line": 6, + }, + }, + "range": Array [ + 215, + 216, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 6, + }, + "start": Object { + "column": 78, + "line": 6, + }, + }, + "range": Array [ + 216, + 217, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 6, + }, + "start": Object { + "column": 79, + "line": 6, + }, + }, + "range": Array [ + 217, + 218, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 81, + "line": 6, + }, + "start": Object { + "column": 80, + "line": 6, + }, + }, + "range": Array [ + 218, + 219, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 254, + 255, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 264, + 270, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, + }, + "range": Array [ + 271, + 276, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 9, + }, + "start": Object { + "column": 20, + "line": 9, + }, + }, + "range": Array [ + 276, + 277, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, }, }, "range": Array [ - 194, - 205, + 282, + 283, ], - "type": "Identifier", - "value": "expressions", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 68, - "line": 6, + "column": 1, + "line": 12, }, "start": Object { - "column": 67, - "line": 6, + "column": 0, + "line": 12, }, }, "range": Array [ - 205, - 206, + 285, + 286, ], "type": "Punctuator", - "value": ".", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 74, - "line": 6, + "column": 2, + "line": 12, }, "start": Object { - "column": 68, - "line": 6, + "column": 1, + "line": 12, }, }, "range": Array [ - 206, - 212, + 286, + 287, ], - "type": "Identifier", - "value": "length", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/template-string-block.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "expressions": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 3, + 7, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "quasis": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "tail": false, + "type": "TemplateElement", + "value": Object { + "cooked": "", + "raw": "", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "tail": true, + "type": "TemplateElement", + "value": Object { + "cooked": "", + "raw": "", + }, + }, + ], + "range": Array [ + 0, + 9, + ], + "type": "TemplateLiteral", + }, "loc": Object { "end": Object { - "column": 76, - "line": 6, + "column": 10, + "line": 1, }, "start": Object { - "column": 75, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 213, - 214, + 0, + 10, ], - "type": "Punctuator", - "value": "-", + "type": "ExpressionStatement", }, Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 56, + 57, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "operator": "+", + "range": Array [ + 56, + 61, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 56, + 62, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { - "column": 78, - "line": 6, + "column": 1, + "line": 5, }, "start": Object { - "column": 77, - "line": 6, + "column": 0, + "line": 2, }, }, "range": Array [ - 215, - 216, + 11, + 64, ], - "type": "Numeric", - "value": "1", + "type": "BlockStatement", }, + ], + "comments": Array [ Object { "loc": Object { "end": Object { - "column": 79, - "line": 6, + "column": 38, + "line": 3, }, "start": Object { - "column": 78, - "line": 6, + "column": 4, + "line": 3, }, }, "range": Array [ - 216, - 217, + 17, + 51, ], - "type": "Punctuator", - "value": "]", + "type": "Block", + "value": " TODO comment comment comment ", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 65, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 80, - "line": 6, + "column": 3, + "line": 1, }, "start": Object { - "column": 79, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 217, - 218, + 0, + 3, ], - "type": "Punctuator", - "value": ")", + "type": "Template", + "value": "\`\${", }, Object { "loc": Object { "end": Object { - "column": 81, - "line": 6, + "column": 7, + "line": 1, }, "start": Object { - "column": 80, - "line": 6, + "column": 3, + "line": 1, }, }, "range": Array [ - 218, - 219, + 3, + 7, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "name", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 8, + "line": 1, }, "start": Object { - "column": 8, - "line": 8, + "column": 7, + "line": 1, }, }, "range": Array [ - 254, - 255, + 7, + 9, ], - "type": "Punctuator", - "value": "}", + "type": "Template", + "value": "}\`", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 9, + "column": 10, + "line": 1, }, "start": Object { - "column": 8, - "line": 9, + "column": 9, + "line": 1, }, }, "range": Array [ - 264, - 270, + 9, + 10, ], - "type": "Keyword", - "value": "return", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 9, + "column": 1, + "line": 2, }, "start": Object { - "column": 15, - "line": 9, + "column": 0, + "line": 2, }, }, "range": Array [ - 271, - 276, + 11, + 12, ], - "type": "Boolean", - "value": "false", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 9, + "column": 5, + "line": 4, }, "start": Object { - "column": 20, - "line": 9, + "column": 4, + "line": 4, }, }, "range": Array [ - 276, - 277, + 56, + 57, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 10, + "column": 7, + "line": 4, }, "start": Object { - "column": 4, - "line": 10, + "column": 6, + "line": 4, }, }, "range": Array [ - 282, - 283, + 58, + 59, ], "type": "Punctuator", - "value": "}", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 12, + "column": 9, + "line": 4, }, "start": Object { - "column": 0, - "line": 12, + "column": 8, + "line": 4, }, }, "range": Array [ - 285, - 286, + 60, + 61, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 12, + "column": 10, + "line": 4, }, "start": Object { - "column": 1, - "line": 12, + "column": 9, + "line": 4, }, }, "range": Array [ - 286, - 287, + 61, + 62, ], "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`Comments fixtures/template-string-block.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "expressions": Array [ - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 3, - 7, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "quasis": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "tail": false, - "type": "TemplateElement", - "value": Object { - "cooked": "", - "raw": "", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 9, - ], - "tail": true, - "type": "TemplateElement", - "value": Object { - "cooked": "", - "raw": "", - }, - }, - ], - "range": Array [ - 0, - 9, - ], - "type": "TemplateLiteral", - }, "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 10, + 63, + 64, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`Comments fixtures/type-assertion-regression-test.src 1`] = ` +Object { + "body": Array [ Object { - "body": Array [ + "declarations": Array [ Object { - "expression": Object { - "left": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 2, + "line": 2, }, }, + "name": "bar", "range": Array [ - 56, - 57, + 28, + 31, ], - "raw": "1", - "type": "Literal", - "value": 1, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 5, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 12, + "line": 1, }, }, - "operator": "+", "range": Array [ - 56, - 61, + 12, + 31, ], - "right": Object { + "type": "TSTypeAssertion", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, - "line": 4, + "column": 13, + "line": 1, }, }, "range": Array [ - 60, - 61, + 13, + 16, ], - "raw": "1", - "type": "Literal", - "value": 1, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, }, - "type": "BinaryExpression", }, "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 5, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 6, + "line": 1, }, }, "range": Array [ - 56, - 62, + 6, + 31, ], - "type": "ExpressionStatement", + "type": "VariableDeclarator", }, ], + "kind": "const", "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 6, + "line": 2, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 11, - 64, + 0, + 32, ], - "type": "BlockStatement", + "type": "VariableDeclaration", }, ], "comments": Array [ Object { "loc": Object { "end": Object { - "column": 38, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 18, + "line": 1, }, }, "range": Array [ - 17, - 51, + 18, + 25, ], - "type": "Block", - "value": " TODO comment comment comment ", + "type": "Line", + "value": " test", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 3, }, "start": Object { "column": 0, @@ -9113,14 +13490,14 @@ Object { }, "range": Array [ 0, - 65, + 33, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -9130,28 +13507,10 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Template", - "value": "\`\${", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 7, + 5, ], - "type": "Identifier", - "value": "name", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { @@ -9160,143 +13519,125 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ - 7, + 6, 9, ], - "type": "Template", - "value": "}\`", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 11, 12, + 13, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 13, + "line": 1, }, }, "range": Array [ - 56, - 57, + 13, + 16, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 17, + "line": 1, }, "start": Object { - "column": 6, - "line": 4, + "column": 16, + "line": 1, }, }, "range": Array [ - 58, - 59, + 16, + 17, ], "type": "Punctuator", - "value": "+", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 5, + "line": 2, }, "start": Object { - "column": 8, - "line": 4, + "column": 2, + "line": 2, }, }, "range": Array [ - 60, - 61, + 28, + 31, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 6, + "line": 2, }, "start": Object { - "column": 9, - "line": 4, + "column": 5, + "line": 2, }, }, "range": Array [ - 61, - 62, + 31, + 32, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 63, - 64, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 504efbba9548..f54e6aa61e61 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -17,6 +17,24 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-jsx.src.js.src 1`] = ` +Object { + "column": 14, + "index": 48, + "lineNumber": 3, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-self-closing-jsx.src.js.src 1`] = ` +Object { + "column": 13, + "index": 47, + "lineNumber": 3, + "message": "'>' expected.", +} +`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comments.src.js.src 1`] = ` Object { "column": 9, @@ -26,6 +44,42 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-multiline-non-comment.src.js.src 1`] = ` +Object { + "column": 5, + "index": 81, + "lineNumber": 7, + "message": "Type expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-url.src.js.src 1`] = ` +Object { + "column": 17, + "index": 17, + "lineNumber": 1, + "message": "'>' expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-with-greather-than.src.js.src 1`] = ` +Object { + "column": 0, + "index": 69, + "lineNumber": 4, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-with-operators.src.js.src 1`] = ` +Object { + "column": 0, + "index": 69, + "lineNumber": 4, + "message": "Expression expected.", +} +`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/line-comment-with-block-syntax.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/mix-line-and-block-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -56,6 +110,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/template-string-block.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/type-assertion-regression-test.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/comments.ts b/packages/typescript-estree/tests/lib/comments.ts index 936b7a249d98..7ad9695ecb18 100644 --- a/packages/typescript-estree/tests/lib/comments.ts +++ b/packages/typescript-estree/tests/lib/comments.ts @@ -18,10 +18,9 @@ const FIXTURES_DIR = './tests/fixtures/comments'; const testFiles = shelljs .find(FIXTURES_DIR) - .filter(filename => filename.indexOf('.src.js') > -1) - // strip off ".src.js" - .map(filename => - filename.substring(FIXTURES_DIR.length - 1, filename.length - 7) + .filter( + filename => + filename.indexOf('.src.js') > -1 || filename.indexOf('.src.ts') > -1 ); //------------------------------------------------------------------------------ @@ -30,17 +29,19 @@ const testFiles = shelljs describe('Comments', () => { testFiles.forEach(filename => { - const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}.src.js`); - const config = { + const code = shelljs.cat(path.resolve(filename)); + const config: ParserOptions = { loc: true, range: true, tokens: true, comment: true, - jsx: true + jsx: path.extname(filename) === '.js' }; - it( - `fixtures/${filename}.src`, - createSnapshotTestBlock(code, config as ParserOptions) + // strip off ".src.js" and ".src.ts" + const name = filename.substring( + FIXTURES_DIR.length - 1, + filename.length - 7 ); + it(`fixtures/${name}.src`, createSnapshotTestBlock(code, config)); }); }); From 53c222363624ada2a87f184d0af7d1897933699f Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 4 Jan 2019 22:01:01 +0100 Subject: [PATCH 49/84] feat: align call and construct signature declarations (#74) BREAKING CHANGE: This changes the AST --- .../typescript-estree/src/ast-node-types.ts | 3 +- packages/typescript-estree/src/convert.ts | 15 +- .../tests/ast-alignment/utils.ts | 26 + .../call-signatures-with-generics.src.ts | 4 + .../typescript/basics/call-signatures.src.ts | 4 + .../semantic-diagnostics-enabled.ts.snap | 4 + .../lib/__snapshots__/typescript.ts.snap | 1491 ++++++++++++++++- 7 files changed, 1536 insertions(+), 11 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures-with-generics.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index 41ee3fb2b67f..7af75dac21f6 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -108,7 +108,8 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSBigIntKeyword: 'TSBigIntKeyword', TSConditionalType: 'TSConditionalType', TSConstructorType: 'TSConstructorType', - TSConstructSignature: 'TSConstructSignature', + TSCallSignatureDeclaration: 'TSCallSignatureDeclaration', + TSConstructSignatureDeclaration: 'TSConstructSignatureDeclaration', TSDeclareKeyword: 'TSDeclareKeyword', TSDeclareFunction: 'TSDeclareFunction', TSEnumDeclaration: 'TSEnumDeclaration', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 098c3dfb2a15..c8476a0f1c43 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2450,13 +2450,20 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; } - case SyntaxKind.ConstructSignature: { + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallSignature: { Object.assign(result, { - type: AST_NODE_TYPES.TSConstructSignature, - params: convertParameters(node.parameters), - typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null + type: + node.kind === SyntaxKind.ConstructSignature + ? AST_NODE_TYPES.TSConstructSignatureDeclaration + : AST_NODE_TYPES.TSCallSignatureDeclaration, + params: convertParameters(node.parameters) }); + if (node.type) { + (result as any).returnType = convertTypeAnnotation(node.type); + } + if (node.typeParameters) { result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( node.typeParameters diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 0345ab5f1a38..52bffc8c957c 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -142,6 +142,32 @@ export function preprocessBabylonAST(ast: any): any { BooleanLiteral(node: any) { node.type = 'Literal'; node.raw = String(node.value); + }, + /** + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/9231 + */ + TSCallSignatureDeclaration(node: any) { + if (node.typeAnnotation) { + node.returnType = node.typeAnnotation; + delete node.typeAnnotation; + } + if (node.parameters) { + node.params = node.parameters; + delete node.parameters; + } + }, + /** + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/9231 + */ + TSConstructSignatureDeclaration(node: any) { + if (node.typeAnnotation) { + node.returnType = node.typeAnnotation; + delete node.typeAnnotation; + } + if (node.parameters) { + node.params = node.parameters; + delete node.parameters; + } } } ); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures-with-generics.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures-with-generics.src.ts new file mode 100644 index 000000000000..66abe7617738 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures-with-generics.src.ts @@ -0,0 +1,4 @@ +type foo = { + (a: string): string + new(a: string): string +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures.src.ts new file mode 100644 index 000000000000..6b9205ce3f76 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/call-signatures.src.ts @@ -0,0 +1,4 @@ +type foo = { + (a: string): string + new(a: string): string +} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index f54e6aa61e61..0c91c88eb71f 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1674,6 +1674,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-with-var-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures-with-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index bec36dc9e40b..245e6efc4eb9 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -4668,6 +4668,1486 @@ Object { } `; +exports[`typescript fixtures/basics/call-signatures.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 61, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 15, + 34, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "TSStringKeyword", + }, + }, + "type": "TSCallSignatureDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 41, + 50, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 42, + 50, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 37, + 59, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 51, + 59, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "TSStringKeyword", + }, + }, + "type": "TSConstructSignatureDeclaration", + }, + ], + "range": Array [ + 11, + 61, + ], + "type": "TSTypeLiteral", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 62, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 53, + 59, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/call-signatures-with-generics.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 67, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 19, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 15, + 37, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + }, + "type": "TSCallSignatureDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 15, + 18, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 47, + 56, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 48, + 56, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 50, + 56, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 40, + 65, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 57, + 65, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 59, + 65, + ], + "type": "TSStringKeyword", + }, + }, + "type": "TSConstructSignatureDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 43, + 46, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "range": Array [ + 11, + 67, + ], + "type": "TSTypeLiteral", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 68, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 40, + 43, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 50, + 56, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 59, + 65, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/cast-as-expression.src 1`] = ` Object { "body": Array [ @@ -38096,8 +39576,7 @@ Object { 245, 265, ], - "type": "TSConstructSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 23, @@ -38131,6 +39610,7 @@ Object { "type": "TSStringKeyword", }, }, + "type": "TSConstructSignatureDeclaration", }, Object { "loc": Object { @@ -38186,8 +39666,7 @@ Object { 270, 293, ], - "type": "TSConstructSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 26, @@ -38221,6 +39700,7 @@ Object { "type": "TSStringKeyword", }, }, + "type": "TSConstructSignatureDeclaration", "typeParameters": Object { "loc": Object { "end": Object { @@ -40444,8 +41924,7 @@ Object { 21, 47, ], - "type": "TSConstructSignature", - "typeAnnotation": null, + "type": "TSConstructSignatureDeclaration", }, ], "loc": Object { From 5162b01ed8f4ab46ef393c7240f7b226fd535ee2 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 5 Jan 2019 00:06:12 +0100 Subject: [PATCH 50/84] feat: add missing TSNamespaceExportDeclaration node (#87) BREAKING CHANGE: This changes the AST --- .../typescript-estree/src/ast-node-types.ts | 1 + packages/typescript-estree/src/convert.ts | 7 + .../basics/export-as-namespace.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 2 + .../lib/__snapshots__/typescript.ts.snap | 150 ++++++++++++++++++ 5 files changed, 161 insertions(+) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-as-namespace.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index 7af75dac21f6..afcf377d7f34 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -131,6 +131,7 @@ export const AST_NODE_TYPES: { [key: string]: string } = { TSModuleBlock: 'TSModuleBlock', TSModuleDeclaration: 'TSModuleDeclaration', TSNamespaceFunctionDeclaration: 'TSNamespaceFunctionDeclaration', + TSNamespaceExportDeclaration: 'TSNamespaceExportDeclaration', TSNonNullExpression: 'TSNonNullExpression', TSNeverKeyword: 'TSNeverKeyword', TSNullKeyword: 'TSNullKeyword', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index c8476a0f1c43..0c24aae9a136 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2711,6 +2711,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); break; } + case SyntaxKind.NamespaceExportDeclaration: { + Object.assign(result, { + type: AST_NODE_TYPES.TSNamespaceExportDeclaration, + id: convertChild(node.name) + }); + break; + } default: deeplyCopy(); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-as-namespace.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-as-namespace.src.ts new file mode 100644 index 000000000000..ff8bbadf397d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-as-namespace.src.ts @@ -0,0 +1 @@ +export as namespace a; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 0c91c88eb71f..6649259217c3 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1760,6 +1760,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-as-namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 245e6efc4eb9..8f61fb2d30b1 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -28708,6 +28708,156 @@ Object { } `; +exports[`typescript fixtures/basics/export-as-namespace.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "TSNamespaceExportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + "value": "namespace", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/export-assignment.src 1`] = ` Object { "body": Array [ From e794e74823d2881d97ff8c2ebf764cf4255ec3e7 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 5 Jan 2019 00:15:50 +0100 Subject: [PATCH 51/84] test: enable alignment tests for importMeta and add labels test (#88) --- .../tests/ast-alignment/fixtures-to-test.ts | 2 + .../tests/ast-alignment/parse.ts | 3 +- .../javascript/labels/label-break.src.js | 5 + .../javascript/labels/label-continue.src.js | 5 + .../lib/__snapshots__/javascript.ts.snap | 804 ++++++++++++++++++ .../semantic-diagnostics-enabled.ts.snap | 4 + 6 files changed, 822 insertions(+), 1 deletion(-) create mode 100644 packages/typescript-estree/tests/fixtures/javascript/labels/label-break.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/labels/label-continue.src.js diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 17858b471dff..c30b382e3a08 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -242,6 +242,8 @@ tester.addFixturePatternConfig('javascript/forOf', { tester.addFixturePatternConfig('javascript/generators'); tester.addFixturePatternConfig('javascript/globalReturn'); +tester.addFixturePatternConfig('javascript/importMeta'); +tester.addFixturePatternConfig('javascript/labels'); tester.addFixturePatternConfig('javascript/modules', { ignore: [ diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index c37f5dc19760..1e0c3198b4d8 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -23,7 +23,8 @@ function parseWithBabelParser(text: string, jsx: boolean = true) { 'asyncGenerators', 'dynamicImport', 'estree', - 'bigInt' + 'bigInt', + 'importMeta' ]; if (jsx) { plugins.push('jsx'); diff --git a/packages/typescript-estree/tests/fixtures/javascript/labels/label-break.src.js b/packages/typescript-estree/tests/fixtures/javascript/labels/label-break.src.js new file mode 100644 index 000000000000..fc6d422d3bf0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/labels/label-break.src.js @@ -0,0 +1,5 @@ +loop1: + while(true) { + break loop1; + break; + } diff --git a/packages/typescript-estree/tests/fixtures/javascript/labels/label-continue.src.js b/packages/typescript-estree/tests/fixtures/javascript/labels/label-continue.src.js new file mode 100644 index 000000000000..4243acedd983 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/labels/label-continue.src.js @@ -0,0 +1,5 @@ +loop1: + while(true) { + continue loop1; + continue; + } diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 019314f20abc..65ca9d1cc284 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -92896,6 +92896,810 @@ Object { } `; +exports[`javascript fixtures/labels/label-break.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Object { + "body": Array [ + Object { + "label": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "name": "loop1", + "range": Array [ + 33, + 38, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 27, + 39, + ], + "type": "BreakStatement", + }, + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "BreakStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 21, + 54, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 9, + 54, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 15, + 19, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "WhileStatement", + }, + "label": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "loop1", + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 54, + ], + "type": "LabeledStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 55, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "loop1", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "Keyword", + "value": "break", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 33, + 38, + ], + "type": "Identifier", + "value": "loop1", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 44, + 49, + ], + "type": "Keyword", + "value": "break", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/labels/label-continue.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Object { + "body": Array [ + Object { + "label": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "loop1", + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 27, + 42, + ], + "type": "ContinueStatement", + }, + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 47, + 56, + ], + "type": "ContinueStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 21, + 60, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 9, + 60, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 15, + 19, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "WhileStatement", + }, + "label": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "loop1", + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 60, + ], + "type": "LabeledStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 61, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "loop1", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Boolean", + "value": "true", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "Keyword", + "value": "continue", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + "value": "loop1", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 47, + 55, + ], + "type": "Keyword", + "value": "continue", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`javascript fixtures/modules/error-delete.src 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 6649259217c3..63ab831332a7 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -648,6 +648,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" en exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/importMeta/simple-import-meta.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/labels/label-break.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/labels/label-continue.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-delete.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; From 73d5ff0af470bcfba63c8b2c5236e4d715a0d195 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 5 Jan 2019 00:34:42 +0100 Subject: [PATCH 52/84] refactor: migrate nodeTypes to enum and correct ESTreeComment interface (#86) --- .../typescript-estree/src/ast-node-types.ts | 326 +++++++++--------- .../typescript-estree/src/convert-comments.ts | 5 +- packages/typescript-estree/src/convert.ts | 10 +- .../src/temp-types-based-on-js-source.ts | 17 +- 4 files changed, 182 insertions(+), 176 deletions(-) diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index afcf377d7f34..36b8198c81d1 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -5,169 +5,169 @@ * @copyright jQuery Foundation and other contributors, https://jquery.org/ * MIT License */ -export const AST_NODE_TYPES: { [key: string]: string } = { - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - AwaitExpression: 'AwaitExpression', - BigIntLiteral: 'BigIntLiteral', - BinaryExpression: 'BinaryExpression', - BlockStatement: 'BlockStatement', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ClassImplements: 'ClassImplements', - ClassProperty: 'ClassProperty', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DebuggerStatement: 'DebuggerStatement', - Decorator: 'Decorator', - DoWhileStatement: 'DoWhileStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForInStatement: 'ForInStatement', - ForOfStatement: 'ForOfStatement', - ForStatement: 'ForStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - GenericTypeAnnotation: 'GenericTypeAnnotation', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - Import: 'Import', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - JSXAttribute: 'JSXAttribute', - JSXClosingElement: 'JSXClosingElement', - JSXClosingFragment: 'JSXClosingFragment', - JSXElement: 'JSXElement', - JSXEmptyExpression: 'JSXEmptyExpression', - JSXExpressionContainer: 'JSXExpressionContainer', - JSXFragment: 'JSXFragment', - JSXIdentifier: 'JSXIdentifier', - JSXMemberExpression: 'JSXMemberExpression', - JSXNamespacedName: 'JSXNamespacedName', - JSXOpeningElement: 'JSXOpeningElement', - JSXOpeningFragment: 'JSXOpeningFragment', - JSXSpreadAttribute: 'JSXSpreadAttribute', - JSXSpreadChild: 'JSXSpreadChild', - JSXText: 'JSXText', - LabeledStatement: 'LabeledStatement', - Literal: 'Literal', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchCase: 'SwitchCase', - SwitchStatement: 'SwitchStatement', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression', +export enum AST_NODE_TYPES { + ArrayExpression = 'ArrayExpression', + ArrayPattern = 'ArrayPattern', + ArrowFunctionExpression = 'ArrowFunctionExpression', + AssignmentExpression = 'AssignmentExpression', + AssignmentPattern = 'AssignmentPattern', + AwaitExpression = 'AwaitExpression', + BigIntLiteral = 'BigIntLiteral', + BinaryExpression = 'BinaryExpression', + BlockStatement = 'BlockStatement', + BreakStatement = 'BreakStatement', + CallExpression = 'CallExpression', + CatchClause = 'CatchClause', + ClassBody = 'ClassBody', + ClassDeclaration = 'ClassDeclaration', + ClassExpression = 'ClassExpression', + ClassImplements = 'ClassImplements', + ClassProperty = 'ClassProperty', + ConditionalExpression = 'ConditionalExpression', + ContinueStatement = 'ContinueStatement', + DebuggerStatement = 'DebuggerStatement', + Decorator = 'Decorator', + DoWhileStatement = 'DoWhileStatement', + EmptyStatement = 'EmptyStatement', + ExportAllDeclaration = 'ExportAllDeclaration', + ExportDefaultDeclaration = 'ExportDefaultDeclaration', + ExportNamedDeclaration = 'ExportNamedDeclaration', + ExportSpecifier = 'ExportSpecifier', + ExpressionStatement = 'ExpressionStatement', + ForInStatement = 'ForInStatement', + ForOfStatement = 'ForOfStatement', + ForStatement = 'ForStatement', + FunctionDeclaration = 'FunctionDeclaration', + FunctionExpression = 'FunctionExpression', + GenericTypeAnnotation = 'GenericTypeAnnotation', + Identifier = 'Identifier', + IfStatement = 'IfStatement', + Import = 'Import', + ImportDeclaration = 'ImportDeclaration', + ImportDefaultSpecifier = 'ImportDefaultSpecifier', + ImportNamespaceSpecifier = 'ImportNamespaceSpecifier', + ImportSpecifier = 'ImportSpecifier', + JSXAttribute = 'JSXAttribute', + JSXClosingElement = 'JSXClosingElement', + JSXClosingFragment = 'JSXClosingFragment', + JSXElement = 'JSXElement', + JSXEmptyExpression = 'JSXEmptyExpression', + JSXExpressionContainer = 'JSXExpressionContainer', + JSXFragment = 'JSXFragment', + JSXIdentifier = 'JSXIdentifier', + JSXMemberExpression = 'JSXMemberExpression', + JSXNamespacedName = 'JSXNamespacedName', + JSXOpeningElement = 'JSXOpeningElement', + JSXOpeningFragment = 'JSXOpeningFragment', + JSXSpreadAttribute = 'JSXSpreadAttribute', + JSXSpreadChild = 'JSXSpreadChild', + JSXText = 'JSXText', + LabeledStatement = 'LabeledStatement', + Literal = 'Literal', + LogicalExpression = 'LogicalExpression', + MemberExpression = 'MemberExpression', + MetaProperty = 'MetaProperty', + MethodDefinition = 'MethodDefinition', + NewExpression = 'NewExpression', + ObjectExpression = 'ObjectExpression', + ObjectPattern = 'ObjectPattern', + Program = 'Program', + Property = 'Property', + RestElement = 'RestElement', + ReturnStatement = 'ReturnStatement', + SequenceExpression = 'SequenceExpression', + SpreadElement = 'SpreadElement', + Super = 'Super', + SwitchCase = 'SwitchCase', + SwitchStatement = 'SwitchStatement', + TaggedTemplateExpression = 'TaggedTemplateExpression', + TemplateElement = 'TemplateElement', + TemplateLiteral = 'TemplateLiteral', + ThisExpression = 'ThisExpression', + ThrowStatement = 'ThrowStatement', + TryStatement = 'TryStatement', + UnaryExpression = 'UnaryExpression', + UpdateExpression = 'UpdateExpression', + VariableDeclaration = 'VariableDeclaration', + VariableDeclarator = 'VariableDeclarator', + WhileStatement = 'WhileStatement', + WithStatement = 'WithStatement', + YieldExpression = 'YieldExpression', /** * TS-prefixed nodes */ - TSAbstractClassDeclaration: 'TSAbstractClassDeclaration', - TSAbstractClassProperty: 'TSAbstractClassProperty', - TSAbstractKeyword: 'TSAbstractKeyword', - TSAbstractMethodDefinition: 'TSAbstractMethodDefinition', - TSAnyKeyword: 'TSAnyKeyword', - TSArrayType: 'TSArrayType', - TSAsExpression: 'TSAsExpression', - TSAsyncKeyword: 'TSAsyncKeyword', - TSBooleanKeyword: 'TSBooleanKeyword', - TSBigIntKeyword: 'TSBigIntKeyword', - TSConditionalType: 'TSConditionalType', - TSConstructorType: 'TSConstructorType', - TSCallSignatureDeclaration: 'TSCallSignatureDeclaration', - TSConstructSignatureDeclaration: 'TSConstructSignatureDeclaration', - TSDeclareKeyword: 'TSDeclareKeyword', - TSDeclareFunction: 'TSDeclareFunction', - TSEnumDeclaration: 'TSEnumDeclaration', - TSEnumMember: 'TSEnumMember', - TSExportAssignment: 'TSExportAssignment', - TSExportKeyword: 'TSExportKeyword', - TSExternalModuleReference: 'TSExternalModuleReference', - TSImportType: 'TSImportType', - TSInferType: 'TSInferType', - TSLiteralType: 'TSLiteralType', - TSIndexedAccessType: 'TSIndexedAccessType', - TSIndexSignature: 'TSIndexSignature', - TSInterfaceBody: 'TSInterfaceBody', - TSInterfaceDeclaration: 'TSInterfaceDeclaration', - TSInterfaceHeritage: 'TSInterfaceHeritage', - TSImportEqualsDeclaration: 'TSImportEqualsDeclaration', - TSFunctionType: 'TSFunctionType', - TSMethodSignature: 'TSMethodSignature', - TSModuleBlock: 'TSModuleBlock', - TSModuleDeclaration: 'TSModuleDeclaration', - TSNamespaceFunctionDeclaration: 'TSNamespaceFunctionDeclaration', - TSNamespaceExportDeclaration: 'TSNamespaceExportDeclaration', - TSNonNullExpression: 'TSNonNullExpression', - TSNeverKeyword: 'TSNeverKeyword', - TSNullKeyword: 'TSNullKeyword', - TSNumberKeyword: 'TSNumberKeyword', - TSMappedType: 'TSMappedType', - TSObjectKeyword: 'TSObjectKeyword', - TSParameterProperty: 'TSParameterProperty', - TSPrivateKeyword: 'TSPrivateKeyword', - TSPropertySignature: 'TSPropertySignature', - TSProtectedKeyword: 'TSProtectedKeyword', - TSPublicKeyword: 'TSPublicKeyword', - TSQualifiedName: 'TSQualifiedName', - TSQuestionToken: 'TSQuestionToken', - TSReadonlyKeyword: 'TSReadonlyKeyword', - TSRestType: 'TSRestType', - TSStaticKeyword: 'TSStaticKeyword', - TSStringKeyword: 'TSStringKeyword', - TSSymbolKeyword: 'TSSymbolKeyword', - TSThisType: 'TSThisType', - TSTypeAnnotation: 'TSTypeAnnotation', - TSTypeAliasDeclaration: 'TSTypeAliasDeclaration', - TSTypeAssertion: 'TSTypeAssertion', - TSTypeLiteral: 'TSTypeLiteral', - TSTypeOperator: 'TSTypeOperator', - TSTypeParameter: 'TSTypeParameter', - TSTypeParameterDeclaration: 'TSTypeParameterDeclaration', - TSTypeParameterInstantiation: 'TSTypeParameterInstantiation', - TSTypePredicate: 'TSTypePredicate', - TSTypeReference: 'TSTypeReference', - TSTypeQuery: 'TSTypeQuery', - TSIntersectionType: 'TSIntersectionType', - TSTupleType: 'TSTupleType', - TSOptionalType: 'TSOptionalType', - TSParenthesizedType: 'TSParenthesizedType', - TSUnionType: 'TSUnionType', - TSUndefinedKeyword: 'TSUndefinedKeyword', - TSUnknownKeyword: 'TSUnknownKeyword', - TSVoidKeyword: 'TSVoidKeyword' -}; + TSAbstractClassDeclaration = 'TSAbstractClassDeclaration', + TSAbstractClassProperty = 'TSAbstractClassProperty', + TSAbstractKeyword = 'TSAbstractKeyword', + TSAbstractMethodDefinition = 'TSAbstractMethodDefinition', + TSAnyKeyword = 'TSAnyKeyword', + TSArrayType = 'TSArrayType', + TSAsExpression = 'TSAsExpression', + TSAsyncKeyword = 'TSAsyncKeyword', + TSBooleanKeyword = 'TSBooleanKeyword', + TSBigIntKeyword = 'TSBigIntKeyword', + TSConditionalType = 'TSConditionalType', + TSConstructorType = 'TSConstructorType', + TSCallSignatureDeclaration = 'TSCallSignatureDeclaration', + TSConstructSignatureDeclaration = 'TSConstructSignatureDeclaration', + TSDeclareKeyword = 'TSDeclareKeyword', + TSDeclareFunction = 'TSDeclareFunction', + TSEnumDeclaration = 'TSEnumDeclaration', + TSEnumMember = 'TSEnumMember', + TSExportAssignment = 'TSExportAssignment', + TSExportKeyword = 'TSExportKeyword', + TSExternalModuleReference = 'TSExternalModuleReference', + TSImportType = 'TSImportType', + TSInferType = 'TSInferType', + TSLiteralType = 'TSLiteralType', + TSIndexedAccessType = 'TSIndexedAccessType', + TSIndexSignature = 'TSIndexSignature', + TSInterfaceBody = 'TSInterfaceBody', + TSInterfaceDeclaration = 'TSInterfaceDeclaration', + TSInterfaceHeritage = 'TSInterfaceHeritage', + TSImportEqualsDeclaration = 'TSImportEqualsDeclaration', + TSFunctionType = 'TSFunctionType', + TSMethodSignature = 'TSMethodSignature', + TSModuleBlock = 'TSModuleBlock', + TSModuleDeclaration = 'TSModuleDeclaration', + TSNamespaceFunctionDeclaration = 'TSNamespaceFunctionDeclaration', + TSNamespaceExportDeclaration = 'TSNamespaceExportDeclaration', + TSNonNullExpression = 'TSNonNullExpression', + TSNeverKeyword = 'TSNeverKeyword', + TSNullKeyword = 'TSNullKeyword', + TSNumberKeyword = 'TSNumberKeyword', + TSMappedType = 'TSMappedType', + TSObjectKeyword = 'TSObjectKeyword', + TSParameterProperty = 'TSParameterProperty', + TSPrivateKeyword = 'TSPrivateKeyword', + TSPropertySignature = 'TSPropertySignature', + TSProtectedKeyword = 'TSProtectedKeyword', + TSPublicKeyword = 'TSPublicKeyword', + TSQualifiedName = 'TSQualifiedName', + TSQuestionToken = 'TSQuestionToken', + TSReadonlyKeyword = 'TSReadonlyKeyword', + TSRestType = 'TSRestType', + TSStaticKeyword = 'TSStaticKeyword', + TSStringKeyword = 'TSStringKeyword', + TSSymbolKeyword = 'TSSymbolKeyword', + TSThisType = 'TSThisType', + TSTypeAnnotation = 'TSTypeAnnotation', + TSTypeAliasDeclaration = 'TSTypeAliasDeclaration', + TSTypeAssertion = 'TSTypeAssertion', + TSTypeLiteral = 'TSTypeLiteral', + TSTypeOperator = 'TSTypeOperator', + TSTypeParameter = 'TSTypeParameter', + TSTypeParameterDeclaration = 'TSTypeParameterDeclaration', + TSTypeParameterInstantiation = 'TSTypeParameterInstantiation', + TSTypePredicate = 'TSTypePredicate', + TSTypeReference = 'TSTypeReference', + TSTypeQuery = 'TSTypeQuery', + TSIntersectionType = 'TSIntersectionType', + TSTupleType = 'TSTupleType', + TSOptionalType = 'TSOptionalType', + TSParenthesizedType = 'TSParenthesizedType', + TSUnionType = 'TSUnionType', + TSUndefinedKeyword = 'TSUndefinedKeyword', + TSUnknownKeyword = 'TSUnknownKeyword', + TSVoidKeyword = 'TSVoidKeyword' +} diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index dda9ceb2ac0e..4c7c9aa67139 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -9,7 +9,6 @@ import ts from 'typescript'; import nodeUtils from './node-utils'; import { ESTreeComment, - ESTreeToken, LineAndColumnData } from './temp-types-based-on-js-source'; @@ -32,7 +31,7 @@ function convertTypeScriptCommentToEsprimaComment( startLoc: LineAndColumnData, endLoc: LineAndColumnData ): ESTreeComment { - const comment: Partial = { + const comment: ESTreeComment = { type: block ? 'Block' : 'Line', value: text }; @@ -48,7 +47,7 @@ function convertTypeScriptCommentToEsprimaComment( }; } - return comment as ESTreeComment; + return comment; } /** diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 0c24aae9a136..bec24db42a59 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -78,7 +78,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * Create a new ESTree node */ let result: ESTreeNode = { - type: '', + type: '' as AST_NODE_TYPES, range: [node.getStart(ast), node.end], loc: nodeUtils.getLoc(node, ast) }; @@ -309,7 +309,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * @returns {void} */ function deeplyCopy(): void { - const customType = `TS${SyntaxKind[node.kind]}`; + const customType = `TS${SyntaxKind[node.kind]}` as AST_NODE_TYPES; /** * If the "errorOnUnknownASTType" option is set to true, throw an error, * otherwise fallback to just including the unknown type as-is. @@ -1480,8 +1480,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } if (node.type) { - (parameter as any).typeAnnotation = convertTypeAnnotation(node.type); - fixTypeAnnotationParentLocation(parameter as any); + parameter!.typeAnnotation = convertTypeAnnotation(node.type); + fixTypeAnnotationParentLocation(parameter!); } if (node.questionToken) { @@ -2255,7 +2255,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.VoidKeyword: case SyntaxKind.UndefinedKeyword: { Object.assign(result, { - type: AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`] + type: AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}` as AST_NODE_TYPES] }); break; } diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index 7def7f36a917..c328e9cd4cde 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -4,11 +4,13 @@ * They will be gradually replaced with the more accurate types derived from the ESTree spec, and its * applicable extensions */ +import { AST_NODE_TYPES } from './ast-node-types'; + export interface ESTreeToken { - type: string; - value: string; + type: AST_NODE_TYPES; range: [number, number]; loc: ESTreeNodeLoc; + value: string; regex?: { pattern: string; flags: string; @@ -19,9 +21,9 @@ export interface ESTreeToken { } export interface ESTreeNode { - type: string; - loc: ESTreeNodeLoc; + type: AST_NODE_TYPES; range: [number, number]; + loc: ESTreeNodeLoc; declaration?: ESTreeNode; specifiers?: (ESTreeNode | null)[]; source?: any; @@ -46,7 +48,12 @@ export interface ESTreeNode { directive?: string; } -export interface ESTreeComment extends ESTreeNode {} +export interface ESTreeComment { + type: 'Block' | 'Line'; + range?: [number, number]; + loc?: ESTreeNodeLoc; + value: string; +} export interface LineAndColumnData { line: number; From 4a0624d49e595b08cac010c182cfdcfa89168818 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 5 Jan 2019 23:25:46 +0100 Subject: [PATCH 53/84] fix: correct typo in parser options in word syntactic (#89) --- packages/typescript-estree/src/parser.ts | 15 +- .../src/temp-types-based-on-js-source.ts | 4 +- .../semantic-diagnostics-enabled.ts.snap | 1324 ++++++++--------- .../tests/lib/semantic-diagnostics-enabled.ts | 4 +- 4 files changed, 674 insertions(+), 673 deletions(-) diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index b4a7eb763eb3..1371b509f4be 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -61,7 +61,7 @@ function resetExtra(): void { log: console.log, projects: [], errorOnUnknownASTType: false, - errorOnTypeScriptSyntaticAndSemanticIssues: false, + errorOnTypeScriptSyntacticAndSemanticIssues: false, code: '', tsconfigRootDir: process.cwd(), extraFileExtensions: [] @@ -255,10 +255,11 @@ function generateAST( */ if ( shouldGenerateServices && - typeof options.errorOnTypeScriptSyntaticAndSemanticIssues === 'boolean' && - options.errorOnTypeScriptSyntaticAndSemanticIssues + typeof options.errorOnTypeScriptSyntacticAndSemanticIssues === + 'boolean' && + options.errorOnTypeScriptSyntacticAndSemanticIssues ) { - extra.errorOnTypeScriptSyntaticAndSemanticIssues = true; + extra.errorOnTypeScriptSyntacticAndSemanticIssues = true; } if (typeof options.useJSXTextNode === 'boolean' && options.useJSXTextNode) { @@ -329,7 +330,7 @@ function generateAST( * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, * there may be other syntactic or semantic issues in the code that we can optionally report on. */ - if (program && extra.errorOnTypeScriptSyntaticAndSemanticIssues) { + if (program && extra.errorOnTypeScriptSyntacticAndSemanticIssues) { const error = getFirstSemanticOrSyntacticError(program, ast); if (error) { throw convertError(error); @@ -358,9 +359,9 @@ export function parse( code: string, options?: T ) { - if (options && options.errorOnTypeScriptSyntaticAndSemanticIssues) { + if (options && options.errorOnTypeScriptSyntacticAndSemanticIssues) { throw new Error( - `"errorOnTypeScriptSyntaticAndSemanticIssues" is only supported for parseAndGenerateServices()` + `"errorOnTypeScriptSyntacticAndSemanticIssues" is only supported for parseAndGenerateServices()` ); } return generateAST(code, options).estree; diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index c328e9cd4cde..e46dd69c6e1e 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -67,7 +67,7 @@ export interface ESTreeNodeLoc { export interface Extra { errorOnUnknownASTType: boolean; - errorOnTypeScriptSyntaticAndSemanticIssues: boolean; + errorOnTypeScriptSyntacticAndSemanticIssues: boolean; useJSXTextNode: boolean; tokens: null | ESTreeToken[]; comment: boolean; @@ -90,7 +90,7 @@ export interface ParserOptions { comment?: boolean; jsx?: boolean; errorOnUnknownASTType?: boolean; - errorOnTypeScriptSyntaticAndSemanticIssues?: boolean; + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; useJSXTextNode?: boolean; loggerFn?: Function | false; project?: string | string[]; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 63ab831332a7..ec04d669fc16 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/block-trailing-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/block-trailing-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/comment-within-condition.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/comment-within-condition.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/export-default-anonymous-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/export-default-anonymous-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsdoc-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsdoc-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-block-comment.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-block-comment.src.js.src 1`] = ` Object { "column": 10, "index": 84, @@ -17,7 +17,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-jsx.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-jsx.src.js.src 1`] = ` Object { "column": 14, "index": 48, @@ -26,7 +26,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-self-closing-jsx.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-self-closing-jsx.src.js.src 1`] = ` Object { "column": 13, "index": 47, @@ -35,7 +35,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comments.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comments.src.js.src 1`] = ` Object { "column": 9, "index": 113, @@ -44,7 +44,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-multiline-non-comment.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-multiline-non-comment.src.js.src 1`] = ` Object { "column": 5, "index": 81, @@ -53,7 +53,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-url.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-url.src.js.src 1`] = ` Object { "column": 17, "index": 17, @@ -62,7 +62,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-with-greather-than.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-with-greather-than.src.js.src 1`] = ` Object { "column": 0, "index": 69, @@ -71,7 +71,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/jsx-with-operators.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-with-operators.src.js.src 1`] = ` Object { "column": 0, "index": 69, @@ -80,57 +80,57 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/line-comment-with-block-syntax.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/line-comment-with-block-syntax.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/mix-line-and-block-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/mix-line-and-block-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/no-comment-regex.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/no-comment-regex.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/no-comment-template.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/no-comment-template.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-call-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-call-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-debugger-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-debugger-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-return-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-return-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-throw-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-throw-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/surrounding-while-loop-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-while-loop-comments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment-in-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment-in-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-nested-functions.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-nested-functions.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/template-string-block.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/template-string-block.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/comments/type-assertion-regression-test.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/type-assertion-regression-test.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param-with-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param-with-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body-not-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body-not-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-dup-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-dup-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-missing-paren.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-missing-paren.src.js.src 1`] = ` Object { "column": 9, "index": 9, @@ -139,7 +139,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-not-arrow.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-not-arrow.src.js.src 1`] = ` Object { "column": 26, "index": 26, @@ -148,7 +148,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -157,7 +157,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js.src 1`] = ` Object { "column": 9, "index": 9, @@ -166,7 +166,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js.src 1`] = ` Object { "column": 1, "index": 1, @@ -175,29 +175,29 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-names.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-names.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-two-lines.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-two-lines.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-wrapped-param.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-wrapped-param.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -206,59 +206,59 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/iife.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/iife.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/multiple-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/multiple-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/no-auto-return.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/no-auto-return.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-arrow-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-arrow-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-sequence.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-sequence.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-parens.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-parens.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/delete-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/delete-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/do-while-statements.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/do-while-statements.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/identifiers-double-underscore.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/identifiers-double-underscore.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/instanceof.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/instanceof.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/new-with-member-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/new-with-member-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/new-without-parens.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/new-without-parens.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/typeof-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/typeof-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/update-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/update-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/basics/void-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/void-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/binary.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/binary.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/decimal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/decimal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/hex.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/hex.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/invalid.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/invalid.src.js.src 1`] = ` Object { "column": 4, "index": 4, @@ -267,77 +267,77 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/lowercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/lowercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/blockBindings/const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/blockBindings/const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let-in-switchcase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let-in-switchcase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-accessor-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-accessor-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-computed-static-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-computed-static-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-prototype.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-prototype.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-static.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-static.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-with-space.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-with-space.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method-super.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method-super.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-prototype.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-prototype.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-static.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-static.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-computed-static-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-computed-static-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-computed-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-computed-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-three-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-three-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-two-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-two-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-parameters.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-parameters.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-with-space.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-with-space.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-assign-to-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-assign-to-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-double-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-double-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/empty-literal-derived-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-literal-derived-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-setter-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-setter-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-two-super-classes.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-two-super-classes.src.js.src 1`] = ` Object { "column": 18, "index": 18, @@ -346,203 +346,203 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/named-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/named-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/classes/named-derived-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/named-derived-class-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/defaultParams/not-all-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/not-all-params.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-member.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-member.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-to-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-to-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-var-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-var-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-assign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-assign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-all.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-array-catch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-array-catch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-object-catch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-object-catch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/named-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/named-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-multi-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-multi-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring/sparse-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/sparse-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-forOf/loop.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-forOf/loop.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/complex-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/complex-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructuring-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructuring-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/multi-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/multi-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/not-final-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/not-final-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/single-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/single-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/block.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/block.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/directive-in-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/directive-in-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/function-non-strict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/function-non-strict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/non-directive-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/non-directive-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/program.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/program.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/program-order.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/program-order.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/directives/raw.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/raw.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-generators.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-generators.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js.src 1`] = ` Object { "column": 18, "index": 18, @@ -551,47 +551,47 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/exponentiationOperators/exponential-operators.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/exponentiationOperators/exponential-operators.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-loop.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-loop.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-coma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-coma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/for/for-with-let.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-let.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-bare-nonstrict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-bare-nonstrict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-destruction.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-destruction.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-object.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-object.src.js.src 1`] = ` Object { "column": 14, "index": 14, @@ -600,153 +600,153 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-bare-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-bare-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-const.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-milti-asigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-milti-asigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/anonymous-generator.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/anonymous-generator.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/double-yield.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/double-yield.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/empty-generator-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/empty-generator-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/generator-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/generator-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-delegation.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-delegation.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-in-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-in-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-no-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-no-semi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-no-arg.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-no-arg.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-true.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-true.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/importMeta/simple-import-meta.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/importMeta/simple-import-meta.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/labels/label-break.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/labels/label-break.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/labels/label-continue.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/labels/label-continue.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-delete.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/error-delete.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/error-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/error-strict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/error-strict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-value.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-value.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-batch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-batch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-anonymous-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-anonymous-function.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-as.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-as.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-jquery.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-jquery.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-module.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-module.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers-comma.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-namespace-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-namespace-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/import-null-as-nil.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-null-as-nil.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-await.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-await.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js.src 1`] = ` Object { "column": 0, "index": 9, @@ -755,7 +755,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-token.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-token.src.js.src 1`] = ` Object { "column": 9, "index": 9, @@ -764,7 +764,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default.src.js.src 1`] = ` Object { "column": 20, "index": 20, @@ -773,7 +773,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-equal.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-equal.src.js.src 1`] = ` Object { "column": 15, "index": 15, @@ -782,7 +782,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-token.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-token.src.js.src 1`] = ` Object { "column": 17, "index": 17, @@ -791,9 +791,9 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-extra-comma.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-extra-comma.src.js.src 1`] = ` Object { "column": 16, "index": 16, @@ -802,7 +802,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-middle-comma.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-middle-comma.src.js.src 1`] = ` Object { "column": 12, "index": 12, @@ -811,7 +811,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default.src.js.src 1`] = ` Object { "column": 7, "index": 7, @@ -820,7 +820,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named.src.js.src 1`] = ` Object { "column": 12, "index": 12, @@ -829,7 +829,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js.src 1`] = ` Object { "column": 17, "index": 17, @@ -838,7 +838,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js.src 1`] = ` Object { "column": 0, "index": 11, @@ -847,9 +847,9 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js.src 1`] = ` Object { "column": 0, "index": 20, @@ -858,9 +858,9 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-named.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-named.src.js.src 1`] = ` Object { "column": 12, "index": 12, @@ -869,7 +869,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-namespace.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-namespace.src.js.src 1`] = ` Object { "column": 15, "index": 15, @@ -878,7 +878,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js.src 1`] = ` Object { "column": 0, "index": 24, @@ -887,7 +887,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-extra-comma.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-extra-comma.src.js.src 1`] = ` Object { "column": 16, "index": 16, @@ -896,7 +896,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-middle-comma.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-middle-comma.src.js.src 1`] = ` Object { "column": 12, "index": 12, @@ -905,7 +905,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-after-named.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-after-named.src.js.src 1`] = ` Object { "column": 12, "index": 12, @@ -914,7 +914,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js.src 1`] = ` Object { "column": 9, "index": 9, @@ -923,25 +923,25 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-unknown-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-unknown-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/newTarget/simple-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/simple-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js.src 1`] = ` Object { "column": 0, "index": 20, @@ -950,7 +950,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -959,21 +959,21 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js.src 1`] = ` Object { "column": 13, "index": 19, @@ -982,23 +982,23 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/invalid.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/invalid.src.js.src 1`] = ` Object { "column": 4, "index": 4, @@ -1007,55 +1007,55 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/lowercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/lowercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/strict-uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/strict-uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/uppercase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regex/regexp-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regex/regexp-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/regexYFlag/regexp-y-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexYFlag/regexp-y-simple.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/basic-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/basic-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/class-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/class-constructor.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/class-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/class-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/error-no-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-no-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/error-not-last.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-not-last.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression-multi.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/invalid-rest-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/invalid-rest-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/restParams/single-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/single-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float-negative.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float-negative.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-null.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-null.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number-negative.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number-negative.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-if.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-if.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -1064,7 +1064,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-sequence.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-sequence.src.js.src 1`] = ` Object { "column": 4, "index": 4, @@ -1073,35 +1073,35 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/multi-function-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/multi-function-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/not-final-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/not-final-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/spread/simple-function-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/simple-function-call.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/deeply-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/deeply-nested.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/error-octal-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/error-octal-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/escape-characters.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/escape-characters.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/expressions.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/expressions.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/multi-line-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/multi-line-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/simple-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/simple-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/single-dollar-sign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/single-dollar-sign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-no-placeholders.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-no-placeholders.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-template-string.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js.src 1`] = ` Object { "column": 4, "index": 4, @@ -1110,7 +1110,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js.src 1`] = ` Object { "column": 10, "index": 10, @@ -1119,7 +1119,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/attributes.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/attributes.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1128,7 +1128,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/element-keyword-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/element-keyword-name.src.js.src 1`] = ` Object { "column": 12, "index": 18, @@ -1137,7 +1137,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-comment.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-comment.src.js.src 1`] = ` Object { "column": 30, "index": 30, @@ -1146,7 +1146,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-conditional.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-conditional.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1155,7 +1155,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-invalid-js-identifier.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-invalid-js-identifier.src.js.src 1`] = ` Object { "column": 9, "index": 9, @@ -1164,7 +1164,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/embedded-tags.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-tags.src.js.src 1`] = ` Object { "column": 11, "index": 11, @@ -1173,7 +1173,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/empty-placeholder.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/empty-placeholder.src.js.src 1`] = ` Object { "column": 7, "index": 7, @@ -1182,7 +1182,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/escape-patterns.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/escape-patterns.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1191,7 +1191,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1200,7 +1200,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute-missing-equals.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute-missing-equals.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1209,7 +1209,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-broken-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-broken-tag.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1218,7 +1218,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-end-tag-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-end-tag-name.src.js.src 1`] = ` Object { "column": 9, "index": 9, @@ -1227,7 +1227,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-string-end-tag-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-string-end-tag-name.src.js.src 1`] = ` Object { "column": 11, "index": 11, @@ -1236,7 +1236,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-embedded-expression.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-embedded-expression.src.js.src 1`] = ` Object { "column": 9, "index": 9, @@ -1245,7 +1245,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-leading-dot-tag-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-leading-dot-tag-name.src.js.src 1`] = ` Object { "column": 1, "index": 1, @@ -1254,7 +1254,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1263,7 +1263,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tag.src.js.src 1`] = ` Object { "column": 4, "index": 4, @@ -1272,7 +1272,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tags.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tags.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -1281,7 +1281,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-dot-tag-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-dot-tag-name.src.js.src 1`] = ` Object { "column": 8, "index": 8, @@ -1290,7 +1290,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-namespace-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-namespace-tag.src.js.src 1`] = ` Object { "column": 2, "index": 2, @@ -1299,7 +1299,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1308,7 +1308,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1317,7 +1317,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-name.src.js.src 1`] = ` Object { "column": 1, "index": 1, @@ -1326,7 +1326,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-value.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-value.src.js.src 1`] = ` Object { "column": 2, "index": 2, @@ -1335,7 +1335,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-spread-operator.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-spread-operator.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1344,7 +1344,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-name-with-docts.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-name-with-docts.src.js.src 1`] = ` Object { "column": 4, "index": 4, @@ -1353,7 +1353,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-value-with-dots.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-value-with-dots.src.js.src 1`] = ` Object { "column": 2, "index": 2, @@ -1362,7 +1362,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent.src.js.src 1`] = ` Object { "column": 36, "index": 36, @@ -1371,7 +1371,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent-with-comment.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent-with-comment.src.js.src 1`] = ` Object { "column": 38, "index": 38, @@ -1380,7 +1380,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-no-tag-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-no-tag-name.src.js.src 1`] = ` Object { "column": 1, "index": 1, @@ -1389,7 +1389,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-placeholder-in-closing-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-placeholder-in-closing-tag.src.js.src 1`] = ` Object { "column": 12, "index": 12, @@ -1398,7 +1398,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js.src 1`] = ` Object { "column": 1, "index": 1, @@ -1407,7 +1407,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-trailing-dot-tag-name.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-trailing-dot-tag-name.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1416,7 +1416,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/invalid-unexpected-comma.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-unexpected-comma.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -1425,7 +1425,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/japanese-characters.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/japanese-characters.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -1434,7 +1434,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/less-than-operator.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/less-than-operator.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -1443,7 +1443,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/member-expression.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/member-expression.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -1452,7 +1452,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/member-expression-this.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/member-expression-this.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1461,7 +1461,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/multiple-blank-spaces.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/multiple-blank-spaces.src.js.src 1`] = ` Object { "column": 8, "index": 8, @@ -1470,7 +1470,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/namespaced-attribute-and-value-inserted.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/namespaced-attribute-and-value-inserted.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1479,7 +1479,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/namespaced-name-and-attribute.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/namespaced-name-and-attribute.src.js.src 1`] = ` Object { "column": 2, "index": 2, @@ -1488,7 +1488,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/newslines-and-entities.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/newslines-and-entities.src.js.src 1`] = ` Object { "column": 4, "index": 4, @@ -1497,7 +1497,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1506,7 +1506,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-inside-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-inside-tag.src.js.src 1`] = ` Object { "column": 9, "index": 15, @@ -1515,7 +1515,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-with-newline.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-with-newline.src.js.src 1`] = ` Object { "column": 2, "index": 2, @@ -1524,7 +1524,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment.src.js.src 1`] = ` Object { "column": 1, "index": 1, @@ -1533,7 +1533,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment-with-child.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment-with-child.src.js.src 1`] = ` Object { "column": 1, "index": 1, @@ -1542,7 +1542,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/spread-child.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/spread-child.src.js.src 1`] = ` Object { "column": 15, "index": 15, @@ -1551,7 +1551,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1560,7 +1560,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attributes.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attributes.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1569,7 +1569,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-dots.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-dots.src.js.src 1`] = ` Object { "column": 6, "index": 6, @@ -1578,7 +1578,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-multi-dots.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-multi-dots.src.js.src 1`] = ` Object { "column": 8, "index": 8, @@ -1587,7 +1587,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/test-content.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/test-content.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1596,7 +1596,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/trailing-spread-operator-attribute.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/trailing-spread-operator-attribute.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1605,7 +1605,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx/unknown-escape-pattern.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/unknown-escape-pattern.src.js.src 1`] = ` Object { "column": 3, "index": 3, @@ -1614,7 +1614,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js.src 1`] = ` Object { "column": 9, "index": 15, @@ -1623,7 +1623,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/test-content.src.js.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/test-content.src.js.src 1`] = ` Object { "column": 5, "index": 5, @@ -1632,13 +1632,13 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/semanticInfo/export-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/semanticInfo/export-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/semanticInfo/import-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/semanticInfo/import-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/semanticInfo/isolated-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/semanticInfo/isolated-file.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/tsx/generic-jsx-element.src.tsx.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/tsx/generic-jsx-element.src.tsx.src 1`] = ` Object { "column": 21, "index": 21, @@ -1647,7 +1647,7 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/tsx/react-typed-props.src.tsx.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/tsx/react-typed-props.src.tsx.src 1`] = ` Object { "column": 12, "index": 141, @@ -1656,321 +1656,321 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-optional-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-optional-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-with-var-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-with-var-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures-with-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures-with-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi-assign.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi-assign.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-simple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-simple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-and-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-and-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method-default.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method-default.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-and-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-and-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-computed-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-computed-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-methods.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-methods.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-property-undefined.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-property-undefined.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-private-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-private-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-public-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-public-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-static-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-static-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-default.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-default.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/const-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/const-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/declare-class-with-optional-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/declare-class-with-optional-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/declare-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/declare-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-object.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-object.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-as-namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-as-namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-alias-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-alias-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-class-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-class-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-function-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-function-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-await.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-await.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types-assignation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types-assignation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-equal-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-equal-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-export-equal-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-export-equal-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-with-type-parameters-in-type-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-all-property-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-all-property-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-jsdoc.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-jsdoc.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/interface-without-type-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-without-type-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/keyof-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/keyof-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/nested-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/nested-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/never-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/never-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/non-null-assertion-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/non-null-assertion-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-escaped-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-escaped-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/symbol-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/symbol-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-object-without-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-object-without-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-parameters-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-parameters-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/type-reference-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-reference-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-bigint.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-bigint.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-boolean.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-boolean.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-false.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-false.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-never.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-never.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-number.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-number.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-object.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-object.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-string.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-string.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-symbol.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-symbol.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-true.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-true.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-undefined.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-undefined.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-unknown.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-unknown.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-void.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-void.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/typed-this.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-this.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/unique-symbol.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/unique-symbol.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/unknown-type-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/unknown-type-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-dotted-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-dotted-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/abstract-class.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/abstract-class.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/class.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/class.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/namespace.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/type-alias.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/type-alias.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/declare/variable.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/variable.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/enum-with-keywords.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/enum-with-keywords.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/solo-const.src.ts.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/solo-const.src.ts.src 1`] = ` Object { "column": 5, "index": 5, @@ -1979,82 +1979,82 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/expressions/call-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/call-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/expressions/new-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/new-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/array-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/array-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-simple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-simple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/conditional-with-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-with-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/literal-number.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-number.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/literal-string.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-string.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-minus.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-minus.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-plus.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-plus.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/nested-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/nested-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/parenthesized-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/parenthesized-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic-nested.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/this-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/this-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/this-type-expanded.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/this-type-expanded.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-empty.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-empty.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-optional.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-optional.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-rest.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-rest.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/tuple-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/type-literal.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/type-literal.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/type-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/type-operator.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/typeof.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/typeof.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/union-intersection.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/union-intersection.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled fixtures/typescript/types/union-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/union-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts index 498acd025a06..e983e6726b29 100644 --- a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts +++ b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.ts @@ -27,7 +27,7 @@ const testFiles = shelljs // Tests //------------------------------------------------------------------------------ -describe('Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" enabled', () => { +describe('Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled', () => { testFiles.forEach(filename => { const code = shelljs.cat(`${path.resolve(FIXTURES_DIR, filename)}`); const config = { @@ -35,7 +35,7 @@ describe('Parse all fixtures with "errorOnTypeScriptSyntaticAndSemanticIssues" e range: true, tokens: true, errorOnUnknownASTType: true, - errorOnTypeScriptSyntaticAndSemanticIssues: true + errorOnTypeScriptSyntacticAndSemanticIssues: true }; it(`fixtures/${filename}.src`, () => { expect.assertions(1); From 0b6afc0f268deefb969a8f5eb875b79f4f195439 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 5 Jan 2019 23:26:50 +0100 Subject: [PATCH 54/84] refactor: remove dead code from NamedImports (#90) --- packages/typescript-estree/src/convert.ts | 34 ++++++++--------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index bec24db42a59..c438555e495d 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1586,9 +1586,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { body: { type: AST_NODE_TYPES.ClassBody, body: [], - - // TODO: Fix location info - range: [openBrace.getStart(ast), result.range[1]], + range: [openBrace.getStart(ast), node.end], loc: nodeUtils.getLocFor(openBrace.getStart(ast), node.end, ast) }, superClass: @@ -1648,20 +1646,20 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } if (node.importClause.namedBindings) { - if ( - node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport - ) { - result.specifiers!.push( - convertChild(node.importClause.namedBindings) - ); - } else { - result.specifiers = result.specifiers!.concat( - node.importClause.namedBindings.elements.map(convertChild) - ); + switch (node.importClause.namedBindings.kind) { + case SyntaxKind.NamespaceImport: + result.specifiers!.push( + convertChild(node.importClause.namedBindings) + ); + break; + case SyntaxKind.NamedImports: + result.specifiers = result.specifiers!.concat( + node.importClause.namedBindings.elements.map(convertChild) + ); + break; } } } - break; case SyntaxKind.NamespaceImport: @@ -1690,14 +1688,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.loc = nodeUtils.getLocFor(result.range[0], result.range[1], ast); break; - case SyntaxKind.NamedImports: - // TODO: node has no name field - Object.assign(result, { - type: AST_NODE_TYPES.ImportDefaultSpecifier, - local: convertChild((node as any).name) - }); - break; - case SyntaxKind.ExportDeclaration: if (node.exportClause) { Object.assign(result, { From f282f9c0ceb326386989b54baa2ecb12e0b240e0 Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 6 Jan 2019 13:30:04 +0100 Subject: [PATCH 55/84] feat: update TSFunctionType and TSConstructorType nodes (#91) BREAKING CHANGE: This changes the AST for TSFunctionType and TSConstructorType nodes --- packages/typescript-estree/src/convert.ts | 33 +- .../tests/ast-alignment/fixtures-to-test.ts | 10 +- .../tests/ast-alignment/utils.ts | 26 + .../types/constructor-generic.src.ts | 1 + .../types/constructor-in-generic.src.ts | 1 + .../types/constructor-with-rest.src.ts | 1 + .../typescript/types/constructor.src.ts | 1 + .../typescript/types/function-generic.src.ts | 1 + .../types/function-in-generic.src.ts | 1 + .../types/function-with-rest.src.ts | 1 + .../types/function-with-this.src.ts | 1 + .../fixtures/typescript/types/function.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 18 + .../lib/__snapshots__/typescript.ts.snap | 4432 ++++++++++++++++- 14 files changed, 4502 insertions(+), 26 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/constructor-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/constructor-in-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/constructor-with-rest.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/constructor.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/function-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/function-in-generic.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/function-with-rest.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/function-with-this.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/function.src.ts diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index c438555e495d..6b14b69a401e 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -122,7 +122,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { */ function convertTypeAnnotation(child: ts.TypeNode): ESTreeNode { const annotation = convertChildType(child); - const annotationStartCol = child.getFullStart() - 1; + // in FunctionType and ConstructorType typeAnnotation has 2 characters `=>` and in other places is just colon + const offset = + node.kind === SyntaxKind.FunctionType || + node.kind === SyntaxKind.ConstructorType + ? 2 + : 1; + const annotationStartCol = child.getFullStart() - offset; + const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); return { type: AST_NODE_TYPES.TSTypeAnnotation, @@ -2439,14 +2446,28 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; } - + case SyntaxKind.ConstructorType: + case SyntaxKind.FunctionType: case SyntaxKind.ConstructSignature: case SyntaxKind.CallSignature: { + let type: AST_NODE_TYPES; + switch (node.kind) { + case SyntaxKind.ConstructSignature: + type = AST_NODE_TYPES.TSConstructSignatureDeclaration; + break; + case SyntaxKind.CallSignature: + type = AST_NODE_TYPES.TSCallSignatureDeclaration; + break; + case SyntaxKind.FunctionType: + type = AST_NODE_TYPES.TSFunctionType; + break; + case SyntaxKind.ConstructorType: + default: + type = AST_NODE_TYPES.TSConstructorType; + break; + } Object.assign(result, { - type: - node.kind === SyntaxKind.ConstructSignature - ? AST_NODE_TYPES.TSConstructSignatureDeclaration - : AST_NODE_TYPES.TSCallSignatureDeclaration, + type: type, params: convertParameters(node.parameters) }); diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index c30b382e3a08..5d24ecf88a8d 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -384,7 +384,6 @@ tester.addFixturePatternConfig('typescript/basics', { 'interface-with-optional-properties', 'interface-without-type-annotation', 'typed-this', - 'export-type-function-declaration', 'abstract-interface', /** * Babel bug for optional or abstract methods? @@ -480,7 +479,14 @@ tester.addFixturePatternConfig('typescript/errorRecovery', { }); tester.addFixturePatternConfig('typescript/types', { - fileType: 'ts' + fileType: 'ts', + ignore: [ + /** + * AST difference + */ + 'function-with-rest', + 'constructor-with-rest' + ] }); tester.addFixturePatternConfig('typescript/declare', { diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 52bffc8c957c..0aab1de9a118 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -168,6 +168,32 @@ export function preprocessBabylonAST(ast: any): any { node.params = node.parameters; delete node.parameters; } + }, + /** + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/9231 + */ + TSFunctionType(node: any) { + if (node.typeAnnotation) { + node.returnType = node.typeAnnotation; + delete node.typeAnnotation; + } + if (node.parameters) { + node.params = node.parameters; + delete node.parameters; + } + }, + /** + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/9231 + */ + TSConstructorType(node: any) { + if (node.typeAnnotation) { + node.returnType = node.typeAnnotation; + delete node.typeAnnotation; + } + if (node.parameters) { + node.params = node.parameters; + delete node.parameters; + } } } ); diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/constructor-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/constructor-generic.src.ts new file mode 100644 index 000000000000..f16a76dffead --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/constructor-generic.src.ts @@ -0,0 +1 @@ +let f: new (a: T) => T; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/constructor-in-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/constructor-in-generic.src.ts new file mode 100644 index 000000000000..d9ea30e59835 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/constructor-in-generic.src.ts @@ -0,0 +1 @@ +let x: Array string>; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/constructor-with-rest.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/constructor-with-rest.src.ts new file mode 100644 index 000000000000..c3d9b7e1dff0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/constructor-with-rest.src.ts @@ -0,0 +1 @@ +let f: new (...a: number[]) => void; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/constructor.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/constructor.src.ts new file mode 100644 index 000000000000..d24054773938 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/constructor.src.ts @@ -0,0 +1 @@ +let f: new (a: number, b?: number) => void; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/function-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/function-generic.src.ts new file mode 100644 index 000000000000..61d8ece714c9 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/function-generic.src.ts @@ -0,0 +1 @@ +let f: (a: T) => T; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/function-in-generic.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/function-in-generic.src.ts new file mode 100644 index 000000000000..6b9a571a7c61 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/function-in-generic.src.ts @@ -0,0 +1 @@ +let x: Array<() => void>; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/function-with-rest.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/function-with-rest.src.ts new file mode 100644 index 000000000000..7dabdd6cf108 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/function-with-rest.src.ts @@ -0,0 +1 @@ +let f: (...a: number[]) => void; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/function-with-this.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/function-with-this.src.ts new file mode 100644 index 000000000000..cd13ed098d71 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/function-with-this.src.ts @@ -0,0 +1 @@ +let f: (this: number) => void; diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/function.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/function.src.ts new file mode 100644 index 000000000000..b82de113da30 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/function.src.ts @@ -0,0 +1 @@ +let f: (a: number, b?: number) => void; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index ec04d669fc16..e29c7a29e9e5 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -2009,6 +2009,24 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-with-null.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-in-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-with-rest.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-in-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-with-rest.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-with-this.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 8f61fb2d30b1..2e840e13c4a8 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -13613,7 +13613,7 @@ Object { "line": 9, }, }, - "parameters": Array [ + "params": Array [ Object { "argument": Object { "loc": Object { @@ -13705,20 +13705,19 @@ Object { 180, 205, ], - "type": "TSConstructorType", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 47, "line": 9, }, "start": Object { - "column": 44, + "column": 43, "line": 9, }, }, "range": Array [ - 202, + 201, 205, ], "type": "TSTypeAnnotation", @@ -13758,7 +13757,7 @@ Object { }, }, }, - "typeParameters": null, + "type": "TSConstructorType", }, "typeParameters": Object { "loc": Object { @@ -31199,7 +31198,7 @@ Object { "line": 1, }, }, - "parameters": Array [ + "params": Array [ Object { "loc": Object { "end": Object { @@ -31257,20 +31256,19 @@ Object { 27, 46, ], - "type": "TSFunctionType", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 46, "line": 1, }, "start": Object { - "column": 40, + "column": 39, "line": 1, }, }, "range": Array [ - 40, + 39, 46, ], "type": "TSTypeAnnotation", @@ -31292,7 +31290,7 @@ Object { "type": "TSVoidKeyword", }, }, - "typeParameters": null, + "type": "TSFunctionType", }, }, "loc": Object { @@ -54029,7 +54027,7 @@ Object { "line": 2, }, }, - "parameters": Array [ + "params": Array [ Object { "loc": Object { "end": Object { @@ -54157,20 +54155,19 @@ Object { 49, 79, ], - "type": "TSFunctionType", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 57, "line": 2, }, "start": Object { - "column": 51, + "column": 50, "line": 2, }, }, "range": Array [ - 73, + 72, 79, ], "type": "TSTypeAnnotation", @@ -54192,7 +54189,7 @@ Object { "type": "TSVoidKeyword", }, }, - "typeParameters": null, + "type": "TSFunctionType", }, }, }, @@ -85001,6 +84998,4405 @@ Object { } `; +exports[`typescript fixtures/types/constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 42, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "TSNumberKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "b", + "optional": true, + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 7, + 42, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 42, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSConstructorType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 42, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 43, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 37, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 42, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/constructor-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 25, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 25, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 7, + 25, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + }, + }, + "type": "TSConstructorType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 14, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/constructor-in-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 30, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 30, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 30, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 29, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "TSStringKeyword", + }, + }, + "type": "TSConstructorType", + }, + ], + "range": Array [ + 12, + 30, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/constructor-with-rest.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 35, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 15, + 26, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 26, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "TSNumberKeyword", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 26, + ], + "type": "TSArrayType", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 26, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 7, + 35, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 35, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSConstructorType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 35, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 35, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/function.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 38, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 8, + 17, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSNumberKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "b", + "optional": true, + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 7, + 38, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 38, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSFunctionType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 38, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 33, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 38, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/function-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 21, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 21, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 7, + 21, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + }, + }, + "type": "TSFunctionType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 8, + 9, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 7, + 10, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/function-in-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 24, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 24, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 24, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 23, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSFunctionType", + }, + ], + "range": Array [ + 12, + 24, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 24, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/function-with-rest.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 31, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 31, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 22, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "TSNumberKeyword", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 22, + ], + "type": "TSArrayType", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 22, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 7, + 31, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 31, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSFunctionType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 31, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/function-with-this.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "this", + "range": Array [ + 8, + 20, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 20, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 7, + 29, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 29, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSFunctionType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 12, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 29, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/types/indexed.src 1`] = ` Object { "body": Array [ From c839243d6a8c21176b46af3c5ed1eb5289a7779a Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 6 Jan 2019 13:30:34 +0100 Subject: [PATCH 56/84] refactor: improve types and add comments (#92) --- .../typescript-estree/src/convert-comments.ts | 4 +- packages/typescript-estree/src/convert.ts | 8 +-- packages/typescript-estree/src/node-utils.ts | 57 +++++++++++-------- .../src/temp-types-based-on-js-source.ts | 1 + .../tests/ast-alignment/fixtures-to-test.ts | 2 + 5 files changed, 41 insertions(+), 31 deletions(-) diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index 4c7c9aa67139..31d83cc1b7bc 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -118,7 +118,7 @@ export function convertComments( const start = triviaScanner.getTokenPos(); const end = triviaScanner.getTextPos(); - let container: ts.Token | null = null; + let container: ts.Node | null = null; switch (kind) { case ts.SyntaxKind.SingleLineCommentTrivia: case ts.SyntaxKind.MultiLineCommentTrivia: { @@ -153,7 +153,7 @@ export function convertComments( break; case ts.SyntaxKind.SlashToken: case ts.SyntaxKind.SlashEqualsToken: - container = nodeUtils.getNodeContainer(ast, start, end) as ts.Node; + container = nodeUtils.getNodeContainer(ast, start, end); if (container.kind === ts.SyntaxKind.RegularExpressionLiteral) { kind = triviaScanner.reScanSlashToken(); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 6b14b69a401e..7302f43aeec4 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -694,7 +694,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // Process returnType if (node.type) { - (result as any).returnType = convertTypeAnnotation(node.type); + result.returnType = convertTypeAnnotation(node.type); } if (functionDeclarationType === AST_NODE_TYPES.TSDeclareFunction) { @@ -1214,7 +1214,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // Process returnType if (node.type) { - (result as any).returnType = convertTypeAnnotation(node.type); + result.returnType = convertTypeAnnotation(node.type); } // Process typeParameters @@ -1322,7 +1322,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // Process returnType if (node.type) { - (result as any).returnType = convertTypeAnnotation(node.type); + result.returnType = convertTypeAnnotation(node.type); } // Process typeParameters @@ -2472,7 +2472,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); if (node.type) { - (result as any).returnType = convertTypeAnnotation(node.type); + result.returnType = convertTypeAnnotation(node.type); } if (node.typeParameters) { diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 81564e969897..75b8548ec4f4 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -171,7 +171,9 @@ export default { * @param {ts.Token} operator the operator token * @returns {boolean} is assignment */ -function isAssignmentOperator(operator: ts.Token): boolean { +function isAssignmentOperator( + operator: ts.Token +): boolean { return ASSIGNMENT_OPERATORS.indexOf(operator.kind) > -1; } @@ -180,7 +182,7 @@ function isAssignmentOperator(operator: ts.Token): boolean { * @param {ts.Token} operator the operator token * @returns {boolean} is a logical operator */ -function isLogicalOperator(operator: ts.Token): boolean { +function isLogicalOperator(operator: ts.Token): boolean { return LOGICAL_OPERATORS.indexOf(operator.kind) > -1; } @@ -221,10 +223,10 @@ function hasModifier( /** * Returns true if the given ts.Token is a comma - * @param {ts.Token} token the TypeScript token + * @param {ts.Node} token the TypeScript token * @returns {boolean} is comma */ -function isComma(token: ts.Token): boolean { +function isComma(token: ts.Node): boolean { return token.kind === SyntaxKind.CommaToken; } @@ -254,7 +256,12 @@ function isJSDocComment(node: ts.Node): boolean { * @param {ts.Token} operator the operator token * @returns {string} the binary expression type */ -function getBinaryExpressionType(operator: ts.Token): string { +function getBinaryExpressionType( + operator: ts.Token +): + | AST_NODE_TYPES.AssignmentExpression + | AST_NODE_TYPES.LogicalExpression + | AST_NODE_TYPES.BinaryExpression { if (isAssignmentOperator(operator)) { return AST_NODE_TYPES.AssignmentExpression; } else if (isLogicalOperator(operator)) { @@ -322,14 +329,11 @@ function canContainDirective(node: ts.Node): boolean { /** * Returns line and column data for the given ts.Node or ts.Token, * for the given AST - * @param {ts.Token|TSNode} nodeOrToken the ts.Node or ts.Token + * @param {ts.Node} nodeOrToken the ts.Node or ts.Token * @param {ts.SourceFile} ast the AST object * @returns {ESTreeLoc} the loc data */ -function getLoc( - nodeOrToken: TSNode | ts.Token, - ast: ts.SourceFile -): ESTreeNodeLoc { +function getLoc(nodeOrToken: ts.Node, ast: ts.SourceFile): ESTreeNodeLoc { return getLocFor(nodeOrToken.getStart(ast), nodeOrToken.end, ast); } @@ -403,19 +407,19 @@ function getTSNodeAccessibility( /** * Finds the next token based on the previous one and its parent * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren - * @param {ts.Token} previousToken The previous TSToken + * @param {ts.Node} previousToken The previous TSToken * @param {ts.Node} parent The parent TSNode * @param {ts.SourceFile} ast The TS AST - * @returns {ts.Token} the next TSToken + * @returns {ts.Node|undefined} the next TSToken */ function findNextToken( - previousToken: ts.Token, + previousToken: ts.Node, parent: ts.Node, ast: ts.SourceFile -): ts.Token | undefined { +): ts.Node | undefined { return find(parent); - function find(n: ts.Node): ts.Token | undefined { + function find(n: ts.Node): ts.Node | undefined { if (ts.isToken(n) && n.pos === previousToken.end) { // this is token that starts at the end of previous token - return it return n; @@ -435,18 +439,18 @@ function findNextToken( /** * Find the first matching token based on the given predicate function. - * @param {ts.Token} previousToken The previous ts.Token + * @param {ts.Node} previousToken The previous ts.Token * @param {ts.Node} parent The parent ts.Node * @param {Function} predicate The predicate function to apply to each checked token * @param {ts.SourceFile} ast The TS AST - * @returns {ts.Token|undefined} a matching ts.Token + * @returns {ts.Node|undefined} a matching ts.Token */ function findFirstMatchingToken( - previousToken: ts.Token | undefined, + previousToken: ts.Node | undefined, parent: ts.Node, predicate: (node: ts.Node) => boolean, ast: ts.SourceFile -): ts.Token | undefined { +): ts.Node | undefined { while (previousToken) { if (predicate(previousToken)) { return previousToken; @@ -493,10 +497,13 @@ function findFirstMatchingAncestor( /** * Finds the first parent ts.Node which matches the given kind * @param {ts.Node} node The current ts.Node - * @param {number} kind The ts.Node kind to match against + * @param {ts.SyntaxKind} kind The ts.Node kind to match against * @returns {ts.Node|undefined} a matching parent ts.Node */ -function findAncestorOfKind(node: ts.Node, kind: number): ts.Node | undefined { +function findAncestorOfKind( + node: ts.Node, + kind: ts.SyntaxKind +): ts.Node | undefined { return findFirstMatchingAncestor(node, parent => parent.kind === kind); } @@ -563,8 +570,8 @@ function fixExports( result.loc = getLocFor(result.range[0], result.range[1], ast); const declarationType = declarationIsDefault - ? 'ExportDefaultDeclaration' - : 'ExportNamedDeclaration'; + ? AST_NODE_TYPES.ExportDefaultDeclaration + : AST_NODE_TYPES.ExportNamedDeclaration; const newResult: any = { type: declarationType, @@ -693,11 +700,11 @@ function getTokenType(token: any): string { /** * Extends and formats a given ts.Token, for a given AST - * @param {ts.Token} token the ts.Token + * @param {ts.Node} token the ts.Token * @param {ts.SourceFile} ast the AST object * @returns {ESTreeToken} the converted ESTreeToken */ -function convertToken(token: ts.Token, ast: ts.SourceFile): ESTreeToken { +function convertToken(token: ts.Node, ast: ts.SourceFile): ESTreeToken { const start = token.kind === SyntaxKind.JsxText ? token.getFullStart() diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index e46dd69c6e1e..f834c17c15d5 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -46,6 +46,7 @@ export interface ESTreeNode { abstract?: boolean; typeName?: ESTreeNode | null; directive?: string; + returnType?: ESTreeNode; } export interface ESTreeComment { diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 5d24ecf88a8d..9a041ed51def 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -393,6 +393,7 @@ tester.addFixturePatternConfig('typescript/basics', { 'declare-class-with-optional-method', // babel parse errors /** * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/6679 + * TODO: remove me in next babel > 7.2.3 */ 'class-with-private-parameter-properties', 'class-with-protected-parameter-properties', @@ -421,6 +422,7 @@ tester.addFixturePatternConfig('typescript/basics', { 'directive-in-namespace', /** * there is difference in range between babel and tsep + * https://github.com/babel/babel/issues/9282 */ 'type-assertion' ], From 9c60f35a616211d6289c143d0bd2d359f080df99 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 6 Jan 2019 08:41:41 -0500 Subject: [PATCH 57/84] feat: report on TS 1141, enable semantic errors for AST comparison (#93) --- .../typescript-estree/src/semantic-errors.ts | 45 +++++++++++++------ .../tests/ast-alignment/fixtures-to-test.ts | 23 +++------- .../tests/ast-alignment/parse.ts | 10 ++++- .../tests/ast-alignment/spec.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 18 +++++++- 5 files changed, 64 insertions(+), 33 deletions(-) diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index e481236e9131..4465d3a2ea15 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -15,23 +15,38 @@ export function getFirstSemanticOrSyntacticError( program: ts.Program, ast: ts.SourceFile ): SemanticOrSyntacticError | undefined { - const supportedSyntacticDiagnostics = whitelistSupportedDiagnostics( - program.getSyntacticDiagnostics(ast) - ); - if (supportedSyntacticDiagnostics.length) { - return convertDiagnosticToSemanticOrSyntacticError( - supportedSyntacticDiagnostics[0] + try { + const supportedSyntacticDiagnostics = whitelistSupportedDiagnostics( + program.getSyntacticDiagnostics(ast) ); - } - const supportedSemanticDiagnostics = whitelistSupportedDiagnostics( - program.getSemanticDiagnostics(ast) - ); - if (supportedSemanticDiagnostics.length) { - return convertDiagnosticToSemanticOrSyntacticError( - supportedSemanticDiagnostics[0] + if (supportedSyntacticDiagnostics.length) { + return convertDiagnosticToSemanticOrSyntacticError( + supportedSyntacticDiagnostics[0] + ); + } + const supportedSemanticDiagnostics = whitelistSupportedDiagnostics( + program.getSemanticDiagnostics(ast) ); + if (supportedSemanticDiagnostics.length) { + return convertDiagnosticToSemanticOrSyntacticError( + supportedSemanticDiagnostics[0] + ); + } + return undefined; + } catch (e) { + /** + * TypeScript compiler has certain Debug.fail() statements in, which will cause the diagnostics + * retrieval above to throw. + * + * E.g. from ast-alignment-tests + * "Debug Failure. Shouldn't ever directly check a JsxOpeningElement" + * + * For our current use-cases this is undesired behavior, so we just suppress it + * and log a a warning. + */ + console.warn(`Warning From TSC: "${e.message}`); + return undefined; } - return undefined; } function whitelistSupportedDiagnostics( @@ -41,6 +56,8 @@ function whitelistSupportedDiagnostics( switch (diagnostic.code) { case 1123: // ts 3.2: "Variable declaration list cannot be empty." return true; + case 1141: // ts 3.2 "String literal expected." + return true; } return false; }); diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 9a041ed51def..de982acfcfb7 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -248,13 +248,9 @@ tester.addFixturePatternConfig('javascript/labels'); tester.addFixturePatternConfig('javascript/modules', { ignore: [ /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. + * Expected babel parse errors - ts-estree is not currently throwing */ - 'invalid-export-named-default', // babel parse errors - 'invalid-import-default-module-specifier', // babel parse errors - 'invalid-import-module-specifier' // babel parse errors + 'invalid-export-named-default' // babel parse errors ], ignoreSourceType: ['error-function', 'error-strict', 'error-delete'] }); @@ -392,7 +388,7 @@ tester.addFixturePatternConfig('typescript/basics', { 'abstract-class-with-optional-method', // babel parse errors 'declare-class-with-optional-method', // babel parse errors /** - * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/6679 + * Reported and resolved Babel issue https://github.com/babel/babel/issues/6679 * TODO: remove me in next babel > 7.2.3 */ 'class-with-private-parameter-properties', @@ -401,13 +397,13 @@ tester.addFixturePatternConfig('typescript/basics', { 'class-with-readonly-parameter-properties', /** * Not yet supported in Babel https://github.com/babel/babel/issues/7749 + * WIP PR is https://github.com/babel/babel/pull/8798 */ 'import-type', 'import-type-with-type-parameters-in-type-reference', /** - * babel is not supporting it yet https://github.com/babel/babel/pull/9230 - * Babel: TSTypeReference -> Identifier - * tsep: TSBigIntKeyword + * PR for BigInt support has been merged into Babel: https://github.com/babel/babel/pull/9230 + * TODO: remove me in next babel > 7.2.3 */ 'typed-keyword-bigint', /** @@ -415,14 +411,9 @@ tester.addFixturePatternConfig('typescript/basics', { * Directive field is not added to module and namespace */ 'directive-in-module', - /** - * Not yet supported in Babel https://github.com/babel/babel/issues/9228 - * Directive field is not added to module and namespace - */ 'directive-in-namespace', /** - * there is difference in range between babel and tsep - * https://github.com/babel/babel/issues/9282 + * Babel range bug, which will be fixed by https://github.com/babel/babel/pull/9284 */ 'type-assertion' ], diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 1e0c3198b4d8..407346455311 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -41,15 +41,23 @@ function parseWithBabelParser(text: string, jsx: boolean = true) { function parseWithTypeScriptESTree(text: string, jsx: boolean = true) { try { - return parser.parse(text, { + const result = parser.parseAndGenerateServices(text, { loc: true, range: true, tokens: false, comment: false, useJSXTextNode: true, errorOnUnknownASTType: true, + /** + * Babel will always throw on these types of issues, so we enable + * them in typescript-estree when comparing behavior between the + * two parsers. By default, the TypeScript compiler is much more + * forgiving. + */ + errorOnTypeScriptSyntacticAndSemanticIssues: true, jsx }); + return result.ast; } catch (e) { throw createError(e.message, e.lineNumber, e.column); } diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index 2f27fb2834d7..9d8896333207 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -40,6 +40,7 @@ fixturesToTest.forEach(fixture => { } /** * Both parsers errored - this is OK as long as the errors are of the same "type" + * E.g. Both must be a SyntaxError, or both must be a RangeError etc. */ it(`[Both parsers error as expected] - ${filename}`, () => { expect(babelParserResult.parseError.name).toEqual( diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index e29c7a29e9e5..e6641f64db56 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -847,7 +847,14 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-module-specifier.src.js.src 1`] = ` +Object { + "column": 16, + "index": 16, + "lineNumber": 1, + "message": "String literal expected.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js.src 1`] = ` Object { @@ -858,7 +865,14 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-module-specifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-module-specifier.src.js.src 1`] = ` +Object { + "column": 18, + "index": 18, + "lineNumber": 1, + "message": "String literal expected.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-named.src.js.src 1`] = ` Object { From 7bdab68c342225cec42569c17aee557c231e2c2f Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 6 Jan 2019 09:17:24 -0500 Subject: [PATCH 58/84] feat(diagnostics): report on TS 1121 and TS 1200 (#94) --- .../typescript-estree/src/semantic-errors.ts | 4 +++ .../tests/ast-alignment/fixtures-to-test.ts | 31 +++++++++++-------- .../tests/ast-alignment/spec.ts | 4 +-- .../semantic-diagnostics-enabled.ts.snap | 18 +++++++++-- 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index 4465d3a2ea15..f1d48fe31482 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -54,10 +54,14 @@ function whitelistSupportedDiagnostics( ): ReadonlyArray { return diagnostics.filter(diagnostic => { switch (diagnostic.code) { + case 1121: + return true; // ts 3.2 "Octal literals are not allowed in strict mode." case 1123: // ts 3.2: "Variable declaration list cannot be empty." return true; case 1141: // ts 3.2 "String literal expected." return true; + case 1200: + return true; // ts 3.2 "Line terminator not permitted before arrow." } return false; }); diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index de982acfcfb7..6dfe6b89df78 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -106,7 +106,7 @@ const jsxFilesWithKnownIssues = jsxKnownIssues.map(f => f.replace('jsx/', '')); /** * Current random error difference on jsx/invalid-no-tag-name.src.js - * TSEP - SyntaxError + * ts-estree - SyntaxError * Babel - RangeError * * Reported here: https://github.com/babel/babel/issues/6680 @@ -151,11 +151,16 @@ tester.addFixturePatternConfig('javascript/arrowFunctions', { * Expected babel parse errors - all of these files below produce parse errors in espree * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree * does not actually error on them and will produce an AST. + * + * We are also unable to leverage diagnostics effectively here. The relevant TypeScript diagnostic is: + * + * (ts 3.2) 2300 "Duplicate identifier '{0}'." + * + * ...but this is heavily overloaded. It will also report an error for an object with two properties + * with the same name, for example. */ 'error-dup-params', // babel parse errors - 'error-strict-dup-params', // babel parse errors - 'error-strict-octal', // babel parse errors - 'error-two-lines' // babel parse errors + 'error-strict-dup-params' // babel parse errors ] }); @@ -219,7 +224,7 @@ tester.addFixturePatternConfig('javascript/forIn', { ignore: [ /** * Error: AST difference - * tsep: AssignmentExpression + * ts-estree: AssignmentExpression * babel: AssignmentPattern */ 'for-in-with-bare-assigment', @@ -345,22 +350,22 @@ tester.addFixturePatternConfig('typescript/basics', { 'interface-with-all-property-types', // babel parse errors 'interface-with-construct-signature-with-parameter-accessibility', // babel parse errors /** - * there is difference in range between babel and tsep + * there is difference in range between babel and ts-estree */ 'arrow-function-with-type-parameters', // typescript-estree parse errors /** * Babel: ClassDeclaration + abstract: true - * tsep: TSAbstractClassDeclaration + * ts-estree: TSAbstractClassDeclaration */ 'abstract-class-with-abstract-properties', /** * Babel: ClassProperty + abstract: true - * tsep: TSAbstractClassProperty + * ts-estree: TSAbstractClassProperty */ 'abstract-class-with-abstract-readonly-property', /** * Babel: TSExpressionWithTypeArguments - * tsep: ClassImplements + * ts-estree: ClassImplements */ 'class-with-implements-generic-multiple', 'class-with-implements-generic', @@ -445,7 +450,7 @@ tester.addFixturePatternConfig('typescript/expressions', { fileType: 'ts', ignore: [ /** - * there is difference in range between babel and tsep + * there is difference in range between babel and ts-estree */ 'tagged-template-expression-type-arguments' ] @@ -487,13 +492,13 @@ tester.addFixturePatternConfig('typescript/declare', { ignore: [ /** * AST difference - * tsep: heritage = [] + * ts-estree: heritage = [] * babel: heritage = undefined */ 'interface', /** * AST difference - * tsep: TSAbstractClassDeclaration + * ts-estree: TSAbstractClassDeclaration * babel: ClassDeclaration[abstract=true] */ 'abstract-class' @@ -509,7 +514,7 @@ tester.addFixturePatternConfig('typescript/namespaces-and-modules', { 'nested-internal-module', /** * Babel: TSDeclareFunction - * tsep: TSNamespaceFunctionDeclaration + * ts-estree: TSNamespaceFunctionDeclaration */ 'declare-namespace-with-exported-function' ], diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index 9d8896333207..777e0b704b41 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -31,7 +31,7 @@ fixturesToTest.forEach(fixture => { * FAIL: babel errored but typescript-estree did not */ if (!typeScriptESTreeResult.parseError) { - it(`TEST FAIL [BABEL ERRORED, BUT TSEP DID NOT] - ${filename}`, () => { + it(`TEST FAIL [BABEL ERRORED, BUT TS-ESTREE DID NOT] - ${filename}`, () => { expect(typeScriptESTreeResult.parseError).toEqual( babelParserResult.parseError ); @@ -54,7 +54,7 @@ fixturesToTest.forEach(fixture => { * FAIL: typescript-estree errored but babel did not */ if (typeScriptESTreeResult.parseError) { - it(`TEST FAIL [TSEP ERRORED, BUT BABEL DID NOT] - ${filename}`, () => { + it(`TEST FAIL [TS-ESTREE ERRORED, BUT BABEL DID NOT] - ${filename}`, () => { expect(babelParserResult.parseError).toEqual( typeScriptESTreeResult.parseError ); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index e6641f64db56..703091b6ca45 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -183,7 +183,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-octal.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-octal.src.js.src 1`] = ` +Object { + "column": 21, + "index": 21, + "lineNumber": 1, + "message": "Octal literals are not allowed in strict mode.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -195,7 +202,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-two-lines.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-two-lines.src.js.src 1`] = ` +Object { + "column": 1, + "index": 12, + "lineNumber": 2, + "message": "Line terminator not permitted before arrow.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-wrapped-param.src.js.src 1`] = ` Object { From e535a19f1229e4264b56797b3177b7f9c4e5fa69 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 6 Jan 2019 09:30:18 -0500 Subject: [PATCH 59/84] feat(diagnostics): report on TS 1049, TS 1211 and TS 2364 (#95) --- .../typescript-estree/src/semantic-errors.ts | 14 +++++++--- .../tests/ast-alignment/fixtures-to-test.ts | 21 ++------------- .../semantic-diagnostics-enabled.ts.snap | 27 ++++++++++++++++--- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index f1d48fe31482..a3dc14d49d23 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -54,14 +54,20 @@ function whitelistSupportedDiagnostics( ): ReadonlyArray { return diagnostics.filter(diagnostic => { switch (diagnostic.code) { - case 1121: - return true; // ts 3.2 "Octal literals are not allowed in strict mode." + case 1049: // ts 3.2 "A 'set' accessor must have exactly one parameter." + return true; + case 1121: // ts 3.2 "Octal literals are not allowed in strict mode." + return true; case 1123: // ts 3.2: "Variable declaration list cannot be empty." return true; case 1141: // ts 3.2 "String literal expected." return true; - case 1200: - return true; // ts 3.2 "Line terminator not permitted before arrow." + case 1200: // ts 3.2 "Line terminator not permitted before arrow." + return true; + case 1211: // ts 3.2 "A class declaration without the 'default' modifier must have a name." + return true; + case 2364: // ts 3.2 "The left-hand side of an assignment expression must be a variable or a property access." + return true; } return false; }); diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 6dfe6b89df78..365442e712b7 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -173,30 +173,13 @@ tester.addFixturePatternConfig('javascript/classes', { /** * super() is being used outside of constructor. Other parsers (e.g. espree, acorn) do not error on this. */ - 'class-one-method-super', // babel parse errors - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'invalid-class-declaration', // babel parse errors - 'invalid-class-setter-declaration' // babel parse errors + 'class-one-method-super' // babel parse errors ] }); tester.addFixturePatternConfig('javascript/defaultParams'); -tester.addFixturePatternConfig('javascript/destructuring', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'invalid-defaults-object-assign' // babel parse errors - ] -}); - +tester.addFixturePatternConfig('javascript/destructuring'); tester.addFixturePatternConfig('javascript/destructuring-and-arrowFunctions'); tester.addFixturePatternConfig('javascript/destructuring-and-blockBindings'); tester.addFixturePatternConfig('javascript/destructuring-and-defaultParams'); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 703091b6ca45..baa35c8d6ec1 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -347,9 +347,23 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-literal-derived-class.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-declaration.src.js.src 1`] = ` +Object { + "column": 0, + "index": 0, + "lineNumber": 1, + "message": "A class declaration without the 'default' modifier must have a name.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-setter-declaration.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-setter-declaration.src.js.src 1`] = ` +Object { + "column": 14, + "index": 14, + "lineNumber": 1, + "message": "A 'set' accessor must have exactly one parameter.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-two-super-classes.src.js.src 1`] = ` Object { @@ -434,7 +448,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-object-catch.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js.src 1`] = ` +Object { + "column": 0, + "index": 0, + "lineNumber": 1, + "message": "The left-hand side of an assignment expression must be a variable or a property access.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/named-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; From df72f542d86a71eb8681ecf272be85bb547861bd Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 6 Jan 2019 10:21:14 -0500 Subject: [PATCH 60/84] feat(diagnostics): report on TS 1014, 1048, 1117, 2462, 17012, 17013 (#96) --- .../typescript-estree/src/semantic-errors.ts | 12 ++-- .../tests/ast-alignment/fixtures-to-test.ts | 56 ++++----------- .../semantic-diagnostics-enabled.ts.snap | 72 ++++++++++++++++--- 3 files changed, 85 insertions(+), 55 deletions(-) diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index a3dc14d49d23..2e77a639dbc0 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -54,19 +54,19 @@ function whitelistSupportedDiagnostics( ): ReadonlyArray { return diagnostics.filter(diagnostic => { switch (diagnostic.code) { + case 1014: // ts 3.2 "A rest parameter must be last in a parameter list." + case 1048: // ts 3.2 "A rest parameter cannot have an initializer." case 1049: // ts 3.2 "A 'set' accessor must have exactly one parameter." - return true; + case 1117: // ts 3.2 "An object literal cannot have multiple properties with the same name in strict mode." case 1121: // ts 3.2 "Octal literals are not allowed in strict mode." - return true; case 1123: // ts 3.2: "Variable declaration list cannot be empty." - return true; case 1141: // ts 3.2 "String literal expected." - return true; case 1200: // ts 3.2 "Line terminator not permitted before arrow." - return true; case 1211: // ts 3.2 "A class declaration without the 'default' modifier must have a name." - return true; case 2364: // ts 3.2 "The left-hand side of an assignment expression must be a variable or a property access." + case 2462: // ts 3.2 "A rest element must be last in a destructuring pattern." + case 17012: // ts 3.2 "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" + case 17013: // ts 3.2 "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." return true; } return false; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 365442e712b7..bf1bef5481c4 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -184,18 +184,7 @@ tester.addFixturePatternConfig('javascript/destructuring-and-arrowFunctions'); tester.addFixturePatternConfig('javascript/destructuring-and-blockBindings'); tester.addFixturePatternConfig('javascript/destructuring-and-defaultParams'); tester.addFixturePatternConfig('javascript/destructuring-and-forOf'); - -tester.addFixturePatternConfig('javascript/destructuring-and-spread', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'error-complex-destructured-spread-first', // babel parse errors - 'not-final-array' // babel parse errors - ] -}); +tester.addFixturePatternConfig('javascript/destructuring-and-spread'); tester.addFixturePatternConfig('javascript/experimentalAsyncIteration'); tester.addFixturePatternConfig('javascript/experimentalDynamicImport'); @@ -243,17 +232,7 @@ tester.addFixturePatternConfig('javascript/modules', { ignoreSourceType: ['error-function', 'error-strict', 'error-delete'] }); -tester.addFixturePatternConfig('javascript/newTarget', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'invalid-new-target', // babel parse errors - 'invalid-unknown-property' // babel parse errors - ] -}); +tester.addFixturePatternConfig('javascript/newTarget'); tester.addFixturePatternConfig('javascript/objectLiteral'); tester.addFixturePatternConfig('javascript/objectLiteralComputedProperties'); @@ -261,12 +240,19 @@ tester.addFixturePatternConfig('javascript/objectLiteralComputedProperties'); tester.addFixturePatternConfig('javascript/objectLiteralDuplicateProperties', { ignore: [ /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. + * Babel throws SyntaxError: Redefinition of __proto__ property + * + * TypeScript reports it via the overloaded TS 2300 "Duplicate identifier '{0}'.", which we + * do not currently enable as per the notes above. */ - 'error-proto-property', // babel parse errors - 'error-proto-string-property' // babel parse errors + 'error-proto-string-property', // babel parse errors + /** + * ts-estree throws thanks to TS 1117 (ts 3.2 at time of writing) + * "An object literal cannot have multiple properties with the same name in strict mode." + * + * Babel does not throw for some reason... + */ + 'strict-duplicate-properties' // ts-estree parse errors ] }); @@ -276,19 +262,7 @@ tester.addFixturePatternConfig('javascript/octalLiterals'); tester.addFixturePatternConfig('javascript/regex'); tester.addFixturePatternConfig('javascript/regexUFlag'); tester.addFixturePatternConfig('javascript/regexYFlag'); - -tester.addFixturePatternConfig('javascript/restParams', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - */ - 'error-no-default', // babel parse errors - 'error-not-last' // babel parse errors - ] -}); - +tester.addFixturePatternConfig('javascript/restParams'); tester.addFixturePatternConfig('javascript/spread'); tester.addFixturePatternConfig('javascript/unicodeCodePointEscapes'); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index baa35c8d6ec1..79511432e453 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -533,13 +533,27 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructuring-param.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "A rest element must be last in a destructuring pattern.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/multi-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/not-final-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/not-final-array.src.js.src 1`] = ` +Object { + "column": 1, + "index": 1, + "lineNumber": 1, + "message": "A rest element must be last in a destructuring pattern.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/single-destructured.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -972,9 +986,23 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-new-target.src.js.src 1`] = ` +Object { + "column": 8, + "index": 8, + "lineNumber": 1, + "message": "Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-unknown-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-unknown-property.src.js.src 1`] = ` +Object { + "column": 25, + "index": 25, + "lineNumber": 1, + "message": "'unknown_property' is not a valid meta-property for keyword 'new'. Did you mean 'target'?", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/simple-new-target.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1014,11 +1042,25 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js.src 1`] = ` +Object { + "column": 1, + "index": 62, + "lineNumber": 7, + "message": "An object literal cannot have multiple properties with the same name in strict mode.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js.src 1`] = ` +Object { + "column": 1, + "index": 39, + "lineNumber": 5, + "message": "An object literal cannot have multiple properties with the same name in strict mode.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1078,9 +1120,23 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/class-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-no-default.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-no-default.src.js.src 1`] = ` +Object { + "column": 17, + "index": 17, + "lineNumber": 1, + "message": "A rest parameter cannot have an initializer.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-not-last.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-not-last.src.js.src 1`] = ` +Object { + "column": 14, + "index": 14, + "lineNumber": 1, + "message": "A rest parameter must be last in a parameter list.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; From 09af3f0d65444cf2088cb071f3d48bd8bc1df29d Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 6 Jan 2019 10:41:57 -0500 Subject: [PATCH 61/84] feat(diagnostics): report on TS 1044, 1045, 1097, 1206, 1246 (#97) --- .../typescript-estree/src/semantic-errors.ts | 5 ++ .../tests/ast-alignment/fixtures-to-test.ts | 14 ++-- .../semantic-diagnostics-enabled.ts.snap | 72 ++++++++++++++++--- 3 files changed, 75 insertions(+), 16 deletions(-) diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index 2e77a639dbc0..9e615dcdd8b1 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -55,14 +55,19 @@ function whitelistSupportedDiagnostics( return diagnostics.filter(diagnostic => { switch (diagnostic.code) { case 1014: // ts 3.2 "A rest parameter must be last in a parameter list." + case 1044: // ts 3.2 "'{0}' modifier cannot appear on a module or namespace element." + case 1045: // ts 3.2 "A '{0}' modifier cannot be used with an interface declaration." case 1048: // ts 3.2 "A rest parameter cannot have an initializer." case 1049: // ts 3.2 "A 'set' accessor must have exactly one parameter." + case 1097: // ts 3.2 "'{0}' list cannot be empty." case 1117: // ts 3.2 "An object literal cannot have multiple properties with the same name in strict mode." case 1121: // ts 3.2 "Octal literals are not allowed in strict mode." case 1123: // ts 3.2: "Variable declaration list cannot be empty." case 1141: // ts 3.2 "String literal expected." case 1200: // ts 3.2 "Line terminator not permitted before arrow." + case 1206: // ts 3.2 "Decorators are not valid here." case 1211: // ts 3.2 "A class declaration without the 'default' modifier must have a name." + case 1246: // ts 3.2 "An interface property cannot have an initializer." case 2364: // ts 3.2 "The left-hand side of an assignment expression must be a variable or a property access." case 2462: // ts 3.2 "A rest element must be last in a destructuring pattern." case 17012: // ts 3.2 "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index bf1bef5481c4..75aed57c51d8 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -421,15 +421,13 @@ tester.addFixturePatternConfig('typescript/errorRecovery', { */ 'interface-empty-extends', /** - * TypeScript-specific tests taken from "errorRecovery". Babel is not being as forgiving as the TypeScript compiler here. + * TypeScript reports it via the overloaded TS 1097 "'{0}' list cannot be empty." + * + * Babel does not currently throw. + * + * TODO: Report this on Babel repo */ - 'class-empty-extends-implements', // babel parse errors - 'class-empty-extends', // babel parse errors - 'decorator-on-enum-declaration', // babel parse errors - 'decorator-on-interface-declaration', // babel parse errors - 'interface-property-modifiers', // babel parse errors - 'enum-with-keywords', // babel parse errors - 'solo-const' // babel parse errors + 'class-extends-empty-implements' ] }); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 79511432e453..8c796eceaf0c 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -2057,23 +2057,79 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends.src.ts.src 1`] = ` +Object { + "column": 17, + "index": 17, + "lineNumber": 1, + "message": "'extends' list cannot be empty.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts.src 1`] = ` +Object { + "column": 17, + "index": 17, + "lineNumber": 1, + "message": "'extends' list cannot be empty.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts.src 1`] = ` +Object { + "column": 32, + "index": 32, + "lineNumber": 1, + "message": "'implements' list cannot be empty.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts.src 1`] = ` +Object { + "column": 0, + "index": 0, + "lineNumber": 1, + "message": "Decorators are not valid here.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts.src 1`] = ` +Object { + "column": 0, + "index": 0, + "lineNumber": 1, + "message": "Decorators are not valid here.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-arguments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/enum-with-keywords.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/enum-with-keywords.src.ts.src 1`] = ` +Object { + "column": 7, + "index": 7, + "lineNumber": 1, + "message": "'private' modifier cannot appear on a module or namespace element.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-empty-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-empty-extends.src.ts.src 1`] = ` +Object { + "column": 21, + "index": 21, + "lineNumber": 1, + "message": "'extends' list cannot be empty.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts.src 1`] = ` +Object { + "column": 18, + "index": 34, + "lineNumber": 2, + "message": "An interface property cannot have an initializer.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/solo-const.src.ts.src 1`] = ` Object { From 4a3743c423763b762787114935ab072085ab7d00 Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 6 Jan 2019 16:58:12 +0100 Subject: [PATCH 62/84] fix: functions without body should be TSDeclareFunctions (#98) --- .../typescript-estree/src/ast-node-types.ts | 1 - packages/typescript-estree/src/convert.ts | 5 +- .../tests/ast-alignment/fixtures-to-test.ts | 10 +- .../basics/function-overloads.src.ts | 5 + .../lib/__snapshots__/javascript.ts.snap | 4 +- .../semantic-diagnostics-enabled.ts.snap | 2 + .../lib/__snapshots__/typescript.ts.snap | 1326 ++++++++++++++++- 7 files changed, 1340 insertions(+), 13 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/function-overloads.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index 36b8198c81d1..cb4ab8d0e72e 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -130,7 +130,6 @@ export enum AST_NODE_TYPES { TSMethodSignature = 'TSMethodSignature', TSModuleBlock = 'TSModuleBlock', TSModuleDeclaration = 'TSModuleDeclaration', - TSNamespaceFunctionDeclaration = 'TSNamespaceFunctionDeclaration', TSNamespaceExportDeclaration = 'TSNamespaceExportDeclaration', TSNonNullExpression = 'TSNonNullExpression', TSNeverKeyword = 'TSNeverKeyword', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 7302f43aeec4..af5687ae10ad 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -677,8 +677,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // Declarations case SyntaxKind.FunctionDeclaration: { + const isDeclare = nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node); let functionDeclarationType = AST_NODE_TYPES.FunctionDeclaration; - if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + if (isDeclare || !node.body) { functionDeclarationType = AST_NODE_TYPES.TSDeclareFunction; } @@ -697,7 +698,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.returnType = convertTypeAnnotation(node.type); } - if (functionDeclarationType === AST_NODE_TYPES.TSDeclareFunction) { + if (isDeclare) { result.declare = true; } diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 75aed57c51d8..9f587e8474fa 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -466,16 +466,12 @@ tester.addFixturePatternConfig('typescript/namespaces-and-modules', { /** * Minor AST difference */ - 'nested-internal-module', - /** - * Babel: TSDeclareFunction - * ts-estree: TSNamespaceFunctionDeclaration - */ - 'declare-namespace-with-exported-function' + 'nested-internal-module' ], ignoreSourceType: [ 'module-with-default-exports', - 'ambient-module-declaration-with-import' + 'ambient-module-declaration-with-import', + 'declare-namespace-with-exported-function' ] }); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/function-overloads.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/function-overloads.src.ts new file mode 100644 index 000000000000..27fb059d8771 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/function-overloads.src.ts @@ -0,0 +1,5 @@ +export function f(x: number): number; +export function f(x: string): string; +export function f(x: string | number): string | number { + return x; +} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 65ca9d1cc284..2fc03060edac 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -119241,7 +119241,7 @@ Object { 0, 24, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, ], "loc": Object { @@ -119575,7 +119575,7 @@ Object { 0, 23, ], - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, ], "loc": Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 8c796eceaf0c..f11909d68964 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1889,6 +1889,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-function-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-overloads.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-await.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 2e840e13c4a8..72a92d886562 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -31549,6 +31549,1330 @@ Object { } `; +exports[`typescript fixtures/basics/function-overloads.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 27, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 7, + 37, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "TSDeclareFunction", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "f", + "range": Array [ + 54, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 56, + 65, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 57, + 65, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 59, + 65, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 45, + 75, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 66, + 74, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "TSStringKeyword", + }, + }, + "type": "TSDeclareFunction", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 38, + 75, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "x", + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 135, + 144, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 55, + "line": 3, + }, + }, + "range": Array [ + 131, + 146, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "f", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 94, + 112, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 95, + 112, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 97, + 112, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 97, + 103, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 106, + 112, + ], + "type": "TSNumberKeyword", + }, + ], + }, + }, + }, + ], + "range": Array [ + 83, + 146, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 3, + }, + }, + "range": Array [ + 113, + 130, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 115, + 130, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 115, + 121, + ], + "type": "TSStringKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, + }, + "start": Object { + "column": 48, + "line": 3, + }, + }, + "range": Array [ + 124, + 130, + ], + "type": "TSNumberKeyword", + }, + ], + }, + }, + "type": "FunctionDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 76, + 146, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 147, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 45, + 53, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 59, + 65, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 68, + 74, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 76, + 82, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 83, + 91, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 93, + 94, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 95, + 96, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 3, + }, + }, + "range": Array [ + 97, + 103, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 104, + 105, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "range": Array [ + 106, + 112, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 3, + }, + "start": Object { + "column": 37, + "line": 3, + }, + }, + "range": Array [ + 113, + 114, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 3, + }, + }, + "range": Array [ + 115, + 121, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 3, + }, + "start": Object { + "column": 46, + "line": 3, + }, + }, + "range": Array [ + 122, + 123, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 3, + }, + "start": Object { + "column": 48, + "line": 3, + }, + }, + "range": Array [ + 124, + 130, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 3, + }, + "start": Object { + "column": 55, + "line": 3, + }, + }, + "range": Array [ + 131, + 132, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 135, + 141, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 142, + 143, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 145, + 146, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/function-with-await.src 1`] = ` Object { "body": Array [ @@ -78069,7 +79393,7 @@ Object { }, }, }, - "type": "FunctionDeclaration", + "type": "TSDeclareFunction", }, "loc": Object { "end": Object { From 78a873e2c2a974c035ddbf96d6d53b1cad29e010 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 6 Jan 2019 11:06:25 -0500 Subject: [PATCH 63/84] feat(diagnostics): report on TS 1090, 1173, 1190, 1242, 2369 (#99) --- .../typescript-estree/src/semantic-errors.ts | 5 ++ .../tests/ast-alignment/fixtures-to-test.ts | 41 +++++++----- .../semantic-diagnostics-enabled.ts.snap | 63 ++++++++++++++++--- 3 files changed, 85 insertions(+), 24 deletions(-) diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index 9e615dcdd8b1..8f85cf303e6b 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -59,16 +59,21 @@ function whitelistSupportedDiagnostics( case 1045: // ts 3.2 "A '{0}' modifier cannot be used with an interface declaration." case 1048: // ts 3.2 "A rest parameter cannot have an initializer." case 1049: // ts 3.2 "A 'set' accessor must have exactly one parameter." + case 1090: // ts 3.2 "'{0}' modifier cannot appear on a parameter." case 1097: // ts 3.2 "'{0}' list cannot be empty." case 1117: // ts 3.2 "An object literal cannot have multiple properties with the same name in strict mode." case 1121: // ts 3.2 "Octal literals are not allowed in strict mode." case 1123: // ts 3.2: "Variable declaration list cannot be empty." case 1141: // ts 3.2 "String literal expected." + case 1173: // ts 3.2 "'extends' clause must precede 'implements' clause." + case 1190: // ts 3.2 "The variable declaration of a 'for...of' statement cannot have an initializer." case 1200: // ts 3.2 "Line terminator not permitted before arrow." case 1206: // ts 3.2 "Decorators are not valid here." case 1211: // ts 3.2 "A class declaration without the 'default' modifier must have a name." + case 1242: // ts 3.2 "'abstract' modifier can only appear on a class, method, or property declaration." case 1246: // ts 3.2 "An interface property cannot have an initializer." case 2364: // ts 3.2 "The left-hand side of an assignment expression must be a variable or a property access." + case 2369: // ts 3.2 "A parameter property is only allowed in a constructor implementation." case 2462: // ts 3.2 "A rest element must be last in a destructuring pattern." case 17012: // ts 3.2 "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" case 17013: // ts 3.2 "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 9f587e8474fa..e9cbb2c9e128 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -201,22 +201,19 @@ tester.addFixturePatternConfig('javascript/forIn', { */ 'for-in-with-bare-assigment', /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. + * Babel correctly errors on this file, and we can report on it via: + * TS 1189 (ts 3.2) "The variable declaration of a 'for...in' statement cannot have an initializer." + * + * However, if we enable that, we get a lot of cases which ts-estree errors on, but Babel doesn't. + * Therefore, leaving this as the one ignored case for now. + * + * TODO: Investigate this in more detail */ 'for-in-with-assigment' // babel parse errors ] }); -tester.addFixturePatternConfig('javascript/forOf', { - ignore: [ - /** - * TypeScript, espree and acorn parse this fine - esprima, flow and babel do not... - */ - 'for-of-with-function-initializer' // babel parse errors - ] -}); +tester.addFixturePatternConfig('javascript/forOf'); tester.addFixturePatternConfig('javascript/generators'); tester.addFixturePatternConfig('javascript/globalReturn'); tester.addFixturePatternConfig('javascript/importMeta'); @@ -297,15 +294,25 @@ tester.addFixturePatternConfig('typescript/basics', { fileType: 'ts', ignore: [ /** - * Other babel parse errors relating to invalid syntax. + * TypeScript does not report any diagnostics for this file, but Babel throws: + * [SyntaxError: Unexpected token, expected "{" (2:8) + 1 | class Foo { + > 2 | foo?(); + | ^ + 3 | bar?(): string; + 4 | private baz?(): string; + 5 | }] */ - 'abstract-class-with-abstract-constructor', // babel parse errors - 'class-with-export-parameter-properties', // babel parse errors - 'class-with-implements-and-extends', // babel parse errors 'class-with-optional-methods', // babel parse errors - 'class-with-static-parameter-properties', // babel parse errors + /** + * There are number of things that can be reported in this file, so it's not great + * for comparison purposes. + * + * Nevertheless, Babel appears to throw on syntax that TypeScript doesn't report on directly. + * + * TODO: Investigate in more depth, potentially split up different parts of the interface + */ 'interface-with-all-property-types', // babel parse errors - 'interface-with-construct-signature-with-parameter-accessibility', // babel parse errors /** * there is difference in range between babel and ts-estree */ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index f11909d68964..b4393b525a17 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -659,7 +659,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src.js.src 1`] = ` +Object { + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "The variable declaration of a 'for...of' statement cannot have an initializer.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1765,7 +1772,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts.src 1`] = ` +Object { + "column": 4, + "index": 43, + "lineNumber": 2, + "message": "'abstract' modifier can only appear on a class, method, or property declaration.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1775,7 +1789,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-optional-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src.ts.src 1`] = ` +Object { + "column": 7, + "index": 7, + "lineNumber": 1, + "message": "'abstract' modifier can only appear on a class, method, or property declaration.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1801,7 +1822,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src.ts.src 1`] = ` +Object { + "column": 16, + "index": 28, + "lineNumber": 2, + "message": "'export' modifier cannot appear on a parameter.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-and-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1815,7 +1843,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-and-extends.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-and-extends.src.ts.src 1`] = ` +Object { + "column": 57, + "index": 57, + "lineNumber": 1, + "message": "'extends' clause must precede 'implements' clause.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1843,7 +1878,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-property.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-static-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-static-parameter-properties.src.ts.src 1`] = ` +Object { + "column": 16, + "index": 28, + "lineNumber": 2, + "message": "'static' modifier cannot appear on a parameter.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1923,7 +1965,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-all-property-types.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts.src 1`] = ` +Object { + "column": 9, + "index": 26, + "lineNumber": 2, + "message": "A parameter property is only allowed in a constructor implementation.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; From 474e91e49140cd8bb69a546b33f6e2b239ac683c Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 6 Jan 2019 17:20:47 +0100 Subject: [PATCH 64/84] fix: don't mutate original TypeScript AST in converter (#100) --- packages/typescript-estree/src/convert.ts | 26 +++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index af5687ae10ad..40f2b1bfe815 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2080,22 +2080,26 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.JsxSelfClosingElement: { - /** - * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, - * TypeScript does not seem to have the idea of openingElement when tag is self-closing - */ - (node as any).kind = SyntaxKind.JsxOpeningElement; - - const openingElement = convertChild(node); - (openingElement as any).selfClosing = true; - Object.assign(result, { type: AST_NODE_TYPES.JSXElement, - openingElement, + /** + * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, + * TypeScript does not seem to have the idea of openingElement when tag is self-closing + */ + openingElement: { + type: AST_NODE_TYPES.JSXOpeningElement, + typeParameters: node.typeArguments + ? convertTypeArgumentsToTypeParameters(node.typeArguments) + : undefined, + selfClosing: true, + name: convertTypeScriptJSXTagNameToESTreeName(node.tagName), + attributes: node.attributes.properties.map(convertChild), + range: result.range, + loc: result.loc + }, closingElement: null, children: [] }); - break; } From fb1e89f16705228bf22c1de3cee0af314076a7c1 Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 6 Jan 2019 19:14:26 +0100 Subject: [PATCH 65/84] chore: add comments about babel issues (#101) --- .../tests/ast-alignment/fixtures-to-test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index e9cbb2c9e128..f1773e9022f3 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -315,8 +315,9 @@ tester.addFixturePatternConfig('typescript/basics', { 'interface-with-all-property-types', // babel parse errors /** * there is difference in range between babel and ts-estree + * https://github.com/babel/babel/issues/9285 */ - 'arrow-function-with-type-parameters', // typescript-estree parse errors + 'arrow-function-with-type-parameters', /** * Babel: ClassDeclaration + abstract: true * ts-estree: TSAbstractClassDeclaration @@ -432,7 +433,7 @@ tester.addFixturePatternConfig('typescript/errorRecovery', { * * Babel does not currently throw. * - * TODO: Report this on Babel repo + * https://github.com/babel/babel/issues/9286 */ 'class-extends-empty-implements' ] From 8fdd3ccc3d6e1a1e2c7a7d9d65f6e803c5313f0b Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 6 Jan 2019 16:06:04 -0500 Subject: [PATCH 66/84] fix: parenthesized expressions are not eligible for directive (#103) --- packages/typescript-estree/src/convert.ts | 4 +- .../basics/parenthesized-use-strict.src.ts | 2 + .../semantic-diagnostics-enabled.ts.snap | 2 + .../lib/__snapshots__/typescript.ts.snap | 133 ++++++++++++++++++ 4 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/parenthesized-use-strict.src.ts diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 40f2b1bfe815..16f3837ec255 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -154,7 +154,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { child.expression && child.expression.type === AST_NODE_TYPES.Literal && (child.expression as any).value && - typeof (child.expression as any).value === 'string' + typeof (child.expression as any).value === 'string' && + // ignore parenthesized expressions + ast.text.charAt(child.range[0]) !== '(' ) .forEach( (child: { directive: string; expression: { raw: string } }) => { diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/parenthesized-use-strict.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/parenthesized-use-strict.src.ts new file mode 100644 index 000000000000..b0dd2af840cf --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/parenthesized-use-strict.src.ts @@ -0,0 +1,2 @@ +// this should not be classed as a directive +("use strict"); \ No newline at end of file diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index b4393b525a17..2b233a910ef8 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1996,6 +1996,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-escaped-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/parenthesized-use-strict.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/symbol-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 72a92d886562..d7e9ca56fdd7 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -49239,6 +49239,139 @@ Object { } `; +exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 46, + 58, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 45, + 60, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 45, + 60, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, + }, + "range": Array [ + 46, + 58, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` Object { "body": Array [ From 366fbf3b7db975e5812f6fdfcebae0fc5305693a Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 8 Jan 2019 19:48:13 +0100 Subject: [PATCH 67/84] chore: add new notes about PRs in babel (#106) --- .../tests/ast-alignment/fixtures-to-test.ts | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index f1773e9022f3..17467a170a90 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -314,8 +314,8 @@ tester.addFixturePatternConfig('typescript/basics', { */ 'interface-with-all-property-types', // babel parse errors /** - * there is difference in range between babel and ts-estree - * https://github.com/babel/babel/issues/9285 + * PR for generic ArrowFunctionExpression ranges has been merged into Babel: https://github.com/babel/babel/pull/9295 + * TODO: remove me in next babel > 7.2.3 */ 'arrow-function-with-type-parameters', /** @@ -358,7 +358,7 @@ tester.addFixturePatternConfig('typescript/basics', { 'abstract-class-with-optional-method', // babel parse errors 'declare-class-with-optional-method', // babel parse errors /** - * Reported and resolved Babel issue https://github.com/babel/babel/issues/6679 + * PR for parameter property ranges has been merged into Babel: https://github.com/babel/babel/pull/9284 * TODO: remove me in next babel > 7.2.3 */ 'class-with-private-parameter-properties', @@ -383,12 +383,16 @@ tester.addFixturePatternConfig('typescript/basics', { 'directive-in-module', 'directive-in-namespace', /** - * Babel range bug, which will be fixed by https://github.com/babel/babel/pull/9284 + * PR for type assertions ranges has been merged into Babel: https://github.com/babel/babel/pull/9284 + * TODO: remove me in next babel > 7.2.3 */ 'type-assertion' ], ignoreSourceType: [ - // https://github.com/babel/babel/issues/9213 + /** + * Babel reports sourceType script + * https://github.com/babel/babel/issues/9213 + */ 'export-assignment', 'import-equal-declaration', 'import-export-equal-declaration' @@ -425,16 +429,10 @@ tester.addFixturePatternConfig('typescript/errorRecovery', { fileType: 'ts', ignore: [ /** - * AST difference + * PR with errors in empty extends and implements has been merged into Babel: https://github.com/babel/babel/pull/9292 + * TODO: remove me in next babel > 7.2.3 */ 'interface-empty-extends', - /** - * TypeScript reports it via the overloaded TS 1097 "'{0}' list cannot be empty." - * - * Babel does not currently throw. - * - * https://github.com/babel/babel/issues/9286 - */ 'class-extends-empty-implements' ] }); From ef703e3d3ec1f806f4f2217c684f1cfd9384731d Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 10 Jan 2019 22:28:22 +0100 Subject: [PATCH 68/84] fix: regression in TSTypeParameter node "name" (#111) --- packages/typescript-estree/src/convert.ts | 2 +- .../tests/ast-alignment/utils.ts | 24 + .../lib/__snapshots__/typescript.ts.snap | 931 +++++++++++++++++- 3 files changed, 907 insertions(+), 50 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 16f3837ec255..ed30369558aa 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2237,7 +2237,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.TypeParameter: { Object.assign(result, { type: AST_NODE_TYPES.TSTypeParameter, - name: node.name.text, + name: convertChildType(node.name), constraint: node.constraint ? convertChildType(node.constraint) : undefined, diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 0aab1de9a118..10bb56103831 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -1,4 +1,5 @@ import isPlainObject from 'lodash.isplainobject'; +import { AST_NODE_TYPES } from '../../src/ast-node-types'; /** * By default, pretty-format (within Jest matchers) retains the names/types of nodes from the babylon AST, @@ -194,6 +195,29 @@ export function preprocessBabylonAST(ast: any): any { node.params = node.parameters; delete node.parameters; } + }, + /** + * We want this node to be different + * @see https://github.com/JamesHenry/typescript-estree/issues/109 + */ + TSTypeParameter(node: any) { + if (node.name) { + node.name = { + loc: { + start: { + column: node.loc.start.column, + line: node.loc.start.line + }, + end: { + column: node.loc.start.column + node.name.length, + line: node.loc.start.line + } + }, + name: node.name, + range: [node.range[0], node.range[0] + node.name.length], + type: AST_NODE_TYPES.Identifier + }; + } } } ); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index d7e9ca56fdd7..b182d2671f53 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -82,7 +82,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, "range": Array [ 13, 14, @@ -397,7 +414,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, "range": Array [ 11, 36, @@ -3293,7 +3327,24 @@ Object { "line": 1, }, }, - "name": "X", + "name": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, "range": Array [ 1, 2, @@ -5493,7 +5544,24 @@ Object { "line": 2, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, "range": Array [ 16, 17, @@ -5635,7 +5703,24 @@ Object { "line": 3, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, "range": Array [ 44, 45, @@ -10040,7 +10125,24 @@ Object { "line": 1, }, }, - "name": "A", + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, "range": Array [ 10, 11, @@ -10513,7 +10615,24 @@ Object { "line": 1, }, }, - "name": "A", + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, "range": Array [ 10, 21, @@ -10943,7 +11062,24 @@ Object { "line": 2, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, "range": Array [ 21, 22, @@ -11389,7 +11525,24 @@ Object { "line": 2, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, "range": Array [ 21, 28, @@ -13264,7 +13417,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, "range": Array [ 11, 36, @@ -13782,7 +13952,24 @@ Object { "line": 9, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "Identifier", + }, "range": Array [ 175, 176, @@ -15213,7 +15400,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, "range": Array [ 11, 35, @@ -22514,7 +22718,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, "range": Array [ 10, 11, @@ -22791,7 +23012,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, "range": Array [ 10, 17, @@ -23069,7 +23307,24 @@ Object { "line": 1, }, }, - "name": "__P", + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "range": Array [ 8, 11, @@ -29052,7 +29307,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, "range": Array [ 21, 22, @@ -29312,7 +29584,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, "range": Array [ 21, 22, @@ -29330,7 +29619,24 @@ Object { "line": 1, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, "range": Array [ 24, 25, @@ -29643,7 +29949,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, "range": Array [ 17, 18, @@ -29922,7 +30245,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, "range": Array [ 17, 18, @@ -29940,7 +30280,24 @@ Object { "line": 1, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, "range": Array [ 20, 21, @@ -34904,7 +35261,24 @@ Object { "line": 1, }, }, - "name": "X", + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, "range": Array [ 11, 12, @@ -35329,7 +35703,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, "range": Array [ 28, 29, @@ -35787,7 +36178,24 @@ Object { "line": 1, }, }, - "name": "X", + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, "range": Array [ 11, 23, @@ -39840,7 +40248,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, "range": Array [ 14, 15, @@ -40979,7 +41404,24 @@ Object { "line": 11, }, }, - "name": "J", + "name": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "name": "J", + "range": Array [ + 222, + 223, + ], + "type": "Identifier", + }, "range": Array [ 222, 223, @@ -41196,7 +41638,24 @@ Object { "line": 13, }, }, - "name": "F", + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 13, + }, + "start": Object { + "column": 9, + "line": 13, + }, + }, + "name": "F", + "range": Array [ + 275, + 276, + ], + "type": "Identifier", + }, "range": Array [ 275, 276, @@ -43875,7 +44334,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, "range": Array [ 14, 15, @@ -44207,7 +44683,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, "range": Array [ 15, 16, @@ -50033,7 +50526,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, "range": Array [ 12, 13, @@ -50507,7 +51017,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, "range": Array [ 12, 24, @@ -52300,7 +52827,24 @@ Object { "line": 2, }, }, - "name": "A", + "name": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "A", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, "range": Array [ 68, 69, @@ -52429,7 +52973,24 @@ Object { "line": 3, }, }, - "name": "A", + "name": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "name": "A", + "range": Array [ + 112, + 113, + ], + "type": "Identifier", + }, "range": Array [ 112, 129, @@ -83499,7 +84060,24 @@ Object { "line": 1, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, "range": Array [ 35, 36, @@ -83633,7 +84211,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, "range": Array [ 13, 14, @@ -84129,7 +84724,24 @@ Object { "line": 2, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "U", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, "range": Array [ 38, 39, @@ -84217,7 +84829,24 @@ Object { "line": 3, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "name": "U", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, "range": Array [ 69, 70, @@ -84334,7 +84963,24 @@ Object { "line": 4, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "name": "U", + "range": Array [ + 107, + 108, + ], + "type": "Identifier", + }, "range": Array [ 107, 108, @@ -84561,7 +85207,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, "range": Array [ 14, 15, @@ -85409,7 +86072,24 @@ Object { "line": 1, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, "range": Array [ 35, 36, @@ -85497,7 +86177,24 @@ Object { "line": 1, }, }, - "name": "U", + "name": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, "range": Array [ 47, 48, @@ -85605,7 +86302,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, "range": Array [ 9, 10, @@ -87219,7 +87933,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, "range": Array [ 12, 13, @@ -89236,7 +89967,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, "range": Array [ 8, 9, @@ -91458,7 +92206,24 @@ Object { "line": 1, }, }, - "name": "T", + "name": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, "range": Array [ 16, 17, @@ -92349,7 +93114,24 @@ Object { "line": 1, }, }, - "name": "P", + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, "range": Array [ 12, 23, @@ -92770,7 +93552,24 @@ Object { "line": 1, }, }, - "name": "P", + "name": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, "range": Array [ 21, 32, @@ -93227,7 +94026,24 @@ Object { "line": 1, }, }, - "name": "P", + "name": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, "range": Array [ 22, 33, @@ -93702,7 +94518,24 @@ Object { "line": 1, }, }, - "name": "P", + "name": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "P", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, "range": Array [ 22, 33, From cd18c940fa7c177af71074978596b0da3de6f98b Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 10 Jan 2019 22:38:24 +0100 Subject: [PATCH 69/84] refactor: simplify assigning directive property to nodes (#105) --- packages/typescript-estree/src/convert.ts | 72 +++++++++---------- .../src/temp-types-based-on-js-source.ts | 2 + 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index ed30369558aa..6da9ceb5d2a9 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -140,33 +140,39 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } /** - * Coverts body ExpressionStatements to directives + * Coverts body Nodes and add directive field to StringLiterals + * @param {ts.NodeArray} nodes of ts.Node + * @returns {ESTreeNode[]} Array of body statements */ - function convertBodyExpressionsToDirectives() { - if (result.body && nodeUtils.canContainDirective(node)) { - const unique: string[] = []; - - // directives has to be unique, if directive is registered twice pick only first one - result.body - .filter( - (child: ESTreeNode) => - child.type === AST_NODE_TYPES.ExpressionStatement && + function convertBodyExpressions( + nodes: ts.NodeArray + ): ESTreeNode[] { + // directives has to be unique, if directive is registered twice pick only first one + const unique: string[] = []; + const allowDirectives = nodeUtils.canContainDirective(node); + + return ( + nodes + .map(statement => { + const child = convertChild(statement); + if ( + allowDirectives && + child && child.expression && - child.expression.type === AST_NODE_TYPES.Literal && - (child.expression as any).value && - typeof (child.expression as any).value === 'string' && - // ignore parenthesized expressions - ast.text.charAt(child.range[0]) !== '(' - ) - .forEach( - (child: { directive: string; expression: { raw: string } }) => { - if (!unique.includes((child.expression as any).raw)) { - child.directive = child.expression.raw.slice(1, -1); - unique.push(child.expression.raw); + ts.isExpressionStatement(statement) && + ts.isStringLiteral(statement.expression) + ) { + const raw = child.expression.raw!; + if (!unique.includes(raw)) { + child.directive = raw.slice(1, -1); + unique.push(raw); } } - ); - } + return child!; // child can be null but it's filtered below + }) + // filter out unknown nodes for now + .filter(statement => statement) + ); } /** @@ -488,21 +494,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.SourceFile: Object.assign(result, { type: AST_NODE_TYPES.Program, - body: [], + body: convertBodyExpressions(node.statements), // externalModuleIndicator is internal field in TSC sourceType: (node as any).externalModuleIndicator ? 'module' : 'script' }); - // filter out unknown nodes for now - node.statements.forEach((statement: any) => { - const convertedStatement = convertChild(statement); - if (convertedStatement) { - result.body.push(convertedStatement); - } - }); - - convertBodyExpressionsToDirectives(); - result.range[1] = node.endOfFileToken.end; result.loc = nodeUtils.getLocFor( node.getStart(ast), @@ -514,10 +510,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.Block: Object.assign(result, { type: AST_NODE_TYPES.BlockStatement, - body: node.statements.map(convertChild) + body: convertBodyExpressions(node.statements) }); - - convertBodyExpressionsToDirectives(); break; case SyntaxKind.Identifier: @@ -1637,10 +1631,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ModuleBlock: Object.assign(result, { type: AST_NODE_TYPES.TSModuleBlock, - body: node.statements.map(convertChild) + body: convertBodyExpressions(node.statements) }); - - convertBodyExpressionsToDirectives(); break; case SyntaxKind.ImportDeclaration: diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index f834c17c15d5..33f9b3faf5d6 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -30,6 +30,8 @@ export interface ESTreeNode { typeAnnotation?: ESTreeNode | null; typeParameters?: ESTreeNode | null; id?: ESTreeNode | null; + raw?: string; + value?: string; expression?: ESTreeNode | null; decorators?: (ESTreeNode | null)[]; const?: boolean; From 0c3544f67d0698249840e0c49861e18be98dc49f Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 10 Jan 2019 22:47:48 +0100 Subject: [PATCH 70/84] refactor: unify converting of class and interface heritage (#107) --- packages/typescript-estree/src/convert.ts | 50 +++++++---------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 6da9ceb5d2a9..e64a24061cb2 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -250,17 +250,18 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } /** - * Converts a child into a class implements node. This creates an intermediary - * ClassImplements node to match what Flow does. + * Converts a child into a specified heritage node. + * @param {AST_NODE_TYPES} nodeType Type of node to be used * @param {ts.ExpressionWithTypeArguments} child The TypeScript AST node to convert. - * @returns {ESTreeNode} The type annotation node. + * @returns {ESTreeNode} The heritage node. */ - function convertClassImplements( + function convertHeritageClause( + nodeType: AST_NODE_TYPES, child: ts.ExpressionWithTypeArguments ): ESTreeNode { - const id = convertChild(child.expression) as ESTreeNode; + const id = convertChild(child.expression)!; const classImplementsNode: ESTreeNode = { - type: AST_NODE_TYPES.ClassImplements, + type: nodeType, loc: id.loc, range: id.range, id @@ -273,30 +274,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { return classImplementsNode; } - /** - * Converts a child into a interface heritage node. - * @param {ts.ExpressionWithTypeArguments} child The TypeScript AST node to convert. - * @returns {ESTreeNode} The type annotation node. - */ - function convertInterfaceHeritageClause( - child: ts.ExpressionWithTypeArguments - ): ESTreeNode { - const id = convertChild(child.expression) as ESTreeNode; - const classImplementsNode: ESTreeNode = { - type: AST_NODE_TYPES.TSInterfaceHeritage, - loc: id.loc, - range: id.range, - id - }; - - if (child.typeArguments && child.typeArguments.length) { - classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters( - child.typeArguments - ); - } - return classImplementsNode; - } - /** * Converts an array of ts.Node parameters into an array of ESTreeNode params * @param {ts.Node[]} parameters An array of ts.Node params to be converted @@ -1600,8 +1577,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); if (implementsClause) { - (result as any).implements = implementsClause.types.map( - convertClassImplements + (result as any).implements = implementsClause.types.map(el => + // ClassImplements node to match what Flow does. + convertHeritageClause(AST_NODE_TYPES.ClassImplements, el) ); } @@ -2518,8 +2496,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const interfaceBody = { type: AST_NODE_TYPES.TSInterfaceBody, - body: node.members.map((member: any) => convertChild(member)), - range: [interfaceOpenBrace.getStart(ast), result.range[1]], + body: node.members.map(member => convertChild(member)), + range: [interfaceOpenBrace.getStart(ast), node.end], loc: nodeUtils.getLocFor( interfaceOpenBrace.getStart(ast), node.end, @@ -2532,8 +2510,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { body: interfaceBody, id: convertChild(node.name), heritage: hasImplementsClause - ? interfaceHeritageClauses[0].types.map( - convertInterfaceHeritageClause + ? interfaceHeritageClauses[0].types.map(el => + convertHeritageClause(AST_NODE_TYPES.TSInterfaceHeritage, el) ) : [] }); From c326435d34b31ad3d8195ec3baf739f892216876 Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 10 Jan 2019 23:13:26 +0100 Subject: [PATCH 71/84] feat(diagnostics): report on TS 1096 (#110) --- .../typescript-estree/src/semantic-errors.ts | 1 + .../tests/ast-alignment/fixtures-to-test.ts | 45 +- .../javascript/forIn/for-in-array.src.js | 1 + .../forIn/for-in-destruction-object.src.js | 1 + .../forIn/for-in-object-with-body.src.js | 1 + .../javascript/forOf/for-of-array.src.js | 2 + .../forOf/for-of-destruction-object.src.js | 1 + .../forOf/for-of-destruction.src.js | 1 + .../javascript/forOf/for-of-object.src.js | 2 + .../export-declare-const-named-enum.src.ts | 4 + .../basics/export-declare-named-enum.src.ts | 4 + .../basics/interface-with-method.src.ts | 4 + .../type-guard-in-arrow-function.src.ts | 3 + ...d.src.ts => type-guard-in-function.src.ts} | 0 .../basics/type-guard-in-interface.src.ts | 3 + .../basics/type-guard-in-method.src.ts | 8 + .../basics/typed-method-signature.src.ts | 4 + .../index-signature-parameters.src.ts | 3 + .../types/index-signature-readonly.src.ts | 3 + .../typescript/types/index-signature.src.ts | 3 + .../types/literal-number-negative.src.ts | 1 + .../lib/__snapshots__/javascript.ts.snap | 3733 ++- .../semantic-diagnostics-enabled.ts.snap | 45 +- .../lib/__snapshots__/typescript.ts.snap | 26197 ++++++++++------ 24 files changed, 19689 insertions(+), 10381 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object-with-body.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-const-named-enum.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-named-enum.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-method.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts rename packages/typescript-estree/tests/fixtures/typescript/basics/{type-guard.src.ts => type-guard-in-function.src.ts} (100%) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-interface.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-method.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/typed-method-signature.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/index-signature-readonly.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/index-signature.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/literal-number-negative.src.ts diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index 8f85cf303e6b..9cc29dabeeaa 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -60,6 +60,7 @@ function whitelistSupportedDiagnostics( case 1048: // ts 3.2 "A rest parameter cannot have an initializer." case 1049: // ts 3.2 "A 'set' accessor must have exactly one parameter." case 1090: // ts 3.2 "'{0}' modifier cannot appear on a parameter." + case 1096: // ts 3.2 "An index signature must have exactly one parameter." case 1097: // ts 3.2 "'{0}' list cannot be empty." case 1117: // ts 3.2 "An object literal cannot have multiple properties with the same name in strict mode." case 1121: // ts 3.2 "Octal literals are not allowed in strict mode." diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 17467a170a90..06e6354b8b67 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -194,6 +194,12 @@ tester.addFixturePatternConfig('javascript/experimentalOptionalCatchBinding'); tester.addFixturePatternConfig('javascript/for'); tester.addFixturePatternConfig('javascript/forIn', { ignore: [ + /** + * Error: AST difference + * ts-estree: ArrayPattern + * babel: ArrayExpression + */ + 'for-in-array', /** * Error: AST difference * ts-estree: AssignmentExpression @@ -213,7 +219,16 @@ tester.addFixturePatternConfig('javascript/forIn', { ] }); -tester.addFixturePatternConfig('javascript/forOf'); +tester.addFixturePatternConfig('javascript/forOf', { + ignore: [ + /** + * Error: AST difference + * ts-estree: ArrayPattern + * babel: ArrayExpression + */ + 'for-of-array' + ] +}); tester.addFixturePatternConfig('javascript/generators'); tester.addFixturePatternConfig('javascript/globalReturn'); tester.addFixturePatternConfig('javascript/importMeta'); @@ -336,6 +351,15 @@ tester.addFixturePatternConfig('typescript/basics', { 'class-with-implements-generic', 'class-with-implements', 'class-with-extends-and-implements', + /** + * Babel error: parameterName is not included into range of TSTypeAnnotation + * TODO: report it to babel + */ + 'type-guard-in-method', + /** + * there is difference in range between babel and ts-estree + */ + 'export-declare-const-named-enum', /** * Other major AST differences (e.g. fundamentally different node types) */ @@ -349,10 +373,18 @@ tester.addFixturePatternConfig('typescript/basics', { 'interface-with-jsdoc', 'interface-with-optional-properties', 'interface-without-type-annotation', + 'interface-with-method', + 'type-guard-in-interface', + 'typed-method-signature', 'typed-this', + /** + * Babel bug for parsing exported abstract interface + * https://github.com/babel/babel/issues/9304 + */ 'abstract-interface', /** - * Babel bug for optional or abstract methods? + * Babel bug for optional or abstract methods + * https://github.com/babel/babel/issues/9305 */ 'abstract-class-with-abstract-method', // babel parse errors 'abstract-class-with-optional-method', // babel parse errors @@ -366,8 +398,8 @@ tester.addFixturePatternConfig('typescript/basics', { 'class-with-public-parameter-properties', 'class-with-readonly-parameter-properties', /** - * Not yet supported in Babel https://github.com/babel/babel/issues/7749 - * WIP PR is https://github.com/babel/babel/pull/8798 + * PR for type import has been merged into Babel: https://github.com/babel/babel/pull/9302 + * TODO: remove me in next babel > 7.2.3 */ 'import-type', 'import-type-with-type-parameters-in-type-reference', @@ -444,7 +476,10 @@ tester.addFixturePatternConfig('typescript/types', { * AST difference */ 'function-with-rest', - 'constructor-with-rest' + 'constructor-with-rest', + 'index-signature', + 'index-signature-readonly', + 'literal-number-negative' ] }); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-array.src.js new file mode 100644 index 000000000000..a756590b577d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-array.src.js @@ -0,0 +1 @@ +for (i in []) {} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction-object.src.js new file mode 100644 index 000000000000..44c69389230a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-destruction-object.src.js @@ -0,0 +1 @@ +for (var {name, value} in obj) {} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object-with-body.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object-with-body.src.js new file mode 100644 index 000000000000..ed66d4e2c308 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-object-with-body.src.js @@ -0,0 +1 @@ +for (i in {}) {} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-array.src.js new file mode 100644 index 000000000000..e91a157cfa66 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-array.src.js @@ -0,0 +1,2 @@ +for (let x of []) + doSomething(); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction-object.src.js new file mode 100644 index 000000000000..3a2fd431654c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction-object.src.js @@ -0,0 +1 @@ +for (var {name, value} of obj) {} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction.src.js new file mode 100644 index 000000000000..d39ffd3276bc --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-destruction.src.js @@ -0,0 +1 @@ +for (var [name, value] of obj) {} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-object.src.js new file mode 100644 index 000000000000..ad1fe32a80b7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-object.src.js @@ -0,0 +1,2 @@ +for (let x of {}) + doSomething(); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-const-named-enum.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-const-named-enum.src.ts new file mode 100644 index 000000000000..7bbafe14ec89 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-const-named-enum.src.ts @@ -0,0 +1,4 @@ +export declare const enum Foo { + foo = 1, + bar +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-named-enum.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-named-enum.src.ts new file mode 100644 index 000000000000..2864376d90b1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/export-declare-named-enum.src.ts @@ -0,0 +1,4 @@ +export declare enum Foo { + foo = 1, + bar +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-method.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-method.src.ts new file mode 100644 index 000000000000..417153779dc4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-method.src.ts @@ -0,0 +1,4 @@ +interface test { + h(bar: string): void; + g(bar: T): T; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts new file mode 100644 index 000000000000..7157427597bd --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts @@ -0,0 +1,3 @@ +const isString = (x: any): x is string => { + return typeof x === 'string' +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-function.src.ts similarity index 100% rename from packages/typescript-estree/tests/fixtures/typescript/basics/type-guard.src.ts rename to packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-function.src.ts diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-interface.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-interface.src.ts new file mode 100644 index 000000000000..d43231224568 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-interface.src.ts @@ -0,0 +1,3 @@ +interface Foo { + isString(node: any): node is string; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-method.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-method.src.ts new file mode 100644 index 000000000000..843f1f58b63f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-guard-in-method.src.ts @@ -0,0 +1,8 @@ +class Foo { + isBar(): this is string { + return this instanceof Foo; + } + isBaz = (): this is string => { + return this instanceof Foo; + } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/typed-method-signature.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-method-signature.src.ts new file mode 100644 index 000000000000..072d0063deb7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/typed-method-signature.src.ts @@ -0,0 +1,4 @@ +type Foo = { + h(bar: string): void; + g(bar: T): T; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts new file mode 100644 index 000000000000..f7922694469b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts @@ -0,0 +1,3 @@ +type foo = { + [a: string, b: string]: string; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/index-signature-readonly.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/index-signature-readonly.src.ts new file mode 100644 index 000000000000..2d330340714a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/index-signature-readonly.src.ts @@ -0,0 +1,3 @@ +type foo = { + readonly [key: number]: number; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/index-signature.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/index-signature.src.ts new file mode 100644 index 000000000000..6e828cc996a2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/index-signature.src.ts @@ -0,0 +1,3 @@ +type foo = { + [a: string]: string; +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/literal-number-negative.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/literal-number-negative.src.ts new file mode 100644 index 000000000000..48e57ca11060 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/literal-number-negative.src.ts @@ -0,0 +1 @@ +let x: -1; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 2fc03060edac..41a6d29bac48 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -82593,6 +82593,264 @@ Object { } `; +exports[`javascript fixtures/forIn/for-in-array.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "ArrayPattern", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`javascript fixtures/forIn/for-in-bare-nonstrict.src 1`] = ` Object { "body": Array [ @@ -84614,9 +84872,2308 @@ Object { } `; +exports[`javascript fixtures/forIn/for-in-destruction-object.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 33, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 14, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 9, + 22, + ], + "type": "ObjectPattern", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 22, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "name", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + "value": "value", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "obj", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`javascript fixtures/forIn/for-in-object.src 1`] = `"';' expected."`; -exports[`javascript fixtures/forIn/for-in-with-assigment.src 1`] = ` +exports[`javascript fixtures/forIn/for-in-object-with-body.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 10, + 12, + ], + "type": "ObjectExpression", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-assigment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 25, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 35, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 36, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 15, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "list", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + "value": "list", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 32, + ], + "type": "Identifier", + "value": "process", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-bare-assigment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "EmptyStatement", + }, + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 5, + 10, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "arr", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "arr", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-const.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 22, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 32, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 33, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 12, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "list", + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 10, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 20, + ], + "type": "Identifier", + "value": "list", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "Identifier", + "value": "process", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-milti-asigment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "EmptyStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 13, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 18, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "q", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "q", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-var.src 1`] = ` Object { "body": Array [ Object { @@ -84626,18 +87183,18 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 29, "line": 1, }, "start": Object { - "column": 33, + "column": 28, "line": 1, }, }, "name": "x", "range": Array [ - 33, - 34, + 28, + 29, ], "type": "Identifier", }, @@ -84645,50 +87202,50 @@ Object { "callee": Object { "loc": Object { "end": Object { - "column": 32, + "column": 27, "line": 1, }, "start": Object { - "column": 25, + "column": 20, "line": 1, }, }, "name": "process", "range": Array [ - 25, - 32, + 20, + 27, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 35, + "column": 30, "line": 1, }, "start": Object { - "column": 25, + "column": 20, "line": 1, }, }, "range": Array [ - 25, - 35, + 20, + 30, ], "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 36, + "column": 31, "line": 1, }, "start": Object { - "column": 25, + "column": 20, "line": 1, }, }, "range": Array [ - 25, - 36, + 20, + 31, ], "type": "ExpressionStatement", }, @@ -84713,28 +87270,10 @@ Object { ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 15, - ], - "raw": "42", - "type": "Literal", - "value": 42, - }, + "init": null, "loc": Object { "end": Object { - "column": 15, + "column": 10, "line": 1, }, "start": Object { @@ -84744,15 +87283,15 @@ Object { }, "range": Array [ 9, - 15, + 10, ], "type": "VariableDeclarator", }, ], - "kind": "let", + "kind": "var", "loc": Object { "end": Object { - "column": 15, + "column": 10, "line": 1, }, "start": Object { @@ -84762,13 +87301,13 @@ Object { }, "range": Array [ 5, - 15, + 10, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 36, + "column": 31, "line": 1, }, "start": Object { @@ -84778,23 +87317,23 @@ Object { }, "range": Array [ 0, - 36, + 31, ], "right": Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 19, + "column": 14, "line": 1, }, }, "name": "list", "range": Array [ - 19, - 23, + 14, + 18, ], "type": "Identifier", }, @@ -84813,7 +87352,7 @@ Object { }, "range": Array [ 0, - 37, + 32, ], "sourceType": "script", "tokens": Array [ @@ -84869,7 +87408,7 @@ Object { 8, ], "type": "Keyword", - "value": "let", + "value": "var", }, Object { "loc": Object { @@ -84892,7 +87431,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { @@ -84902,43 +87441,7 @@ Object { }, "range": Array [ 11, - 12, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ 13, - 15, - ], - "type": "Numeric", - "value": "42", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, ], "type": "Keyword", "value": "in", @@ -84946,17 +87449,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 19, + "column": 14, "line": 1, }, }, "range": Array [ - 19, - 23, + 14, + 18, ], "type": "Identifier", "value": "list", @@ -84964,17 +87467,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 1, }, "start": Object { - "column": 23, + "column": 18, "line": 1, }, }, "range": Array [ - 23, - 24, + 18, + 19, ], "type": "Punctuator", "value": ")", @@ -84982,17 +87485,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 27, "line": 1, }, "start": Object { - "column": 25, + "column": 20, "line": 1, }, }, "range": Array [ - 25, - 32, + 20, + 27, ], "type": "Identifier", "value": "process", @@ -85000,17 +87503,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, + "column": 28, "line": 1, }, "start": Object { - "column": 32, + "column": 27, "line": 1, }, }, "range": Array [ - 32, - 33, + 27, + 28, ], "type": "Punctuator", "value": "(", @@ -85018,17 +87521,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 29, "line": 1, }, "start": Object { - "column": 33, + "column": 28, "line": 1, }, }, "range": Array [ - 33, - 34, + 28, + 29, ], "type": "Identifier", "value": "x", @@ -85036,17 +87539,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 30, "line": 1, }, "start": Object { - "column": 34, + "column": 29, "line": 1, }, }, "range": Array [ - 34, - 35, + 29, + 30, ], "type": "Punctuator", "value": ")", @@ -85054,17 +87557,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 36, + "column": 31, "line": 1, }, "start": Object { - "column": 35, + "column": 30, "line": 1, }, }, "range": Array [ - 35, - 36, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -85074,46 +87577,104 @@ Object { } `; -exports[`javascript fixtures/forIn/for-in-with-bare-assigment.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-array.src 1`] = ` Object { "body": Array [ Object { + "await": false, "body": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 22, + 33, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 35, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 18, - 19, + 22, + 36, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, "left": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, - "start": Object { - "column": 5, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "range": Array [ + 9, + 10, + ], + "type": "VariableDeclarator", }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, + ], + "kind": "let", "loc": Object { "end": Object { "column": 10, @@ -85124,36 +87685,16 @@ Object { "line": 1, }, }, - "operator": "=", "range": Array [ 5, 10, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "AssignmentExpression", + "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 0, @@ -85162,12 +87703,13 @@ Object { }, "range": Array [ 0, - 19, + 36, ], "right": Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { @@ -85175,20 +87717,19 @@ Object { "line": 1, }, }, - "name": "arr", "range": Array [ 14, - 17, + 16, ], - "type": "Identifier", + "type": "ArrayPattern", }, - "type": "ForInStatement", + "type": "ForOfStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -85197,7 +87738,7 @@ Object { }, "range": Array [ 0, - 20, + 37, ], "sourceType": "script", "tokens": Array [ @@ -85240,7 +87781,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -85250,7 +87791,25 @@ Object { }, "range": Array [ 5, - 6, + 8, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, ], "type": "Identifier", "value": "x", @@ -85258,89 +87817,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 11, "line": 1, }, }, "range": Array [ - 7, - 8, + 11, + 13, + ], + "type": "Identifier", + "value": "of", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, ], "type": "Punctuator", - "value": "=", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 15, "line": 1, }, }, "range": Array [ - 9, - 10, + 15, + 16, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, }, }, "range": Array [ - 11, - 13, + 22, + 33, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "doSomething", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 14, - 17, + 33, + 34, ], - "type": "Identifier", - "value": "arr", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 17, - 18, + 34, + 35, ], "type": "Punctuator", "value": ")", @@ -85348,17 +87943,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 18, - 19, + 35, + 36, ], "type": "Punctuator", "value": ";", @@ -85368,125 +87963,109 @@ Object { } `; -exports[`javascript fixtures/forIn/for-in-with-const.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-destruction.src 1`] = ` Object { "body": Array [ Object { + "await": false, "body": Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "process", - "range": Array [ - 22, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 32, - ], - "type": "CallExpression", - }, + "body": Array [], "loc": Object { "end": Object { "column": 33, "line": 1, }, "start": Object { - "column": 22, + "column": 31, "line": 1, }, }, "range": Array [ - 22, + 31, 33, ], - "type": "ExpressionStatement", + "type": "BlockStatement", }, "left": Object { "declarations": Array [ Object { "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, + ], "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, - "name": "x", "range": Array [ - 11, - 12, + 9, + 22, ], - "type": "Identifier", + "type": "ArrayPattern", }, "init": null, "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 12, + 9, + 22, ], "type": "VariableDeclarator", }, ], - "kind": "const", + "kind": "var", "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { @@ -85496,7 +88075,7 @@ Object { }, "range": Array [ 5, - 12, + 22, ], "type": "VariableDeclaration", }, @@ -85517,22 +88096,22 @@ Object { "right": Object { "loc": Object { "end": Object { - "column": 20, + "column": 29, "line": 1, }, "start": Object { - "column": 16, + "column": 26, "line": 1, }, }, - "name": "list", + "name": "obj", "range": Array [ - 16, - 20, + 26, + 29, ], "type": "Identifier", }, - "type": "ForInStatement", + "type": "ForOfStatement", }, ], "loc": Object { @@ -85590,7 +88169,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -85600,28 +88179,46 @@ Object { }, "range": Array [ 5, - 10, + 8, ], "type": "Keyword", - "value": "const", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 12, + 9, + 10, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, ], "type": "Identifier", - "value": "x", + "value": "name", }, Object { "loc": Object { @@ -85630,21 +88227,21 @@ Object { "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, + 14, 15, ], - "type": "Keyword", - "value": "in", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { @@ -85654,82 +88251,82 @@ Object { }, "range": Array [ 16, - 20, + 21, ], "type": "Identifier", - "value": "list", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 22, "line": 1, }, "start": Object { - "column": 20, + "column": 21, "line": 1, }, }, "range": Array [ - 20, 21, + 22, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 25, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, "range": Array [ - 22, - 29, + 23, + 25, ], "type": "Identifier", - "value": "process", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 29, "line": 1, }, "start": Object { - "column": 29, + "column": 26, "line": 1, }, }, "range": Array [ + 26, 29, - 30, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 30, "line": 1, }, "start": Object { - "column": 30, + "column": 29, "line": 1, }, }, "range": Array [ + 29, 30, - 31, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -85747,7 +88344,7 @@ Object { 32, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { @@ -85765,33 +88362,35 @@ Object { 33, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-with-milti-asigment.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-destruction-object.src 1`] = ` Object { "body": Array [ Object { + "await": false, "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { - "column": 24, + "column": 31, "line": 1, }, }, "range": Array [ - 24, - 25, + 31, + 33, ], - "type": "EmptyStatement", + "type": "BlockStatement", }, "left": Object { "declarations": Array [ @@ -85799,7 +88398,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 1, }, "start": Object { @@ -85807,70 +88406,132 @@ Object { "line": 1, }, }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, - "start": Object { - "column": 13, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 14, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, }, - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 13, - 18, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", }, - "start": Object { - "column": 17, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", }, }, - "name": "z", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", + ], + "range": Array [ + 9, + 22, + ], + "type": "ObjectPattern", }, + "init": null, "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { @@ -85880,7 +88541,7 @@ Object { }, "range": Array [ 9, - 18, + 22, ], "type": "VariableDeclarator", }, @@ -85888,7 +88549,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { @@ -85898,13 +88559,13 @@ Object { }, "range": Array [ 5, - 18, + 22, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { @@ -85914,27 +88575,27 @@ Object { }, "range": Array [ 0, - 25, + 33, ], "right": Object { "loc": Object { "end": Object { - "column": 23, + "column": 29, "line": 1, }, "start": Object { - "column": 22, + "column": 26, "line": 1, }, }, - "name": "q", + "name": "obj", "range": Array [ - 22, - 23, + 26, + 29, ], "type": "Identifier", }, - "type": "ForInStatement", + "type": "ForOfStatement", }, ], "loc": Object { @@ -85949,7 +88610,7 @@ Object { }, "range": Array [ 0, - 26, + 34, ], "sourceType": "script", "tokens": Array [ @@ -86022,231 +88683,231 @@ Object { 9, 10, ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], "type": "Identifier", - "value": "x", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 14, "line": 1, }, }, "range": Array [ - 11, - 12, + 14, + 15, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 21, "line": 1, }, "start": Object { - "column": 13, + "column": 16, "line": 1, }, }, "range": Array [ - 13, - 14, + 16, + 21, ], "type": "Identifier", - "value": "y", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 15, + "column": 21, "line": 1, }, }, "range": Array [ - 15, - 16, + 21, + 22, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 25, "line": 1, }, "start": Object { - "column": 17, + "column": 23, "line": 1, }, }, "range": Array [ - 17, - 18, + 23, + 25, ], "type": "Identifier", - "value": "z", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 29, "line": 1, }, "start": Object { - "column": 19, + "column": 26, "line": 1, }, }, "range": Array [ - 19, - 21, + 26, + 29, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 30, "line": 1, }, "start": Object { - "column": 22, + "column": 29, "line": 1, }, }, "range": Array [ - 22, - 23, + 29, + 30, ], - "type": "Identifier", - "value": "q", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 32, "line": 1, }, "start": Object { - "column": 23, + "column": 31, "line": 1, }, }, "range": Array [ - 23, - 24, + 31, + 32, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { - "column": 24, + "column": 32, "line": 1, }, }, "range": Array [ - 24, - 25, + 32, + 33, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-with-var.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-object.src 1`] = ` Object { "body": Array [ Object { + "await": false, "body": Object { "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - ], + "arguments": Array [], "callee": Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "process", + "name": "doSomething", "range": Array [ - 20, - 27, + 22, + 33, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 20, - 30, + 22, + 35, ], "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 20, - 31, + 22, + 36, ], "type": "ExpressionStatement", }, @@ -86289,7 +88950,7 @@ Object { "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "let", "loc": Object { "end": Object { "column": 10, @@ -86308,8 +88969,8 @@ Object { }, "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 0, @@ -86318,12 +88979,12 @@ Object { }, "range": Array [ 0, - 31, + 36, ], "right": Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { @@ -86331,20 +88992,20 @@ Object { "line": 1, }, }, - "name": "list", + "properties": Array [], "range": Array [ 14, - 18, + 16, ], - "type": "Identifier", + "type": "ObjectExpression", }, - "type": "ForInStatement", + "type": "ForOfStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -86353,7 +89014,7 @@ Object { }, "range": Array [ 0, - 32, + 37, ], "sourceType": "script", "tokens": Array [ @@ -86409,7 +89070,7 @@ Object { 8, ], "type": "Keyword", - "value": "var", + "value": "let", }, Object { "loc": Object { @@ -86444,13 +89105,13 @@ Object { 11, 13, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { @@ -86460,97 +89121,97 @@ Object { }, "range": Array [ 14, - 18, + 15, ], - "type": "Identifier", - "value": "list", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 16, "line": 1, }, "start": Object { - "column": 18, + "column": 15, "line": 1, }, }, "range": Array [ - 18, - 19, + 15, + 16, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 17, "line": 1, }, "start": Object { - "column": 20, + "column": 16, "line": 1, }, }, "range": Array [ - 20, - 27, + 16, + 17, ], - "type": "Identifier", - "value": "process", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 27, - 28, + 22, + 33, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "doSomething", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 28, - 29, + 33, + 34, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 29, - 30, + 34, + 35, ], "type": "Punctuator", "value": ")", @@ -86558,17 +89219,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 30, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 30, - 31, + 35, + 36, ], "type": "Punctuator", "value": ";", diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 2b233a910ef8..1ca5b49b52ba 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -636,10 +636,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-let.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-bare-nonstrict.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-destruction.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-destruction-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-object.src.js.src 1`] = ` Object { "column": 14, @@ -649,6 +653,8 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-object-with-body.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-bare-assigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -659,6 +665,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-destruction.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-destruction-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src.js.src 1`] = ` Object { "column": 9, @@ -1915,6 +1929,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-declare-const-named-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-declare-named-enum.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1980,6 +1998,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-jsdoc.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-optional-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-without-type-annotation.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -2008,7 +2028,13 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-arrow-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-interface.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-parameters-comments.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -2040,6 +2066,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-void.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-method-signature.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-this.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/unique-symbol.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -2166,6 +2194,15 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/index-signature-parameters.src.ts.src 1`] = ` +Object { + "column": 3, + "index": 16, + "lineNumber": 2, + "message": "An index signature must have exactly one parameter.", +} +`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-empty-extends.src.ts.src 1`] = ` Object { "column": 21, @@ -2241,12 +2278,18 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-with-this.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/index-signature.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/index-signature-readonly.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-number.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-number-negative.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-string.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index b182d2671f53..fb8b6ca3dccb 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -29244,105 +29244,142 @@ Object { } `; -exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/export-declare-const-named-enum.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "body": Object { - "body": Array [], + "const": true, + "declare": true, + "id": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 29, + "line": 1, }, "start": Object { - "column": 24, + "column": 26, "line": 1, }, }, + "name": "Foo", "range": Array [ - 24, - 28, + 26, + 29, ], - "type": "ClassBody", + "type": "Identifier", }, - "id": null, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { - "column": 15, + "column": 21, "line": 1, }, }, - "range": Array [ - 15, - 28, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", }, - }, - "params": Array [ - Object { + "initializer": Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 10, + "line": 2, }, }, - "name": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, + "range": Array [ + 42, + 43, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", }, + "name": "bar", "range": Array [ - 21, - 22, + 49, + 52, ], - "type": "TSTypeParameter", + "type": "Identifier", }, - ], - "range": Array [ - 20, - 23, - ], - "type": "TSTypeParameterDeclaration", - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 21, + 54, + ], + "type": "TSEnumDeclaration", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -29351,15 +29388,17 @@ Object { }, "range": Array [ 0, - 28, + 54, ], - "type": "ExportDefaultDeclaration", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -29368,7 +29407,7 @@ Object { }, "range": Array [ 0, - 29, + 55, ], "sourceType": "module", "tokens": Array [ @@ -29405,8 +29444,8 @@ Object { 7, 14, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { @@ -29424,94 +29463,166 @@ Object { 20, ], "type": "Keyword", - "value": "class", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 20, + "column": 21, "line": 1, }, }, "range": Array [ - 20, 21, + 25, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 29, "line": 1, }, "start": Object { - "column": 21, + "column": 26, "line": 1, }, }, "range": Array [ - 21, - 22, + 26, + 29, ], "type": "Identifier", - "value": "T", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 31, "line": 1, }, "start": Object { - "column": 22, + "column": 30, "line": 1, }, }, "range": Array [ - 22, - 23, + 30, + 31, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 24, - 25, + 36, + 39, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, "line": 3, }, "start": Object { - "column": 0, + "column": 4, "line": 3, }, }, "range": Array [ - 27, - 28, + 49, + 52, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, ], "type": "Punctuator", "value": "}", @@ -29521,140 +29632,141 @@ Object { } `; -exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` +exports[`typescript fixtures/basics/export-declare-named-enum.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "body": Object { - "body": Array [], + "declare": true, + "id": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { - "column": 27, + "column": 20, "line": 1, }, }, + "name": "Foo", "range": Array [ - 27, - 31, + 20, + 23, ], - "type": "ClassBody", + "type": "Identifier", }, - "id": null, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 15, "line": 1, }, }, - "range": Array [ - 15, - 31, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "params": Array [ - Object { + "members": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, + "column": 4, + "line": 2, }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", }, + "name": "foo", "range": Array [ - 21, - 22, + 30, + 33, ], - "type": "TSTypeParameter", + "type": "Identifier", }, - Object { + "initializer": Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 10, + "line": 2, }, }, - "name": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, + "range": Array [ + 36, + 37, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, }, - "name": "U", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", }, + "name": "bar", "range": Array [ - 24, - 25, + 43, + 46, ], - "type": "TSTypeParameter", + "type": "Identifier", }, - ], - "range": Array [ - 20, - 26, - ], - "type": "TSTypeParameterDeclaration", - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 15, + 48, + ], + "type": "TSEnumDeclaration", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -29663,15 +29775,17 @@ Object { }, "range": Array [ 0, - 31, + 48, ], - "type": "ExportDefaultDeclaration", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -29680,7 +29794,7 @@ Object { }, "range": Array [ 0, - 32, + 49, ], "sourceType": "module", "tokens": Array [ @@ -29717,13 +29831,13 @@ Object { 7, 14, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { @@ -29733,15 +29847,15 @@ Object { }, "range": Array [ 15, - 20, + 19, ], "type": "Keyword", - "value": "class", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { @@ -29751,115 +29865,133 @@ Object { }, "range": Array [ 20, - 21, + 23, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 21, + "column": 24, "line": 1, }, }, "range": Array [ - 21, - 22, + 24, + 25, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, - }, + "column": 7, + "line": 2, + }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 22, - 23, + 30, + 33, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 24, - 25, + 36, + 37, ], - "type": "Identifier", - "value": "U", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 25, - 26, + 37, + 38, ], "type": "Punctuator", - "value": ">", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 27, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 27, - 28, + 43, + 46, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 4, }, }, "range": Array [ - 30, - 31, + 47, + 48, ], "type": "Punctuator", "value": "}", @@ -29869,7 +30001,7 @@ Object { } `; -exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` Object { "body": Array [ Object { @@ -29882,58 +30014,41 @@ Object { "line": 3, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "range": Array [ - 20, 24, + 28, ], "type": "ClassBody", }, - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, + "id": null, "loc": Object { "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 24, + 15, + 28, ], "superClass": null, "type": "ClassDeclaration", "typeParameters": Object { "loc": Object { "end": Object { - "column": 19, + "column": 23, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, @@ -29941,42 +30056,42 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "name": Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "name": "T", "range": Array [ - 17, - 18, + 21, + 22, ], "type": "Identifier", }, "range": Array [ - 17, - 18, + 21, + 22, ], "type": "TSTypeParameter", }, ], "range": Array [ - 16, - 19, + 20, + 23, ], "type": "TSTypeParameterDeclaration", }, @@ -29993,11 +30108,9 @@ Object { }, "range": Array [ 0, - 24, + 28, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { @@ -30012,7 +30125,7 @@ Object { }, "range": Array [ 0, - 25, + 29, ], "sourceType": "module", "tokens": Array [ @@ -30037,7 +30150,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { @@ -30047,43 +30160,43 @@ Object { }, "range": Array [ 7, - 12, + 14, ], "type": "Keyword", - "value": "class", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 16, + 15, + 20, ], - "type": "Identifier", - "value": "Foo", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 17, + 20, + 21, ], "type": "Punctuator", "value": "<", @@ -30091,17 +30204,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "range": Array [ - 17, - 18, + 21, + 22, ], "type": "Identifier", "value": "T", @@ -30109,17 +30222,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 23, "line": 1, }, "start": Object { - "column": 18, + "column": 22, "line": 1, }, }, "range": Array [ - 18, - 19, + 22, + 23, ], "type": "Punctuator", "value": ">", @@ -30127,17 +30240,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "range": Array [ - 20, - 21, + 24, + 25, ], "type": "Punctuator", "value": "{", @@ -30154,8 +30267,8 @@ Object { }, }, "range": Array [ - 23, - 24, + 27, + 28, ], "type": "Punctuator", "value": "}", @@ -30165,7 +30278,7 @@ Object { } `; -exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` +exports[`typescript fixtures/basics/export-default-class-with-multiple-generics.src 1`] = ` Object { "body": Array [ Object { @@ -30178,58 +30291,41 @@ Object { "line": 3, }, "start": Object { - "column": 23, + "column": 27, "line": 1, }, }, "range": Array [ - 23, 27, + 31, ], "type": "ClassBody", }, - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, + "id": null, "loc": Object { "end": Object { "column": 1, "line": 3, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 27, + 15, + 31, ], "superClass": null, "type": "ClassDeclaration", "typeParameters": Object { "loc": Object { "end": Object { - "column": 22, + "column": 26, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, @@ -30237,77 +30333,77 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "name": Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "name": "T", "range": Array [ - 17, - 18, + 21, + 22, ], "type": "Identifier", }, "range": Array [ - 17, - 18, + 21, + 22, ], "type": "TSTypeParameter", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "name": Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "name": "U", "range": Array [ - 20, - 21, + 24, + 25, ], "type": "Identifier", }, "range": Array [ - 20, - 21, + 24, + 25, ], "type": "TSTypeParameter", }, ], "range": Array [ - 16, - 22, + 20, + 26, ], "type": "TSTypeParameterDeclaration", }, @@ -30324,11 +30420,9 @@ Object { }, "range": Array [ 0, - 27, + 31, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { @@ -30343,7 +30437,7 @@ Object { }, "range": Array [ 0, - 28, + 32, ], "sourceType": "module", "tokens": Array [ @@ -30368,7 +30462,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { @@ -30378,43 +30472,43 @@ Object { }, "range": Array [ 7, - 12, + 14, ], "type": "Keyword", - "value": "class", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 16, + 15, + 20, ], - "type": "Identifier", - "value": "Foo", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 17, + 20, + 21, ], "type": "Punctuator", "value": "<", @@ -30422,17 +30516,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "range": Array [ - 17, - 18, + 21, + 22, ], "type": "Identifier", "value": "T", @@ -30440,17 +30534,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 23, "line": 1, }, "start": Object { - "column": 18, + "column": 22, "line": 1, }, }, "range": Array [ - 18, - 19, + 22, + 23, ], "type": "Punctuator", "value": ",", @@ -30458,17 +30552,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "range": Array [ - 20, - 21, + 24, + 25, ], "type": "Identifier", "value": "U", @@ -30476,17 +30570,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 26, "line": 1, }, "start": Object { - "column": 21, + "column": 25, "line": 1, }, }, "range": Array [ - 21, - 22, + 25, + 26, ], "type": "Punctuator", "value": ">", @@ -30494,17 +30588,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 28, "line": 1, }, "start": Object { - "column": 23, + "column": 27, "line": 1, }, }, "range": Array [ - 23, - 24, + 27, + 28, ], "type": "Punctuator", "value": "{", @@ -30521,8 +30615,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 30, + 31, ], "type": "Punctuator", "value": "}", @@ -30532,140 +30626,122 @@ Object { } `; -exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/export-named-class-with-generic.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "ClassBody", + }, "id": Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "name": "Foo", "range": Array [ - 12, - 15, + 13, + 16, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 7, "line": 1, }, }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "initializer": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "raw": "1", - "type": "Literal", - "value": 1, + "range": Array [ + 7, + 24, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "start": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 22, - 29, - ], - "type": "TSEnumMember", }, - Object { - "id": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 17, + "line": 1, }, }, - "name": "bar", + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, "range": Array [ - 35, - 38, + 17, + 18, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "type": "TSTypeParameter", }, - "range": Array [ - 35, - 38, - ], - "type": "TSEnumMember", - }, - ], - "range": Array [ - 7, - 40, - ], - "type": "TSEnumDeclaration", + ], + "range": Array [ + 16, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, }, "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 0, @@ -30674,7 +30750,7 @@ Object { }, "range": Array [ 0, - 40, + 24, ], "source": null, "specifiers": Array [], @@ -30683,7 +30759,7 @@ Object { ], "loc": Object { "end": Object { - "column": 1, + "column": 0, "line": 4, }, "start": Object { @@ -30693,7 +30769,7 @@ Object { }, "range": Array [ 0, - 40, + 25, ], "sourceType": "module", "tokens": Array [ @@ -30718,7 +30794,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 12, "line": 1, }, "start": Object { @@ -30728,25 +30804,25 @@ Object { }, "range": Array [ 7, - 11, + 12, ], "type": "Keyword", - "value": "enum", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, - 15, + 13, + 16, ], "type": "Identifier", "value": "Foo", @@ -30767,112 +30843,76 @@ Object { 17, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 22, - 25, + 17, + 18, ], "type": "Identifier", - "value": "foo", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 26, - 27, + 18, + 19, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Numeric", - "value": "1", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 29, - 30, + 20, + 21, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 35, - 38, - ], - "type": "Identifier", - "value": "bar", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 3, }, "start": Object { "column": 0, - "line": 4, + "line": 3, }, }, "range": Array [ - 39, - 40, + 23, + 24, ], "type": "Punctuator", "value": "}", @@ -30882,33 +30922,51 @@ Object { } `; -exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` +exports[`typescript fixtures/basics/export-named-class-with-multiple-generics.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "ClassBody", + }, "id": Object { "loc": Object { "end": Object { - "column": 21, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, - "name": "TestAlias", + "name": "Foo", "range": Array [ - 12, - 21, + 13, + 16, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 7, @@ -30917,67 +30975,104 @@ Object { }, "range": Array [ 7, - 40, + 27, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 39, + "column": 22, "line": 1, }, "start": Object { - "column": 24, + "column": 16, "line": 1, }, }, - "range": Array [ - 24, - 39, - ], - "type": "TSUnionType", - "types": Array [ + "params": Array [ Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { - "column": 24, + "column": 17, "line": 1, }, }, + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, "range": Array [ - 24, - 30, + 17, + 18, ], - "type": "TSStringKeyword", + "type": "TSTypeParameter", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 21, "line": 1, }, "start": Object { - "column": 33, + "column": 20, "line": 1, }, }, + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, "range": Array [ - 33, - 39, + 20, + 21, ], - "type": "TSNumberKeyword", + "type": "TSTypeParameter", }, ], + "range": Array [ + 16, + 22, + ], + "type": "TSTypeParameterDeclaration", }, }, "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -30986,7 +31081,7 @@ Object { }, "range": Array [ 0, - 40, + 27, ], "source": null, "specifiers": Array [], @@ -30995,8 +31090,8 @@ Object { ], "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -31005,7 +31100,7 @@ Object { }, "range": Array [ 0, - 40, + 28, ], "sourceType": "module", "tokens": Array [ @@ -31030,7 +31125,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 12, "line": 1, }, "start": Object { @@ -31040,125 +31135,161 @@ Object { }, "range": Array [ 7, - 11, + 12, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, - 21, + 13, + 16, ], "type": "Identifier", - "value": "TestAlias", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { - "column": 24, + "column": 17, "line": 1, }, }, "range": Array [ - 24, - 30, + 17, + 18, ], "type": "Identifier", - "value": "string", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 19, "line": 1, }, "start": Object { - "column": 31, + "column": 18, "line": 1, }, }, "range": Array [ - 31, - 32, - ], + 18, + 19, + ], "type": "Punctuator", - "value": "|", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 21, "line": 1, }, "start": Object { - "column": 33, + "column": 20, "line": 1, }, }, "range": Array [ - 33, - 39, + 20, + 21, ], "type": "Identifier", - "value": "number", + "value": "U", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 22, "line": 1, }, "start": Object { - "column": 39, + "column": 21, "line": 1, }, }, "range": Array [ - 39, - 40, + 21, + 22, ], "type": "Punctuator", - "value": ";", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` +exports[`typescript fixtures/basics/export-named-enum.src 1`] = ` Object { "body": Array [ Object { @@ -31166,7 +31297,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { @@ -31174,122 +31305,124 @@ Object { "line": 1, }, }, - "name": "TestClassProps", + "name": "Foo", "range": Array [ 12, - 26, + 15, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { "column": 7, "line": 1, }, }, - "range": Array [ - 7, - 51, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, }, - "name": "count", - "range": Array [ - 35, - 40, - ], - "type": "Identifier", }, + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "initializer": Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 2, }, "start": Object { - "column": 4, + "column": 10, "line": 2, }, }, "range": Array [ - 35, - 48, + 28, + 29, ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, }, - "range": Array [ - 40, - 48, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 42, - 48, - ], - "type": "TSNumberKeyword", + "start": Object { + "column": 4, + "line": 3, }, }, + "name": "bar", + "range": Array [ + 35, + 38, + ], + "type": "Identifier", }, - ], - "range": Array [ - 29, - 50, - ], - "type": "TSTypeLiteral", - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 7, + 40, + ], + "type": "TSEnumDeclaration", }, "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -31298,7 +31431,7 @@ Object { }, "range": Array [ 0, - 51, + 40, ], "source": null, "specifiers": Array [], @@ -31307,8 +31440,8 @@ Object { ], "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -31317,7 +31450,7 @@ Object { }, "range": Array [ 0, - 51, + 40, ], "sourceType": "module", "tokens": Array [ @@ -31354,13 +31487,13 @@ Object { 7, 11, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { @@ -31370,46 +31503,46 @@ Object { }, "range": Array [ 12, - 26, + 15, ], "type": "Identifier", - "value": "TestClassProps", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 17, "line": 1, }, "start": Object { - "column": 27, + "column": 16, "line": 1, }, }, "range": Array [ - 27, - 28, + 16, + 17, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 29, - 30, + 22, + 25, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -31418,39 +31551,39 @@ Object { "line": 2, }, "start": Object { - "column": 4, + "column": 8, "line": 2, }, }, "range": Array [ - 35, - 40, + 26, + 27, ], - "type": "Identifier", - "value": "count", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 2, }, "start": Object { - "column": 9, + "column": 10, "line": 2, }, }, "range": Array [ - 40, - 41, + 28, + 29, ], - "type": "Punctuator", - "value": ":", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 12, "line": 2, }, "start": Object { @@ -31459,54 +31592,54 @@ Object { }, }, "range": Array [ - 42, - 48, + 29, + 30, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 7, "line": 3, }, "start": Object { - "column": 0, + "column": 4, "line": 3, }, }, "range": Array [ - 49, - 50, + 35, + 38, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 1, + "line": 4, }, "start": Object { - "column": 1, - "line": 3, + "column": 0, + "line": 4, }, }, "range": Array [ - 50, - 51, + 39, + 40, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` +exports[`typescript fixtures/basics/export-type-alias-declaration.src 1`] = ` Object { "body": Array [ Object { @@ -31514,7 +31647,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 1, }, "start": Object { @@ -31522,16 +31655,16 @@ Object { "line": 1, }, }, - "name": "TestCallback", + "name": "TestAlias", "range": Array [ 12, - 24, + 21, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 47, + "column": 40, "line": 1, }, "start": Object { @@ -31541,118 +31674,66 @@ Object { }, "range": Array [ 7, - 47, + 40, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 46, + "column": 39, "line": 1, }, "start": Object { - "column": 27, + "column": 24, "line": 1, }, }, - "params": Array [ + "range": Array [ + 24, + 39, + ], + "type": "TSUnionType", + "types": Array [ Object { "loc": Object { "end": Object { - "column": 37, + "column": 30, "line": 1, }, "start": Object { - "column": 28, + "column": 24, "line": 1, }, }, - "name": "a", "range": Array [ - 28, - 37, + 24, + 30, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 37, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 37, - ], - "type": "TSNumberKeyword", - }, - }, - }, - ], - "range": Array [ - 27, - 46, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, + "type": "TSStringKeyword", }, - "range": Array [ - 39, - 46, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + Object { "loc": Object { "end": Object { - "column": 46, + "column": 39, "line": 1, }, "start": Object { - "column": 42, + "column": 33, "line": 1, }, }, "range": Array [ - 42, - 46, + 33, + 39, ], - "type": "TSVoidKeyword", + "type": "TSNumberKeyword", }, - }, - "type": "TSFunctionType", + ], }, }, "loc": Object { "end": Object { - "column": 47, + "column": 40, "line": 1, }, "start": Object { @@ -31662,7 +31743,7 @@ Object { }, "range": Array [ 0, - 47, + 40, ], "source": null, "specifiers": Array [], @@ -31671,7 +31752,7 @@ Object { ], "loc": Object { "end": Object { - "column": 47, + "column": 40, "line": 1, }, "start": Object { @@ -31681,7 +31762,7 @@ Object { }, "range": Array [ 0, - 47, + 40, ], "sourceType": "module", "tokens": Array [ @@ -31724,7 +31805,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 1, }, "start": Object { @@ -31734,25 +31815,25 @@ Object { }, "range": Array [ 12, - 24, + 21, ], "type": "Identifier", - "value": "TestCallback", + "value": "TestAlias", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 23, "line": 1, }, "start": Object { - "column": 25, + "column": 22, "line": 1, }, }, "range": Array [ - 25, - 26, + 22, + 23, ], "type": "Punctuator", "value": "=", @@ -31760,143 +31841,419 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 30, "line": 1, }, "start": Object { - "column": 27, + "column": 24, "line": 1, }, }, "range": Array [ - 27, - 28, + 24, + 30, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 32, "line": 1, }, "start": Object { - "column": 28, + "column": 31, "line": 1, }, }, "range": Array [ - 28, - 29, + 31, + 32, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "|", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 39, "line": 1, }, "start": Object { - "column": 29, + "column": 33, "line": 1, }, }, "range": Array [ - 29, - 30, + 33, + 39, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 40, "line": 1, }, "start": Object { - "column": 31, + "column": 39, "line": 1, }, }, "range": Array [ - 31, - 37, + 39, + 40, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ";", }, - Object { + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-type-class-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "TestClassProps", + "range": Array [ + 12, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 51, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "count", + "range": Array [ + 35, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 35, + 48, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 40, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 29, + 50, + ], + "type": "TSTypeLiteral", + }, + }, "loc": Object { "end": Object { - "column": 38, + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, "line": 1, }, "start": Object { - "column": 37, + "column": 0, "line": 1, }, }, "range": Array [ - 37, - 38, + 0, + 6, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 11, "line": 1, }, "start": Object { - "column": 39, + "column": 7, "line": 1, }, }, "range": Array [ - 39, - 41, + 7, + 11, ], - "type": "Punctuator", - "value": "=>", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 26, "line": 1, }, "start": Object { - "column": 42, + "column": 12, "line": 1, }, }, "range": Array [ - 42, - 46, + 12, + 26, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "TestClassProps", }, Object { "loc": Object { "end": Object { - "column": 47, + "column": 28, "line": 1, }, "start": Object { - "column": 46, + "column": 27, "line": 1, }, }, "range": Array [ - 46, - 47, + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 35, + 40, + ], + "type": "Identifier", + "value": "count", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 50, + 51, ], "type": "Punctuator", "value": ";", @@ -31906,35 +32263,32 @@ Object { } `; -exports[`typescript fixtures/basics/function-overloads.src 1`] = ` +exports[`typescript fixtures/basics/export-type-function-declaration.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "async": false, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, - "name": "f", + "name": "TestCallback", "range": Array [ - 16, - 17, + 12, + 24, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 37, + "column": 47, "line": 1, }, "start": Object { @@ -31942,103 +32296,120 @@ Object { "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, + "range": Array [ + 7, + 47, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, }, - "name": "x", - "range": Array [ - 18, - 27, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 27, + "column": 37, "line": 1, }, "start": Object { - "column": 19, + "column": 28, "line": 1, }, }, + "name": "a", "range": Array [ - 19, - 27, + 28, + 37, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 27, + "column": 37, "line": 1, }, "start": Object { - "column": 21, + "column": 29, "line": 1, }, }, "range": Array [ - 21, - 27, + 29, + 37, ], - "type": "TSNumberKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSNumberKeyword", + }, }, }, - }, - ], - "range": Array [ - 7, - 37, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, + ], "range": Array [ - 28, - 36, + 27, + 46, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 36, + "column": 46, "line": 1, }, "start": Object { - "column": 30, + "column": 39, "line": 1, }, }, "range": Array [ - 30, - 36, + 39, + 46, ], - "type": "TSNumberKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 46, + ], + "type": "TSVoidKeyword", + }, }, + "type": "TSFunctionType", }, - "type": "TSDeclareFunction", }, "loc": Object { "end": Object { - "column": 37, + "column": 47, "line": 1, }, "start": Object { @@ -32048,36 +32419,422 @@ Object { }, "range": Array [ 0, - 37, + 47, ], "source": null, "specifiers": Array [], "type": "ExportNamedDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 47, + ], + "sourceType": "module", + "tokens": Array [ Object { - "declaration": Object { - "async": false, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "f", - "range": Array [ - 54, - 55, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, - "loc": Object { + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 24, + ], + "type": "Identifier", + "value": "TestCallback", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 41, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 46, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/function-overloads.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 27, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 27, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 7, + 37, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "TSDeclareFunction", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + Object { + "declaration": Object { + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "f", + "range": Array [ + 54, + 55, + ], + "type": "Identifier", + }, + "loc": Object { "end": Object { "column": 37, "line": 2, @@ -45164,7 +45921,7 @@ Object { } `; -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` Object { "body": Array [ Object { @@ -45175,106 +45932,124 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, - "name": "foo", + "name": "h", "range": Array [ - 21, - 24, + 19, + 20, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 9, + "column": 23, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, - "optional": true, - "range": Array [ - 21, - 26, - ], - "type": "TSPropertySignature", - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, - "start": Object { - "column": 4, - "line": 3, + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, }, }, - "name": "bar", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "optional": true, + ], "range": Array [ - 31, - 44, + 19, + 40, ], - "type": "TSPropertySignature", + "static": false, + "type": "TSMethodSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 8, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ - 35, - 43, + 33, + 39, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 10, - "line": 3, + "column": 18, + "line": 2, }, }, "range": Array [ - 37, - 43, + 35, + 39, ], - "type": "TSStringKeyword", + "type": "TSVoidKeyword", }, }, }, @@ -45283,137 +46058,222 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 3, + "line": 3, }, "start": Object { - "column": 4, - "line": 4, + "column": 2, + "line": 3, }, }, - "name": "baz", + "name": "g", "range": Array [ - 49, - 52, + 43, + 44, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 18, + "line": 3, }, "start": Object { - "column": 4, - "line": 4, + "column": 2, + "line": 3, }, }, - "optional": true, + "optional": false, "params": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "name": "foo", - "range": Array [ - 54, - 57, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, + "column": 13, + "line": 3, }, "start": Object { - "column": 14, - "line": 4, + "column": 7, + "line": 3, }, }, "name": "bar", - "optional": true, "range": Array [ - 59, - 71, + 48, + 54, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 13, + "line": 3, }, "start": Object { - "column": 18, - "line": 4, + "column": 10, + "line": 3, }, }, "range": Array [ - 63, - 71, + 51, + 54, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 13, + "line": 3, }, "start": Object { - "column": 20, - "line": 4, + "column": 12, + "line": 3, }, }, "range": Array [ - 65, - 71, + 53, + 54, ], - "type": "TSStringKeyword", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, }, }, }, - Object { + ], + "range": Array [ + 43, + 59, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 55, + 58, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 17, + "line": 3, }, "start": Object { - "column": 28, - "line": 4, + "column": 16, + "line": 3, }, }, - "name": "baz", - "optional": true, "range": Array [ - 73, - 76, + 57, + 58, ], - "type": "Identifier", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, }, - ], - "range": Array [ - 49, - 79, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": null, + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "range": Array [ + 45, + 46, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 44, + 47, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 15, @@ -45422,7 +46282,7 @@ Object { }, "range": Array [ 15, - 81, + 61, ], "type": "TSInterfaceBody", }, @@ -45448,7 +46308,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -45457,7 +46317,7 @@ Object { }, "range": Array [ 0, - 81, + 61, ], "type": "TSInterfaceDeclaration", }, @@ -45465,7 +46325,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 5, }, "start": Object { "column": 0, @@ -45474,7 +46334,7 @@ Object { }, "range": Array [ 0, - 82, + 62, ], "sourceType": "script", "tokens": Array [ @@ -45532,6 +46392,42 @@ Object { "type": "Punctuator", "value": "{", }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "h", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "(", + }, Object { "loc": Object { "end": Object { @@ -45548,7 +46444,7 @@ Object { 24, ], "type": "Identifier", - "value": "foo", + "value": "bar", }, Object { "loc": Object { @@ -45566,166 +46462,184 @@ Object { 25, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 15, "line": 2, }, "start": Object { - "column": 8, + "column": 9, "line": 2, }, }, "range": Array [ - 25, 26, + 32, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 16, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 15, + "line": 2, }, }, "range": Array [ - 31, - 34, + 32, + 33, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 7, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ + 33, 34, - 35, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 8, - "line": 3, + "column": 18, + "line": 2, }, }, "range": Array [ 35, - 36, + 39, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 3, "line": 3, }, "start": Object { - "column": 10, + "column": 2, "line": 3, }, }, "range": Array [ - 37, 43, + 44, ], "type": "Identifier", - "value": "string", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 4, "line": 3, }, "start": Object { - "column": 16, + "column": 3, "line": 3, }, }, "range": Array [ - 43, 44, + 45, ], "type": "Punctuator", - "value": ";", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 4, + "line": 3, }, }, "range": Array [ - 49, - 52, + 45, + 46, ], "type": "Identifier", - "value": "baz", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 4, + "column": 6, + "line": 3, }, "start": Object { - "column": 7, - "line": 4, + "column": 5, + "line": 3, }, }, "range": Array [ - 52, - 53, + 46, + 47, ], "type": "Punctuator", - "value": "?", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 7, + "line": 3, }, "start": Object { - "column": 8, - "line": 4, + "column": 6, + "line": 3, }, }, "range": Array [ - 53, - 54, + 47, + 48, ], "type": "Punctuator", "value": "(", @@ -45733,53 +46647,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "range": Array [ - 54, - 57, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, + "column": 10, + "line": 3, }, "start": Object { - "column": 14, - "line": 4, + "column": 7, + "line": 3, }, }, "range": Array [ - 59, - 62, + 48, + 51, ], "type": "Identifier", "value": "bar", @@ -45787,35 +46665,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 4, + "column": 11, + "line": 3, }, "start": Object { - "column": 18, - "line": 4, + "column": 10, + "line": 3, }, }, "range": Array [ - 63, - 64, + 51, + 52, ], "type": "Punctuator", "value": ":", @@ -45823,107 +46683,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 13, + "line": 3, }, "start": Object { - "column": 20, - "line": 4, + "column": 12, + "line": 3, }, }, "range": Array [ - 65, - 71, + 53, + 54, ], "type": "Identifier", - "value": "string", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 14, + "line": 3, }, "start": Object { - "column": 26, - "line": 4, + "column": 13, + "line": 3, }, }, "range": Array [ - 71, - 72, + 54, + 55, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 4, - }, - "start": Object { - "column": 28, - "line": 4, - }, - }, - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - "value": "baz", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 15, + "line": 3, }, "start": Object { - "column": 31, - "line": 4, + "column": 14, + "line": 3, }, }, "range": Array [ - 76, - 77, + 55, + 56, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 4, + "column": 17, + "line": 3, }, "start": Object { - "column": 32, - "line": 4, + "column": 16, + "line": 3, }, }, "range": Array [ - 77, - 78, + 57, + 58, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 18, + "line": 3, }, "start": Object { - "column": 33, - "line": 4, + "column": 17, + "line": 3, }, }, "range": Array [ - 78, - 79, + 58, + 59, ], "type": "Punctuator", "value": ";", @@ -45932,16 +46774,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, - "line": 5, + "line": 4, }, }, "range": Array [ - 80, - 81, + 60, + 61, ], "type": "Punctuator", "value": "}", @@ -45951,7 +46793,7 @@ Object { } `; -exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { "body": Array [ Object { @@ -45979,7 +46821,7 @@ Object { }, "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 2, }, "start": Object { @@ -45987,17 +46829,220 @@ Object { "line": 2, }, }, + "optional": true, "range": Array [ 21, - 25, + 26, + ], + "type": "TSPropertySignature", + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 31, + 44, ], "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 35, + 43, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 37, + 43, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "baz", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "optional": true, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "foo", + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "name": "bar", + "optional": true, + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 63, + 71, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 65, + 71, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "name": "baz", + "optional": true, + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 49, + 79, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 15, @@ -46006,7 +47051,7 @@ Object { }, "range": Array [ 15, - 27, + 81, ], "type": "TSInterfaceBody", }, @@ -46032,7 +47077,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -46041,7 +47086,7 @@ Object { }, "range": Array [ 0, - 27, + 81, ], "type": "TSInterfaceDeclaration", }, @@ -46049,7 +47094,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -46058,7 +47103,7 @@ Object { }, "range": Array [ 0, - 28, + 82, ], "sourceType": "script", "tokens": Array [ @@ -46150,225 +47195,184 @@ Object { 25, ], "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 7, "line": 3, }, "start": Object { - "column": 0, + "column": 4, "line": 3, }, }, "range": Array [ - 26, - 27, + 31, + 34, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", - "value": "}", + "value": "?", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ":", + }, + Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 0, - 19, + 37, + 43, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "operator": "keyof", - "range": Array [ - 9, - 18, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "string", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 17, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 0, - 4, + 43, + 44, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 7, + "line": 4, }, "start": Object { - "column": 5, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 5, - 6, + 49, + 52, ], "type": "Identifier", - "value": "x", + "value": "baz", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 1, + "line": 4, }, "start": Object { "column": 7, - "line": 1, + "line": 4, }, }, "range": Array [ - 7, - 8, + 52, + 53, ], "type": "Punctuator", - "value": "=", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 9, + "line": 4, }, "start": Object { - "column": 9, - "line": 1, + "column": 8, + "line": 4, }, }, "range": Array [ - 9, - 14, + 53, + 54, ], - "type": "Identifier", - "value": "keyof", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 9, + "line": 4, }, }, "range": Array [ - 15, - 18, + 54, + 57, ], "type": "Identifier", "value": "foo", @@ -46376,814 +47380,305 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 13, + "line": 4, }, "start": Object { - "column": 18, - "line": 1, + "column": 12, + "line": 4, }, }, "range": Array [ - 18, - 19, + 57, + 58, ], "type": "Punctuator", - "value": ";", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "nestedArray", - "range": Array [ - 4, - 44, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 44, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 44, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 17, - 22, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 43, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 23, - 28, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 42, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 29, - 34, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "TSStringKeyword", - }, - ], - "range": Array [ - 34, - 42, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 28, - 43, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 22, - 44, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 44, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 0, - 44, + 59, + 62, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "bar", }, - }, - "range": Array [ - 0, - 44, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 0, - 3, + 62, + 63, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 4, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 4, - 15, + 63, + 64, ], - "type": "Identifier", - "value": "nestedArray", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 20, + "line": 4, }, }, "range": Array [ - 15, - 16, + 65, + 71, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 27, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 26, + "line": 4, }, }, "range": Array [ - 17, - 22, + 71, + 72, ], - "type": "Identifier", - "value": "Array", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 28, + "line": 4, }, }, "range": Array [ - 22, - 23, + 73, + 76, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 28, - ], - "type": "Identifier", - "value": "Array", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 34, - ], - "type": "Identifier", - "value": "Array", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, + "column": 32, + "line": 4, }, "start": Object { - "column": 34, - "line": 1, + "column": 31, + "line": 4, }, }, "range": Array [ - 34, - 35, + 76, + 77, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "Identifier", - "value": "string", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 33, + "line": 4, }, "start": Object { - "column": 41, - "line": 1, + "column": 32, + "line": 4, }, }, "range": Array [ - 41, - 42, + 77, + 78, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 34, + "line": 4, }, "start": Object { - "column": 42, - "line": 1, + "column": 33, + "line": 4, }, }, "range": Array [ - 42, - 43, + 78, + 79, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 43, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 43, - 44, + 80, + 81, ], "type": "Punctuator", - "value": ">", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 17, - ], - "type": "Identifier", - "typeAnnotation": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 4, + "line": 2, }, }, + "name": "foo", "range": Array [ - 7, - 17, + 21, + 24, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 17, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 16, - ], - "type": "TSNeverKeyword", - }, - ], - "range": Array [ - 10, - 17, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 17, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 18, - ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, + "type": "Identifier", }, - "name": "Observable", - "range": Array [ - 19, - 29, - ], - "type": "Identifier", - }, - "property": Object { "loc": Object { "end": Object { - "column": 16, + "column": 8, "line": 2, }, "start": Object { - "column": 11, + "column": 4, "line": 2, }, }, - "name": "empty", "range": Array [ - 30, - 35, + 21, + 25, ], - "type": "Identifier", + "type": "TSPropertySignature", }, - "range": Array [ - 19, - 35, - ], - "type": "MemberExpression", - }, + ], "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 19, - 44, + 15, + 27, ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 36, - 41, - ], - "type": "TSNeverKeyword", - }, - ], - "range": Array [ - 35, - 42, - ], - "type": "TSTypeParameterInstantiation", }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 19, - 45, + 0, + 27, ], - "type": "ExpressionStatement", + "type": "TSInterfaceDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -47192,14 +47687,14 @@ Object { }, "range": Array [ 0, - 46, + 28, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { @@ -47209,295 +47704,318 @@ Object { }, "range": Array [ 0, - 5, + 9, ], "type": "Keyword", - "value": "const", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 14, "line": 1, }, "start": Object { - "column": 6, + "column": 10, "line": 1, }, }, "range": Array [ - 6, - 7, + 10, + 14, ], "type": "Identifier", - "value": "x", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 16, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 8, + 15, + 16, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 10, + 21, + 24, ], "type": "Identifier", - "value": "X", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 10, - 11, + 24, + 25, ], "type": "Punctuator", - "value": "<", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 11, - 16, + 26, + 27, ], - "type": "Identifier", - "value": "never", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, - 17, + 0, + 19, ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, - "start": Object { - "column": 17, - "line": 1, + "operator": "keyof", + "range": Array [ + 9, + 18, + ], + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, }, }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 19, - 29, - ], - "type": "Identifier", - "value": "Observable", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": ".", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 30, - 35, + 0, + 4, ], "type": "Identifier", - "value": "empty", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": "<", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 6, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 36, - 41, + 5, + 6, ], "type": "Identifier", - "value": "never", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 41, - 42, + 7, + 8, ], "type": "Punctuator", - "value": ">", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 42, - 43, + 9, + 14, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "keyof", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 43, - 44, + 15, + 18, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 25, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 44, - 45, + 18, + 19, ], "type": "Punctuator", "value": ";", @@ -47507,342 +48025,266 @@ Object { } `; -exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` +exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": "e", - "range": Array [ - 56, - 57, - ], - "type": "Identifier", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "nestedArray", + "range": Array [ + 4, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, }, + }, + "range": Array [ + 15, + 44, ], - "callee": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 44, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, }, - "name": "validateEntity", "range": Array [ - 41, - 55, + 17, + 44, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 58, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 59, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 17, + "line": 1, }, }, - "name": "s", + "name": "Array", "range": Array [ - 68, - 69, + 17, + 22, ], "type": "Identifier", }, - "init": Object { - "computed": false, + "typeParameters": Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { - "column": 12, - "line": 3, + "column": 22, + "line": 1, }, }, - "object": Object { - "expression": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 43, + "line": 1, }, "start": Object { - "column": 12, - "line": 3, + "column": 23, + "line": 1, }, }, - "name": "e", "range": Array [ - 72, - 73, + 23, + 43, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 72, - 74, - ], - "type": "TSNonNullExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", }, - "start": Object { - "column": 15, - "line": 3, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 42, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 34, + 42, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 28, + 43, + ], + "type": "TSTypeParameterInstantiation", }, }, - "name": "name", - "range": Array [ - 75, - 79, - ], - "type": "Identifier", - }, + ], "range": Array [ - 72, - 79, + 22, + 44, ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, + "type": "TSTypeParameterInstantiation", }, - "range": Array [ - 68, - 79, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, }, }, - "range": Array [ - 64, - 80, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 82, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, }, - }, - "name": "processEntity", - "range": Array [ - 9, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "init": null, "loc": Object { "end": Object { - "column": 33, + "column": 44, "line": 1, }, "start": Object { - "column": 23, + "column": 4, "line": 1, }, }, - "name": "e", - "optional": true, "range": Array [ - 23, - 33, + 4, + 44, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 33, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 33, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "name": "Entity", - "range": Array [ - 27, - 33, - ], - "type": "Identifier", - }, - }, - }, + "type": "VariableDeclarator", }, ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 82, + 44, ], - "type": "FunctionDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 44, + "line": 1, }, "start": Object { "column": 0, @@ -47851,14 +48293,14 @@ Object { }, "range": Array [ 0, - 82, + 44, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 3, "line": 1, }, "start": Object { @@ -47868,118 +48310,118 @@ Object { }, "range": Array [ 0, - 8, + 3, ], "type": "Keyword", - "value": "function", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 15, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, "range": Array [ - 9, - 22, + 4, + 15, ], "type": "Identifier", - "value": "processEntity", + "value": "nestedArray", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 16, "line": 1, }, "start": Object { - "column": 22, + "column": 15, "line": 1, }, }, "range": Array [ - 22, - 23, + 15, + 16, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 22, "line": 1, }, "start": Object { - "column": 23, + "column": 17, "line": 1, }, }, "range": Array [ - 23, - 24, + 17, + 22, ], "type": "Identifier", - "value": "e", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 23, "line": 1, }, "start": Object { - "column": 24, + "column": 22, "line": 1, }, }, "range": Array [ - 24, - 25, + 22, + 23, ], "type": "Punctuator", - "value": "?", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 28, "line": 1, }, "start": Object { - "column": 25, + "column": 23, "line": 1, }, }, "range": Array [ - 25, - 26, + 23, + 28, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 29, "line": 1, }, "start": Object { - "column": 27, + "column": 28, "line": 1, }, }, "range": Array [ - 27, - 33, + 28, + 29, ], - "type": "Identifier", - "value": "Entity", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { @@ -47988,293 +48430,113 @@ Object { "line": 1, }, "start": Object { - "column": 33, + "column": 29, "line": 1, }, }, "range": Array [ - 33, + 29, 34, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 35, "line": 1, }, "start": Object { - "column": 35, + "column": 34, "line": 1, }, }, "range": Array [ + 34, 35, - 36, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 41, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 35, + "line": 1, }, }, "range": Array [ + 35, 41, - 55, - ], - "type": "Identifier", - "value": "validateEntity", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 55, - 56, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 56, - 57, - ], - "type": "Identifier", - "value": "e", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 64, - 67, - ], - "type": "Keyword", - "value": "let", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 68, - 69, - ], - "type": "Identifier", - "value": "s", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 70, - 71, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 72, - 73, ], "type": "Identifier", - "value": "e", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, - }, - }, - "range": Array [ - 73, - 74, - ], - "type": "Punctuator", - "value": "!", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 42, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 41, + "line": 1, }, }, "range": Array [ - 74, - 75, + 41, + 42, ], "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 75, - 79, - ], - "type": "Identifier", - "value": "name", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 43, + "line": 1, }, "start": Object { - "column": 19, - "line": 3, + "column": 42, + "line": 1, }, }, "range": Array [ - 79, - 80, + 42, + 43, ], "type": "Punctuator", - "value": ";", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 44, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 43, + "line": 1, }, }, "range": Array [ - 81, - 82, + 43, + 44, ], "type": "Punctuator", - "value": "}", + "value": ">", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` Object { "body": Array [ Object { @@ -48283,77 +48545,131 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "name": "x", "range": Array [ - 4, - 11, + 6, + 17, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { - "column": 5, + "column": 7, "line": 1, }, }, "range": Array [ - 5, - 11, + 7, + 17, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 11, + 9, + 17, ], - "type": "TSNullKeyword", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameterInstantiation", + }, }, }, }, "init": null, "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 11, + 6, + 17, ], "type": "VariableDeclarator", }, ], - "kind": "let", + "kind": "const", "loc": Object { "end": Object { - "column": 12, + "column": 18, "line": 1, }, "start": Object { @@ -48363,87 +48679,122 @@ Object { }, "range": Array [ 0, - 12, + 18, ], "type": "VariableDeclaration", }, Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "object": Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 2, }, "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, - "name": "y", + "name": "Observable", "range": Array [ - 17, + 19, 29, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, }, - "range": Array [ - 18, - 29, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 20, - 29, - ], - "type": "TSUndefinedKeyword", + "start": Object { + "column": 11, + "line": 2, }, }, + "name": "empty", + "range": Array [ + 30, + 35, + ], + "type": "Identifier", }, - "init": null, + "range": Array [ + 19, + 35, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 44, + ], + "type": "CallExpression", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 2, }, "start": Object { - "column": 4, + "column": 16, "line": 2, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "TSNeverKeyword", + }, + ], "range": Array [ - 17, - 29, + 35, + 42, ], - "type": "VariableDeclarator", + "type": "TSTypeParameterInstantiation", }, - ], - "kind": "let", + }, "loc": Object { "end": Object { - "column": 17, + "column": 26, "line": 2, }, "start": Object { @@ -48452,16 +48803,16 @@ Object { }, }, "range": Array [ - 13, - 30, + 19, + 45, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 3, }, "start": Object { "column": 0, @@ -48470,14 +48821,14 @@ Object { }, "range": Array [ 0, - 30, + 46, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -48487,25 +48838,25 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "let", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", "value": "x", @@ -48513,21 +48864,39 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { - "column": 5, + "column": 7, "line": 1, }, }, "range": Array [ - 5, - 6, + 7, + 8, ], "type": "Punctuator", "value": ":", }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "X", + }, Object { "loc": Object { "end": Object { @@ -48535,21 +48904,21 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 10, "line": 1, }, }, "range": Array [ - 7, + 10, 11, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { @@ -48559,7 +48928,43 @@ Object { }, "range": Array [ 11, - 12, + 16, + ], + "type": "Identifier", + "value": "never", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -48567,7 +48972,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 10, "line": 2, }, "start": Object { @@ -48576,80 +48981,152 @@ Object { }, }, "range": Array [ - 13, - 16, + 19, + 29, ], - "type": "Keyword", - "value": "let", + "type": "Identifier", + "value": "Observable", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 11, "line": 2, }, "start": Object { - "column": 4, + "column": 10, "line": 2, }, }, "range": Array [ - 17, - 18, + 29, + 30, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, ], "type": "Identifier", - "value": "y", + "value": "empty", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 2, }, "start": Object { - "column": 5, + "column": 16, "line": 2, }, }, "range": Array [ - 18, - 19, + 35, + 36, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 2, }, "start": Object { - "column": 7, + "column": 17, "line": 2, }, }, "range": Array [ - 20, - 29, + 36, + 41, ], "type": "Identifier", - "value": "undefined", + "value": "never", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 2, }, "start": Object { - "column": 16, + "column": 22, "line": 2, }, }, "range": Array [ - 29, - 30, + 41, + 42, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, ], "type": "Punctuator", "value": ";", @@ -48659,432 +49136,342 @@ Object { } `; -exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` +exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ + "async": false, + "body": Object { + "body": Array [ Object { - "computed": false, - "key": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "e", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "validateEntity", + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 3, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 3, - 7, + 41, + 58, ], - "raw": "'__'", - "type": "Literal", - "value": "__", + "type": "CallExpression", }, - "kind": "init", "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 3, - "line": 1, + "column": 4, + "line": 2, }, }, - "method": false, "range": Array [ - 3, - 13, + 41, + 59, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 13, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], - "range": Array [ - 1, - 15, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 17, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 1, - "line": 3, + "type": "ExpressionStatement", }, - }, - "properties": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", }, - "start": Object { - "column": 3, - "line": 3, + "init": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "object": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "e", + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 72, + 74, + ], + "type": "TSNonNullExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 75, + 79, + ], + "type": "Identifier", + }, + "range": Array [ + 72, + 79, + ], + "type": "MemberExpression", }, - }, - "range": Array [ - 22, - 26, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "method": true, - "range": Array [ - 22, - 31, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 12, + "column": 19, "line": 3, }, "start": Object { - "column": 10, + "column": 8, "line": 3, }, }, "range": Array [ - 29, - 31, + 68, + 79, ], - "type": "BlockStatement", + "type": "VariableDeclarator", }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, }, - "params": Array [], - "range": Array [ - 26, - 31, - ], - "type": "FunctionExpression", }, + "range": Array [ + 64, + 80, + ], + "type": "VariableDeclaration", }, ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, "range": Array [ - 20, - 33, + 35, + 82, ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, + "type": "BlockStatement", }, - "range": Array [ - 19, - 35, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 22, + "line": 1, }, "start": Object { - "column": 1, - "line": 5, + "column": 9, + "line": 1, }, }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 41, - 45, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "method": false, - "range": Array [ - 40, - 52, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "range": Array [ - 48, - 52, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], + "name": "processEntity", "range": Array [ - 38, - 54, + 9, + 22, ], - "type": "ObjectExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 1, + "line": 4, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, - "range": Array [ - 37, - 56, - ], - "type": "ExpressionStatement", - }, - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 68, - 72, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, }, + }, + "name": "e", + "optional": true, + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 33, + "line": 1, }, "start": Object { - "column": 10, - "line": 7, + "column": 25, + "line": 1, }, }, "range": Array [ - 68, - 79, + 25, + 33, ], - "static": false, - "type": "ClassProperty", - "value": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 33, + "line": 1, }, "start": Object { - "column": 17, - "line": 7, + "column": 27, + "line": 1, }, }, "range": Array [ - 75, - 79, + 27, + 33, ], - "raw": "null", - "type": "Literal", - "value": null, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "Entity", + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + }, }, }, - ], - "loc": Object { - "end": Object { - "column": 23, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 66, - 81, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, }, - "name": "X", - "range": Array [ - 64, - 65, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, + ], "range": Array [ - 58, - 81, + 0, + 82, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 8, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -49100,7 +49487,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -49110,115 +49497,133 @@ Object { }, "range": Array [ 0, - 1, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 22, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, "range": Array [ - 1, - 2, + 9, + 22, + ], + "type": "Identifier", + "value": "processEntity", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 24, "line": 1, }, "start": Object { - "column": 3, + "column": 23, "line": 1, }, }, "range": Array [ - 3, - 7, + 23, + 24, ], - "type": "String", - "value": "'__'", + "type": "Identifier", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 25, "line": 1, }, "start": Object { - "column": 7, + "column": 24, "line": 1, }, }, "range": Array [ - 7, - 8, + 24, + 25, ], "type": "Punctuator", - "value": ":", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 26, "line": 1, }, "start": Object { - "column": 9, + "column": 25, "line": 1, }, }, "range": Array [ - 9, - 13, + 25, + 26, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 33, "line": 1, }, "start": Object { - "column": 14, + "column": 27, "line": 1, }, }, "range": Array [ - 14, - 15, + 27, + 33, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Entity", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 34, "line": 1, }, "start": Object { - "column": 15, + "column": 33, "line": 1, }, }, "range": Array [ - 15, - 16, + 33, + 34, ], "type": "Punctuator", "value": ")", @@ -49226,35 +49631,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 36, "line": 1, }, "start": Object { - "column": 16, + "column": 35, "line": 1, }, }, "range": Array [ - 16, - 17, + 35, + 36, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 20, + 41, + 55, + ], + "type": "Identifier", + "value": "validateEntity", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 55, + 56, ], "type": "Punctuator", "value": "(", @@ -49262,56 +49685,74 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 20, + "line": 2, }, "start": Object { - "column": 1, - "line": 3, + "column": 19, + "line": 2, }, }, "range": Array [ - 20, - 21, + 56, + 57, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 57, + 58, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 3, - "line": 3, + "column": 21, + "line": 2, }, }, "range": Array [ - 22, - 26, + 58, + 59, ], - "type": "String", - "value": "'__'", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 3, }, "start": Object { - "column": 7, + "column": 4, "line": 3, }, }, "range": Array [ - 26, - 27, + 64, + 67, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { @@ -49325,11 +49766,11 @@ Object { }, }, "range": Array [ - 27, - 28, + 68, + 69, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "s", }, Object { "loc": Object { @@ -49343,29 +49784,29 @@ Object { }, }, "range": Array [ - 29, - 30, + 70, + 71, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 3, }, "start": Object { - "column": 11, + "column": 12, "line": 3, }, }, "range": Array [ - 30, - 31, + 72, + 73, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "e", }, Object { "loc": Object { @@ -49379,11 +49820,11 @@ Object { }, }, "range": Array [ - 32, - 33, + 73, + 74, ], "type": "Punctuator", - "value": "}", + "value": "!", }, Object { "loc": Object { @@ -49397,16 +49838,16 @@ Object { }, }, "range": Array [ - 33, - 34, + 74, + 75, ], "type": "Punctuator", - "value": ")", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 19, "line": 3, }, "start": Object { @@ -49415,296 +49856,321 @@ Object { }, }, "range": Array [ - 34, - 35, + 75, + 79, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 20, + "line": 3, }, "start": Object { - "column": 0, - "line": 5, + "column": 19, + "line": 3, }, }, "range": Array [ - 37, - 38, + 79, + 80, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 1, + "line": 4, }, "start": Object { - "column": 1, - "line": 5, + "column": 0, + "line": 4, }, }, "range": Array [ - 38, - 39, + 81, + 82, ], "type": "Punctuator", - "value": "{", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "TSNullKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 12, + "line": 1, }, "start": Object { - "column": 3, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 40, - 41, + 0, + 12, ], - "type": "Punctuator", - "value": "[", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 29, + ], + "type": "TSUndefinedKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 17, + "line": 2, }, "start": Object { - "column": 4, - "line": 5, + "column": 0, + "line": 2, }, }, "range": Array [ - 41, - 45, + 13, + 30, ], - "type": "String", - "value": "'__'", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 3, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 45, - 46, + 0, + 3, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 5, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 4, + "line": 1, }, }, "range": Array [ - 46, - 47, + 4, + 5, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 6, + "line": 1, }, "start": Object { - "column": 11, - "line": 5, + "column": 5, + "line": 1, }, }, "range": Array [ - 48, - 52, + 5, + 6, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "range": Array [ - 54, - 55, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 5, - }, - "start": Object { - "column": 18, - "line": 5, - }, - }, - "range": Array [ - 55, - 56, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 7, + "column": 11, + "line": 1, }, "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 58, - 63, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { "column": 7, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "range": Array [ - 64, - 65, - ], - "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 66, - 67, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 68, - 72, - ], - "type": "String", - "value": "'__'", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 7, - }, - "start": Object { - "column": 15, - "line": 7, - }, - }, - "range": Array [ - 73, - 74, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 17, - "line": 7, + "line": 1, }, }, "range": Array [ - 75, - 79, + 7, + 11, ], "type": "Keyword", "value": "null", @@ -49712,52 +50178,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 7, + "column": 12, + "line": 1, }, "start": Object { - "column": 22, - "line": 7, + "column": 11, + "line": 1, }, }, "range": Array [ - 80, - 81, + 11, + 12, ], "type": "Punctuator", - "value": "}", + "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 1, - "line": 2, - }, - }, - "range": Array [ - 46, - 58, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, "loc": Object { "end": Object { - "column": 15, + "column": 3, "line": 2, }, "start": Object { @@ -49766,96 +50205,80 @@ Object { }, }, "range": Array [ - 45, - 60, + 13, + 16, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, + "type": "Keyword", + "value": "let", }, - }, - "range": Array [ - 45, - 60, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 2, }, "start": Object { - "column": 0, + "column": 4, "line": 2, }, }, "range": Array [ - 45, - 46, + 17, + 18, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 6, "line": 2, }, "start": Object { - "column": 1, + "column": 5, "line": 2, }, }, "range": Array [ - 46, - 58, + 18, + 19, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 2, }, "start": Object { - "column": 13, + "column": 7, "line": 2, }, }, "range": Array [ - 58, - 59, + 20, + 29, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "undefined", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 2, }, "start": Object { - "column": 14, + "column": 16, "line": 2, }, }, "range": Array [ - 59, - 60, + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -49865,211 +50288,91 @@ Object { } `; -exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "range": Array [ - 40, - 42, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { + "expression": Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, - "name": "test", - "range": Array [ - 9, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", }, - }, - "name": "abc", - "range": Array [ - 14, - 38, - ], - "type": "Identifier", - "typeAnnotation": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 38, + "column": 13, "line": 1, }, "start": Object { - "column": 17, + "column": 3, "line": 1, }, }, + "method": false, "range": Array [ - 17, - 38, + 3, + 13, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 38, + "column": 13, "line": 1, }, "start": Object { - "column": 19, + "column": 9, "line": 1, }, }, "range": Array [ - 19, - 38, + 9, + 13, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "Map", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 29, - ], - "type": "TSSymbolKeyword", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 37, - ], - "type": "TSStringKeyword", - }, - ], - "range": Array [ - 22, - 38, - ], - "type": "TSTypeParameterInstantiation", - }, + "raw": "null", + "type": "Literal", + "value": null, }, }, - }, - ], - "range": Array [ - 0, - 42, - ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 42, - ], - "sourceType": "script", - "tokens": Array [ - Object { + ], + "range": Array [ + 1, + 15, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 8, + "column": 17, "line": 1, }, "start": Object { @@ -50079,223 +50382,526 @@ Object { }, "range": Array [ 0, - 8, + 17, ], - "type": "Keyword", - "value": "function", + "type": "ExpressionStatement", }, Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, }, - }, - "range": Array [ - 9, - 13, - ], - "type": "Identifier", - "value": "test", + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 22, + 26, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "method": true, + "range": Array [ + 22, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "params": Array [], + "range": Array [ + 26, + 31, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 20, + 33, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 19, + 35, + ], + "type": "ExpressionStatement", }, Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "method": false, + "range": Array [ + 40, + 52, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 48, + 52, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 38, + 54, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 19, + "line": 5, }, "start": Object { - "column": 13, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 13, - 14, + 37, + 56, ], - "type": "Punctuator", - "value": "(", + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 79, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 75, + 79, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 66, + 81, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 58, + 81, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, + "column": 1, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 17, + 0, + 1, ], - "type": "Identifier", - "value": "abc", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 2, "line": 1, }, "start": Object { - "column": 17, + "column": 1, "line": 1, }, }, "range": Array [ - 17, - 18, + 1, + 2, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 7, "line": 1, }, "start": Object { - "column": 19, + "column": 3, "line": 1, }, }, "range": Array [ - 19, - 22, + 3, + 7, ], - "type": "Identifier", - "value": "Map", + "type": "String", + "value": "'__'", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 8, "line": 1, }, "start": Object { - "column": 22, + "column": 7, "line": 1, }, }, "range": Array [ - 22, - 23, + 7, + 8, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 13, "line": 1, }, "start": Object { - "column": 23, + "column": 9, "line": 1, }, }, "range": Array [ - 23, - 29, + 9, + 13, ], - "type": "Identifier", - "value": "symbol", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 15, "line": 1, }, "start": Object { - "column": 29, + "column": 14, "line": 1, }, }, "range": Array [ - 29, - 30, + 14, + 15, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 16, "line": 1, }, "start": Object { - "column": 31, + "column": 15, "line": 1, }, }, "range": Array [ - 31, - 37, + 15, + 16, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 17, "line": 1, }, "start": Object { - "column": 37, + "column": 16, "line": 1, }, }, "range": Array [ - 37, - 38, + 16, + 17, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 38, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 38, - 39, + 19, + 20, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { - "column": 40, - "line": 1, + "column": 1, + "line": 3, }, }, "range": Array [ - 40, - 41, + 20, + 21, ], "type": "Punctuator", "value": "{", @@ -50303,1069 +50909,637 @@ Object { Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 41, - "line": 1, + "column": 3, + "line": 3, }, }, "range": Array [ - 41, - 42, + 22, + 26, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "'__'", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, }, - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "(", + }, + Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 0, - 37, + 27, + 28, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, }, - "range": Array [ - 17, - 37, - ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 27, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Success", - "range": Array [ - 17, - 24, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 37, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "Failure", - "range": Array [ - 30, - 37, - ], - "type": "Identifier", - }, - }, - ], - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "start": Object { + "column": 10, + "line": 3, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "range": Array [ - 12, - 13, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 11, - 14, - ], - "type": "TSTypeParameterDeclaration", }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", }, - ], - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 37, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 14, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 13, + "line": 3, }, }, "range": Array [ - 0, - 4, + 32, + 33, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 5, - 11, + 33, + 34, ], - "type": "Identifier", - "value": "Result", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 3, }, }, "range": Array [ - 11, - 12, + 34, + 35, ], "type": "Punctuator", - "value": "<", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 12, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 12, - 13, + 37, + 38, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 2, + "line": 5, }, "start": Object { - "column": 13, - "line": 1, + "column": 1, + "line": 5, }, }, "range": Array [ - 13, - 14, + 38, + 39, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 4, + "line": 5, }, "start": Object { - "column": 15, - "line": 1, + "column": 3, + "line": 5, }, }, "range": Array [ - 15, - 16, + 40, + 41, ], "type": "Punctuator", - "value": "=", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 5, }, "start": Object { - "column": 17, - "line": 1, + "column": 4, + "line": 5, }, }, "range": Array [ - 17, - 24, + 41, + 45, ], - "type": "Identifier", - "value": "Success", + "type": "String", + "value": "'__'", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 24, - 25, + 45, + 46, ], "type": "Punctuator", - "value": "<", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 10, + "line": 5, }, "start": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 5, }, }, "range": Array [ - 25, - 26, + 46, + 47, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 15, + "line": 5, }, "start": Object { - "column": 26, - "line": 1, + "column": 11, + "line": 5, }, }, "range": Array [ - 26, - 27, + 48, + 52, ], - "type": "Punctuator", - "value": ">", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 17, + "line": 5, }, "start": Object { - "column": 28, - "line": 1, + "column": 16, + "line": 5, }, }, "range": Array [ - 28, - 29, + 53, + 54, ], "type": "Punctuator", - "value": "|", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 18, + "line": 5, }, "start": Object { - "column": 30, - "line": 1, + "column": 17, + "line": 5, }, }, "range": Array [ - 30, - 37, + 54, + 55, ], - "type": "Identifier", - "value": "Failure", + "type": "Punctuator", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, }, - "name": "Result", - "range": Array [ - 5, - 11, - ], - "type": "Identifier", }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", + }, + Object { "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 5, + "line": 7, }, "start": Object { "column": 0, - "line": 1, + "line": 7, }, }, "range": Array [ - 0, - 48, + 58, + 63, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 48, - ], - "type": "TSUnionType", - "types": Array [ - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 38, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "Success", - "range": Array [ - 28, - 35, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 35, - 38, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 48, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "name": "Failure", - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - }, - }, - ], - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "params": Array [ - Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "members": Array [], - "range": Array [ - 22, - 24, - ], - "type": "TSTypeLiteral", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "range": Array [ - 12, - 24, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 11, - 25, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 48, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 7, }, }, "range": Array [ - 0, - 4, + 64, + 65, ], "type": "Identifier", - "value": "type", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 9, + "line": 7, }, "start": Object { - "column": 5, - "line": 1, + "column": 8, + "line": 7, }, }, "range": Array [ - 5, - 11, + 66, + 67, ], - "type": "Identifier", - "value": "Result", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 14, + "line": 7, }, "start": Object { - "column": 11, - "line": 1, + "column": 10, + "line": 7, }, }, "range": Array [ - 11, - 12, + 68, + 72, ], - "type": "Punctuator", - "value": "<", + "type": "String", + "value": "'__'", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 7, }, "start": Object { - "column": 12, - "line": 1, + "column": 15, + "line": 7, }, }, "range": Array [ - 12, - 13, + 73, + 74, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 21, - "line": 1, + "line": 7, }, "start": Object { - "column": 14, - "line": 1, + "column": 17, + "line": 7, }, }, "range": Array [ - 14, - 21, + 75, + 79, ], "type": "Keyword", - "value": "extends", + "value": "null", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 1, + "line": 7, }, "start": Object { "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, + "line": 7, }, }, "range": Array [ - 23, - 24, + 80, + 81, ], "type": "Punctuator", "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/parenthesized-use-strict.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, }, + "range": Array [ + 46, + 58, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": ">", - }, - Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 26, - 27, + 45, + 60, ], - "type": "Punctuator", - "value": "=", + "type": "ExpressionStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 35, - ], - "type": "Identifier", - "value": "Success", + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, }, + }, + "range": Array [ + 45, + 60, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 35, - 36, + 45, + 46, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 36, - "line": 1, + "column": 1, + "line": 2, }, }, "range": Array [ - 36, - 37, + 46, + 58, ], - "type": "Identifier", - "value": "T", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 37, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 37, - 38, + 58, + 59, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 39, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 39, - 40, + 59, + 60, ], "type": "Punctuator", - "value": "|", - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - "value": "Failure", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +exports[`typescript fixtures/basics/symbol-type-param.src 1`] = ` Object { "body": Array [ Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 42, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, - "name": "foo", + "name": "test", "range": Array [ - 5, - 8, + 9, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 30, + "column": 42, "line": 1, }, "start": Object { @@ -51373,142 +51547,142 @@ Object { "line": 1, }, }, - "range": Array [ - 0, - 30, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, + }, + "name": "abc", + "range": Array [ + 14, + 38, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 24, + "column": 38, "line": 1, }, "start": Object { - "column": 12, + "column": 17, "line": 1, }, }, "range": Array [ - 12, - 24, + 17, + 38, ], - "type": "TSPropertySignature", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, + "column": 38, "line": 1, }, "start": Object { - "column": 15, + "column": 19, "line": 1, }, }, "range": Array [ - 15, - 23, + 19, + 38, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 23, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 19, "line": 1, }, }, + "name": "Map", "range": Array [ - 17, - 23, + 19, + 22, ], - "type": "TSStringKeyword", + "type": "Identifier", }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, }, - }, - "name": "baz", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "TSSymbolKeyword", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 22, + 38, + ], + "type": "TSTypeParameterInstantiation", }, }, - "range": Array [ - 25, - 28, - ], - "type": "TSPropertySignature", }, - ], - "range": Array [ - 11, - 29, - ], - "type": "TSTypeLiteral", - }, + }, + ], + "range": Array [ + 0, + 42, + ], + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 42, + "line": 1, }, "start": Object { "column": 0, @@ -51517,14 +51691,14 @@ Object { }, "range": Array [ 0, - 31, + 42, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 8, "line": 1, }, "start": Object { @@ -51534,33 +51708,15 @@ Object { }, "range": Array [ 0, - 4, - ], - "type": "Identifier", - "value": "type", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, 8, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 13, "line": 1, }, "start": Object { @@ -51570,61 +51726,61 @@ Object { }, "range": Array [ 9, - 10, + 13, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "range": Array [ - 11, - 12, + 13, + 14, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, - 15, + 14, + 17, ], "type": "Identifier", - "value": "bar", + "value": "abc", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 16, + 17, + 18, ], "type": "Punctuator", "value": ":", @@ -51632,56 +51788,38 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 19, "line": 1, }, }, "range": Array [ - 17, - 23, + 19, + 22, ], "type": "Identifier", - "value": "string", + "value": "Map", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { - "column": 23, + "column": 22, "line": 1, }, }, "range": Array [ + 22, 23, - 24, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - "value": "baz", + "value": "<", }, Object { "loc": Object { @@ -51690,16 +51828,16 @@ Object { "line": 1, }, "start": Object { - "column": 28, + "column": 23, "line": 1, }, }, "range": Array [ - 28, + 23, 29, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "symbol", }, Object { "loc": Object { @@ -51717,586 +51855,4187 @@ Object { 30, ], "type": "Punctuator", - "value": ";", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/type-assertion.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 27, - ], - "type": "TSTypeAssertion", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 16, - ], - "type": "TSAnyKeyword", - }, - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 27, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 28, + "column": 37, "line": 1, }, "start": Object { - "column": 0, + "column": 31, "line": 1, }, }, "range": Array [ - 0, - 28, + 31, + 37, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "string", }, - }, - "range": Array [ - 0, - 29, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 38, "line": 1, }, "start": Object { - "column": 0, + "column": 37, "line": 1, }, }, "range": Array [ - 0, - 5, + 37, + 38, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 39, "line": 1, }, "start": Object { - "column": 6, + "column": 38, "line": 1, }, }, "range": Array [ - 6, - 9, + 38, + 39, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 41, "line": 1, }, "start": Object { - "column": 10, + "column": 40, "line": 1, }, }, "range": Array [ - 10, - 11, + 40, + 41, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 42, "line": 1, }, "start": Object { - "column": 12, + "column": 41, "line": 1, }, }, "range": Array [ - 12, - 13, + 41, + 42, ], "type": "Punctuator", - "value": "<", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", }, - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - "value": "any", - }, - Object { "loc": Object { "end": Object { - "column": 17, + "column": 37, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, - 17, + 0, + 37, ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/type-guard.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "left": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 59, - 60, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "operator": "typeof", - "prefix": true, - "range": Array [ - 52, - 60, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "operator": "===", - "range": Array [ - 52, - 73, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 65, - 73, - ], - "raw": "'string'", - "type": "Literal", - "value": "string", - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 45, - 73, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 75, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, + "column": 37, "line": 1, }, "start": Object { - "column": 9, + "column": 17, "line": 1, }, }, - "name": "isString", "range": Array [ - 9, 17, + 37, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 18, - 24, - ], - "type": "Identifier", - "typeAnnotation": Object { + "type": "TSUnionType", + "types": Array [ + Object { "loc": Object { "end": Object { - "column": 24, + "column": 27, "line": 1, }, "start": Object { - "column": 19, + "column": 17, "line": 1, }, }, "range": Array [ - 19, - 24, + 17, + 27, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { "column": 24, "line": 1, }, "start": Object { - "column": 21, + "column": 17, "line": 1, }, }, + "name": "Success", "range": Array [ - 21, + 17, 24, ], - "type": "TSAnyKeyword", - }, - }, - }, - ], - "range": Array [ - 0, - 75, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 38, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, + "type": "Identifier", }, - "start": Object { - "column": 27, - "line": 1, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", }, }, - "parameterName": Object { + Object { "loc": Object { "end": Object { - "column": 28, + "column": 37, "line": 1, }, "start": Object { - "column": 27, + "column": 30, "line": 1, }, }, - "name": "x", "range": Array [ - 27, - 28, + 30, + 37, ], - "type": "Identifier", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 30, + 37, + ], + "type": "Identifier", + }, }, - "range": Array [ - 27, - 38, - ], - "type": "TSTypePredicate", - "typeAnnotation": Object { + ], + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 38, + "column": 13, "line": 1, }, "start": Object { - "column": 32, + "column": 12, "line": 1, }, }, - "range": Array [ - 32, - 38, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "name": Object { "loc": Object { "end": Object { - "column": 38, + "column": 13, "line": 1, }, "start": Object { - "column": 32, + "column": 12, "line": 1, }, }, + "name": "T", "range": Array [ - 32, - 38, + 12, + 13, ], - "type": "TSStringKeyword", + "type": "Identifier", }, + "range": Array [ + 12, + 13, + ], + "type": "TSTypeParameter", }, + ], + "range": Array [ + 11, + 14, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + "value": "Result", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + "value": "Success", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "Identifier", + "value": "Failure", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Result", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 48, + ], + "type": "TSUnionType", + "types": Array [ + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 38, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 35, + 38, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "Failure", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + }, + }, + ], + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 22, + 24, + ], + "type": "TSTypeLiteral", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "range": Array [ + 12, + 24, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 25, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + "value": "Result", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + "value": "Success", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "|", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "Identifier", + "value": "Failure", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-alias-object-without-annotation.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 24, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSPropertySignature", + }, + ], + "range": Array [ + 11, + 29, + ], + "type": "TSTypeLiteral", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-assertion.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 27, + ], + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-guard-in-arrow-function.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "isString", + "range": Array [ + 6, + 14, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "operator": "typeof", + "prefix": true, + "range": Array [ + 55, + 63, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "operator": "===", + "range": Array [ + 55, + 76, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 68, + 76, + ], + "raw": "'string'", + "type": "Literal", + "value": "string", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 48, + 76, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 78, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 17, + 78, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "range": Array [ + 27, + 38, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 78, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 79, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "Identifier", + "value": "isString", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 41, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 48, + 54, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 55, + 61, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 64, + 67, + ], + "type": "Punctuator", + "value": "===", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 68, + 76, + ], + "type": "String", + "value": "'string'", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-guard-in-function.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "operator": "typeof", + "prefix": true, + "range": Array [ + 52, + 60, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "operator": "===", + "range": Array [ + 52, + 73, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 65, + 73, + ], + "raw": "'string'", + "type": "Literal", + "value": "string", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 45, + 73, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 75, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "isString", + "range": Array [ + 9, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 24, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 0, + 75, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "range": Array [ + 27, + 38, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 75, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "Identifier", + "value": "isString", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 45, + 51, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 52, + 58, + ], + "type": "Keyword", + "value": "typeof", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 61, + 64, + ], + "type": "Punctuator", + "value": "===", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 65, + 73, + ], + "type": "String", + "value": "'string'", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-guard-in-interface.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "isString", + "range": Array [ + 18, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "node", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 33, + 36, + ], + "type": "TSAnyKeyword", + }, + }, + }, + ], + "range": Array [ + 18, + 54, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 37, + 53, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "node", + "range": Array [ + 39, + 43, + ], + "type": "Identifier", + }, + "range": Array [ + 39, + 53, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 47, + 53, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 47, + 53, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 56, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 56, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 57, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 26, + ], + "type": "Identifier", + "value": "isString", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 31, + ], + "type": "Identifier", + "value": "node", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 33, + 36, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 39, + 43, + ], + "type": "Identifier", + "value": "node", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 44, + 46, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 47, + 53, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-guard-in-method.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "isBar", + "range": Array [ + 14, + 19, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 75, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 51, + 55, + ], + "type": "ThisExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "operator": "instanceof", + "range": Array [ + 51, + 70, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 3, + }, + "start": Object { + "column": 27, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 67, + 70, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 44, + 71, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 75, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 19, + 75, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 21, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "TSThisType", + }, + "range": Array [ + 23, + 37, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "isBaz", + "range": Array [ + 78, + 83, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 78, + 145, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 121, + 125, + ], + "type": "ThisExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "operator": "instanceof", + "range": Array [ + 121, + 140, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 6, + }, + "start": Object { + "column": 27, + "line": 6, + }, + }, + "name": "Foo", + "range": Array [ + 137, + 140, + ], + "type": "Identifier", + }, + "type": "BinaryExpression", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 114, + 141, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 32, + "line": 5, + }, + }, + "range": Array [ + 108, + 145, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "params": Array [], + "range": Array [ + 86, + 145, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 88, + 104, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameterName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 90, + 94, + ], + "type": "TSThisType", + }, + "range": Array [ + 90, + 104, + ], + "type": "TSTypePredicate", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 98, + 104, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 98, + 104, + ], + "type": "TSStringKeyword", + }, + }, + }, + }, + "type": "ArrowFunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 147, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, }, }, - "type": "FunctionDeclaration", + "range": Array [ + 0, + 147, + ], + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 0, + "line": 9, }, "start": Object { "column": 0, @@ -52305,14 +56044,14 @@ Object { }, "range": Array [ 0, - 75, + 148, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -52322,74 +56061,74 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 9, - 17, ], "type": "Identifier", - "value": "isString", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 17, + "column": 10, "line": 1, }, }, "range": Array [ - 17, - 18, + 10, + 11, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 18, + 14, 19, ], "type": "Identifier", - "value": "x", + "value": "isBar", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ @@ -52397,94 +56136,346 @@ Object { 20, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ + 20, 21, - 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 23, + 27, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 28, + 30, ], "type": "Identifier", - "value": "any", + "value": "is", }, Object { "loc": Object { "end": Object { "column": 25, - "line": 1, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 24, - 25, + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, ], "type": "Punctuator", - "value": ")", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 51, + 55, + ], + "type": "Keyword", + "value": "this", }, Object { "loc": Object { "end": Object { "column": 26, - "line": 1, + "line": 3, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 25, - 26, + 56, + 66, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "instanceof", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 30, + "line": 3, }, "start": Object { "column": 27, - "line": 1, + "line": 3, }, }, "range": Array [ - 27, - 28, + 67, + 70, ], "type": "Identifier", - "value": "x", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 31, - "line": 1, + "line": 3, }, "start": Object { - "column": 29, - "line": 1, + "column": 30, + "line": 3, }, }, "range": Array [ - 29, - 31, + 70, + 71, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 78, + 83, + ], + "type": "Identifier", + "value": "isBaz", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 87, + 88, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 90, + 94, + ], + "type": "Keyword", + "value": "this", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 95, + 97, ], "type": "Identifier", "value": "is", @@ -52492,17 +56483,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 28, + "line": 5, }, "start": Object { - "column": 32, - "line": 1, + "column": 22, + "line": 5, }, }, "range": Array [ - 32, - 38, + 98, + 104, ], "type": "Identifier", "value": "string", @@ -52510,17 +56501,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 31, + "line": 5, }, "start": Object { - "column": 39, - "line": 1, + "column": 29, + "line": 5, }, }, "range": Array [ - 39, - 40, + 105, + 107, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 5, + }, + "start": Object { + "column": 32, + "line": 5, + }, + }, + "range": Array [ + 108, + 109, ], "type": "Punctuator", "value": "{", @@ -52529,16 +56538,16 @@ Object { "loc": Object { "end": Object { "column": 10, - "line": 2, + "line": 6, }, "start": Object { "column": 4, - "line": 2, + "line": 6, }, }, "range": Array [ - 45, - 51, + 114, + 120, ], "type": "Keyword", "value": "return", @@ -52546,89 +56555,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 15, + "line": 6, }, "start": Object { "column": 11, - "line": 2, + "line": 6, }, }, "range": Array [ - 52, - 58, + 121, + 125, ], "type": "Keyword", - "value": "typeof", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 26, + "line": 6, }, "start": Object { - "column": 18, - "line": 2, + "column": 16, + "line": 6, }, }, "range": Array [ - 59, - 60, + 126, + 136, + ], + "type": "Keyword", + "value": "instanceof", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 6, + }, + "start": Object { + "column": 27, + "line": 6, + }, + }, + "range": Array [ + 137, + 140, ], "type": "Identifier", - "value": "x", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 31, + "line": 6, }, "start": Object { - "column": 20, - "line": 2, + "column": 30, + "line": 6, }, }, "range": Array [ - 61, - 64, + 140, + 141, ], "type": "Punctuator", - "value": "===", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 2, + "column": 3, + "line": 7, }, "start": Object { - "column": 24, - "line": 2, + "column": 2, + "line": 7, }, }, "range": Array [ - 65, - 73, + 144, + 145, ], - "type": "String", - "value": "'string'", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 8, }, "start": Object { "column": 0, - "line": 3, + "line": 8, }, }, "range": Array [ - 74, - 75, + 146, + 147, ], "type": "Punctuator", "value": "}", @@ -53691,34 +57718,478 @@ Object { "line": 1, }, }, - "range": Array [ - 22, - 77, - ], - "type": "ClassBody", + "range": Array [ + 22, + 77, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "AudioBufferList", + "range": Array [ + 6, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 77, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 78, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 21, + ], + "type": "Identifier", + "value": "AudioBufferList", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "Identifier", + "value": "mBuffers", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "Identifier", + "value": "interop", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 44, + 53, + ], + "type": "Identifier", + "value": "Reference", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "Identifier", + "value": "any", + }, + Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 49, + "line": 2, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 2, + }, + "start": Object { + "column": 50, + "line": 2, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSBigIntKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "range": Array [ + 11, + 17, + ], + "type": "Identifier", + "value": "bigint", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` +Object { + "body": Array [ + Object { "id": Object { "loc": Object { "end": Object { - "column": 21, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, - "name": "AudioBufferList", + "name": "Foo", "range": Array [ - 6, - 21, + 5, + 8, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { "column": 0, @@ -53727,16 +58198,32 @@ Object { }, "range": Array [ 0, - 77, + 18, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 18, + ], + "type": "TSBooleanKeyword", + }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -53745,14 +58232,14 @@ Object { }, "range": Array [ 0, - 78, + 19, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { @@ -53762,233 +58249,388 @@ Object { }, "range": Array [ 0, - 5, + 4, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ - 6, - 21, + 5, + 8, ], "type": "Identifier", - "value": "AudioBufferList", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 10, "line": 1, }, "start": Object { - "column": 22, + "column": 9, "line": 1, }, }, "range": Array [ - 22, - 23, + 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 26, - 34, + 11, + 18, ], "type": "Identifier", - "value": "mBuffers", + "value": "boolean", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 34, - 35, + 0, + 16, ], - "type": "Punctuator", - "value": ":", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSLiteralType", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 36, - 43, + 0, + 4, ], "type": "Identifier", - "value": "interop", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 43, - 44, + 5, + 8, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, ], "type": "Punctuator", - "value": ".", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 44, - 53, + 11, + 16, ], - "type": "Identifier", - "value": "Reference", + "type": "Boolean", + "value": "false", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 29, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 53, - 54, + 0, + 16, ], - "type": "Punctuator", - "value": "<", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSNeverKeyword", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 30, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 54, - 57, + 0, + 4, ], "type": "Identifier", - "value": "any", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 50, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 49, - "line": 2, + "column": 5, + "line": 1, }, }, "range": Array [ - 73, - 74, + 5, + 8, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 51, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 50, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 74, - 75, + 9, + 10, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 76, - 77, + 11, + 16, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "never", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-bigint.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` Object { "body": Array [ Object { @@ -54012,7 +58654,7 @@ Object { }, "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -54022,13 +58664,13 @@ Object { }, "range": Array [ 0, - 17, + 15, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -54038,9 +58680,9 @@ Object { }, "range": Array [ 11, - 17, + 15, ], - "type": "TSBigIntKeyword", + "type": "TSNullKeyword", }, }, ], @@ -54056,7 +58698,7 @@ Object { }, "range": Array [ 0, - 18, + 16, ], "sourceType": "script", "tokens": Array [ @@ -54117,7 +58759,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -54127,17 +58769,17 @@ Object { }, "range": Array [ 11, - 17, + 15, ], - "type": "Identifier", - "value": "bigint", + "type": "Keyword", + "value": "null", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-boolean.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` Object { "body": Array [ Object { @@ -54161,7 +58803,7 @@ Object { }, "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { @@ -54171,13 +58813,13 @@ Object { }, "range": Array [ 0, - 18, + 17, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { @@ -54187,9 +58829,9 @@ Object { }, "range": Array [ 11, - 18, + 17, ], - "type": "TSBooleanKeyword", + "type": "TSNumberKeyword", }, }, ], @@ -54205,7 +58847,7 @@ Object { }, "range": Array [ 0, - 19, + 18, ], "sourceType": "script", "tokens": Array [ @@ -54266,7 +58908,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { @@ -54276,17 +58918,17 @@ Object { }, "range": Array [ 11, - 18, + 17, ], "type": "Identifier", - "value": "boolean", + "value": "number", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-false.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` Object { "body": Array [ Object { @@ -54310,7 +58952,7 @@ Object { }, "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -54320,32 +58962,13 @@ Object { }, "range": Array [ 0, - 16, + 17, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 16, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -54355,9 +58978,9 @@ Object { }, "range": Array [ 11, - 16, + 17, ], - "type": "TSLiteralType", + "type": "TSObjectKeyword", }, }, ], @@ -54373,7 +58996,7 @@ Object { }, "range": Array [ 0, - 17, + 18, ], "sourceType": "script", "tokens": Array [ @@ -54434,7 +59057,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -54444,17 +59067,17 @@ Object { }, "range": Array [ 11, - 16, + 17, ], - "type": "Boolean", - "value": "false", + "type": "Identifier", + "value": "object", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-never.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` Object { "body": Array [ Object { @@ -54478,7 +59101,7 @@ Object { }, "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -54488,13 +59111,13 @@ Object { }, "range": Array [ 0, - 16, + 17, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -54504,9 +59127,9 @@ Object { }, "range": Array [ 11, - 16, + 17, ], - "type": "TSNeverKeyword", + "type": "TSStringKeyword", }, }, ], @@ -54522,7 +59145,7 @@ Object { }, "range": Array [ 0, - 17, + 18, ], "sourceType": "script", "tokens": Array [ @@ -54583,7 +59206,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -54593,17 +59216,17 @@ Object { }, "range": Array [ 11, - 16, + 17, ], "type": "Identifier", - "value": "never", + "value": "string", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-null.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` Object { "body": Array [ Object { @@ -54627,7 +59250,7 @@ Object { }, "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { @@ -54637,13 +59260,13 @@ Object { }, "range": Array [ 0, - 15, + 17, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { @@ -54653,9 +59276,9 @@ Object { }, "range": Array [ 11, - 15, + 17, ], - "type": "TSNullKeyword", + "type": "TSSymbolKeyword", }, }, ], @@ -54671,7 +59294,7 @@ Object { }, "range": Array [ 0, - 16, + 18, ], "sourceType": "script", "tokens": Array [ @@ -54732,7 +59355,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { @@ -54742,17 +59365,17 @@ Object { }, "range": Array [ 11, - 15, + 17, ], - "type": "Keyword", - "value": "null", + "type": "Identifier", + "value": "symbol", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-number.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` Object { "body": Array [ Object { @@ -54776,7 +59399,7 @@ Object { }, "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -54786,13 +59409,32 @@ Object { }, "range": Array [ 0, - 17, + 15, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { + "literal": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -54802,9 +59444,9 @@ Object { }, "range": Array [ 11, - 17, + 15, ], - "type": "TSNumberKeyword", + "type": "TSLiteralType", }, }, ], @@ -54820,7 +59462,7 @@ Object { }, "range": Array [ 0, - 18, + 16, ], "sourceType": "script", "tokens": Array [ @@ -54881,7 +59523,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -54891,17 +59533,17 @@ Object { }, "range": Array [ 11, - 17, + 15, ], - "type": "Identifier", - "value": "number", + "type": "Boolean", + "value": "true", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-object.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` Object { "body": Array [ Object { @@ -54925,7 +59567,7 @@ Object { }, "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { @@ -54935,13 +59577,13 @@ Object { }, "range": Array [ 0, - 17, + 20, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { @@ -54951,9 +59593,9 @@ Object { }, "range": Array [ 11, - 17, + 20, ], - "type": "TSObjectKeyword", + "type": "TSUndefinedKeyword", }, }, ], @@ -54969,7 +59611,7 @@ Object { }, "range": Array [ 0, - 18, + 21, ], "sourceType": "script", "tokens": Array [ @@ -55030,7 +59672,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { @@ -55040,17 +59682,17 @@ Object { }, "range": Array [ 11, - 17, + 20, ], "type": "Identifier", - "value": "object", + "value": "undefined", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-string.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` Object { "body": Array [ Object { @@ -55074,7 +59716,7 @@ Object { }, "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { @@ -55084,13 +59726,13 @@ Object { }, "range": Array [ 0, - 17, + 18, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { @@ -55100,9 +59742,9 @@ Object { }, "range": Array [ 11, - 17, + 18, ], - "type": "TSStringKeyword", + "type": "TSUnknownKeyword", }, }, ], @@ -55118,7 +59760,7 @@ Object { }, "range": Array [ 0, - 18, + 19, ], "sourceType": "script", "tokens": Array [ @@ -55179,7 +59821,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { @@ -55189,17 +59831,17 @@ Object { }, "range": Array [ 11, - 17, + 18, ], "type": "Identifier", - "value": "string", + "value": "unknown", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-symbol.src 1`] = ` +exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` Object { "body": Array [ Object { @@ -55223,7 +59865,7 @@ Object { }, "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -55233,13 +59875,13 @@ Object { }, "range": Array [ 0, - 17, + 15, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -55249,9 +59891,9 @@ Object { }, "range": Array [ 11, - 17, + 15, ], - "type": "TSSymbolKeyword", + "type": "TSVoidKeyword", }, }, ], @@ -55267,7 +59909,7 @@ Object { }, "range": Array [ 0, - 18, + 16, ], "sourceType": "script", "tokens": Array [ @@ -55328,7 +59970,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -55338,17 +59980,17 @@ Object { }, "range": Array [ 11, - 17, + 15, ], - "type": "Identifier", - "value": "symbol", + "type": "Keyword", + "value": "void", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/typed-keyword-true.src 1`] = ` +exports[`typescript fixtures/basics/typed-method-signature.src 1`] = ` Object { "body": Array [ Object { @@ -55372,8 +60014,8 @@ Object { }, "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -55382,51 +60024,376 @@ Object { }, "range": Array [ 0, - 15, + 57, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { - "literal": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 15, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 11, "line": 1, }, }, + "members": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "h", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 17, + 28, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 28, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 15, + 36, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 31, + 35, + ], + "type": "TSVoidKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "g", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 44, + 50, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 49, + 50, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 39, + 55, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 51, + 54, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + }, + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "range": Array [ + 41, + 42, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 40, + 43, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], "range": Array [ 11, - 15, + 57, ], - "type": "TSLiteralType", + "type": "TSTypeLiteral", }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -55435,7 +60402,7 @@ Object { }, "range": Array [ 0, - 16, + 58, ], "sourceType": "script", "tokens": Array [ @@ -55496,7 +60463,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 12, "line": 1, }, "start": Object { @@ -55506,457 +60473,406 @@ Object { }, "range": Array [ 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ 15, + 16, ], - "type": "Boolean", - "value": "true", + "type": "Identifier", + "value": "h", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/typed-keyword-undefined.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, }, - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 0, + 17, 20, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, }, - "range": Array [ - 11, - 20, - ], - "type": "TSUndefinedKeyword", }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ":", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 0, - 4, + 22, + 28, ], "type": "Identifier", - "value": "type", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 5, - 8, + 28, + 29, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 9, - 10, + 29, + 30, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 11, - 20, + 31, + 35, ], - "type": "Identifier", - "value": "undefined", + "type": "Keyword", + "value": "void", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/typed-keyword-unknown.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, }, - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 0, - 18, + 39, + 40, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "type": "Identifier", + "value": "g", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, }, - "range": Array [ - 11, - 18, - ], - "type": "TSUnknownKeyword", }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "<", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 19, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 0, - 4, + 41, + 42, ], "type": "Identifier", - "value": "type", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 6, + "line": 3, }, "start": Object { "column": 5, - "line": 1, + "line": 3, }, }, "range": Array [ - 5, - 8, + 42, + 43, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 9, - 10, + 43, + 44, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 10, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 7, + "line": 3, }, }, "range": Array [ - 11, - 18, + 44, + 47, ], "type": "Identifier", - "value": "unknown", + "value": "bar", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/typed-keyword-void.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, }, - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ":", + }, + Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 3, }, }, "range": Array [ - 0, - 15, + 49, + 50, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, }, - "range": Array [ - 11, - 15, - ], - "type": "TSVoidKeyword", }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": ")", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 0, - 4, + 51, + 52, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 17, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 5, - 8, + 53, + 54, ], "type": "Identifier", - "value": "Foo", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 18, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 17, + "line": 3, }, }, "range": Array [ - 9, - 10, + 54, + 55, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 11, - 15, + 56, + 57, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "}", }, ], "type": "Program", @@ -73458,6 +78374,495 @@ Object { } `; +exports[`typescript fixtures/errorRecovery/index-signature-parameters.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "index": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 46, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 37, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 11, + 48, + ], + "type": "TSTypeLiteral", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/errorRecovery/interface-empty-extends.src 1`] = ` Object { "body": Array [ @@ -82443,186 +87848,600 @@ Object { }, }, "range": Array [ - 0, - 231, + 0, + 231, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 231, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 23, + 26, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 17, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 19, + "line": 3, + }, + }, + "range": Array [ + 31, + 44, + ], + "type": "String", + "value": "'hello world'", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 49, + 55, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 62, + 67, + ], + "type": "Identifier", + "value": "Point", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 89, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 89, + 90, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 5, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "range": Array [ + 90, + 96, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 5, + }, + "start": Object { + "column": 27, + "line": 5, + }, + }, + "range": Array [ + 97, + 98, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 5, + }, + "start": Object { + "column": 28, + "line": 5, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 5, + }, + "start": Object { + "column": 36, + "line": 5, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 5, + }, + "start": Object { + "column": 38, + "line": 5, + }, + }, + "range": Array [ + 108, + 114, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 45, + "line": 5, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 5, + }, + "start": Object { + "column": 46, + "line": 5, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 48, + "line": 5, + }, + }, + "range": Array [ + 118, + 124, ], - "type": "TSModuleDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 12, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "number", }, - }, - "range": Array [ - 0, - 231, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 55, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 54, + "line": 5, }, }, "range": Array [ - 0, - 6, + 124, + 125, ], - "type": "Identifier", - "value": "module", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 57, + "line": 5, }, "start": Object { - "column": 7, - "line": 1, + "column": 56, + "line": 5, }, }, "range": Array [ - 7, - 8, + 126, + 127, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 59, + "line": 5, }, "start": Object { - "column": 9, - "line": 1, + "column": 58, + "line": 5, }, }, "range": Array [ - 9, - 10, + 128, + 129, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 5, + "line": 6, }, "start": Object { "column": 4, - "line": 3, + "line": 6, }, }, "range": Array [ - 16, - 22, + 134, + 135, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 10, + "line": 7, }, "start": Object { - "column": 11, - "line": 3, + "column": 4, + "line": 7, }, }, "range": Array [ - 23, - 26, + 140, + 146, ], "type": "Keyword", - "value": "var", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 17, + "line": 7, }, "start": Object { - "column": 15, - "line": 3, + "column": 11, + "line": 7, }, }, "range": Array [ - 27, - 28, + 147, + 153, ], "type": "Identifier", - "value": "x", + "value": "module", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 19, + "line": 7, }, "start": Object { - "column": 17, - "line": 3, + "column": 18, + "line": 7, }, }, "range": Array [ - 29, - 30, + 154, + 155, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 3, + "column": 21, + "line": 7, }, "start": Object { - "column": 19, - "line": 3, + "column": 20, + "line": 7, }, }, "range": Array [ - 31, - 44, + 156, + 157, ], - "type": "String", - "value": "'hello world'", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 14, + "line": 8, }, "start": Object { - "column": 4, - "line": 4, + "column": 8, + "line": 8, }, }, "range": Array [ - 49, - 55, + 166, + 172, ], "type": "Keyword", "value": "export", @@ -82630,53 +88449,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 24, + "line": 8, }, "start": Object { - "column": 11, - "line": 4, + "column": 15, + "line": 8, }, }, "range": Array [ - 56, - 61, + 173, + 182, ], "type": "Keyword", - "value": "class", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 4, + "column": 27, + "line": 8, }, "start": Object { - "column": 17, - "line": 4, + "column": 25, + "line": 8, }, }, "range": Array [ - 62, - 67, + 183, + 185, ], "type": "Identifier", - "value": "Point", + "value": "Id", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 29, + "line": 8, }, "start": Object { - "column": 23, - "line": 4, + "column": 28, + "line": 8, }, }, "range": Array [ - 68, - 69, + 186, + 187, ], "type": "Punctuator", "value": "{", @@ -82684,673 +88503,842 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 16, + "line": 9, }, "start": Object { - "column": 8, - "line": 5, + "column": 12, + "line": 9, }, }, "range": Array [ - 78, - 89, + 200, + 204, ], "type": "Identifier", - "value": "constructor", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, + "column": 17, + "line": 9, }, "start": Object { - "column": 19, - "line": 5, + "column": 16, + "line": 9, }, }, "range": Array [ - 89, - 90, + 204, + 205, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 5, + "column": 24, + "line": 9, }, "start": Object { - "column": 20, - "line": 5, + "column": 18, + "line": 9, }, }, "range": Array [ - 90, - 96, + 206, + 212, ], - "type": "Keyword", - "value": "public", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 5, + "column": 25, + "line": 9, }, "start": Object { - "column": 27, - "line": 5, + "column": 24, + "line": 9, }, }, "range": Array [ - 97, - 98, + 212, + 213, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 5, + "column": 9, + "line": 10, }, "start": Object { - "column": 28, - "line": 5, + "column": 8, + "line": 10, }, }, "range": Array [ - 98, - 99, + 222, + 223, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 5, + "column": 5, + "line": 11, }, "start": Object { - "column": 30, - "line": 5, + "column": 4, + "line": 11, }, }, "range": Array [ - 100, - 106, + 228, + 229, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 5, + "column": 1, + "line": 12, }, "start": Object { - "column": 36, - "line": 5, + "column": 0, + "line": 12, }, }, "range": Array [ - 106, - 107, + 230, + 231, ], "type": "Punctuator", - "value": ",", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` +Object { + "body": Array [ Object { + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 31, + ], + "raw": "\\"hot-new-module\\"", + "type": "Literal", + "value": "hot-new-module", + }, "loc": Object { "end": Object { - "column": 44, - "line": 5, + "column": 32, + "line": 1, }, "start": Object { - "column": 38, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 108, - 114, + 0, + 32, ], - "type": "Keyword", - "value": "public", + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 46, - "line": 5, + "column": 7, + "line": 1, }, "start": Object { - "column": 45, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 115, - 116, + 0, + 7, ], "type": "Identifier", - "value": "y", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 5, + "column": 14, + "line": 1, }, "start": Object { - "column": 46, - "line": 5, + "column": 8, + "line": 1, }, }, "range": Array [ - 116, - 117, + 8, + 14, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "module", }, Object { "loc": Object { "end": Object { - "column": 54, - "line": 5, + "column": 31, + "line": 1, }, "start": Object { - "column": 48, - "line": 5, + "column": 15, + "line": 1, }, }, "range": Array [ - 118, - 124, + 15, + 31, ], - "type": "Identifier", - "value": "number", + "type": "String", + "value": "\\"hot-new-module\\"", }, Object { "loc": Object { "end": Object { - "column": 55, - "line": 5, + "column": 32, + "line": 1, }, "start": Object { - "column": 54, - "line": 5, + "column": 31, + "line": 1, }, }, "range": Array [ - 124, - 125, + 31, + 32, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/array-type.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 57, - "line": 5, + "column": 19, + "line": 1, }, "start": Object { - "column": 56, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 126, - 127, + 0, + 19, ], - "type": "Punctuator", - "value": "{", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 19, + ], + "type": "TSArrayType", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 59, - "line": 5, + "column": 4, + "line": 1, }, "start": Object { - "column": 58, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 128, - 129, + 0, + 4, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 6, + "column": 8, + "line": 1, }, "start": Object { - "column": 4, - "line": 6, + "column": 5, + "line": 1, }, }, "range": Array [ - 134, - 135, + 5, + 8, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 7, + "line": 1, }, "start": Object { - "column": 4, - "line": 7, + "column": 9, + "line": 1, }, }, "range": Array [ - 140, - 146, + 9, + 10, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 7, + "line": 1, }, "start": Object { "column": 11, - "line": 7, + "line": 1, }, }, "range": Array [ - 147, - 153, + 11, + 17, ], "type": "Identifier", - "value": "module", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, - }, - "start": Object { "column": 18, - "line": 7, - }, - }, - "range": Array [ - 154, - 155, - ], - "type": "Identifier", - "value": "B", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 7, + "line": 1, }, "start": Object { - "column": 20, - "line": 7, + "column": 17, + "line": 1, }, }, "range": Array [ - 156, - 157, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 19, + "line": 1, }, "start": Object { - "column": 8, - "line": 8, + "column": 18, + "line": 1, }, }, "range": Array [ - 166, - 172, + 18, + 19, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "]", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/conditional.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 8, - }, - "start": Object { - "column": 15, - "line": 8, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 47, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 47, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, + ], + "type": "TSNumberKeyword", + }, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", + }, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "TSStringKeyword", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 47, + ], + "trueType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "TSBooleanKeyword", + }, + "type": "TSConditionalType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 173, - 182, ], - "type": "Keyword", - "value": "interface", - }, - Object { + "kind": "let", "loc": Object { "end": Object { - "column": 27, - "line": 8, + "column": 48, + "line": 1, }, "start": Object { - "column": 25, - "line": 8, + "column": 0, + "line": 1, }, }, "range": Array [ - 183, - 185, + 0, + 48, ], - "type": "Identifier", - "value": "Id", + "type": "VariableDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 8, - }, - "start": Object { - "column": 28, - "line": 8, - }, - }, - "range": Array [ - 186, - 187, - ], - "type": "Punctuator", - "value": "{", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 9, - }, - "start": Object { - "column": 12, - "line": 9, - }, - }, - "range": Array [ - 200, - 204, - ], - "type": "Identifier", - "value": "name", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, - "line": 9, + "column": 3, + "line": 1, }, "start": Object { - "column": 16, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 204, - 205, + 0, + 3, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 9, + "column": 5, + "line": 1, }, "start": Object { - "column": 18, - "line": 9, + "column": 4, + "line": 1, }, }, "range": Array [ - 206, - 212, + 4, + 5, ], "type": "Identifier", - "value": "string", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 9, + "column": 6, + "line": 1, }, "start": Object { - "column": 24, - "line": 9, + "column": 5, + "line": 1, }, }, "range": Array [ - 212, - 213, + 5, + 6, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 10, + "column": 13, + "line": 1, }, "start": Object { - "column": 8, - "line": 10, + "column": 7, + "line": 1, }, }, "range": Array [ - 222, - 223, + 7, + 13, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 11, + "column": 21, + "line": 1, }, "start": Object { - "column": 4, - "line": 11, + "column": 14, + "line": 1, }, }, "range": Array [ - 228, - 229, + 14, + 21, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 12, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 12, + "column": 22, + "line": 1, }, }, "range": Array [ - 230, - 231, + 22, + 28, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "string", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = ` -Object { - "body": Array [ Object { - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 31, - ], - "raw": "\\"hot-new-module\\"", - "type": "Literal", - "value": "hot-new-module", - }, "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 1, }, "start": Object { - "column": 0, + "column": 29, "line": 1, }, }, "range": Array [ - 0, - 32, + 29, + 30, ], - "type": "TSModuleDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "?", }, - }, - "range": Array [ - 0, - 33, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 38, "line": 1, }, "start": Object { - "column": 0, + "column": 31, "line": 1, }, }, "range": Array [ - 0, - 7, + 31, + 38, ], "type": "Identifier", - "value": "declare", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 40, "line": 1, }, "start": Object { - "column": 8, + "column": 39, "line": 1, }, }, "range": Array [ - 8, - 14, + 39, + 40, ], - "type": "Identifier", - "value": "module", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 47, "line": 1, }, "start": Object { - "column": 15, + "column": 41, "line": 1, }, }, "range": Array [ - 15, - 31, + 41, + 47, ], - "type": "String", - "value": "\\"hot-new-module\\"", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 48, "line": 1, }, "start": Object { - "column": 31, + "column": 47, "line": 1, }, }, "range": Array [ - 31, - 32, + 47, + 48, ], "type": "Punctuator", "value": ";", @@ -83360,14 +89348,14 @@ Object { } `; -exports[`typescript fixtures/types/array-type.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer.src 1`] = ` Object { "body": Array [ Object { "id": Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { @@ -83375,16 +89363,16 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "Element", "range": Array [ 5, - 8, + 12, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 19, + "column": 48, "line": 1, }, "start": Object { @@ -83394,42 +89382,270 @@ Object { }, "range": Array [ 0, - 19, + 48, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { - "elementType": Object { + "checkType": Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { - "column": 11, + "column": 18, "line": 1, }, }, "range": Array [ - 11, - 17, + 18, + 19, ], - "type": "TSStringKeyword", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 37, + ], + "type": "TSParenthesizedType", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "range": Array [ + 35, + 36, + ], + "type": "TSTypeParameter", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 39, + ], + "type": "TSArrayType", + }, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 46, + 47, + ], + "type": "Identifier", + }, }, "loc": Object { "end": Object { - "column": 19, + "column": 47, "line": 1, }, "start": Object { - "column": 11, + "column": 18, "line": 1, }, }, "range": Array [ - 11, - 19, + 18, + 47, ], - "type": "TSArrayType", + "trueType": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + }, + "type": "TSConditionalType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 14, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 12, + 15, + ], + "type": "TSTypeParameterDeclaration", }, }, ], @@ -83445,7 +89661,7 @@ Object { }, "range": Array [ 0, - 20, + 49, ], "sourceType": "script", "tokens": Array [ @@ -83470,7 +89686,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { @@ -83480,64 +89696,82 @@ Object { }, "range": Array [ 5, - 8, + 12, ], "type": "Identifier", - "value": "Foo", + "value": "Element", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 13, "line": 1, }, "start": Object { - "column": 9, + "column": 12, "line": 1, }, }, "range": Array [ - 9, - 10, + 12, + 13, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "range": Array [ - 11, - 17, + 13, + 14, ], "type": "Identifier", - "value": "string", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { "column": 17, "line": 1, }, + "start": Object { + "column": 16, + "line": 1, + }, }, "range": Array [ + 16, 17, - 18, ], "type": "Punctuator", - "value": "[", + "value": "=", }, Object { "loc": Object { @@ -83554,314 +89788,149 @@ Object { 18, 19, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "T", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/types/conditional.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 47, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 47, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "checkType": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 13, - ], - "type": "TSNumberKeyword", - }, - "extendsType": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 28, - ], - "type": "TSStringKeyword", - }, - "falseType": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 47, - ], - "type": "TSStringKeyword", - }, - "loc": Object { - "end": Object { - "column": 47, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 47, - ], - "trueType": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 38, - ], - "type": "TSBooleanKeyword", - }, - "type": "TSConditionalType", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 47, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 47, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", "loc": Object { "end": Object { - "column": 48, + "column": 27, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 48, + 20, + 27, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "extends", }, - }, - "range": Array [ - 0, - 49, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 29, "line": 1, }, "start": Object { - "column": 0, + "column": 28, "line": 1, }, }, - "range": Array [ - 0, - 3, + "range": Array [ + 28, + 29, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 34, "line": 1, }, "start": Object { - "column": 4, + "column": 29, "line": 1, }, }, "range": Array [ - 4, - 5, + 29, + 34, ], "type": "Identifier", - "value": "x", + "value": "infer", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 36, "line": 1, }, "start": Object { - "column": 5, + "column": 35, "line": 1, }, }, "range": Array [ - 5, - 6, + 35, + 36, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "U", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 37, "line": 1, }, "start": Object { - "column": 7, + "column": 36, "line": 1, }, }, "range": Array [ - 7, - 13, + 36, + 37, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 38, "line": 1, }, "start": Object { - "column": 14, + "column": 37, "line": 1, }, }, "range": Array [ - 14, - 21, + 37, + 38, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 39, "line": 1, }, "start": Object { - "column": 22, + "column": 38, "line": 1, }, }, "range": Array [ - 22, - 28, + 38, + 39, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 41, "line": 1, }, "start": Object { - "column": 29, + "column": 40, "line": 1, }, }, "range": Array [ - 29, - 30, + 40, + 41, ], "type": "Punctuator", "value": "?", @@ -83869,35 +89938,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, + "column": 43, "line": 1, }, "start": Object { - "column": 31, + "column": 42, "line": 1, }, }, "range": Array [ - 31, - 38, + 42, + 43, ], "type": "Identifier", - "value": "boolean", + "value": "U", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 45, "line": 1, }, "start": Object { - "column": 39, + "column": 44, "line": 1, }, }, "range": Array [ - 39, - 40, + 44, + 45, ], "type": "Punctuator", "value": ":", @@ -83909,16 +89978,16 @@ Object { "line": 1, }, "start": Object { - "column": 41, + "column": 46, "line": 1, }, }, "range": Array [ - 41, + 46, 47, ], "type": "Identifier", - "value": "string", + "value": "T", }, Object { "loc": Object { @@ -83943,14 +90012,14 @@ Object { } `; -exports[`typescript fixtures/types/conditional-infer.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` Object { "body": Array [ Object { "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { @@ -83958,17 +90027,17 @@ Object { "line": 1, }, }, - "name": "Element", + "name": "Unpacked", "range": Array [ 5, - 12, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 10, + "line": 5, }, "start": Object { "column": 0, @@ -83977,41 +90046,41 @@ Object { }, "range": Array [ 0, - 48, + 126, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "checkType": Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "TSTypeReference", "typeName": Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 2, + "line": 2, }, }, "name": "T", "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Identifier", }, @@ -84020,168 +90089,500 @@ Object { "elementType": Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 28, - 37, + 31, + 40, ], "type": "TSParenthesizedType", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 29, - 36, + 32, + 39, ], "type": "TSInferType", "typeParameter": Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 19, + "line": 2, }, }, "name": Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 19, + "line": 2, }, }, "name": "U", "range": Array [ - 35, - 36, + 38, + 39, ], "type": "Identifier", }, "range": Array [ - 35, - 36, + 38, + 39, + ], + "type": "TSTypeParameter", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 31, + 42, + ], + "type": "TSArrayType", + }, + "falseType": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 63, + 70, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "name": "U", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + "range": Array [ + 69, + 70, + ], + "type": "TSTypeParameter", + }, + }, + "falseType": Object { + "checkType": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "name": "T", + "range": Array [ + 83, + 84, + ], + "type": "Identifier", + }, + }, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 93, + 109, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "Promise", + "range": Array [ + 93, + 100, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 101, + 108, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 30, + "line": 4, + }, + }, + "name": "U", + "range": Array [ + 107, + 108, + ], + "type": "Identifier", + }, + "range": Array [ + 107, + 108, + ], + "type": "TSTypeParameter", + }, + }, + ], + "range": Array [ + 100, + 109, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": "T", + "range": Array [ + 124, + 125, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 83, + 125, + ], + "trueType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "range": Array [ + 112, + 113, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "name": "U", + "range": Array [ + 112, + 113, ], - "type": "TSTypeParameter", + "type": "Identifier", }, }, + "type": "TSConditionalType", }, "loc": Object { "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 39, - ], - "type": "TSArrayType", - }, - "falseType": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 46, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 46, - 47, + 53, + 125, ], - "type": "TSTypeReference", - "typeName": Object { + "trueType": Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 25, + "line": 3, }, "start": Object { - "column": 46, - "line": 1, + "column": 24, + "line": 3, }, }, - "name": "T", "range": Array [ - 46, - 47, + 73, + 74, ], - "type": "Identifier", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "name": "U", + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + }, }, + "type": "TSConditionalType", }, "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 18, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 18, - 47, + 21, + 125, ], "trueType": Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 42, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 42, - 43, + 45, + 46, ], "type": "TSTypeReference", "typeName": Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 42, - "line": 1, + "column": 26, + "line": 2, }, }, "name": "U", "range": Array [ - 42, - 43, + 45, + 46, ], "type": "Identifier", }, @@ -84191,11 +90592,11 @@ Object { "typeParameters": Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, @@ -84203,42 +90604,42 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "name": Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "name": "T", "range": Array [ - 13, 14, + 15, ], "type": "Identifier", }, "range": Array [ - 13, 14, + 15, ], "type": "TSTypeParameter", }, ], "range": Array [ - 12, - 15, + 13, + 16, ], "type": "TSTypeParameterDeclaration", }, @@ -84247,7 +90648,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 6, }, "start": Object { "column": 0, @@ -84256,7 +90657,7 @@ Object { }, "range": Array [ 0, - 49, + 127, ], "sourceType": "script", "tokens": Array [ @@ -84281,7 +90682,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { @@ -84291,25 +90692,25 @@ Object { }, "range": Array [ 5, - 12, + 13, ], "type": "Identifier", - "value": "Element", + "value": "Unpacked", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], "type": "Punctuator", "value": "<", @@ -84317,17 +90718,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 15, ], "type": "Identifier", "value": "T", @@ -84335,17 +90736,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, + 16, ], "type": "Punctuator", "value": ">", @@ -84353,17 +90754,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 18, ], "type": "Punctuator", "value": "=", @@ -84371,17 +90772,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Identifier", "value": "T", @@ -84389,17 +90790,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 20, - 27, + 23, + 30, ], "type": "Keyword", "value": "extends", @@ -84407,17 +90808,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 28, - 29, + 31, + 32, ], "type": "Punctuator", "value": "(", @@ -84425,107 +90826,413 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 18, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 32, + 37, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, }, "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { "column": 29, - "line": 1, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, }, }, "range": Array [ - 29, - 34, + 47, + 48, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 55, + 62, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 63, + 68, + ], + "type": "Identifier", + "value": "infer", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 20, + "line": 3, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 3, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 75, + 76, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 83, + 84, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 85, + 92, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 93, + 100, ], "type": "Identifier", - "value": "infer", + "value": "Promise", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 24, + "line": 4, }, "start": Object { - "column": 35, - "line": 1, + "column": 23, + "line": 4, }, }, "range": Array [ - 35, - 36, + 100, + 101, ], - "type": "Identifier", - "value": "U", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 29, + "line": 4, }, "start": Object { - "column": 36, - "line": 1, + "column": 24, + "line": 4, }, }, "range": Array [ - 36, - 37, + 101, + 106, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "infer", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 37, - "line": 1, + "column": 30, + "line": 4, }, }, "range": Array [ - 37, - 38, + 107, + 108, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "U", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 32, + "line": 4, }, "start": Object { - "column": 38, - "line": 1, + "column": 31, + "line": 4, }, }, "range": Array [ - 38, - 39, + 108, + 109, ], "type": "Punctuator", - "value": "]", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 34, + "line": 4, }, "start": Object { - "column": 40, - "line": 1, + "column": 33, + "line": 4, }, }, "range": Array [ - 40, - 41, + 110, + 111, ], "type": "Punctuator", "value": "?", @@ -84533,17 +91240,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 36, + "line": 4, }, "start": Object { - "column": 42, - "line": 1, + "column": 35, + "line": 4, }, }, "range": Array [ - 42, - 43, + 112, + 113, ], "type": "Identifier", "value": "U", @@ -84551,17 +91258,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 38, + "line": 4, }, "start": Object { - "column": 44, - "line": 1, + "column": 37, + "line": 4, }, }, "range": Array [ - 44, - 45, + 114, + 115, ], "type": "Punctuator", "value": ":", @@ -84569,17 +91276,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 46, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 46, - 47, + 124, + 125, ], "type": "Identifier", "value": "T", @@ -84587,17 +91294,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 10, + "line": 5, }, "start": Object { - "column": 47, - "line": 1, + "column": 9, + "line": 5, }, }, "range": Array [ - 47, - 48, + 125, + 126, ], "type": "Punctuator", "value": ";", @@ -84607,14 +91314,14 @@ Object { } `; -exports[`typescript fixtures/types/conditional-infer-nested.src 1`] = ` +exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` Object { "body": Array [ Object { "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 8, "line": 1, }, "start": Object { @@ -84622,17 +91329,17 @@ Object { "line": 1, }, }, - "name": "Unpacked", + "name": "Foo", "range": Array [ 5, - 13, + 8, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 63, + "line": 1, }, "start": Object { "column": 0, @@ -84641,543 +91348,336 @@ Object { }, "range": Array [ 0, - 126, + 63, ], "type": "TSTypeAliasDeclaration", "typeAnnotation": Object { "checkType": Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 21, - 22, + 14, + 15, ], "type": "TSTypeReference", "typeName": Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 14, + "line": 1, }, }, "name": "T", "range": Array [ - 21, - 22, + 14, + 15, ], "type": "Identifier", }, }, "extendsType": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 31, - 40, - ], - "type": "TSParenthesizedType", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 32, - 39, - ], - "type": "TSInferType", - "typeParameter": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": "U", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "range": Array [ - 38, - 39, - ], - "type": "TSTypeParameter", - }, - }, - }, "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 50, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 31, - 42, - ], - "type": "TSArrayType", - }, - "falseType": Object { - "checkType": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "T", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - }, - "extendsType": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 63, - 70, - ], - "type": "TSInferType", - "typeParameter": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 20, - "line": 3, - }, - }, - "name": "U", - "range": Array [ - 69, - 70, - ], - "type": "Identifier", - }, - "range": Array [ - 69, - 70, - ], - "type": "TSTypeParameter", + "column": 24, + "line": 1, }, }, - "falseType": Object { - "checkType": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "range": Array [ - 83, - 84, - ], - "type": "TSTypeReference", - "typeName": Object { + "members": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 27, + "line": 1, }, "start": Object { - "column": 6, - "line": 4, + "column": 26, + "line": 1, }, }, - "name": "T", + "name": "a", "range": Array [ - 83, - 84, + 26, + 27, ], "type": "Identifier", }, - }, - "extendsType": Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 37, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 93, - 109, + 26, + 37, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSPropertySignature", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 27, + "line": 1, }, }, - "name": "Promise", "range": Array [ - 93, - 100, + 27, + 36, ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 4, - }, - "start": Object { - "column": 23, - "line": 4, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, }, - }, - "params": Array [ - Object { + "range": Array [ + 29, + 36, + ], + "type": "TSInferType", + "typeParameter": Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 24, - "line": 4, + "column": 35, + "line": 1, }, }, - "range": Array [ - 101, - 108, - ], - "type": "TSInferType", - "typeParameter": Object { + "name": Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 30, - "line": 4, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 4, - }, - "start": Object { - "column": 30, - "line": 4, - }, + "column": 35, + "line": 1, }, - "name": "U", - "range": Array [ - 107, - 108, - ], - "type": "Identifier", }, + "name": "U", "range": Array [ - 107, - 108, + 35, + 36, ], - "type": "TSTypeParameter", + "type": "Identifier", }, + "range": Array [ + 35, + 36, + ], + "type": "TSTypeParameter", }, - ], - "range": Array [ - 100, - 109, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "falseType": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, }, }, - "range": Array [ - 124, - 125, - ], - "type": "TSTypeReference", - "typeName": Object { + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 39, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 38, + "line": 1, }, }, - "name": "T", + "name": "b", "range": Array [ - 124, - 125, + 38, + 39, ], "type": "Identifier", }, - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "range": Array [ - 83, - 125, - ], - "trueType": Object { "loc": Object { "end": Object { - "column": 36, - "line": 4, + "column": 48, + "line": 1, }, "start": Object { - "column": 35, - "line": 4, + "column": 38, + "line": 1, }, }, "range": Array [ - 112, - 113, + 38, + 48, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSPropertySignature", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 36, - "line": 4, + "column": 48, + "line": 1, }, "start": Object { - "column": 35, - "line": 4, + "column": 39, + "line": 1, }, }, - "name": "U", "range": Array [ - 112, - 113, + 39, + 48, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 48, + ], + "type": "TSInferType", + "typeParameter": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 47, + 48, + ], + "type": "Identifier", + }, + "range": Array [ + 47, + 48, + ], + "type": "TSTypeParameter", + }, + }, }, }, - "type": "TSConditionalType", - }, + ], + "range": Array [ + 24, + 50, + ], + "type": "TSTypeLiteral", + }, + "falseType": Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 62, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 57, + "line": 1, }, }, "range": Array [ - 53, - 125, + 57, + 62, ], - "trueType": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "range": Array [ - 73, - 74, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 3, - }, - }, - "name": "U", - "range": Array [ - 73, - 74, - ], - "type": "Identifier", - }, - }, - "type": "TSConditionalType", + "type": "TSNeverKeyword", }, "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 62, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 21, - 125, + 14, + 62, ], "trueType": Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 54, + "line": 1, }, "start": Object { - "column": 26, - "line": 2, + "column": 53, + "line": 1, }, }, "range": Array [ - 45, - 46, + 53, + 54, ], "type": "TSTypeReference", "typeName": Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 54, + "line": 1, }, "start": Object { - "column": 26, - "line": 2, + "column": 53, + "line": 1, }, }, "name": "U", "range": Array [ - 45, - 46, + 53, + 54, ], "type": "Identifier", }, @@ -85187,11 +91687,11 @@ Object { "typeParameters": Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, "line": 1, }, "start": Object { - "column": 13, + "column": 8, "line": 1, }, }, @@ -85199,42 +91699,42 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 10, "line": 1, }, "start": Object { - "column": 14, + "column": 9, "line": 1, }, }, "name": Object { "loc": Object { "end": Object { - "column": 15, + "column": 10, "line": 1, }, "start": Object { - "column": 14, + "column": 9, "line": 1, }, }, "name": "T", "range": Array [ - 14, - 15, + 9, + 10, ], "type": "Identifier", }, "range": Array [ - 14, - 15, + 9, + 10, ], "type": "TSTypeParameter", }, ], "range": Array [ - 13, - 16, + 8, + 11, ], "type": "TSTypeParameterDeclaration", }, @@ -85243,7 +91743,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -85252,7 +91752,7 @@ Object { }, "range": Array [ 0, - 127, + 64, ], "sourceType": "script", "tokens": Array [ @@ -85277,7 +91777,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 8, "line": 1, }, "start": Object { @@ -85287,25 +91787,25 @@ Object { }, "range": Array [ 5, - 13, + 8, ], "type": "Identifier", - "value": "Unpacked", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 9, "line": 1, }, "start": Object { - "column": 13, + "column": 8, "line": 1, }, }, "range": Array [ - 13, - 14, + 8, + 9, ], "type": "Punctuator", "value": "<", @@ -85313,17 +91813,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 10, "line": 1, }, "start": Object { - "column": 14, + "column": 9, "line": 1, }, }, "range": Array [ - 14, - 15, + 9, + 10, ], "type": "Identifier", "value": "T", @@ -85331,17 +91831,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 10, "line": 1, }, }, "range": Array [ - 15, - 16, + 10, + 11, ], "type": "Punctuator", "value": ">", @@ -85349,17 +91849,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { - "column": 17, + "column": 12, "line": 1, }, }, "range": Array [ - 17, - 18, + 12, + 13, ], "type": "Punctuator", "value": "=", @@ -85367,413 +91867,197 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 21, - 22, + 14, + 15, ], "type": "Identifier", "value": "T", }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 23, - 30, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 32, - 37, - ], - "type": "Identifier", - "value": "infer", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - "value": "U", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": "[", - }, Object { "loc": Object { "end": Object { "column": 23, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "range": Array [ - 41, - 42, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 43, - 44, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - "value": "U", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 47, - 48, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - "value": "T", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 55, - 62, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 16, + "line": 1, }, }, "range": Array [ - 63, - 68, + 16, + 23, ], - "type": "Identifier", - "value": "infer", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 20, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 69, - 70, + 24, + 25, ], - "type": "Identifier", - "value": "U", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 27, + "line": 1, }, "start": Object { - "column": 22, - "line": 3, + "column": 26, + "line": 1, }, }, "range": Array [ - 71, - 72, + 26, + 27, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 24, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 73, - 74, + 27, + 28, ], - "type": "Identifier", - "value": "U", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 34, + "line": 1, }, "start": Object { - "column": 26, - "line": 3, + "column": 29, + "line": 1, }, }, "range": Array [ - 75, - 76, + 29, + 34, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "infer", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 6, - "line": 4, + "column": 35, + "line": 1, }, }, "range": Array [ - 83, - 84, + 35, + 36, ], "type": "Identifier", - "value": "T", + "value": "U", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 37, + "line": 1, }, "start": Object { - "column": 8, - "line": 4, + "column": 36, + "line": 1, }, }, "range": Array [ - 85, - 92, + 36, + 37, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 4, + "column": 39, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 38, + "line": 1, }, }, "range": Array [ - 93, - 100, + 38, + 39, ], "type": "Identifier", - "value": "Promise", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 40, + "line": 1, }, "start": Object { - "column": 23, - "line": 4, + "column": 39, + "line": 1, }, }, "range": Array [ - 100, - 101, + 39, + 40, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 4, + "column": 46, + "line": 1, }, "start": Object { - "column": 24, - "line": 4, + "column": 41, + "line": 1, }, }, "range": Array [ - 101, - 106, + 41, + 46, ], "type": "Identifier", "value": "infer", @@ -85781,17 +92065,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 48, + "line": 1, }, "start": Object { - "column": 30, - "line": 4, + "column": 47, + "line": 1, }, }, "range": Array [ - 107, - 108, + 47, + 48, ], "type": "Identifier", "value": "U", @@ -85799,35 +92083,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 50, + "line": 1, }, "start": Object { - "column": 31, - "line": 4, + "column": 49, + "line": 1, }, }, "range": Array [ - 108, - 109, + 49, + 50, ], "type": "Punctuator", - "value": ">", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 52, + "line": 1, }, "start": Object { - "column": 33, - "line": 4, + "column": 51, + "line": 1, }, }, "range": Array [ - 110, - 111, + 51, + 52, ], "type": "Punctuator", "value": "?", @@ -85835,17 +92119,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 36, - "line": 4, + "column": 54, + "line": 1, }, "start": Object { - "column": 35, - "line": 4, + "column": 53, + "line": 1, }, }, "range": Array [ - 112, - 113, + 53, + 54, ], "type": "Identifier", "value": "U", @@ -85853,17 +92137,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, - "line": 4, + "column": 56, + "line": 1, }, "start": Object { - "column": 37, - "line": 4, + "column": 55, + "line": 1, }, }, "range": Array [ - 114, - 115, + 55, + 56, ], "type": "Punctuator", "value": ":", @@ -85871,35 +92155,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 62, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 57, + "line": 1, }, }, "range": Array [ - 124, - 125, + 57, + 62, ], "type": "Identifier", - "value": "T", + "value": "never", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 63, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 62, + "line": 1, }, }, "range": Array [ - 125, - 126, + 62, + 63, ], "type": "Punctuator", "value": ";", @@ -85909,430 +92193,166 @@ Object { } `; -exports[`typescript fixtures/types/conditional-infer-simple.src 1`] = ` +exports[`typescript fixtures/types/conditional-with-null.src 1`] = ` Object { "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 5, - 8, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 63, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 63, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "checkType": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "TSTypeReference", - "typeName": Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 15, + "column": 45, "line": 1, }, "start": Object { - "column": 14, + "column": 4, "line": 1, }, }, - "name": "T", + "name": "x", "range": Array [ - 14, - 15, + 4, + 45, ], "type": "Identifier", - }, - }, - "extendsType": Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "members": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 37, + "column": 45, "line": 1, }, "start": Object { - "column": 26, + "column": 5, "line": 1, }, }, "range": Array [ - 26, - 37, + 5, + 45, ], - "type": "TSPropertySignature", + "type": "TSTypeAnnotation", "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 36, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "checkType": Object { "loc": Object { "end": Object { - "column": 36, + "column": 13, "line": 1, }, "start": Object { - "column": 29, + "column": 7, "line": 1, }, }, "range": Array [ - 29, - 36, + 7, + 13, ], - "type": "TSInferType", - "typeParameter": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, + "type": "TSNumberKeyword", + }, + "extendsType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, }, - "name": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "name": "U", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", + "start": Object { + "column": 22, + "line": 1, }, - "range": Array [ - 35, - 36, - ], - "type": "TSTypeParameter", }, + "range": Array [ + 22, + 28, + ], + "type": "TSStringKeyword", }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, + "falseType": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, }, + "range": Array [ + 41, + 45, + ], + "type": "TSNullKeyword", }, - "name": "b", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 48, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 48, + "column": 45, "line": 1, }, "start": Object { - "column": 39, + "column": 7, "line": 1, }, }, "range": Array [ - 39, - 48, + 7, + 45, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "trueType": Object { "loc": Object { "end": Object { - "column": 48, + "column": 38, "line": 1, }, "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 48, - ], - "type": "TSInferType", - "typeParameter": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 47, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 47, - "line": 1, - }, - }, - "name": "U", - "range": Array [ - 47, - 48, - ], - "type": "Identifier", + "column": 31, + "line": 1, }, - "range": Array [ - 47, - 48, - ], - "type": "TSTypeParameter", }, + "range": Array [ + 31, + 38, + ], + "type": "TSBooleanKeyword", }, + "type": "TSConditionalType", }, }, - ], - "range": Array [ - 24, - 50, - ], - "type": "TSTypeLiteral", - }, - "falseType": Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "start": Object { - "column": 57, - "line": 1, - }, - }, - "range": Array [ - 57, - 62, - ], - "type": "TSNeverKeyword", - }, - "loc": Object { - "end": Object { - "column": 62, - "line": 1, }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 62, - ], - "trueType": Object { + "init": null, "loc": Object { "end": Object { - "column": 54, + "column": 45, "line": 1, }, "start": Object { - "column": 53, + "column": 4, "line": 1, }, }, "range": Array [ - 53, - 54, + 4, + 45, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 1, - }, - "start": Object { - "column": 53, - "line": 1, - }, - }, - "name": "U", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, + "type": "VariableDeclarator", }, - "type": "TSConditionalType", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "range": Array [ - 9, - 10, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 8, - 11, - ], - "type": "TSTypeParameterDeclaration", }, + "range": Array [ + 0, + 46, + ], + "type": "VariableDeclaration", }, ], "loc": Object { @@ -86347,14 +92367,14 @@ Object { }, "range": Array [ 0, - 64, + 47, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 3, "line": 1, }, "start": Object { @@ -86364,15 +92384,33 @@ Object { }, "range": Array [ 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ 4, + 5, ], "type": "Identifier", - "value": "type", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -86382,403 +92420,713 @@ Object { }, "range": Array [ 5, - 8, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 13, ], "type": "Identifier", - "value": "Foo", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 14, "line": 1, }, }, "range": Array [ - 8, - 9, + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", - "value": "<", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 38, "line": 1, }, "start": Object { - "column": 9, + "column": 31, "line": 1, }, }, "range": Array [ - 9, - 10, + 31, + 38, ], "type": "Identifier", - "value": "T", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 40, "line": 1, }, "start": Object { - "column": 10, + "column": 39, "line": 1, }, }, "range": Array [ - 10, - 11, + 39, + 40, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 45, "line": 1, }, "start": Object { - "column": 12, + "column": 41, "line": 1, }, }, "range": Array [ - 12, - 13, + 41, + 45, + ], + "type": "Keyword", + "value": "null", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 4, + 42, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 21, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 21, + ], + "type": "TSNumberKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "b", + "optional": true, + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 7, + 42, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 42, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSConstructorType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 42, + ], + "type": "VariableDeclarator", + }, ], - "type": "Punctuator", - "value": "=", - }, - Object { + "kind": "let", "loc": Object { "end": Object { - "column": 15, + "column": 43, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 43, ], - "type": "Identifier", - "value": "T", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 23, + "column": 3, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, - 23, + 0, + 3, ], "type": "Keyword", - "value": "extends", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 5, "line": 1, }, "start": Object { - "column": 24, + "column": 4, "line": 1, }, }, "range": Array [ - 24, - 25, + 4, + 5, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 6, "line": 1, }, "start": Object { - "column": 26, + "column": 5, "line": 1, }, }, "range": Array [ - 26, - 27, + 5, + 6, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 10, "line": 1, }, "start": Object { - "column": 27, + "column": 7, "line": 1, }, }, "range": Array [ - 27, - 28, + 7, + 10, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 12, "line": 1, }, "start": Object { - "column": 29, + "column": 11, "line": 1, }, }, "range": Array [ - 29, - 34, + 11, + 12, ], - "type": "Identifier", - "value": "infer", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 13, "line": 1, }, "start": Object { - "column": 35, + "column": 12, "line": 1, }, }, "range": Array [ - 35, - 36, + 12, + 13, ], "type": "Identifier", - "value": "U", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 14, "line": 1, }, "start": Object { - "column": 36, + "column": 13, "line": 1, }, }, "range": Array [ - 36, - 37, + 13, + 14, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 21, "line": 1, }, "start": Object { - "column": 38, + "column": 15, "line": 1, }, }, "range": Array [ - 38, - 39, + 15, + 21, ], "type": "Identifier", - "value": "b", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 22, "line": 1, }, "start": Object { - "column": 39, + "column": 21, "line": 1, }, }, "range": Array [ - 39, - 40, + 21, + 22, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 24, "line": 1, }, "start": Object { - "column": 41, + "column": 23, "line": 1, }, }, "range": Array [ - 41, - 46, + 23, + 24, ], "type": "Identifier", - "value": "infer", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 48, + "column": 25, "line": 1, }, "start": Object { - "column": 47, + "column": 24, "line": 1, }, }, "range": Array [ - 47, - 48, + 24, + 25, ], - "type": "Identifier", - "value": "U", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 50, + "column": 26, "line": 1, }, "start": Object { - "column": 49, + "column": 25, "line": 1, }, }, "range": Array [ - 49, - 50, + 25, + 26, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 52, + "column": 33, "line": 1, }, "start": Object { - "column": 51, + "column": 27, "line": 1, }, }, "range": Array [ - 51, - 52, + 27, + 33, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 54, + "column": 34, "line": 1, }, "start": Object { - "column": 53, + "column": 33, "line": 1, }, }, "range": Array [ - 53, - 54, + 33, + 34, ], - "type": "Identifier", - "value": "U", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 56, + "column": 37, "line": 1, }, "start": Object { - "column": 55, + "column": 35, "line": 1, }, }, "range": Array [ - 55, - 56, + 35, + 37, ], "type": "Punctuator", - "value": ":", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 62, + "column": 42, "line": 1, }, "start": Object { - "column": 57, + "column": 38, "line": 1, }, }, "range": Array [ - 57, - 62, + 38, + 42, ], - "type": "Identifier", - "value": "never", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 63, + "column": 43, "line": 1, }, "start": Object { - "column": 62, + "column": 42, "line": 1, }, }, "range": Array [ - 62, - 63, + 42, + 43, ], "type": "Punctuator", "value": ";", @@ -86788,7 +93136,7 @@ Object { } `; -exports[`typescript fixtures/types/conditional-with-null.src 1`] = ` +exports[`typescript fixtures/types/constructor-generic.src 1`] = ` Object { "body": Array [ Object { @@ -86797,7 +93145,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 45, + "column": 25, "line": 1, }, "start": Object { @@ -86805,16 +93153,16 @@ Object { "line": 1, }, }, - "name": "x", + "name": "f", "range": Array [ 4, - 45, + 25, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 45, + "column": 25, "line": 1, }, "start": Object { @@ -86824,100 +93172,210 @@ Object { }, "range": Array [ 5, - 45, + 25, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { - "checkType": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, - "range": Array [ - 7, - 13, - ], - "type": "TSNumberKeyword", }, - "extendsType": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, }, - "start": Object { - "column": 22, - "line": 1, + "name": "a", + "range": Array [ + 15, + 19, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, }, }, - "range": Array [ - 22, - 28, - ], - "type": "TSStringKeyword", - }, - "falseType": Object { + ], + "range": Array [ + 7, + 25, + ], + "returnType": Object { "loc": Object { "end": Object { - "column": 45, + "column": 25, "line": 1, }, "start": Object { - "column": 41, + "column": 21, "line": 1, }, }, "range": Array [ - 41, - 45, + 21, + 25, ], - "type": "TSNullKeyword", - }, - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, }, }, - "range": Array [ - 7, - 45, - ], - "trueType": Object { + "type": "TSConstructorType", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 38, + "column": 14, "line": 1, }, "start": Object { - "column": 31, + "column": 11, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "range": Array [ + 12, + 13, + ], + "type": "TSTypeParameter", + }, + ], "range": Array [ - 31, - 38, + 11, + 14, ], - "type": "TSBooleanKeyword", + "type": "TSTypeParameterDeclaration", }, - "type": "TSConditionalType", }, }, }, "init": null, "loc": Object { "end": Object { - "column": 45, + "column": 25, "line": 1, }, "start": Object { @@ -86927,7 +93385,7 @@ Object { }, "range": Array [ 4, - 45, + 25, ], "type": "VariableDeclarator", }, @@ -86935,7 +93393,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 46, + "column": 26, "line": 1, }, "start": Object { @@ -86945,7 +93403,7 @@ Object { }, "range": Array [ 0, - 46, + 26, ], "type": "VariableDeclaration", }, @@ -86962,86 +93420,140 @@ Object { }, "range": Array [ 0, - 47, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 3, + 7, + 10, ], "type": "Keyword", - "value": "let", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 12, "line": 1, }, "start": Object { - "column": 4, + "column": 11, "line": 1, }, }, "range": Array [ - 4, - 5, + 11, + 12, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 13, "line": 1, }, "start": Object { - "column": 5, + "column": 12, "line": 1, }, }, "range": Array [ - 5, - 6, + 12, + 13, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 7, + "column": 13, "line": 1, }, }, "range": Array [ - 7, 13, + 14, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 15, "line": 1, }, "start": Object { @@ -87051,115 +93563,133 @@ Object { }, "range": Array [ 14, - 21, + 15, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 16, "line": 1, }, "start": Object { - "column": 22, + "column": 15, "line": 1, }, }, "range": Array [ - 22, - 28, + 15, + 16, ], "type": "Identifier", - "value": "string", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 17, "line": 1, }, "start": Object { - "column": 29, + "column": 16, "line": 1, }, }, "range": Array [ - 29, - 30, + 16, + 17, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 19, "line": 1, }, "start": Object { - "column": 31, + "column": 18, "line": 1, }, }, "range": Array [ - 31, - 38, + 18, + 19, ], "type": "Identifier", - "value": "boolean", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 20, "line": 1, }, "start": Object { - "column": 39, + "column": 19, "line": 1, }, }, "range": Array [ - 39, - 40, + 19, + 20, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 45, + "column": 23, "line": 1, }, "start": Object { - "column": 41, + "column": 21, "line": 1, }, }, "range": Array [ - 41, - 45, + 21, + 23, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 25, "line": 1, }, "start": Object { - "column": 45, + "column": 24, "line": 1, }, }, "range": Array [ - 45, - 46, + 24, + 25, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, ], "type": "Punctuator", "value": ";", @@ -87169,7 +93699,7 @@ Object { } `; -exports[`typescript fixtures/types/constructor.src 1`] = ` +exports[`typescript fixtures/types/constructor-in-generic.src 1`] = ` Object { "body": Array [ Object { @@ -87178,7 +93708,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 42, + "column": 30, "line": 1, }, "start": Object { @@ -87186,16 +93716,16 @@ Object { "line": 1, }, }, - "name": "f", + "name": "x", "range": Array [ 4, - 42, + 30, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 42, + "column": 30, "line": 1, }, "start": Object { @@ -87205,13 +93735,13 @@ Object { }, "range": Array [ 5, - 42, + 30, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 42, + "column": 30, "line": 1, }, "start": Object { @@ -87219,28 +93749,45 @@ Object { "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "range": Array [ + 7, + 30, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, }, - "name": "a", - "range": Array [ - 12, - 21, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 21, + "column": 29, "line": 1, }, "start": Object { @@ -87248,130 +93795,61 @@ Object { "line": 1, }, }, + "params": Array [], "range": Array [ 13, - 21, + 29, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 21, + "column": 29, "line": 1, }, "start": Object { - "column": 15, + "column": 20, "line": 1, }, }, "range": Array [ - 15, - 21, + 20, + 29, ], - "type": "TSNumberKeyword", - }, - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "b", - "optional": true, - "range": Array [ - 23, - 33, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 33, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, }, + "range": Array [ + 23, + 29, + ], + "type": "TSStringKeyword", }, - "range": Array [ - 27, - 33, - ], - "type": "TSNumberKeyword", }, + "type": "TSConstructorType", }, - }, - ], - "range": Array [ - 7, - 42, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, + ], "range": Array [ - 35, - 42, + 12, + 30, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 42, - ], - "type": "TSVoidKeyword", - }, + "type": "TSTypeParameterInstantiation", }, - "type": "TSConstructorType", }, }, }, "init": null, "loc": Object { "end": Object { - "column": 42, + "column": 30, "line": 1, }, "start": Object { @@ -87381,7 +93859,7 @@ Object { }, "range": Array [ 4, - 42, + 30, ], "type": "VariableDeclarator", }, @@ -87389,7 +93867,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 43, + "column": 31, "line": 1, }, "start": Object { @@ -87399,7 +93877,7 @@ Object { }, "range": Array [ 0, - 43, + 31, ], "type": "VariableDeclaration", }, @@ -87416,7 +93894,7 @@ Object { }, "range": Array [ 0, - 44, + 32, ], "sourceType": "script", "tokens": Array [ @@ -87454,7 +93932,7 @@ Object { 5, ], "type": "Identifier", - "value": "f", + "value": "x", }, Object { "loc": Object { @@ -87477,7 +93955,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -87487,28 +93965,10 @@ Object { }, "range": Array [ 7, - 10, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, 12, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "Array", }, Object { "loc": Object { @@ -87525,13 +93985,13 @@ Object { 12, 13, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { @@ -87541,187 +94001,115 @@ Object { }, "range": Array [ 13, - 14, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 21, + 16, ], - "type": "Identifier", - "value": "number", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 18, "line": 1, }, "start": Object { - "column": 21, + "column": 17, "line": 1, }, }, "range": Array [ - 21, - 22, + 17, + 18, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - "value": "b", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 19, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "range": Array [ - 24, - 25, + 18, + 19, ], "type": "Punctuator", - "value": "?", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 22, "line": 1, }, "start": Object { - "column": 25, + "column": 20, "line": 1, }, }, "range": Array [ - 25, - 26, + 20, + 22, ], "type": "Punctuator", - "value": ":", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 29, "line": 1, }, "start": Object { - "column": 27, + "column": 23, "line": 1, }, }, "range": Array [ - 27, - 33, + 23, + 29, ], "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": ")", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 30, "line": 1, }, "start": Object { - "column": 35, + "column": 29, "line": 1, }, }, "range": Array [ - 35, - 37, + 29, + 30, ], "type": "Punctuator", - "value": "=>", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 42, - ], - "type": "Keyword", - "value": "void", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 31, "line": 1, }, "start": Object { - "column": 42, + "column": 30, "line": 1, }, }, "range": Array [ - 42, - 43, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -87731,7 +94119,7 @@ Object { } `; -exports[`typescript fixtures/types/constructor-generic.src 1`] = ` +exports[`typescript fixtures/types/constructor-with-rest.src 1`] = ` Object { "body": Array [ Object { @@ -87740,7 +94128,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 25, + "column": 35, "line": 1, }, "start": Object { @@ -87751,13 +94139,13 @@ Object { "name": "f", "range": Array [ 4, - 25, + 35, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, + "column": 35, "line": 1, }, "start": Object { @@ -87767,13 +94155,13 @@ Object { }, "range": Array [ 5, - 25, + 35, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, + "column": 35, "line": 1, }, "start": Object { @@ -87783,58 +94171,60 @@ Object { }, "params": Array [ Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 15, - 19, - ], - "type": "Identifier", - "typeAnnotation": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 19, + "column": 26, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, + "name": "a", "range": Array [ - 16, - 19, + 15, + 26, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 19, + "column": 26, "line": 1, }, "start": Object { - "column": 18, + "column": 16, "line": 1, }, }, "range": Array [ - 18, - 19, + 16, + 26, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "TSNumberKeyword", + }, "loc": Object { "end": Object { - "column": 19, + "column": 26, "line": 1, }, "start": Object { @@ -87842,135 +94232,77 @@ Object { "line": 1, }, }, - "name": "T", "range": Array [ 18, - 19, + 26, ], - "type": "Identifier", + "type": "TSArrayType", }, }, }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 26, + ], + "type": "RestElement", }, ], "range": Array [ 7, - 25, + 35, ], "returnType": Object { "loc": Object { "end": Object { - "column": 25, + "column": 35, "line": 1, }, "start": Object { - "column": 21, + "column": 28, "line": 1, }, }, "range": Array [ - 21, - 25, + 28, + 35, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, + "column": 35, "line": 1, }, "start": Object { - "column": 24, + "column": 31, "line": 1, }, }, "range": Array [ - 24, - 25, + 31, + 35, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, + "type": "TSVoidKeyword", }, }, "type": "TSConstructorType", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "range": Array [ - 12, - 13, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 11, - 14, - ], - "type": "TSTypeParameterDeclaration", - }, }, }, }, "init": null, "loc": Object { "end": Object { - "column": 25, + "column": 35, "line": 1, }, "start": Object { @@ -87980,7 +94312,7 @@ Object { }, "range": Array [ 4, - 25, + 35, ], "type": "VariableDeclarator", }, @@ -87988,7 +94320,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 26, + "column": 36, "line": 1, }, "start": Object { @@ -87998,7 +94330,7 @@ Object { }, "range": Array [ 0, - 26, + 36, ], "type": "VariableDeclaration", }, @@ -88015,7 +94347,7 @@ Object { }, "range": Array [ 0, - 27, + 37, ], "sourceType": "script", "tokens": Array [ @@ -88107,12 +94439,12 @@ Object { 12, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { @@ -88122,115 +94454,115 @@ Object { }, "range": Array [ 12, - 13, + 15, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 14, + 15, + 16, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, - 15, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 24, "line": 1, }, "start": Object { - "column": 15, + "column": 18, "line": 1, }, }, "range": Array [ - 15, - 16, + 18, + 24, ], "type": "Identifier", - "value": "a", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 24, "line": 1, }, }, "range": Array [ - 16, - 17, + 24, + 25, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 26, "line": 1, }, "start": Object { - "column": 18, + "column": 25, "line": 1, }, }, "range": Array [ - 18, - 19, + 25, + 26, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 27, "line": 1, }, "start": Object { - "column": 19, + "column": 26, "line": 1, }, }, "range": Array [ - 19, - 20, + 26, + 27, ], "type": "Punctuator", "value": ")", @@ -88238,17 +94570,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 30, "line": 1, }, "start": Object { - "column": 21, + "column": 28, "line": 1, }, }, "range": Array [ - 21, - 23, + 28, + 30, ], "type": "Punctuator", "value": "=>", @@ -88256,35 +94588,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 35, "line": 1, }, "start": Object { - "column": 24, + "column": 31, "line": 1, }, }, "range": Array [ - 24, - 25, + 31, + 35, ], - "type": "Identifier", - "value": "T", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 36, "line": 1, }, "start": Object { - "column": 25, + "column": 35, "line": 1, }, }, "range": Array [ - 25, - 26, + 35, + 36, ], "type": "Punctuator", "value": ";", @@ -88294,7 +94626,7 @@ Object { } `; -exports[`typescript fixtures/types/constructor-in-generic.src 1`] = ` +exports[`typescript fixtures/types/function.src 1`] = ` Object { "body": Array [ Object { @@ -88303,7 +94635,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 30, + "column": 38, "line": 1, }, "start": Object { @@ -88311,16 +94643,16 @@ Object { "line": 1, }, }, - "name": "x", + "name": "f", "range": Array [ 4, - 30, + 38, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 30, + "column": 38, "line": 1, }, "start": Object { @@ -88330,13 +94662,13 @@ Object { }, "range": Array [ 5, - 30, + 38, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 30, + "column": 38, "line": 1, }, "start": Object { @@ -88344,107 +94676,159 @@ Object { "line": 1, }, }, - "range": Array [ - 7, - 30, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - "start": Object { - "column": 7, - "line": 1, + "name": "a", + "range": Array [ + 8, + 17, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "TSNumberKeyword", + }, }, }, - "name": "Array", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, }, - }, - "params": Array [ - Object { + "name": "b", + "optional": true, + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { "column": 29, "line": 1, }, "start": Object { - "column": 13, + "column": 21, "line": 1, }, }, - "params": Array [], "range": Array [ - 13, + 21, 29, ], - "returnType": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { "column": 29, "line": 1, }, "start": Object { - "column": 20, + "column": 23, "line": 1, }, }, "range": Array [ - 20, + 23, 29, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 29, - ], - "type": "TSStringKeyword", - }, + "type": "TSNumberKeyword", }, - "type": "TSConstructorType", }, - ], + }, + ], + "range": Array [ + 7, + 38, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, "range": Array [ - 12, - 30, + 31, + 38, ], - "type": "TSTypeParameterInstantiation", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 38, + ], + "type": "TSVoidKeyword", + }, }, + "type": "TSFunctionType", }, }, }, "init": null, "loc": Object { "end": Object { - "column": 30, + "column": 38, "line": 1, }, "start": Object { @@ -88454,7 +94838,7 @@ Object { }, "range": Array [ 4, - 30, + 38, ], "type": "VariableDeclarator", }, @@ -88462,7 +94846,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 31, + "column": 39, "line": 1, }, "start": Object { @@ -88472,7 +94856,7 @@ Object { }, "range": Array [ 0, - 31, + 39, ], "type": "VariableDeclaration", }, @@ -88489,7 +94873,7 @@ Object { }, "range": Array [ 0, - 32, + 40, ], "sourceType": "script", "tokens": Array [ @@ -88527,7 +94911,7 @@ Object { 5, ], "type": "Identifier", - "value": "x", + "value": "f", }, Object { "loc": Object { @@ -88550,7 +94934,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 8, "line": 1, }, "start": Object { @@ -88560,46 +94944,64 @@ Object { }, "range": Array [ 7, - 12, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, ], "type": "Identifier", - "value": "Array", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, "line": 1, }, "start": Object { - "column": 12, + "column": 9, "line": 1, }, }, "range": Array [ - 12, - 13, + 9, + 10, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 13, + "column": 11, "line": 1, }, }, "range": Array [ - 13, - 16, + 11, + 17, ], - "type": "Keyword", - "value": "new", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { @@ -88617,30 +95019,30 @@ Object { 18, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 20, "line": 1, }, "start": Object { - "column": 18, + "column": 19, "line": 1, }, }, "range": Array [ - 18, 19, + 20, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { @@ -88650,10 +95052,28 @@ Object { }, "range": Array [ 20, + 21, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, 22, ], "type": "Punctuator", - "value": "=>", + "value": ":", }, Object { "loc": Object { @@ -88671,7 +95091,7 @@ Object { 29, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { @@ -88689,22 +95109,58 @@ Object { 30, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 33, "line": 1, }, "start": Object { - "column": 30, + "column": 31, "line": 1, }, }, "range": Array [ - 30, 31, + 33, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 38, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, ], "type": "Punctuator", "value": ";", @@ -88714,7 +95170,7 @@ Object { } `; -exports[`typescript fixtures/types/constructor-with-rest.src 1`] = ` +exports[`typescript fixtures/types/function-generic.src 1`] = ` Object { "body": Array [ Object { @@ -88723,7 +95179,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { @@ -88734,13 +95190,13 @@ Object { "name": "f", "range": Array [ 4, - 35, + 21, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { @@ -88750,13 +95206,13 @@ Object { }, "range": Array [ 5, - 35, + 21, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { @@ -88766,138 +95222,194 @@ Object { }, "params": Array [ Object { - "argument": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 15, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, - "name": "a", "range": Array [ + 12, 15, - 26, ], - "type": "Identifier", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, "range": Array [ - 16, - 26, + 14, + 15, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 24, - ], - "type": "TSNumberKeyword", - }, + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { - "column": 18, + "column": 14, "line": 1, }, }, + "name": "T", "range": Array [ - 18, - 26, + 14, + 15, ], - "type": "TSArrayType", + "type": "Identifier", }, }, }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 26, - ], - "type": "RestElement", }, ], "range": Array [ 7, - 35, + 21, ], "returnType": Object { "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { - "column": 28, + "column": 17, "line": 1, }, }, "range": Array [ - 28, - 35, + 17, + 21, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { - "column": 31, + "column": 20, "line": 1, }, }, "range": Array [ - 31, - 35, + 20, + 21, ], - "type": "TSVoidKeyword", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, }, }, - "type": "TSConstructorType", + "type": "TSFunctionType", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 9, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 7, + 10, + ], + "type": "TSTypeParameterDeclaration", + }, }, }, }, "init": null, "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { @@ -88907,7 +95419,7 @@ Object { }, "range": Array [ 4, - 35, + 21, ], "type": "VariableDeclarator", }, @@ -88915,7 +95427,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 36, + "column": 22, "line": 1, }, "start": Object { @@ -88925,7 +95437,7 @@ Object { }, "range": Array [ 0, - 36, + 22, ], "type": "VariableDeclaration", }, @@ -88942,7 +95454,7 @@ Object { }, "range": Array [ 0, - 37, + 23, ], "sourceType": "script", "tokens": Array [ @@ -89003,7 +95515,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -89013,151 +95525,133 @@ Object { }, "range": Array [ 7, - 10, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, + 8, ], "type": "Punctuator", - "value": "(", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, "range": Array [ - 12, - 15, + 8, + 9, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 16, + 9, + 10, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { - "column": 16, + "column": 10, "line": 1, }, }, "range": Array [ - 16, - 17, + 10, + 11, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 12, "line": 1, }, "start": Object { - "column": 18, + "column": 11, "line": 1, }, }, "range": Array [ - 18, - 24, + 11, + 12, ], "type": "Identifier", - "value": "number", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 13, "line": 1, }, "start": Object { - "column": 24, + "column": 12, "line": 1, }, }, "range": Array [ - 24, - 25, + 12, + 13, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { - "column": 25, + "column": 14, "line": 1, }, }, "range": Array [ - 25, - 26, + 14, + 15, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 16, "line": 1, }, "start": Object { - "column": 26, + "column": 15, "line": 1, }, }, "range": Array [ - 26, - 27, + 15, + 16, ], "type": "Punctuator", "value": ")", @@ -89165,17 +95659,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, + "column": 19, "line": 1, }, "start": Object { - "column": 28, + "column": 17, "line": 1, }, }, "range": Array [ - 28, - 30, + 17, + 19, ], "type": "Punctuator", "value": "=>", @@ -89183,35 +95677,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { - "column": 31, + "column": 20, "line": 1, }, }, "range": Array [ - 31, - 35, + 20, + 21, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 22, "line": 1, }, "start": Object { - "column": 35, + "column": 21, "line": 1, }, }, "range": Array [ - 35, - 36, + 21, + 22, ], "type": "Punctuator", "value": ";", @@ -89221,7 +95715,7 @@ Object { } `; -exports[`typescript fixtures/types/function.src 1`] = ` +exports[`typescript fixtures/types/function-in-generic.src 1`] = ` Object { "body": Array [ Object { @@ -89230,7 +95724,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 38, + "column": 24, "line": 1, }, "start": Object { @@ -89238,16 +95732,16 @@ Object { "line": 1, }, }, - "name": "f", + "name": "x", "range": Array [ 4, - 38, + 24, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 38, + "column": 24, "line": 1, }, "start": Object { @@ -89257,13 +95751,13 @@ Object { }, "range": Array [ 5, - 38, + 24, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 38, + "column": 24, "line": 1, }, "start": Object { @@ -89271,159 +95765,107 @@ Object { "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "range": Array [ + 7, + 24, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, }, - "name": "a", - "range": Array [ - 8, - 17, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 17, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 17, - ], - "type": "TSNumberKeyword", - }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, }, - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, + "start": Object { + "column": 12, + "line": 1, }, - "name": "b", - "optional": true, - "range": Array [ - 19, - 29, - ], - "type": "Identifier", - "typeAnnotation": Object { + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 29, + "column": 23, "line": 1, }, "start": Object { - "column": 21, + "column": 13, "line": 1, }, }, + "params": Array [], "range": Array [ - 21, - 29, + 13, + 23, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 29, + "column": 23, "line": 1, }, "start": Object { - "column": 23, + "column": 16, "line": 1, }, }, "range": Array [ + 16, 23, - 29, ], - "type": "TSNumberKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "TSVoidKeyword", + }, }, + "type": "TSFunctionType", }, - }, - ], - "range": Array [ - 7, - 38, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, + ], "range": Array [ - 31, - 38, + 12, + 24, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 38, - ], - "type": "TSVoidKeyword", - }, + "type": "TSTypeParameterInstantiation", }, - "type": "TSFunctionType", }, }, }, "init": null, "loc": Object { "end": Object { - "column": 38, + "column": 24, "line": 1, }, "start": Object { @@ -89433,7 +95875,7 @@ Object { }, "range": Array [ 4, - 38, + 24, ], "type": "VariableDeclarator", }, @@ -89441,7 +95883,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 39, + "column": 25, "line": 1, }, "start": Object { @@ -89451,7 +95893,7 @@ Object { }, "range": Array [ 0, - 39, + 25, ], "type": "VariableDeclaration", }, @@ -89468,7 +95910,7 @@ Object { }, "range": Array [ 0, - 40, + 26, ], "sourceType": "script", "tokens": Array [ @@ -89506,7 +95948,7 @@ Object { 5, ], "type": "Identifier", - "value": "f", + "value": "x", }, Object { "loc": Object { @@ -89529,7 +95971,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { @@ -89539,64 +95981,64 @@ Object { }, "range": Array [ 7, - 8, + 12, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 12, "line": 1, }, }, "range": Array [ - 8, - 9, + 12, + 13, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 13, "line": 1, }, }, "range": Array [ - 9, - 10, + 13, + 14, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 14, "line": 1, }, }, "range": Array [ - 11, - 17, + 14, + 15, ], - "type": "Identifier", - "value": "number", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -89605,21 +96047,21 @@ Object { "line": 1, }, "start": Object { - "column": 17, + "column": 16, "line": 1, }, }, "range": Array [ - 17, + 16, 18, ], "type": "Punctuator", - "value": ",", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 23, "line": 1, }, "start": Object { @@ -89629,51 +96071,15 @@ Object { }, "range": Array [ 19, - 20, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, + 23, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 24, "line": 1, }, "start": Object { @@ -89683,79 +96089,25 @@ Object { }, "range": Array [ 23, - 29, - ], - "type": "Identifier", - "value": "number", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 33, + 24, ], "type": "Punctuator", - "value": "=>", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 38, - ], - "type": "Keyword", - "value": "void", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 25, "line": 1, }, "start": Object { - "column": 38, + "column": 24, "line": 1, }, }, "range": Array [ - 38, - 39, + 24, + 25, ], "type": "Punctuator", "value": ";", @@ -89765,7 +96117,7 @@ Object { } `; -exports[`typescript fixtures/types/function-generic.src 1`] = ` +exports[`typescript fixtures/types/function-with-rest.src 1`] = ` Object { "body": Array [ Object { @@ -89774,7 +96126,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { @@ -89785,13 +96137,13 @@ Object { "name": "f", "range": Array [ 4, - 21, + 31, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { @@ -89801,13 +96153,13 @@ Object { }, "range": Array [ 5, - 21, + 31, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { @@ -89817,58 +96169,60 @@ Object { }, "params": Array [ Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 11, - 15, - ], - "type": "Identifier", - "typeAnnotation": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, + "name": "a", "range": Array [ - 12, - 15, + 11, + 22, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { - "column": 14, + "column": 12, "line": 1, }, }, "range": Array [ - 14, - 15, + 12, + 22, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "TSNumberKeyword", + }, "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { @@ -89876,135 +96230,77 @@ Object { "line": 1, }, }, - "name": "T", "range": Array [ 14, - 15, + 22, ], - "type": "Identifier", + "type": "TSArrayType", }, }, }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 22, + ], + "type": "RestElement", }, ], "range": Array [ 7, - 21, + 31, ], "returnType": Object { "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { - "column": 17, + "column": 24, "line": 1, }, }, "range": Array [ - 17, - 21, + 24, + 31, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { - "column": 20, + "column": 27, "line": 1, }, }, "range": Array [ - 20, - 21, + 27, + 31, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, + "type": "TSVoidKeyword", }, }, "type": "TSFunctionType", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 9, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 7, - 10, - ], - "type": "TSTypeParameterDeclaration", - }, }, }, }, "init": null, "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { @@ -90014,7 +96310,7 @@ Object { }, "range": Array [ 4, - 21, + 31, ], "type": "VariableDeclarator", }, @@ -90022,7 +96318,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 22, + "column": 32, "line": 1, }, "start": Object { @@ -90032,7 +96328,7 @@ Object { }, "range": Array [ 0, - 22, + 32, ], "type": "VariableDeclaration", }, @@ -90049,7 +96345,7 @@ Object { }, "range": Array [ 0, - 23, + 33, ], "sourceType": "script", "tokens": Array [ @@ -90104,62 +96400,26 @@ Object { 5, 6, ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 10, + 7, + 8, ], "type": "Punctuator", - "value": ">", + "value": "(", }, Object { "loc": Object { @@ -90168,16 +96428,16 @@ Object { "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, + 8, 11, ], "type": "Punctuator", - "value": "(", + "value": "...", }, Object { "loc": Object { @@ -90218,7 +96478,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 20, "line": 1, }, "start": Object { @@ -90228,25 +96488,61 @@ Object { }, "range": Array [ 14, - 15, + 20, ], "type": "Identifier", - "value": "T", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 21, "line": 1, }, "start": Object { - "column": 15, + "column": 20, "line": 1, }, }, "range": Array [ - 15, - 16, + 20, + 21, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, ], "type": "Punctuator", "value": ")", @@ -90254,17 +96550,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 26, "line": 1, }, "start": Object { - "column": 17, + "column": 24, "line": 1, }, }, "range": Array [ - 17, - 19, + 24, + 26, ], "type": "Punctuator", "value": "=>", @@ -90272,35 +96568,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { - "column": 20, + "column": 27, "line": 1, }, }, "range": Array [ - 20, - 21, + 27, + 31, ], - "type": "Identifier", - "value": "T", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 32, "line": 1, }, "start": Object { - "column": 21, + "column": 31, "line": 1, }, }, "range": Array [ - 21, - 22, + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -90310,7 +96606,7 @@ Object { } `; -exports[`typescript fixtures/types/function-in-generic.src 1`] = ` +exports[`typescript fixtures/types/function-with-this.src 1`] = ` Object { "body": Array [ Object { @@ -90319,7 +96615,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 24, + "column": 29, "line": 1, }, "start": Object { @@ -90327,16 +96623,16 @@ Object { "line": 1, }, }, - "name": "x", + "name": "f", "range": Array [ 4, - 24, + 29, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 24, + "column": 29, "line": 1, }, "start": Object { @@ -90346,13 +96642,13 @@ Object { }, "range": Array [ 5, - 24, + 29, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 24, + "column": 29, "line": 1, }, "start": Object { @@ -90360,107 +96656,106 @@ Object { "line": 1, }, }, - "range": Array [ - 7, - 24, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - }, - "params": Array [ - Object { + "name": "this", + "range": Array [ + 8, + 20, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, - "params": Array [], "range": Array [ - 13, - 23, + 12, + 20, ], - "returnType": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, "range": Array [ - 16, - 23, + 14, + 20, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 23, - ], - "type": "TSVoidKeyword", - }, + "type": "TSNumberKeyword", }, - "type": "TSFunctionType", }, - ], + }, + ], + "range": Array [ + 7, + 29, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, "range": Array [ - 12, - 24, + 22, + 29, ], - "type": "TSTypeParameterInstantiation", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 29, + ], + "type": "TSVoidKeyword", + }, }, + "type": "TSFunctionType", }, }, }, "init": null, "loc": Object { "end": Object { - "column": 24, + "column": 29, "line": 1, }, "start": Object { @@ -90470,7 +96765,7 @@ Object { }, "range": Array [ 4, - 24, + 29, ], "type": "VariableDeclarator", }, @@ -90478,7 +96773,7 @@ Object { "kind": "let", "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { @@ -90488,7 +96783,7 @@ Object { }, "range": Array [ 0, - 25, + 30, ], "type": "VariableDeclaration", }, @@ -90505,7 +96800,7 @@ Object { }, "range": Array [ 0, - 26, + 31, ], "sourceType": "script", "tokens": Array [ @@ -90543,7 +96838,7 @@ Object { 5, ], "type": "Identifier", - "value": "x", + "value": "f", }, Object { "loc": Object { @@ -90566,7 +96861,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 8, "line": 1, }, "start": Object { @@ -90576,51 +96871,51 @@ Object { }, "range": Array [ 7, - 12, + 8, ], - "type": "Identifier", - "value": "Array", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 12, - 13, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 14, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 20, "line": 1, }, "start": Object { @@ -90630,79 +96925,79 @@ Object { }, "range": Array [ 14, - 15, + 20, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 18, + 20, + 21, ], "type": "Punctuator", - "value": "=>", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 1, }, "start": Object { - "column": 19, + "column": 22, "line": 1, }, }, "range": Array [ - 19, - 23, + 22, + 24, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 29, "line": 1, }, "start": Object { - "column": 23, + "column": 25, "line": 1, }, }, "range": Array [ - 23, - 24, + 25, + 29, ], - "type": "Punctuator", - "value": ">", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { - "column": 24, + "column": 29, "line": 1, }, }, "range": Array [ - 24, - 25, + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -90712,226 +97007,172 @@ Object { } `; -exports[`typescript fixtures/types/function-with-rest.src 1`] = ` +exports[`typescript fixtures/types/index-signature.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 4, - 31, - ], - "type": "Identifier", - "typeAnnotation": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "index": Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 3, + "line": 2, }, }, + "name": "a", "range": Array [ - 5, - 31, + 16, + 25, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 11, - 22, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 22, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 20, - ], - "type": "TSNumberKeyword", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 22, - ], - "type": "TSArrayType", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 22, - ], - "type": "RestElement", + "column": 12, + "line": 2, }, - ], + "start": Object { + "column": 4, + "line": 2, + }, + }, "range": Array [ - 7, - 31, + 17, + 25, ], - "returnType": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 24, - 31, + 19, + 25, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 31, - ], - "type": "TSVoidKeyword", - }, + "type": "TSStringKeyword", }, - "type": "TSFunctionType", }, }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, }, - "start": Object { - "column": 4, - "line": 1, + "range": Array [ + 15, + 35, + ], + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "TSStringKeyword", + }, }, }, - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 11, + 37, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -90940,14 +97181,14 @@ Object { }, "range": Array [ 0, - 33, + 38, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 4, "line": 1, }, "start": Object { @@ -90957,97 +97198,97 @@ Object { }, "range": Array [ 0, - 3, + 4, ], - "type": "Keyword", - "value": "let", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, 5, + 8, ], "type": "Identifier", - "value": "f", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 6, + 9, + 10, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { - "column": 7, + "column": 11, "line": 1, }, }, "range": Array [ - 7, - 8, + 11, + 12, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 8, - 11, + 15, + 16, ], "type": "Punctuator", - "value": "...", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 4, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 3, + "line": 2, }, }, "range": Array [ - 11, - 12, + 16, + 17, ], "type": "Identifier", "value": "a", @@ -91055,17 +97296,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 12, - 13, + 17, + 18, ], "type": "Punctuator", "value": ":", @@ -91073,320 +97314,283 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 14, - 20, + 19, + 25, ], "type": "Identifier", - "value": "number", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 20, - 21, + 25, + 26, ], "type": "Punctuator", - "value": "[", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 21, - 22, + 26, + 27, ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 22, - 23, + 28, + 34, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 24, - 26, + 34, + 35, ], "type": "Punctuator", - "value": "=>", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 27, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 27, - 31, + 36, + 37, ], - "type": "Keyword", - "value": "void", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/types/index-signature-readonly.src 1`] = ` +Object { + "body": Array [ Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 31, + "column": 0, "line": 1, }, }, "range": Array [ - 31, - 32, + 0, + 48, ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/types/function-with-this.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 4, - 29, - ], - "type": "Identifier", - "typeAnnotation": Object { + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "index": Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 12, + "line": 2, }, }, + "name": "key", "range": Array [ - 5, - 29, + 25, + 36, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 15, + "line": 2, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "this", - "range": Array [ - 8, - 20, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 20, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 20, - ], - "type": "TSNumberKeyword", - }, - }, - }, - ], "range": Array [ - 7, - 29, + 28, + 36, ], - "returnType": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 17, + "line": 2, }, }, - "range": Array [ - 22, - 29, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 29, - ], - "type": "TSVoidKeyword", + "range": Array [ + 30, + 36, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 46, + ], + "readonly": true, + "static": false, + "type": "TSIndexSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 37, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, }, }, - "type": "TSFunctionType", + "range": Array [ + 39, + 45, + ], + "type": "TSNumberKeyword", }, }, }, - "init": null, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 29, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 11, + 48, + ], + "type": "TSTypeLiteral", }, - "range": Array [ - 0, - 30, - ], - "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -91395,14 +97599,14 @@ Object { }, "range": Array [ 0, - 31, + 49, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 4, "line": 1, }, "start": Object { @@ -91412,97 +97616,133 @@ Object { }, "range": Array [ 0, - 3, + 4, ], - "type": "Keyword", - "value": "let", + "type": "Identifier", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, 5, + 8, ], "type": "Identifier", - "value": "f", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 6, + 9, + 10, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { - "column": 7, + "column": 11, "line": 1, }, }, "range": Array [ - 7, - 8, + 11, + 12, ], "type": "Punctuator", - "value": "(", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 23, + ], + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 1, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 8, - 12, + 24, + 25, ], - "type": "Keyword", - "value": "this", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { "column": 12, - "line": 1, + "line": 2, }, }, "range": Array [ - 12, - 13, + 25, + 28, + ], + "type": "Identifier", + "value": "key", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, ], "type": "Punctuator", "value": ":", @@ -91510,17 +97750,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 14, - 20, + 30, + 36, ], "type": "Identifier", "value": "number", @@ -91528,75 +97768,93 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 24, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 23, + "line": 2, }, }, "range": Array [ - 20, - 21, + 36, + 37, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 22, - 24, + 37, + 38, ], "type": "Punctuator", - "value": "=>", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 25, - 29, + 39, + 45, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 29, - 30, + 45, + 46, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } @@ -92790,6 +99048,267 @@ Object { } `; +exports[`typescript fixtures/types/literal-number-negative.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 9, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "literal": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "operator": "-", + "prefix": true, + "range": Array [ + 7, + 9, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "TSLiteralType", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "-", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/types/literal-string.src 1`] = ` Object { "body": Array [ From 0f973c510079808d061aafec29a75bcc29a8a1ec Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 11 Jan 2019 00:15:55 +0100 Subject: [PATCH 72/84] test: add unsupported test cases for errors (#113) --- .../tests/ast-alignment/fixtures-to-test.ts | 26 +- .../interface-index-signature-export.src.ts | 4 + .../interface-index-signature-private.src.ts | 4 + ...interface-index-signature-protected.src.ts | 4 + .../interface-index-signature-public.src.ts | 4 + .../interface-index-signature-static.src.ts | 4 + .../interface-method-export.src.ts | 4 + .../interface-method-private.src.ts | 4 + .../interface-method-protected.src.ts | 4 + .../interface-method-public.src.ts | 4 + .../interface-method-static.src.ts | 4 + .../interface-property-export.src.ts | 4 + .../interface-property-modifiers.src.ts | 24 - .../interface-property-private.src.ts | 4 + .../interface-property-protected.src.ts | 4 + .../interface-property-public.src.ts | 4 + .../interface-property-static.src.ts | 4 + ...terface-property-with-default-value.src.ts | 3 + .../semantic-diagnostics-enabled.ts.snap | 36 +- .../lib/__snapshots__/typescript.ts.snap | 7235 ++++++++++------- 20 files changed, 4511 insertions(+), 2873 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-export.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-private.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-protected.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-public.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-static.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-export.src.ts delete mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-private.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-protected.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-public.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-static.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 06e6354b8b67..02e366530536 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -465,7 +465,31 @@ tester.addFixturePatternConfig('typescript/errorRecovery', { * TODO: remove me in next babel > 7.2.3 */ 'interface-empty-extends', - 'class-extends-empty-implements' + 'class-extends-empty-implements', + /** + * TS1071 + */ + 'interface-index-signature-export', + 'interface-index-signature-private', + 'interface-index-signature-protected', + 'interface-index-signature-public', + 'interface-index-signature-static', + /** + * TS1070 + */ + 'interface-method-export', + 'interface-method-private', + 'interface-method-protected', + 'interface-method-public', + 'interface-method-static', + /** + * TS1070 + */ + 'interface-property-export', + 'interface-property-private', + 'interface-property-protected', + 'interface-property-public', + 'interface-property-static' ] }); diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts new file mode 100644 index 000000000000..32d597417f1b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts @@ -0,0 +1,4 @@ +interface Foo { + export [baz: string]: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts new file mode 100644 index 000000000000..fca05ad495f4 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts @@ -0,0 +1,4 @@ +interface Foo { + private [baz: string]: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts new file mode 100644 index 000000000000..4ba7918d570f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts @@ -0,0 +1,4 @@ +interface Foo { + protected [baz: string]: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts new file mode 100644 index 000000000000..963b1d954338 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts @@ -0,0 +1,4 @@ +interface Foo { + public [baz: string]: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts new file mode 100644 index 000000000000..729350f096d2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts @@ -0,0 +1,4 @@ +interface Foo { + static [baz: string]: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-export.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-export.src.ts new file mode 100644 index 000000000000..45e722d0866e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-export.src.ts @@ -0,0 +1,4 @@ +interface Foo { + export g(bar: string): void; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-private.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-private.src.ts new file mode 100644 index 000000000000..af4488e5925f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-private.src.ts @@ -0,0 +1,4 @@ +interface Foo { + private g(bar: string): void; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-protected.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-protected.src.ts new file mode 100644 index 000000000000..2b7bb108273d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-protected.src.ts @@ -0,0 +1,4 @@ +interface Foo { + protected g(bar: string): void; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-public.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-public.src.ts new file mode 100644 index 000000000000..0f9914f2dc36 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-public.src.ts @@ -0,0 +1,4 @@ +interface Foo { + public g(bar: string): void; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-static.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-static.src.ts new file mode 100644 index 000000000000..84b3f3f39506 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-method-static.src.ts @@ -0,0 +1,4 @@ +interface Foo { + static g(bar: string): void; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-export.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-export.src.ts new file mode 100644 index 000000000000..c24282e75d7d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-export.src.ts @@ -0,0 +1,4 @@ +interface Foo { + export a: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts deleted file mode 100644 index 02c0c9131844..000000000000 --- a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts +++ /dev/null @@ -1,24 +0,0 @@ -interface Foo { - bar: string = 'a'; - public a: string; - private b: string; - protected c: string; - static d: string; - export e: string; - readonly f: string; - - public [baz: string]: string; - private [baz: string]: string; - protected [baz: string]: string; - static [baz: string]: string; - export [baz: string]: string; - readonly [baz: string]: string; - - public g(bar: string): void; - private h(bar: string): void; - protected i(bar: string): void; - static j(bar: string): void; - export k(bar: string): void; - readonly l(bar: string): void; -} - diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-private.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-private.src.ts new file mode 100644 index 000000000000..33f00924378f --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-private.src.ts @@ -0,0 +1,4 @@ +interface Foo { + private b: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-protected.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-protected.src.ts new file mode 100644 index 000000000000..20f839a3279b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-protected.src.ts @@ -0,0 +1,4 @@ +interface Foo { + protected a: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-public.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-public.src.ts new file mode 100644 index 000000000000..f9fb03e73ab8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-public.src.ts @@ -0,0 +1,4 @@ +interface Foo { + public a: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-static.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-static.src.ts new file mode 100644 index 000000000000..ae41b9b40d7b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-static.src.ts @@ -0,0 +1,4 @@ +interface Foo { + static a: string; +} + diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts new file mode 100644 index 000000000000..4a90a54a78a1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts @@ -0,0 +1,3 @@ +interface Foo { + bar: string = 'a'; +} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 1ca5b49b52ba..b8283a590cec 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -2212,10 +2212,40 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-modifiers.src.ts.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-export.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-private.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-protected.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-public.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-static.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-export.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-private.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-protected.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-public.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-static.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts.src 1`] = ` Object { - "column": 18, - "index": 34, + "column": 16, + "index": 32, "lineNumber": 2, "message": "An interface property cannot have an initializer.", } diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index fb8b6ca3dccb..0bbde7f1bfa1 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -79032,995 +79032,480 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/interface-property-modifiers.src 1`] = ` +exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { - "computed": false, - "initializer": Object { + "export": true, + "index": Object { "loc": Object { "end": Object { "column": 21, "line": 2, }, "start": Object { - "column": 18, + "column": 10, "line": 2, }, }, + "name": "baz", "range": Array [ - 34, + 26, 37, ], - "raw": "'a'", - "type": "Literal", - "value": "a", - }, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 20, - 23, - ], "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 20, - 38, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 23, - 31, - ], - "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 15, + "column": 21, "line": 2, }, "start": Object { - "column": 9, + "column": 13, "line": 2, }, }, "range": Array [ - 25, - 31, + 29, + 37, ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "public", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 11, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 43, - 60, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 51, - 59, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, }, - }, - "range": Array [ - 53, - 59, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 4, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", }, }, - "name": "b", - "range": Array [ - 73, - 74, - ], - "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, - "line": 4, + "column": 31, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 2, + "line": 2, }, }, "range": Array [ - 65, - 83, + 18, + 47, ], - "type": "TSPropertySignature", + "static": false, + "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 30, + "line": 2, }, "start": Object { - "column": 13, - "line": 4, + "column": 22, + "line": 2, }, }, "range": Array [ - 74, - 82, + 38, + 46, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 30, + "line": 2, }, "start": Object { - "column": 15, - "line": 4, + "column": 24, + "line": 2, }, }, "range": Array [ - 76, - 82, + 40, + 46, ], "type": "TSStringKeyword", }, }, }, - Object { - "accessibility": "protected", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "name": "c", - "range": Array [ - 98, - 99, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 88, - 108, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 5, - }, - }, - "range": Array [ - 99, - 107, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "range": Array [ - 101, - 107, - ], - "type": "TSStringKeyword", - }, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 11, - "line": 6, - }, - }, - "name": "d", - "range": Array [ - 120, - 121, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 113, - 130, - ], - "static": true, - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 121, - 129, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 6, - }, - "start": Object { - "column": 14, - "line": 6, - }, - }, - "range": Array [ - 123, - 129, - ], - "type": "TSStringKeyword", - }, - }, + "start": Object { + "column": 14, + "line": 1, }, - Object { - "computed": false, - "export": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 11, - "line": 7, - }, - }, - "name": "e", - "range": Array [ - 142, - 143, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 135, - 152, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 12, - "line": 7, - }, - }, - "range": Array [ - 143, - 151, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 14, - "line": 7, - }, - }, - "range": Array [ - 145, - 151, - ], - "type": "TSStringKeyword", - }, - }, + }, + "range": Array [ + 14, + 49, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 13, - "line": 8, - }, - }, - "name": "f", - "range": Array [ - 166, - 167, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 157, - 176, - ], - "readonly": true, - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 8, - }, - "start": Object { - "column": 14, - "line": 8, - }, - }, - "range": Array [ - 167, - 175, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 8, - }, - "start": Object { - "column": 16, - "line": 8, - }, - }, - "range": Array [ - 169, - 175, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "public", - "index": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 10, - }, - "start": Object { - "column": 12, - "line": 10, - }, - }, - "name": "baz", - "range": Array [ - 190, - 201, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 10, - }, - "start": Object { - "column": 15, - "line": 10, - }, - }, - "range": Array [ - 193, - 201, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 10, - }, - "start": Object { - "column": 17, - "line": 10, - }, - }, - "range": Array [ - 195, - 201, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 10, - }, - "start": Object { - "column": 4, - "line": 10, - }, - }, - "range": Array [ - 182, - 211, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 10, - }, - "start": Object { - "column": 24, - "line": 10, - }, - }, - "range": Array [ - 202, - 210, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 10, - }, - "start": Object { - "column": 26, - "line": 10, - }, - }, - "range": Array [ - 204, - 210, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "private", - "index": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 11, - }, - "start": Object { - "column": 13, - "line": 11, - }, - }, - "name": "baz", - "range": Array [ - 225, - 236, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 11, - }, - "start": Object { - "column": 16, - "line": 11, - }, - }, - "range": Array [ - 228, - 236, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 11, - }, - "start": Object { - "column": 18, - "line": 11, - }, - }, - "range": Array [ - 230, - 236, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 11, - }, - "start": Object { - "column": 4, - "line": 11, - }, - }, - "range": Array [ - 216, - 246, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 11, - }, - "start": Object { - "column": 25, - "line": 11, - }, - }, - "range": Array [ - 237, - 245, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 11, - }, - "start": Object { - "column": 27, - "line": 11, - }, - }, - "range": Array [ - 239, - 245, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "protected", - "index": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 12, - }, - "start": Object { - "column": 15, - "line": 12, - }, - }, - "name": "baz", - "range": Array [ - 262, - 273, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 12, - }, - "start": Object { - "column": 18, - "line": 12, - }, - }, - "range": Array [ - 265, - 273, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 12, - }, - "start": Object { - "column": 20, - "line": 12, - }, - }, - "range": Array [ - 267, - 273, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 12, - }, - "start": Object { - "column": 4, - "line": 12, - }, - }, - "range": Array [ - 251, - 283, - ], - "static": false, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 12, - }, - "start": Object { - "column": 27, - "line": 12, - }, - }, - "range": Array [ - 274, - 282, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 12, - }, - "start": Object { - "column": 29, - "line": 12, - }, - }, - "range": Array [ - 276, - 282, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 12, - "line": 13, - }, - }, - "name": "baz", - "range": Array [ - 296, - 307, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 15, - "line": 13, - }, - }, - "range": Array [ - 299, - 307, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 17, - "line": 13, - }, - }, - "range": Array [ - 301, - 307, - ], - "type": "TSStringKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 13, - }, - "start": Object { - "column": 4, - "line": 13, - }, - }, - "range": Array [ - 288, - 317, - ], - "static": true, - "type": "TSIndexSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 13, - }, - "start": Object { - "column": 24, - "line": 13, - }, - }, - "range": Array [ - 308, - 316, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 13, - }, - "start": Object { - "column": 26, - "line": 13, - }, - }, - "range": Array [ - 310, - 316, - ], - "type": "TSStringKeyword", - }, - }, + "start": Object { + "column": 10, + "line": 1, }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-index-signature-private.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { - "export": true, + "accessibility": "private", "index": Object { "loc": Object { "end": Object { - "column": 23, - "line": 14, + "column": 22, + "line": 2, }, "start": Object { - "column": 12, - "line": 14, + "column": 11, + "line": 2, }, }, "name": "baz", "range": Array [ - 330, - 341, + 27, + 38, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, - "line": 14, + "column": 22, + "line": 2, }, "start": Object { - "column": 15, - "line": 14, + "column": 14, + "line": 2, }, }, "range": Array [ - 333, - 341, + 30, + 38, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 23, - "line": 14, + "column": 22, + "line": 2, }, "start": Object { - "column": 17, - "line": 14, + "column": 16, + "line": 2, }, }, "range": Array [ - 335, - 341, + 32, + 38, ], "type": "TSStringKeyword", }, @@ -80028,103 +79513,418 @@ Object { }, "loc": Object { "end": Object { - "column": 33, - "line": 14, + "column": 32, + "line": 2, }, "start": Object { - "column": 4, - "line": 14, + "column": 2, + "line": 2, }, }, "range": Array [ - 322, - 351, + 18, + 48, ], "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, - "line": 14, + "column": 31, + "line": 2, }, "start": Object { - "column": 24, - "line": 14, + "column": 23, + "line": 2, }, }, "range": Array [ - 342, - 350, + 39, + 47, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, - "line": 14, + "column": 31, + "line": 2, }, "start": Object { - "column": 26, - "line": 14, + "column": 25, + "line": 2, }, }, "range": Array [ - 344, - 350, + 41, + 47, ], "type": "TSStringKeyword", }, }, }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 50, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 25, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-index-signature-protected.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { + "accessibility": "protected", "index": Object { "loc": Object { "end": Object { - "column": 25, - "line": 15, + "column": 24, + "line": 2, }, "start": Object { - "column": 14, - "line": 15, + "column": 13, + "line": 2, }, }, "name": "baz", "range": Array [ - 366, - 377, + 29, + 40, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, - "line": 15, + "column": 24, + "line": 2, }, "start": Object { - "column": 17, - "line": 15, + "column": 16, + "line": 2, }, }, "range": Array [ - 369, - 377, + 32, + 40, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, - "line": 15, + "column": 24, + "line": 2, }, "start": Object { - "column": 19, - "line": 15, + "column": 18, + "line": 2, }, }, "range": Array [ - 371, - 377, + 34, + 40, ], "type": "TSStringKeyword", }, @@ -80132,563 +79932,1206 @@ Object { }, "loc": Object { "end": Object { - "column": 35, - "line": 15, + "column": 34, + "line": 2, }, "start": Object { - "column": 4, - "line": 15, + "column": 2, + "line": 2, }, }, "range": Array [ - 356, - 387, + 18, + 50, ], - "readonly": true, "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 34, - "line": 15, - }, - "start": Object { - "column": 26, - "line": 15, - }, - }, - "range": Array [ - 378, - 386, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 15, - }, - "start": Object { - "column": 28, - "line": 15, - }, - }, - "range": Array [ - 380, - 386, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "accessibility": "public", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 17, - }, - "start": Object { - "column": 11, - "line": 17, - }, - }, - "name": "g", - "range": Array [ - 400, - 401, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 17, - }, - "start": Object { - "column": 4, - "line": 17, - }, - }, - "optional": false, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 17, - }, - "start": Object { - "column": 13, - "line": 17, - }, - }, - "name": "bar", - "range": Array [ - 402, - 413, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 17, - }, - "start": Object { - "column": 16, - "line": 17, - }, - }, - "range": Array [ - 405, - 413, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 17, - }, - "start": Object { - "column": 18, - "line": 17, - }, - }, - "range": Array [ - 407, - 413, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 393, - 421, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 17, + "column": 33, + "line": 2, }, "start": Object { "column": 25, - "line": 17, + "line": 2, }, }, "range": Array [ - 414, - 420, + 41, + 49, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 17, + "column": 33, + "line": 2, }, "start": Object { "column": 27, - "line": 17, + "line": 2, }, }, "range": Array [ - 416, - 420, + 43, + 49, ], - "type": "TSVoidKeyword", + "type": "TSStringKeyword", }, }, }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 52, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 54, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 27, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-index-signature-public.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { - "accessibility": "private", - "computed": false, - "key": Object { + "accessibility": "public", + "index": Object { "loc": Object { "end": Object { - "column": 13, - "line": 18, + "column": 21, + "line": 2, }, "start": Object { - "column": 12, - "line": 18, + "column": 10, + "line": 2, }, }, - "name": "h", + "name": "baz", "range": Array [ - 434, - 435, + 26, + 37, ], "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 18, - }, - "start": Object { - "column": 4, - "line": 18, - }, - }, - "optional": false, - "params": Array [ - Object { + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, - "line": 18, + "column": 21, + "line": 2, }, "start": Object { - "column": 14, - "line": 18, + "column": 13, + "line": 2, }, }, - "name": "bar", "range": Array [ - 436, - 447, + 29, + 37, ], - "type": "Identifier", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 25, - "line": 18, + "column": 21, + "line": 2, }, "start": Object { - "column": 17, - "line": 18, + "column": 15, + "line": 2, }, }, "range": Array [ - 439, - 447, + 31, + 37, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 18, - }, - "start": Object { - "column": 19, - "line": 18, - }, - }, - "range": Array [ - 441, - 447, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], - "range": Array [ - 426, - 455, - ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 18, - }, - "start": Object { - "column": 26, - "line": 18, - }, - }, - "range": Array [ - 448, - 454, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 18, - }, - "start": Object { - "column": 28, - "line": 18, - }, - }, - "range": Array [ - 450, - 454, - ], - "type": "TSVoidKeyword", - }, - }, - }, - Object { - "accessibility": "protected", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 19, - }, - "start": Object { - "column": 14, - "line": 19, + "type": "TSStringKeyword", }, }, - "name": "i", - "range": Array [ - 470, - 471, - ], - "type": "Identifier", }, "loc": Object { "end": Object { - "column": 35, - "line": 19, + "column": 31, + "line": 2, }, "start": Object { - "column": 4, - "line": 19, + "column": 2, + "line": 2, }, }, - "optional": false, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 19, - }, - "start": Object { - "column": 16, - "line": 19, - }, - }, - "name": "bar", - "range": Array [ - 472, - 483, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 19, - }, - "start": Object { - "column": 19, - "line": 19, - }, - }, - "range": Array [ - 475, - 483, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 19, - }, - "start": Object { - "column": 21, - "line": 19, - }, - }, - "range": Array [ - 477, - 483, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], "range": Array [ - 460, - 491, + 18, + 47, ], "static": false, - "type": "TSMethodSignature", + "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 34, - "line": 19, + "column": 30, + "line": 2, }, "start": Object { - "column": 28, - "line": 19, + "column": 22, + "line": 2, }, }, "range": Array [ - 484, - 490, + 38, + 46, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 34, - "line": 19, + "column": 30, + "line": 2, }, "start": Object { - "column": 30, - "line": 19, + "column": 24, + "line": 2, }, }, "range": Array [ - 486, - 490, + 40, + 46, ], - "type": "TSVoidKeyword", + "type": "TSStringKeyword", }, }, }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 49, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-index-signature-static.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { - "computed": false, - "key": Object { + "index": Object { "loc": Object { "end": Object { - "column": 12, - "line": 20, + "column": 21, + "line": 2, }, "start": Object { - "column": 11, - "line": 20, + "column": 10, + "line": 2, }, }, - "name": "j", + "name": "baz", "range": Array [ - 503, - 504, + 26, + 37, ], "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 20, - }, - "start": Object { - "column": 4, - "line": 20, - }, - }, - "optional": false, - "params": Array [ - Object { + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 24, - "line": 20, + "column": 21, + "line": 2, }, "start": Object { "column": 13, - "line": 20, + "line": 2, }, }, - "name": "bar", "range": Array [ - 505, - 516, + 29, + 37, ], - "type": "Identifier", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 24, - "line": 20, + "column": 21, + "line": 2, }, "start": Object { - "column": 16, - "line": 20, + "column": 15, + "line": 2, }, }, "range": Array [ - 508, - 516, + 31, + 37, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 20, - }, - "start": Object { - "column": 18, - "line": 20, - }, - }, - "range": Array [ - 510, - 516, - ], - "type": "TSStringKeyword", - }, + "type": "TSStringKeyword", }, }, - ], + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, "range": Array [ - 496, - 524, + 18, + 47, ], "static": true, - "type": "TSMethodSignature", + "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 20, + "column": 30, + "line": 2, }, "start": Object { - "column": 25, - "line": 20, + "column": 22, + "line": 2, }, }, "range": Array [ - 517, - 523, + 38, + 46, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 31, - "line": 20, + "column": 30, + "line": 2, }, "start": Object { - "column": 27, - "line": 20, + "column": 24, + "line": 2, }, }, "range": Array [ - 519, - 523, + 40, + 46, ], - "type": "TSVoidKeyword", + "type": "TSStringKeyword", }, }, }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 49, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 46, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-method-export.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { "computed": false, "export": true, @@ -80696,28 +81139,28 @@ Object { "loc": Object { "end": Object { "column": 12, - "line": 21, + "line": 2, }, "start": Object { "column": 11, - "line": 21, + "line": 2, }, }, - "name": "k", + "name": "g", "range": Array [ - 536, - 537, + 27, + 28, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 32, - "line": 21, + "line": 2, }, "start": Object { "column": 4, - "line": 21, + "line": 2, }, }, "optional": false, @@ -80726,49 +81169,49 @@ Object { "loc": Object { "end": Object { "column": 24, - "line": 21, + "line": 2, }, "start": Object { "column": 13, - "line": 21, + "line": 2, }, }, "name": "bar", "range": Array [ - 538, - 549, + 29, + 40, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { "column": 24, - "line": 21, + "line": 2, }, "start": Object { "column": 16, - "line": 21, + "line": 2, }, }, "range": Array [ - 541, - 549, + 32, + 40, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { "column": 24, - "line": 21, + "line": 2, }, "start": Object { "column": 18, - "line": 21, + "line": 2, }, }, "range": Array [ - 543, - 549, + 34, + 40, ], "type": "TSStringKeyword", }, @@ -80776,8 +81219,8 @@ Object { }, ], "range": Array [ - 529, - 557, + 20, + 48, ], "static": false, "type": "TSMethodSignature", @@ -80785,65 +81228,398 @@ Object { "loc": Object { "end": Object { "column": 31, - "line": 21, + "line": 2, }, "start": Object { "column": 25, - "line": 21, + "line": 2, }, }, "range": Array [ - 550, - 556, + 41, + 47, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { "column": 31, - "line": 21, + "line": 2, }, "start": Object { "column": 27, - "line": 21, + "line": 2, }, }, "range": Array [ - 552, - 556, + 43, + 47, ], "type": "TSVoidKeyword", }, }, }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 50, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 26, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "g", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 43, + 47, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-method-private.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { + "accessibility": "private", "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 14, - "line": 22, + "column": 13, + "line": 2, }, "start": Object { - "column": 13, - "line": 22, + "column": 12, + "line": 2, }, }, - "name": "l", + "name": "g", "range": Array [ - 571, - 572, + 28, + 29, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 34, - "line": 22, + "column": 33, + "line": 2, }, "start": Object { "column": 4, - "line": 22, + "line": 2, }, }, "optional": false, @@ -80851,50 +81627,50 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 25, + "line": 2, }, "start": Object { - "column": 15, - "line": 22, + "column": 14, + "line": 2, }, }, "name": "bar", "range": Array [ - 573, - 584, + 30, + 41, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 25, + "line": 2, }, "start": Object { - "column": 18, - "line": 22, + "column": 17, + "line": 2, }, }, "range": Array [ - 576, - 584, + 33, + 41, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 25, + "line": 2, }, "start": Object { - "column": 20, - "line": 22, + "column": 19, + "line": 2, }, }, "range": Array [ - 578, - 584, + 35, + 41, ], "type": "TSStringKeyword", }, @@ -80902,42 +81678,41 @@ Object { }, ], "range": Array [ - 562, - 592, + 20, + 49, ], - "readonly": true, "static": false, "type": "TSMethodSignature", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 33, - "line": 22, + "column": 32, + "line": 2, }, "start": Object { - "column": 27, - "line": 22, + "column": 26, + "line": 2, }, }, "range": Array [ - 585, - 591, + 42, + 48, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 33, - "line": 22, + "column": 32, + "line": 2, }, "start": Object { - "column": 29, - "line": 22, + "column": 28, + "line": 2, }, }, "range": Array [ - 587, - 591, + 44, + 48, ], "type": "TSVoidKeyword", }, @@ -80947,7 +81722,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 23, + "line": 3, }, "start": Object { "column": 14, @@ -80956,7 +81731,7 @@ Object { }, "range": Array [ 14, - 594, + 51, ], "type": "TSInterfaceBody", }, @@ -80982,7 +81757,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 23, + "line": 3, }, "start": Object { "column": 0, @@ -80991,7 +81766,7 @@ Object { }, "range": Array [ 0, - 594, + 51, ], "type": "TSInterfaceDeclaration", }, @@ -80999,7 +81774,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 25, + "line": 5, }, "start": Object { "column": 0, @@ -81008,7 +81783,7 @@ Object { }, "range": Array [ 0, - 596, + 53, ], "sourceType": "script", "tokens": Array [ @@ -81069,7 +81844,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 11, "line": 2, }, "start": Object { @@ -81079,241 +81854,133 @@ Object { }, "range": Array [ 20, - 23, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 23, - 24, + 27, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 9, + "column": 12, "line": 2, }, }, "range": Array [ - 25, - 31, + 28, + 29, ], "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 34, - 37, - ], - "type": "String", - "value": "'a'", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, + "column": 14, "line": 2, }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 43, - 49, - ], - "type": "Keyword", - "value": "public", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, "start": Object { - "column": 11, - "line": 3, - }, - }, - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, + "line": 2, }, }, "range": Array [ - 51, - 52, + 29, + 30, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { "column": 14, - "line": 3, + "line": 2, }, }, "range": Array [ - 53, - 59, + 30, + 33, ], "type": "Identifier", - "value": "string", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 18, + "line": 2, }, "start": Object { - "column": 20, - "line": 3, + "column": 17, + "line": 2, }, }, "range": Array [ - 59, - 60, + 33, + 34, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 4, + "column": 25, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 19, + "line": 2, }, }, "range": Array [ - 65, - 72, + 35, + 41, ], - "type": "Keyword", - "value": "private", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 26, + "line": 2, }, "start": Object { - "column": 12, - "line": 4, + "column": 25, + "line": 2, }, }, "range": Array [ - 73, - 74, + 41, + 42, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 27, + "line": 2, }, "start": Object { - "column": 13, - "line": 4, + "column": 26, + "line": 2, }, }, "range": Array [ - 74, - 75, + 42, + 43, ], "type": "Punctuator", "value": ":", @@ -81321,35 +81988,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 32, + "line": 2, }, "start": Object { - "column": 15, - "line": 4, + "column": 28, + "line": 2, }, }, "range": Array [ - 76, - 82, + 44, + 48, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 4, + "column": 33, + "line": 2, }, "start": Object { - "column": 21, - "line": 4, + "column": 32, + "line": 2, }, }, "range": Array [ - 82, - 83, + 48, + 49, ], "type": "Punctuator", "value": ";", @@ -81357,1295 +82024,1652 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 5, + "column": 0, + "line": 3, }, }, "range": Array [ - 88, - 97, + 50, + 51, ], - "type": "Keyword", - "value": "protected", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-method-protected.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, + "body": Object { + "body": Array [ + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "g", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 30, + 41, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 33, + 41, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 18, + 49, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 42, + 48, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "TSVoidKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 51, + ], + "type": "TSInterfaceBody", }, - "range": Array [ - 98, - 99, - ], - "type": "Identifier", - "value": "c", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 5, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 99, - 100, - ], - "type": "Punctuator", - "value": ":", - }, - Object { "loc": Object { "end": Object { - "column": 23, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 17, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 101, - 107, + 0, + 51, ], - "type": "Identifier", - "value": "string", + "type": "TSInterfaceDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 5, - }, - "start": Object { - "column": 23, - "line": 5, - }, - }, - "range": Array [ - 107, - 108, - ], - "type": "Punctuator", - "value": ";", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 113, - 119, - ], - "type": "Keyword", - "value": "static", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 53, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 9, + "line": 1, }, "start": Object { - "column": 11, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 120, - 121, + 0, + 9, ], - "type": "Identifier", - "value": "d", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 6, - }, - "start": Object { - "column": 12, - "line": 6, - }, - }, - "range": Array [ - 121, - 122, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 6, + "line": 1, }, "start": Object { - "column": 14, - "line": 6, + "column": 10, + "line": 1, }, }, "range": Array [ - 123, - 129, + 10, + 13, ], "type": "Identifier", - "value": "string", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 6, + "column": 15, + "line": 1, }, "start": Object { - "column": 20, - "line": 6, + "column": 14, + "line": 1, }, }, "range": Array [ - 129, - 130, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 11, + "line": 2, }, "start": Object { - "column": 4, - "line": 7, + "column": 2, + "line": 2, }, }, "range": Array [ - 135, - 141, + 18, + 27, ], "type": "Keyword", - "value": "export", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 13, + "line": 2, }, "start": Object { - "column": 11, - "line": 7, + "column": 12, + "line": 2, }, }, "range": Array [ - 142, - 143, + 28, + 29, ], "type": "Identifier", - "value": "e", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 14, + "line": 2, }, "start": Object { - "column": 12, - "line": 7, + "column": 13, + "line": 2, }, }, "range": Array [ - 143, - 144, + 29, + 30, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 7, + "column": 17, + "line": 2, }, "start": Object { "column": 14, - "line": 7, - }, - }, - "range": Array [ - 145, - 151, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 20, - "line": 7, + "line": 2, }, }, "range": Array [ - 151, - 152, - ], - "type": "Punctuator", - "value": ";", + 30, + 33, + ], + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 8, + "column": 18, + "line": 2, }, "start": Object { - "column": 4, - "line": 8, + "column": 17, + "line": 2, }, }, "range": Array [ - 157, - 165, + 33, + 34, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 25, + "line": 2, }, "start": Object { - "column": 13, - "line": 8, + "column": 19, + "line": 2, }, }, "range": Array [ - 166, - 167, + 35, + 41, ], "type": "Identifier", - "value": "f", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 8, + "column": 26, + "line": 2, }, "start": Object { - "column": 14, - "line": 8, + "column": 25, + "line": 2, }, }, "range": Array [ - 167, - 168, + 41, + 42, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 8, + "column": 27, + "line": 2, }, "start": Object { - "column": 16, - "line": 8, + "column": 26, + "line": 2, }, }, "range": Array [ - 169, - 175, + 42, + 43, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 8, + "column": 32, + "line": 2, }, "start": Object { - "column": 22, - "line": 8, + "column": 28, + "line": 2, }, }, "range": Array [ - 175, - 176, + 44, + 48, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 10, + "column": 33, + "line": 2, }, "start": Object { - "column": 4, - "line": 10, + "column": 32, + "line": 2, }, }, "range": Array [ - 182, - 188, + 48, + 49, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 10, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, - "line": 10, + "column": 0, + "line": 3, }, }, "range": Array [ - 189, - 190, + 50, + 51, ], "type": "Punctuator", - "value": "[", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-method-public.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 10, - }, - "start": Object { - "column": 12, - "line": 10, + "body": Object { + "body": Array [ + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "g", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 29, + 40, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 40, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 20, + 48, + ], + "static": false, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 43, + 47, + ], + "type": "TSVoidKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 50, + ], + "type": "TSInterfaceBody", }, - "range": Array [ - 190, - 193, - ], - "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 10, - }, - "start": Object { - "column": 15, - "line": 10, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 193, - 194, - ], - "type": "Punctuator", - "value": ":", - }, - Object { "loc": Object { "end": Object { - "column": 23, - "line": 10, + "column": 1, + "line": 3, }, "start": Object { - "column": 17, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 195, - 201, + 0, + 50, ], - "type": "Identifier", - "value": "string", + "type": "TSInterfaceDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 10, - }, - "start": Object { - "column": 23, - "line": 10, - }, - }, - "range": Array [ - 201, - 202, - ], - "type": "Punctuator", - "value": "]", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 52, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, - "line": 10, + "column": 9, + "line": 1, }, "start": Object { - "column": 24, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 202, - 203, + 0, + 9, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 10, + "column": 13, + "line": 1, }, "start": Object { - "column": 26, - "line": 10, + "column": 10, + "line": 1, }, }, "range": Array [ - 204, - 210, + 10, + 13, ], "type": "Identifier", - "value": "string", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 10, + "column": 15, + "line": 1, }, "start": Object { - "column": 32, - "line": 10, + "column": 14, + "line": 1, }, }, "range": Array [ - 210, - 211, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 11, + "column": 10, + "line": 2, }, "start": Object { "column": 4, - "line": 11, + "line": 2, }, }, "range": Array [ - 216, - 223, + 20, + 26, ], "type": "Keyword", - "value": "private", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 11, - }, - "start": Object { "column": 12, - "line": 11, - }, - }, - "range": Array [ - 224, - 225, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 11, - }, - "start": Object { - "column": 13, - "line": 11, - }, - }, - "range": Array [ - 225, - 228, - ], - "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 11, - }, - "start": Object { - "column": 16, - "line": 11, - }, - }, - "range": Array [ - 228, - 229, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 11, + "line": 2, }, "start": Object { - "column": 18, - "line": 11, + "column": 11, + "line": 2, }, }, "range": Array [ - 230, - 236, + 27, + 28, ], "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 11, - }, - "start": Object { - "column": 24, - "line": 11, - }, - }, - "range": Array [ - 236, - 237, - ], - "type": "Punctuator", - "value": "]", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 11, + "column": 13, + "line": 2, }, "start": Object { - "column": 25, - "line": 11, + "column": 12, + "line": 2, }, }, "range": Array [ - 237, - 238, + 28, + 29, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 11, + "column": 16, + "line": 2, }, "start": Object { - "column": 27, - "line": 11, + "column": 13, + "line": 2, }, }, "range": Array [ - 239, - 245, + 29, + 32, ], "type": "Identifier", - "value": "string", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 11, + "column": 17, + "line": 2, }, "start": Object { - "column": 33, - "line": 11, + "column": 16, + "line": 2, }, }, "range": Array [ - 245, - 246, + 32, + 33, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 12, + "column": 24, + "line": 2, }, "start": Object { - "column": 4, - "line": 12, + "column": 18, + "line": 2, }, }, "range": Array [ - 251, - 260, + 34, + 40, ], - "type": "Keyword", - "value": "protected", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 12, + "column": 25, + "line": 2, }, "start": Object { - "column": 14, - "line": 12, + "column": 24, + "line": 2, }, }, "range": Array [ - 261, - 262, + 40, + 41, ], "type": "Punctuator", - "value": "[", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 12, + "column": 26, + "line": 2, }, "start": Object { - "column": 15, - "line": 12, + "column": 25, + "line": 2, }, }, "range": Array [ - 262, - 265, + 41, + 42, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 12, + "column": 31, + "line": 2, }, "start": Object { - "column": 18, - "line": 12, + "column": 27, + "line": 2, }, }, "range": Array [ - 265, - 266, + 43, + 47, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 12, + "column": 32, + "line": 2, }, "start": Object { - "column": 20, - "line": 12, + "column": 31, + "line": 2, }, }, "range": Array [ - 267, - 273, + 47, + 48, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 12, + "column": 1, + "line": 3, }, "start": Object { - "column": 26, - "line": 12, + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-method-static.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "g", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": false, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 27, + 38, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 30, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 18, + 46, + ], + "static": true, + "type": "TSMethodSignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 39, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "TSVoidKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 48, + ], + "type": "TSInterfaceBody", }, - "range": Array [ - 273, - 274, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 12, - }, - "start": Object { - "column": 27, - "line": 12, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 274, - 275, - ], - "type": "Punctuator", - "value": ":", - }, - Object { "loc": Object { "end": Object { - "column": 35, - "line": 12, + "column": 1, + "line": 3, }, "start": Object { - "column": 29, - "line": 12, + "column": 0, + "line": 1, }, }, "range": Array [ - 276, - 282, + 0, + 48, ], - "type": "Identifier", - "value": "string", + "type": "TSInterfaceDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 12, - }, - "start": Object { - "column": 35, - "line": 12, - }, - }, - "range": Array [ - 282, - 283, - ], - "type": "Punctuator", - "value": ";", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 13, - }, - "start": Object { - "column": 4, - "line": 13, - }, - }, - "range": Array [ - 288, - 294, - ], - "type": "Keyword", - "value": "static", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 13, + "column": 9, + "line": 1, }, "start": Object { - "column": 11, - "line": 13, + "column": 0, + "line": 1, }, }, "range": Array [ - 295, - 296, + 0, + 9, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 13, + "column": 13, + "line": 1, }, "start": Object { - "column": 12, - "line": 13, + "column": 10, + "line": 1, }, }, "range": Array [ - 296, - 299, + 10, + 13, ], "type": "Identifier", - "value": "baz", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 13, - }, - "start": Object { "column": 15, - "line": 13, - }, - }, - "range": Array [ - 299, - 300, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 13, - }, - "start": Object { - "column": 17, - "line": 13, - }, - }, - "range": Array [ - 301, - 307, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 13, + "line": 1, }, "start": Object { - "column": 23, - "line": 13, + "column": 14, + "line": 1, }, }, "range": Array [ - 307, - 308, + 14, + 15, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 13, + "column": 8, + "line": 2, }, "start": Object { - "column": 24, - "line": 13, + "column": 2, + "line": 2, }, }, "range": Array [ - 308, - 309, + 18, + 24, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 13, + "column": 10, + "line": 2, }, "start": Object { - "column": 26, - "line": 13, + "column": 9, + "line": 2, }, }, "range": Array [ - 310, - 316, + 25, + 26, ], "type": "Identifier", - "value": "string", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 13, + "column": 11, + "line": 2, }, "start": Object { - "column": 32, - "line": 13, - }, - }, - "range": Array [ - 316, - 317, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { "column": 10, - "line": 14, - }, - "start": Object { - "column": 4, - "line": 14, + "line": 2, }, }, "range": Array [ - 322, - 328, + 26, + 27, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 14, + "column": 14, + "line": 2, }, "start": Object { "column": 11, - "line": 14, + "line": 2, }, }, "range": Array [ - 329, - 330, + 27, + 30, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 14, + "line": 2, }, "start": Object { - "column": 12, - "line": 14, + "column": 14, + "line": 2, }, }, "range": Array [ - 330, - 333, + 30, + 31, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 14, + "column": 22, + "line": 2, }, "start": Object { - "column": 15, - "line": 14, + "column": 16, + "line": 2, }, }, "range": Array [ - 333, - 334, + 32, + 38, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 14, + "line": 2, }, "start": Object { - "column": 17, - "line": 14, + "column": 22, + "line": 2, }, }, "range": Array [ - 335, - 341, + 38, + 39, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 24, - "line": 14, + "line": 2, }, "start": Object { "column": 23, - "line": 14, + "line": 2, }, }, "range": Array [ - 341, - 342, + 39, + 40, ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 14, + "column": 29, + "line": 2, }, "start": Object { - "column": 24, - "line": 14, + "column": 25, + "line": 2, }, }, "range": Array [ - 342, - 343, + 41, + 45, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 14, + "column": 30, + "line": 2, }, "start": Object { - "column": 26, - "line": 14, + "column": 29, + "line": 2, }, }, "range": Array [ - 344, - 350, + 45, + 46, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 14, + "column": 1, + "line": 3, }, "start": Object { - "column": 32, - "line": 14, + "column": 0, + "line": 3, }, }, "range": Array [ - 350, - 351, + 47, + 48, ], "type": "Punctuator", - "value": ";", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "export": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 35, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 37, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 12, - "line": 15, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 15, + "column": 0, + "line": 1, }, }, "range": Array [ - 356, - 364, + 0, + 37, ], - "type": "Identifier", - "value": "readonly", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 14, - "line": 15, + "column": 9, + "line": 1, }, "start": Object { - "column": 13, - "line": 15, + "column": 0, + "line": 1, }, }, "range": Array [ - 365, - 366, + 0, + 9, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 15, + "column": 13, + "line": 1, }, "start": Object { - "column": 14, - "line": 15, + "column": 10, + "line": 1, }, }, "range": Array [ - 366, - 369, + 10, + 13, ], "type": "Identifier", - "value": "baz", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 15, + "column": 15, + "line": 1, }, "start": Object { - "column": 17, - "line": 15, + "column": 14, + "line": 1, }, }, "range": Array [ - 369, - 370, + 14, + 15, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 15, + "column": 8, + "line": 2, }, "start": Object { - "column": 19, - "line": 15, + "column": 2, + "line": 2, }, }, "range": Array [ - 371, - 377, + 18, + 24, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 15, + "column": 10, + "line": 2, }, "start": Object { - "column": 25, - "line": 15, + "column": 9, + "line": 2, }, }, "range": Array [ - 377, - 378, + 25, + 26, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 15, + "column": 11, + "line": 2, }, "start": Object { - "column": 26, - "line": 15, + "column": 10, + "line": 2, }, }, "range": Array [ - 378, - 379, + 26, + 27, ], "type": "Punctuator", "value": ":", @@ -82653,17 +83677,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, - "line": 15, + "column": 18, + "line": 2, }, "start": Object { - "column": 28, - "line": 15, + "column": 12, + "line": 2, }, }, "range": Array [ - 380, - 386, + 28, + 34, ], "type": "Identifier", "value": "string", @@ -82671,17 +83695,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, - "line": 15, + "column": 19, + "line": 2, }, "start": Object { - "column": 34, - "line": 15, + "column": 18, + "line": 2, }, }, "range": Array [ - 386, - 387, + 34, + 35, ], "type": "Punctuator", "value": ";", @@ -82689,143 +83713,276 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 17, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 17, + "column": 0, + "line": 3, }, }, "range": Array [ - 393, - 399, + 36, + 37, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-private.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 36, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 38, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 12, - "line": 17, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, - "line": 17, + "column": 0, + "line": 1, }, }, "range": Array [ - 400, - 401, + 0, + 38, ], - "type": "Identifier", - "value": "g", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, - "line": 17, + "column": 9, + "line": 1, }, - "start": Object { - "column": 12, - "line": 17, + "start": Object { + "column": 0, + "line": 1, }, }, "range": Array [ - 401, - 402, + 0, + 9, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 17, + "column": 13, + "line": 1, }, "start": Object { - "column": 13, - "line": 17, + "column": 10, + "line": 1, }, }, "range": Array [ - 402, - 405, + 10, + 13, ], "type": "Identifier", - "value": "bar", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 17, + "column": 15, + "line": 1, }, "start": Object { - "column": 16, - "line": 17, + "column": 14, + "line": 1, }, }, "range": Array [ - 405, - 406, + 14, + 15, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 17, + "column": 9, + "line": 2, }, "start": Object { - "column": 18, - "line": 17, + "column": 2, + "line": 2, }, }, "range": Array [ - 407, - 413, + 18, + 25, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 17, + "column": 11, + "line": 2, }, "start": Object { - "column": 24, - "line": 17, + "column": 10, + "line": 2, }, }, "range": Array [ - 413, - 414, + 26, + 27, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 17, + "column": 12, + "line": 2, }, "start": Object { - "column": 25, - "line": 17, + "column": 11, + "line": 2, }, }, "range": Array [ - 414, - 415, + 27, + 28, ], "type": "Punctuator", "value": ":", @@ -82833,35 +83990,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, - "line": 17, + "column": 19, + "line": 2, }, "start": Object { - "column": 27, - "line": 17, + "column": 13, + "line": 2, }, }, "range": Array [ - 416, - 420, + 29, + 35, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 17, + "column": 20, + "line": 2, }, "start": Object { - "column": 31, - "line": 17, + "column": 19, + "line": 2, }, }, "range": Array [ - 420, - 421, + 35, + 36, ], "type": "Punctuator", "value": ";", @@ -82869,143 +84026,276 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 18, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 18, + "column": 0, + "line": 3, }, }, "range": Array [ - 426, - 433, + 37, + 38, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-protected.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "protected", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 38, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 29, + 37, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 40, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 13, - "line": 18, + "column": 1, + "line": 3, }, "start": Object { - "column": 12, - "line": 18, + "column": 0, + "line": 1, }, }, "range": Array [ - 434, - 435, + 0, + 40, ], - "type": "Identifier", - "value": "h", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 14, - "line": 18, + "column": 9, + "line": 1, }, "start": Object { - "column": 13, - "line": 18, + "column": 0, + "line": 1, }, }, "range": Array [ - 435, - 436, + 0, + 9, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 18, + "column": 13, + "line": 1, }, "start": Object { - "column": 14, - "line": 18, + "column": 10, + "line": 1, }, }, "range": Array [ - 436, - 439, + 10, + 13, ], "type": "Identifier", - "value": "bar", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 18, + "column": 15, + "line": 1, }, "start": Object { - "column": 17, - "line": 18, + "column": 14, + "line": 1, }, }, "range": Array [ - 439, - 440, + 14, + 15, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 18, + "column": 11, + "line": 2, }, "start": Object { - "column": 19, - "line": 18, + "column": 2, + "line": 2, }, }, "range": Array [ - 441, - 447, + 18, + 27, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 18, + "column": 13, + "line": 2, }, "start": Object { - "column": 25, - "line": 18, + "column": 12, + "line": 2, }, }, "range": Array [ - 447, - 448, + 28, + 29, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 18, + "column": 14, + "line": 2, }, "start": Object { - "column": 26, - "line": 18, + "column": 13, + "line": 2, }, }, "range": Array [ - 448, - 449, + 29, + 30, ], "type": "Punctuator", "value": ":", @@ -83013,35 +84303,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, - "line": 18, + "column": 21, + "line": 2, }, "start": Object { - "column": 28, - "line": 18, + "column": 15, + "line": 2, }, }, "range": Array [ - 450, - 454, + 31, + 37, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 18, + "column": 22, + "line": 2, }, "start": Object { - "column": 32, - "line": 18, + "column": 21, + "line": 2, }, }, "range": Array [ - 454, - 455, + 37, + 38, ], "type": "Punctuator", "value": ";", @@ -83049,143 +84339,276 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, - "line": 19, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 19, + "column": 0, + "line": 3, }, }, "range": Array [ - 460, - 469, + 39, + 40, ], - "type": "Keyword", - "value": "protected", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-public.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "public", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 37, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 28, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 39, + ], + "type": "TSInterfaceBody", + }, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 15, - "line": 19, + "column": 1, + "line": 3, }, "start": Object { - "column": 14, - "line": 19, + "column": 0, + "line": 1, }, }, "range": Array [ - 470, - 471, + 0, + 39, ], - "type": "Identifier", - "value": "i", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 16, - "line": 19, + "column": 9, + "line": 1, }, "start": Object { - "column": 15, - "line": 19, + "column": 0, + "line": 1, }, }, "range": Array [ - 471, - 472, + 0, + 9, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 19, + "column": 13, + "line": 1, }, "start": Object { - "column": 16, - "line": 19, + "column": 10, + "line": 1, }, }, "range": Array [ - 472, - 475, + 10, + 13, ], "type": "Identifier", - "value": "bar", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 19, + "column": 15, + "line": 1, }, "start": Object { - "column": 19, - "line": 19, + "column": 14, + "line": 1, }, }, "range": Array [ - 475, - 476, + 14, + 15, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 19, + "column": 10, + "line": 2, }, "start": Object { - "column": 21, - "line": 19, + "column": 4, + "line": 2, }, }, "range": Array [ - 477, - 483, + 20, + 26, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 19, + "column": 12, + "line": 2, }, "start": Object { - "column": 27, - "line": 19, + "column": 11, + "line": 2, }, }, "range": Array [ - 483, - 484, + 27, + 28, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 19, + "column": 13, + "line": 2, }, "start": Object { - "column": 28, - "line": 19, + "column": 12, + "line": 2, }, }, "range": Array [ - 484, - 485, + 28, + 29, ], "type": "Punctuator", "value": ":", @@ -83193,35 +84616,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, - "line": 19, + "column": 20, + "line": 2, }, "start": Object { - "column": 30, - "line": 19, + "column": 14, + "line": 2, }, }, "range": Array [ - 486, - 490, + 30, + 36, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 19, + "column": 21, + "line": 2, }, "start": Object { - "column": 34, - "line": 19, + "column": 20, + "line": 2, }, }, "range": Array [ - 490, - 491, + 36, + 37, ], "type": "Punctuator", "value": ";", @@ -83229,431 +84652,571 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 20, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 20, + "column": 0, + "line": 3, }, }, "range": Array [ - 496, - 502, + 38, + 39, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-static.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 20, - }, - "start": Object { - "column": 11, - "line": 20, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 35, + ], + "static": true, + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 26, + 34, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 28, + 34, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 37, + ], + "type": "TSInterfaceBody", }, - "range": Array [ - 503, - 504, - ], - "type": "Identifier", - "value": "j", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 20, - }, - "start": Object { - "column": 12, - "line": 20, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 504, - 505, - ], - "type": "Punctuator", - "value": "(", - }, - Object { "loc": Object { "end": Object { - "column": 16, - "line": 20, + "column": 1, + "line": 3, }, "start": Object { - "column": 13, - "line": 20, + "column": 0, + "line": 1, }, }, "range": Array [ - 505, - 508, + 0, + 37, ], - "type": "Identifier", - "value": "bar", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, - "line": 20, + "column": 9, + "line": 1, }, "start": Object { - "column": 16, - "line": 20, + "column": 0, + "line": 1, }, }, "range": Array [ - 508, - 509, + 0, + 9, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 20, + "column": 13, + "line": 1, }, "start": Object { - "column": 18, - "line": 20, + "column": 10, + "line": 1, }, }, "range": Array [ - 510, - 516, + 10, + 13, ], "type": "Identifier", - "value": "string", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 20, + "column": 15, + "line": 1, }, "start": Object { - "column": 24, - "line": 20, + "column": 14, + "line": 1, }, }, "range": Array [ - 516, - 517, + 14, + 15, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 20, + "column": 8, + "line": 2, }, "start": Object { - "column": 25, - "line": 20, + "column": 2, + "line": 2, }, }, "range": Array [ - 517, - 518, + 18, + 24, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 20, + "column": 10, + "line": 2, }, "start": Object { - "column": 27, - "line": 20, + "column": 9, + "line": 2, }, }, "range": Array [ - 519, - 523, + 25, + 26, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 20, + "column": 11, + "line": 2, }, "start": Object { - "column": 31, - "line": 20, + "column": 10, + "line": 2, }, }, "range": Array [ - 523, - 524, + 26, + 27, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 21, + "column": 18, + "line": 2, }, "start": Object { - "column": 4, - "line": 21, + "column": 12, + "line": 2, }, }, "range": Array [ - 529, - 535, + 28, + 34, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 21, + "column": 19, + "line": 2, }, "start": Object { - "column": 11, - "line": 21, + "column": 18, + "line": 2, }, }, "range": Array [ - 536, - 537, + 34, + 35, ], - "type": "Identifier", - "value": "k", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 21, + "column": 1, + "line": 3, }, "start": Object { - "column": 12, - "line": 21, + "column": 0, + "line": 3, }, }, "range": Array [ - 537, - 538, + 36, + 37, ], "type": "Punctuator", - "value": "(", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/interface-property-with-default-value.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 21, - }, - "start": Object { - "column": 13, - "line": 21, + "body": Object { + "body": Array [ + Object { + "computed": false, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "raw": "'a'", + "type": "Literal", + "value": "a", + }, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 36, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 21, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 38, + ], + "type": "TSInterfaceBody", }, - "range": Array [ - 538, - 541, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 21, - }, - "start": Object { - "column": 16, - "line": 21, + "heritage": Array [], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 541, - 542, - ], - "type": "Punctuator", - "value": ":", - }, - Object { "loc": Object { "end": Object { - "column": 24, - "line": 21, + "column": 1, + "line": 3, }, "start": Object { - "column": 18, - "line": 21, + "column": 0, + "line": 1, }, }, "range": Array [ - 543, - 549, + 0, + 38, ], - "type": "Identifier", - "value": "string", + "type": "TSInterfaceDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 21, - }, - "start": Object { - "column": 24, - "line": 21, - }, - }, - "range": Array [ - 549, - 550, - ], - "type": "Punctuator", - "value": ")", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 21, - }, - "start": Object { - "column": 25, - "line": 21, - }, - }, - "range": Array [ - 550, - 551, - ], - "type": "Punctuator", - "value": ":", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 31, - "line": 21, + "column": 9, + "line": 1, }, "start": Object { - "column": 27, - "line": 21, + "column": 0, + "line": 1, }, }, "range": Array [ - 552, - 556, + 0, + 9, ], "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 21, - }, - "start": Object { - "column": 31, - "line": 21, - }, - }, - "range": Array [ - 556, - 557, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 22, - }, - "start": Object { - "column": 4, - "line": 22, - }, - }, - "range": Array [ - 562, - 570, - ], - "type": "Identifier", - "value": "readonly", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 22, + "column": 13, + "line": 1, }, "start": Object { - "column": 13, - "line": 22, + "column": 10, + "line": 1, }, }, "range": Array [ - 571, - 572, + 10, + 13, ], "type": "Identifier", - "value": "l", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 22, + "line": 1, }, "start": Object { "column": 14, - "line": 22, + "line": 1, }, }, "range": Array [ - 572, - 573, + 14, + 15, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 22, + "column": 5, + "line": 2, }, "start": Object { - "column": 15, - "line": 22, + "column": 2, + "line": 2, }, }, "range": Array [ - 573, - 576, + 18, + 21, ], "type": "Identifier", "value": "bar", @@ -83661,17 +85224,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 22, + "column": 6, + "line": 2, }, "start": Object { - "column": 18, - "line": 22, + "column": 5, + "line": 2, }, }, "range": Array [ - 576, - 577, + 21, + 22, ], "type": "Punctuator", "value": ":", @@ -83679,17 +85242,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 22, + "column": 13, + "line": 2, }, "start": Object { - "column": 20, - "line": 22, + "column": 7, + "line": 2, }, }, "range": Array [ - 578, - 584, + 23, + 29, ], "type": "Identifier", "value": "string", @@ -83697,71 +85260,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, - "line": 22, - }, - "start": Object { - "column": 26, - "line": 22, - }, - }, - "range": Array [ - 584, - 585, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 22, + "column": 15, + "line": 2, }, "start": Object { - "column": 27, - "line": 22, + "column": 14, + "line": 2, }, }, "range": Array [ - 585, - 586, + 30, + 31, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 22, + "column": 19, + "line": 2, }, "start": Object { - "column": 29, - "line": 22, + "column": 16, + "line": 2, }, }, "range": Array [ - 587, - 591, + 32, + 35, ], - "type": "Keyword", - "value": "void", + "type": "String", + "value": "'a'", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 22, + "column": 20, + "line": 2, }, "start": Object { - "column": 33, - "line": 22, + "column": 19, + "line": 2, }, }, "range": Array [ - 591, - 592, + 35, + 36, ], "type": "Punctuator", "value": ";", @@ -83770,16 +85315,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 23, + "line": 3, }, "start": Object { "column": 0, - "line": 23, + "line": 3, }, }, "range": Array [ - 593, - 594, + 37, + 38, ], "type": "Punctuator", "value": "}", From b75b123b35c151198e3b5343021e277fac45e534 Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 11 Jan 2019 00:27:04 +0100 Subject: [PATCH 73/84] feat: rest element should contain information about type annotation (#108) BREAKING CHANGE: This changes the AST for RestElement node --- packages/typescript-estree/src/convert.ts | 17 +- .../tests/ast-alignment/fixtures-to-test.ts | 5 +- .../lib/__snapshots__/typescript.ts.snap | 466 +++++++++--------- 3 files changed, 242 insertions(+), 246 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index e64a24061cb2..584d17f80822 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1435,34 +1435,33 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } case SyntaxKind.Parameter: { - let parameter; + let parameter: ESTreeNode; if (node.dotDotDotToken) { - parameter = convertChild(node.name); Object.assign(result, { type: AST_NODE_TYPES.RestElement, - argument: parameter + argument: convertChild(node.name) }); + parameter = result; } else if (node.initializer) { - parameter = convertChild(node.name); + parameter = convertChild(node.name)!; Object.assign(result, { type: AST_NODE_TYPES.AssignmentPattern, left: parameter, right: convertChild(node.initializer) }); } else { - parameter = convert({ + parameter = result = convert({ node: node.name, parent, ast, additionalOptions - }); - (result as any) = parameter; + })!; } if (node.type) { - parameter!.typeAnnotation = convertTypeAnnotation(node.type); - fixTypeAnnotationParentLocation(parameter!); + parameter.typeAnnotation = convertTypeAnnotation(node.type); + fixTypeAnnotationParentLocation(parameter); } if (node.questionToken) { diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 02e366530536..91a1bc3b2287 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -351,6 +351,7 @@ tester.addFixturePatternConfig('typescript/basics', { 'class-with-implements-generic', 'class-with-implements', 'class-with-extends-and-implements', + 'class-with-mixin', /** * Babel error: parameterName is not included into range of TSTypeAnnotation * TODO: report it to babel @@ -363,8 +364,6 @@ tester.addFixturePatternConfig('typescript/basics', { /** * Other major AST differences (e.g. fundamentally different node types) */ - 'class-with-mixin', - 'function-with-types-assignation', 'interface-extends-multiple', 'interface-extends', 'interface-type-parameters', @@ -499,8 +498,6 @@ tester.addFixturePatternConfig('typescript/types', { /** * AST difference */ - 'function-with-rest', - 'constructor-with-rest', 'index-signature', 'index-signature-readonly', 'literal-number-negative' diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 0bbde7f1bfa1..47fd91da60d8 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -13788,7 +13788,7 @@ Object { "argument": Object { "loc": Object { "end": Object { - "column": 41, + "column": 34, "line": 9, }, "start": Object { @@ -13799,60 +13799,9 @@ Object { "name": "args", "range": Array [ 188, - 199, + 192, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 34, - "line": 9, - }, - }, - "range": Array [ - 192, - 199, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 9, - }, - "start": Object { - "column": 36, - "line": 9, - }, - }, - "range": Array [ - 194, - 197, - ], - "type": "TSAnyKeyword", - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 36, - "line": 9, - }, - }, - "range": Array [ - 194, - 199, - ], - "type": "TSArrayType", - }, - }, }, "loc": Object { "end": Object { @@ -13869,6 +13818,57 @@ Object { 199, ], "type": "RestElement", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 34, + "line": 9, + }, + }, + "range": Array [ + 192, + 199, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 197, + ], + "type": "TSAnyKeyword", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 199, + ], + "type": "TSArrayType", + }, + }, }, ], "range": Array [ @@ -38040,7 +38040,7 @@ Object { "argument": Object { "loc": Object { "end": Object { - "column": 69, + "column": 55, "line": 1, }, "start": Object { @@ -38051,9 +38051,41 @@ Object { "name": "args", "range": Array [ 51, - 69, + 55, ], "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "range": Array [ + 48, + 69, + ], + "type": "RestElement", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 69, + ], + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -38061,19 +38093,19 @@ Object { "line": 1, }, "start": Object { - "column": 55, + "column": 56, "line": 1, }, }, "range": Array [ - 55, + 56, 69, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 69, + "column": 61, "line": 1, }, "start": Object { @@ -38081,83 +38113,51 @@ Object { "line": 1, }, }, + "name": "Array", "range": Array [ 56, - 69, + 61, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 61, - "line": 1, - }, - "start": Object { - "column": 56, - "line": 1, - }, + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 69, + "line": 1, }, - "name": "Array", - "range": Array [ - 56, - 61, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 69, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, + "start": Object { + "column": 61, + "line": 1, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 68, - "line": 1, - }, - "start": Object { - "column": 62, - "line": 1, - }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, }, - "range": Array [ - 62, - 68, - ], - "type": "TSStringKeyword", }, - ], - "range": Array [ - 61, - 69, - ], - "type": "TSTypeParameterInstantiation", - }, + "range": Array [ + 62, + 68, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 61, + 69, + ], + "type": "TSTypeParameterInstantiation", }, }, }, - "loc": Object { - "end": Object { - "column": 69, - "line": 1, - }, - "start": Object { - "column": 48, - "line": 1, - }, - }, - "range": Array [ - 48, - 69, - ], - "type": "RestElement", }, ], "range": Array [ @@ -95719,7 +95719,7 @@ Object { "argument": Object { "loc": Object { "end": Object { - "column": 26, + "column": 16, "line": 1, }, "start": Object { @@ -95730,60 +95730,9 @@ Object { "name": "a", "range": Array [ 15, - 26, + 16, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 26, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 24, - ], - "type": "TSNumberKeyword", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 26, - ], - "type": "TSArrayType", - }, - }, }, "loc": Object { "end": Object { @@ -95800,6 +95749,57 @@ Object { 26, ], "type": "RestElement", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 26, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "TSNumberKeyword", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 26, + ], + "type": "TSArrayType", + }, + }, }, ], "range": Array [ @@ -97717,7 +97717,7 @@ Object { "argument": Object { "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { @@ -97728,60 +97728,9 @@ Object { "name": "a", "range": Array [ 11, - 22, + 12, ], "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 22, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 20, - ], - "type": "TSNumberKeyword", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 22, - ], - "type": "TSArrayType", - }, - }, }, "loc": Object { "end": Object { @@ -97798,6 +97747,57 @@ Object { 22, ], "type": "RestElement", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 22, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "type": "TSNumberKeyword", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 22, + ], + "type": "TSArrayType", + }, + }, }, ], "range": Array [ From 05ba969aded147a2117856aa50451e86a80ff035 Mon Sep 17 00:00:00 2001 From: James Henry Date: Thu, 10 Jan 2019 18:40:13 -0500 Subject: [PATCH 74/84] fix: commit message for #108 BREAKING CHANGE: This changes the AST for RestElement node --- packages/typescript-estree/.prettierignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typescript-estree/.prettierignore b/packages/typescript-estree/.prettierignore index 206eb246b3f9..9da7aa648acc 100644 --- a/packages/typescript-estree/.prettierignore +++ b/packages/typescript-estree/.prettierignore @@ -1 +1 @@ -tests/fixtures/**/* +tests/fixtures/**/* \ No newline at end of file From 5ac295daa85c861692549eade15020056a66836f Mon Sep 17 00:00:00 2001 From: Armano Date: Fri, 11 Jan 2019 00:50:49 +0100 Subject: [PATCH 75/84] feat: update TSMethodSignature node (#104) BREAKING CHANGE: This changes the AST for TSMethodSignature node --- packages/typescript-estree/src/convert.ts | 46 +++++---- .../typescript-estree/src/semantic-errors.ts | 1 + .../src/temp-types-based-on-js-source.ts | 3 +- .../tests/ast-alignment/fixtures-to-test.ts | 26 ++--- .../tests/ast-alignment/utils.ts | 13 +++ .../semantic-diagnostics-enabled.ts.snap | 90 ++++++++++++++++-- .../lib/__snapshots__/typescript.ts.snap | 94 ++++++------------- 7 files changed, 163 insertions(+), 110 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 584d17f80822..e79271de5a5b 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -933,7 +933,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } if (node.name.kind === SyntaxKind.Identifier && node.questionToken) { - (result as any).optional = true; + result.optional = true; } if (node.exclamationToken) { @@ -944,7 +944,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).key.type === AST_NODE_TYPES.Literal && node.questionToken ) { - (result as any).optional = true; + result.optional = true; } break; } @@ -2293,9 +2293,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (node.readonlyToken) { if (node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword) { - (result as any).readonly = true; + result.readonly = true; } else { - (result as any).readonly = nodeUtils.getTextForTokenKind( + result.readonly = nodeUtils.getTextForTokenKind( node.readonlyToken.kind ); } @@ -2303,9 +2303,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (node.questionToken) { if (node.questionToken.kind === SyntaxKind.QuestionToken) { - (result as any).optional = true; + result.optional = true; } else { - (result as any).optional = nodeUtils.getTextForTokenKind( + result.optional = nodeUtils.getTextForTokenKind( node.questionToken.kind ); } @@ -2351,21 +2351,21 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.MethodSignature: { Object.assign(result, { type: AST_NODE_TYPES.TSMethodSignature, - optional: nodeUtils.isOptional(node), computed: nodeUtils.isComputedProperty(node.name), key: convertChild(node.name), - params: convertParameters(node.parameters), - typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, - readonly: - nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), - export: - nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + params: convertParameters(node.parameters) }); - const accessibility = nodeUtils.getTSNodeAccessibility(node); - if (accessibility) { - result.accessibility = accessibility; + if (nodeUtils.isOptional(node)) { + result.optional = true; + } + + if (node.type) { + result.returnType = convertTypeAnnotation(node.type); + } + + if (nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node)) { + result.readonly = true; } if (node.typeParameters) { @@ -2374,6 +2374,18 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ); } + const accessibility = nodeUtils.getTSNodeAccessibility(node); + if (accessibility) { + result.accessibility = accessibility; + } + + if (nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node)) { + result.export = true; + } + + if (nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node)) { + result.static = true; + } break; } diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index 9cc29dabeeaa..221987e1dbc6 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -59,6 +59,7 @@ function whitelistSupportedDiagnostics( case 1045: // ts 3.2 "A '{0}' modifier cannot be used with an interface declaration." case 1048: // ts 3.2 "A rest parameter cannot have an initializer." case 1049: // ts 3.2 "A 'set' accessor must have exactly one parameter." + case 1070: // ts 3.2 "'{0}' modifier cannot appear on a type member." case 1090: // ts 3.2 "'{0}' modifier cannot appear on a parameter." case 1096: // ts 3.2 "An index signature must have exactly one parameter." case 1097: // ts 3.2 "'{0}' list cannot be empty." diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index 33f9b3faf5d6..cf7124ab04f6 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -41,7 +41,7 @@ export interface ESTreeNode { body?: any; params?: any; accessibility?: 'public' | 'protected' | 'private'; - readonly?: boolean; + readonly?: boolean | string; static?: boolean; export?: boolean; parameter?: any; @@ -49,6 +49,7 @@ export interface ESTreeNode { typeName?: ESTreeNode | null; directive?: string; returnType?: ESTreeNode; + optional?: boolean | string; } export interface ESTreeComment { diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 91a1bc3b2287..8e6f00bd9917 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -372,10 +372,14 @@ tester.addFixturePatternConfig('typescript/basics', { 'interface-with-jsdoc', 'interface-with-optional-properties', 'interface-without-type-annotation', - 'interface-with-method', 'type-guard-in-interface', - 'typed-method-signature', 'typed-this', + /** + * AST difference + * ts-estree: heritage = [] + * babel: heritage = undefined + */ + 'interface-with-method', /** * Babel bug for parsing exported abstract interface * https://github.com/babel/babel/issues/9304 @@ -472,23 +476,7 @@ tester.addFixturePatternConfig('typescript/errorRecovery', { 'interface-index-signature-private', 'interface-index-signature-protected', 'interface-index-signature-public', - 'interface-index-signature-static', - /** - * TS1070 - */ - 'interface-method-export', - 'interface-method-private', - 'interface-method-protected', - 'interface-method-public', - 'interface-method-static', - /** - * TS1070 - */ - 'interface-property-export', - 'interface-property-private', - 'interface-property-protected', - 'interface-property-public', - 'interface-property-static' + 'interface-index-signature-static' ] }); diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 10bb56103831..185797249f44 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -196,6 +196,19 @@ export function preprocessBabylonAST(ast: any): any { delete node.parameters; } }, + /** + * Awaiting feedback on Babel issue https://github.com/babel/babel/issues/9231 + */ + TSMethodSignature(node: any) { + if (node.typeAnnotation) { + node.returnType = node.typeAnnotation; + delete node.typeAnnotation; + } + if (node.parameters) { + node.params = node.parameters; + delete node.parameters; + } + }, /** * We want this node to be different * @see https://github.com/JamesHenry/typescript-estree/issues/109 diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index b8283a590cec..76bd622b63cd 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -2222,25 +2222,95 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-export.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-export.src.ts.src 1`] = ` +Object { + "column": 4, + "index": 20, + "lineNumber": 2, + "message": "'export' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-private.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-private.src.ts.src 1`] = ` +Object { + "column": 4, + "index": 20, + "lineNumber": 2, + "message": "'private' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-protected.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-protected.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'protected' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-public.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-public.src.ts.src 1`] = ` +Object { + "column": 4, + "index": 20, + "lineNumber": 2, + "message": "'public' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-static.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-static.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'static' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-export.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-export.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'export' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-private.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-private.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'private' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-protected.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-protected.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'protected' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-public.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-public.src.ts.src 1`] = ` +Object { + "column": 4, + "index": 20, + "lineNumber": 2, + "message": "'public' modifier cannot appear on a type member.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-static.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-static.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'static' modifier cannot appear on a type member.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts.src 1`] = ` Object { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 47fd91da60d8..83d1f664ba29 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -41712,15 +41712,12 @@ Object { "line": 8, }, }, - "optional": false, "params": Array [], "range": Array [ 149, 161, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 15, @@ -41754,6 +41751,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, Object { "computed": false, @@ -41846,9 +41844,7 @@ Object { 166, 186, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 23, @@ -41882,6 +41878,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, Object { "computed": true, @@ -41974,9 +41971,7 @@ Object { 191, 213, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 25, @@ -42010,6 +42005,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, Object { "computed": false, @@ -42041,7 +42037,6 @@ Object { "line": 11, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -42102,9 +42097,7 @@ Object { 218, 240, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 25, @@ -42138,6 +42131,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", "typeParameters": Object { "loc": Object { "end": Object { @@ -45656,7 +45650,6 @@ Object { "line": 6, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -45681,9 +45674,7 @@ Object { 76, 85, ], - "static": false, "type": "TSMethodSignature", - "typeAnnotation": null, }, ], "loc": Object { @@ -45957,7 +45948,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -46016,9 +46006,7 @@ Object { 19, 40, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 22, @@ -46052,6 +46040,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, Object { "computed": false, @@ -46083,7 +46072,6 @@ Object { "line": 3, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -46160,9 +46148,7 @@ Object { 43, 59, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 17, @@ -46214,6 +46200,7 @@ Object { }, }, }, + "type": "TSMethodSignature", "typeParameters": Object { "loc": Object { "end": Object { @@ -47034,9 +47021,7 @@ Object { 49, 79, ], - "static": false, "type": "TSMethodSignature", - "typeAnnotation": null, }, ], "loc": Object { @@ -55014,7 +54999,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -55073,9 +55057,7 @@ Object { 18, 54, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 37, @@ -55161,6 +55143,7 @@ Object { }, }, }, + "type": "TSMethodSignature", }, ], "loc": Object { @@ -60069,7 +60052,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -60128,9 +60110,7 @@ Object { 15, 36, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 22, @@ -60164,6 +60144,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, Object { "computed": false, @@ -60195,7 +60176,6 @@ Object { "line": 3, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -60272,9 +60252,7 @@ Object { 39, 55, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 17, @@ -60326,6 +60304,7 @@ Object { }, }, }, + "type": "TSMethodSignature", "typeParameters": Object { "loc": Object { "end": Object { @@ -60915,7 +60894,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -61132,9 +61110,7 @@ Object { 23, 87, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 64, @@ -61168,6 +61144,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, ], "loc": Object { @@ -81163,7 +81140,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -81222,9 +81198,7 @@ Object { 20, 48, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 31, @@ -81258,6 +81232,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, ], "loc": Object { @@ -81622,7 +81597,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -81681,9 +81655,7 @@ Object { 20, 49, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 32, @@ -81717,6 +81689,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, ], "loc": Object { @@ -82081,7 +82054,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -82140,9 +82112,7 @@ Object { 18, 49, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 32, @@ -82176,6 +82146,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, ], "loc": Object { @@ -82540,7 +82511,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -82599,9 +82569,7 @@ Object { 20, 48, ], - "static": false, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 31, @@ -82635,6 +82603,7 @@ Object { "type": "TSVoidKeyword", }, }, + "type": "TSMethodSignature", }, ], "loc": Object { @@ -82998,7 +82967,6 @@ Object { "line": 2, }, }, - "optional": false, "params": Array [ Object { "loc": Object { @@ -83057,9 +83025,7 @@ Object { 18, 46, ], - "static": true, - "type": "TSMethodSignature", - "typeAnnotation": Object { + "returnType": Object { "loc": Object { "end": Object { "column": 29, @@ -83093,6 +83059,8 @@ Object { "type": "TSVoidKeyword", }, }, + "static": true, + "type": "TSMethodSignature", }, ], "loc": Object { From 25c0acea85066be1f1da96196949204ae35156cf Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 11 Jan 2019 09:56:31 -0500 Subject: [PATCH 76/84] chore: add codecov (#114) --- packages/typescript-estree/.codecov.yml | 8 ++++++++ packages/typescript-estree/.travis.yml | 4 +++- packages/typescript-estree/jest.config.js | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 packages/typescript-estree/.codecov.yml diff --git a/packages/typescript-estree/.codecov.yml b/packages/typescript-estree/.codecov.yml new file mode 100644 index 000000000000..bd0a21a60e04 --- /dev/null +++ b/packages/typescript-estree/.codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + patch: + default: + target: 90% + project: + default: + target: auto diff --git a/packages/typescript-estree/.travis.yml b/packages/typescript-estree/.travis.yml index 91faa15bbfc7..4465698ed5bb 100644 --- a/packages/typescript-estree/.travis.yml +++ b/packages/typescript-estree/.travis.yml @@ -18,8 +18,10 @@ script: - yarn check-format - yarn test - yarn build + - yarn global add codecov after_success: - - npm run travis-deploy-once "npm run semantic-release" + - codecov + - yarn travis-deploy-once "yarn semantic-release" branches: only: - master diff --git a/packages/typescript-estree/jest.config.js b/packages/typescript-estree/jest.config.js index f9aa158b08e5..d5d94e9ab018 100644 --- a/packages/typescript-estree/jest.config.js +++ b/packages/typescript-estree/jest.config.js @@ -9,5 +9,5 @@ module.exports = { collectCoverage: true, collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], - coverageReporters: ['text-summary'] + coverageReporters: ['text-summary', 'lcov'] }; From 44dc2299bf1090b09ffbb12b0e07d2690608429c Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 12 Jan 2019 00:53:25 +0100 Subject: [PATCH 77/84] test: improve workflow for development (#116) --- packages/typescript-estree/jest.config.js | 2 +- packages/typescript-estree/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/typescript-estree/jest.config.js b/packages/typescript-estree/jest.config.js index d5d94e9ab018..fca6f6147e0f 100644 --- a/packages/typescript-estree/jest.config.js +++ b/packages/typescript-estree/jest.config.js @@ -6,7 +6,7 @@ module.exports = { '^.+\\.tsx?$': 'ts-jest' }, testRegex: './tests/(lib/.*\\.(jsx?|tsx?)|ast-alignment/spec\\.ts)$', - collectCoverage: true, + collectCoverage: false, collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], coverageReporters: ['text-summary', 'lcov'] diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 3286b6eb58b5..8ca835a0ba45 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -54,7 +54,7 @@ ], "scripts": { "build": "tsc", - "test": "jest", + "test": "jest --coverage", "unit-tests": "jest \"./tests/lib/.*\"", "ast-alignment-tests": "jest spec.ts", "precommit": "npm test && lint-staged", From 89c67d3162ef51e2893b2ff251b4f54d843e1372 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 12 Jan 2019 01:43:26 +0100 Subject: [PATCH 78/84] refactor: add explicit implementation of TSLiteralType (#117) --- packages/typescript-estree/src/convert.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index e79271de5a5b..9d0a535bb3fa 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2686,6 +2686,13 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); break; } + case SyntaxKind.LiteralType: { + Object.assign(result, { + type: AST_NODE_TYPES.TSLiteralType, + literal: convertChildType(node.literal) + }); + break; + } case SyntaxKind.TypeAssertionExpression: { Object.assign(result, { type: AST_NODE_TYPES.TSTypeAssertion, From bd1e2c4f1377e8561f3f41089270a70d59794a68 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 12 Jan 2019 02:12:54 +0100 Subject: [PATCH 79/84] feat: update TSIndexSignature and report on TS1071 (#115) BREAKING CHANGE: This changes the AST for TSIndexSignature node --- .../typescript-estree/src/ast-node-types.ts | 3 +- packages/typescript-estree/src/convert.ts | 20 +- .../typescript-estree/src/semantic-errors.ts | 1 + .../tests/ast-alignment/fixtures-to-test.ts | 17 +- .../types/index-signature-without-type.src.ts | 3 + .../semantic-diagnostics-enabled.ts.snap | 47 +- .../lib/__snapshots__/typescript.ts.snap | 1110 +++++++++++------ 7 files changed, 828 insertions(+), 373 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/types/index-signature-without-type.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index cb4ab8d0e72e..d35277f58167 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -39,7 +39,6 @@ export enum AST_NODE_TYPES { ForStatement = 'ForStatement', FunctionDeclaration = 'FunctionDeclaration', FunctionExpression = 'FunctionExpression', - GenericTypeAnnotation = 'GenericTypeAnnotation', Identifier = 'Identifier', IfStatement = 'IfStatement', Import = 'Import', @@ -56,7 +55,7 @@ export enum AST_NODE_TYPES { JSXFragment = 'JSXFragment', JSXIdentifier = 'JSXIdentifier', JSXMemberExpression = 'JSXMemberExpression', - JSXNamespacedName = 'JSXNamespacedName', + JSXNamespacedName = 'JSXNamespacedName', // https://github.com/Microsoft/TypeScript/issues/7411 JSXOpeningElement = 'JSXOpeningElement', JSXOpeningFragment = 'JSXOpeningFragment', JSXSpreadAttribute = 'JSXSpreadAttribute', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 9d0a535bb3fa..fdb09cd54705 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2418,20 +2418,26 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.IndexSignature: { Object.assign(result, { type: AST_NODE_TYPES.TSIndexSignature, - index: convertChild(node.parameters[0]), - typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null, - readonly: - nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), - export: - nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + parameters: node.parameters.map(convertChild), + typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null }); + if (nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node)) { + result.readonly = true; + } + const accessibility = nodeUtils.getTSNodeAccessibility(node); if (accessibility) { result.accessibility = accessibility; } + if (nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node)) { + result.export = true; + } + + if (nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node)) { + result.static = true; + } break; } case SyntaxKind.ConstructorType: diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index 221987e1dbc6..067a702474c7 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -60,6 +60,7 @@ function whitelistSupportedDiagnostics( case 1048: // ts 3.2 "A rest parameter cannot have an initializer." case 1049: // ts 3.2 "A 'set' accessor must have exactly one parameter." case 1070: // ts 3.2 "'{0}' modifier cannot appear on a type member." + case 1071: // ts 3.2 "'{0}' modifier cannot appear on an index signature." case 1090: // ts 3.2 "'{0}' modifier cannot appear on a parameter." case 1096: // ts 3.2 "An index signature must have exactly one parameter." case 1097: // ts 3.2 "'{0}' list cannot be empty." diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 8e6f00bd9917..eccd24ab0fef 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -468,15 +468,7 @@ tester.addFixturePatternConfig('typescript/errorRecovery', { * TODO: remove me in next babel > 7.2.3 */ 'interface-empty-extends', - 'class-extends-empty-implements', - /** - * TS1071 - */ - 'interface-index-signature-export', - 'interface-index-signature-private', - 'interface-index-signature-protected', - 'interface-index-signature-public', - 'interface-index-signature-static' + 'class-extends-empty-implements' ] }); @@ -484,10 +476,15 @@ tester.addFixturePatternConfig('typescript/types', { fileType: 'ts', ignore: [ /** - * AST difference + * Babel bug for range of Identifier in TSIndexSignature + * https://github.com/babel/babel/issues/9319 */ 'index-signature', 'index-signature-readonly', + 'index-signature-without-type', + /** + * AST difference + */ 'literal-number-negative' ] }); diff --git a/packages/typescript-estree/tests/fixtures/typescript/types/index-signature-without-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/types/index-signature-without-type.src.ts new file mode 100644 index 000000000000..1994449aef65 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/types/index-signature-without-type.src.ts @@ -0,0 +1,3 @@ +type foo = { + [a: string]; +} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 76bd622b63cd..0597717bf9dd 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -2212,15 +2212,50 @@ Object { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'export' modifier cannot appear on an index signature.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'private' modifier cannot appear on an index signature.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'protected' modifier cannot appear on an index signature.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'public' modifier cannot appear on an index signature.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts.src 1`] = ` +Object { + "column": 2, + "index": 18, + "lineNumber": 2, + "message": "'static' modifier cannot appear on an index signature.", +} +`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-export.src.ts.src 1`] = ` Object { @@ -2382,6 +2417,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/index-signature-readonly.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/index-signature-without-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 83d1f664ba29..fa037c8ebd7a 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -41474,39 +41474,34 @@ Object { }, }, Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 6, - }, - "start": Object { - "column": 5, - "line": 6, - }, + "loc": Object { + "end": Object { + "column": 26, + "line": 6, }, - "name": "eee", - "range": Array [ - 95, - 106, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 4, + "line": 6, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 16, "line": 6, }, "start": Object { - "column": 8, + "column": 5, "line": 6, }, }, + "name": "eee", "range": Array [ - 98, + 95, 106, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -41514,33 +41509,39 @@ Object { "line": 6, }, "start": Object { - "column": 10, + "column": 8, "line": 6, }, }, "range": Array [ - 100, + 98, 106, ], - "type": "TSNumberKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "TSNumberKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, + ], "range": Array [ 94, 116, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -41578,40 +41579,35 @@ Object { }, }, Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 7, - }, - "start": Object { - "column": 5, - "line": 7, - }, + "loc": Object { + "end": Object { + "column": 27, + "line": 7, }, - "name": "fff", - "optional": true, - "range": Array [ - 122, - 134, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 4, + "line": 7, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 17, "line": 7, }, "start": Object { - "column": 9, + "column": 5, "line": 7, }, }, + "name": "fff", + "optional": true, "range": Array [ - 126, + 122, 134, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -41619,33 +41615,39 @@ Object { "line": 7, }, "start": Object { - "column": 11, + "column": 9, "line": 7, }, }, "range": Array [ - 128, + 126, 134, ], - "type": "TSNumberKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 128, + 134, + ], + "type": "TSNumberKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, + ], "range": Array [ 121, 144, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -78401,39 +78403,34 @@ Object { }, "members": Array [ Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, }, - "name": "a", - "range": Array [ - 16, - 25, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 12, "line": 2, }, "start": Object { - "column": 4, + "column": 3, "line": 2, }, }, + "name": "a", "range": Array [ - 17, + 16, 25, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -78441,33 +78438,91 @@ Object { "line": 2, }, "start": Object { - "column": 6, + "column": 4, "line": 2, }, }, "range": Array [ - 19, + 17, 25, ], - "type": "TSStringKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "b", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 28, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSStringKeyword", + }, + }, }, - }, + ], "range": Array [ 15, 46, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -79017,39 +79072,34 @@ Object { "body": Array [ Object { "export": true, - "index": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 31, + "line": 2, }, - "name": "baz", - "range": Array [ - 26, - 37, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 21, "line": 2, }, "start": Object { - "column": 13, + "column": 10, "line": 2, }, }, + "name": "baz", "range": Array [ - 29, + 26, 37, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -79057,33 +79107,39 @@ Object { "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "range": Array [ - 31, + 29, 37, ], - "type": "TSStringKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, + ], "range": Array [ 18, 47, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -79436,39 +79492,34 @@ Object { "body": Array [ Object { "accessibility": "private", - "index": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, }, - "name": "baz", - "range": Array [ - 27, - 38, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 22, "line": 2, }, "start": Object { - "column": 14, + "column": 11, "line": 2, }, }, + "name": "baz", "range": Array [ - 30, + 27, 38, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -79476,33 +79527,39 @@ Object { "line": 2, }, "start": Object { - "column": 16, + "column": 14, "line": 2, }, }, "range": Array [ - 32, + 30, 38, ], - "type": "TSStringKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, + ], "range": Array [ 18, 48, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -79855,39 +79912,34 @@ Object { "body": Array [ Object { "accessibility": "protected", - "index": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 34, + "line": 2, }, - "name": "baz", - "range": Array [ - 29, - 40, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 24, "line": 2, }, "start": Object { - "column": 16, + "column": 13, "line": 2, }, }, + "name": "baz", "range": Array [ - 32, + 29, 40, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -79895,33 +79947,39 @@ Object { "line": 2, }, "start": Object { - "column": 18, + "column": 16, "line": 2, }, }, "range": Array [ - 34, + 32, 40, ], - "type": "TSStringKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 34, + 40, + ], + "type": "TSStringKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, + ], "range": Array [ 18, 50, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -80274,39 +80332,34 @@ Object { "body": Array [ Object { "accessibility": "public", - "index": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 31, + "line": 2, }, - "name": "baz", - "range": Array [ - 26, - 37, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 21, "line": 2, }, "start": Object { - "column": 13, + "column": 10, "line": 2, }, }, + "name": "baz", "range": Array [ - 29, + 26, 37, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -80314,33 +80367,39 @@ Object { "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "range": Array [ - 31, + 29, 37, ], - "type": "TSStringKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, + ], "range": Array [ 18, 47, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -80692,39 +80751,34 @@ Object { "body": Object { "body": Array [ Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 31, + "line": 2, }, - "name": "baz", - "range": Array [ - 26, - 37, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 21, "line": 2, }, "start": Object { - "column": 13, + "column": 10, "line": 2, }, }, + "name": "baz", "range": Array [ - 29, + 26, 37, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -80732,28 +80786,35 @@ Object { "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "range": Array [ - 31, + 29, 37, ], - "type": "TSStringKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "TSStringKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, + ], "range": Array [ 18, 47, @@ -98570,39 +98631,34 @@ Object { }, "members": Array [ Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 3, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, }, - "name": "a", - "range": Array [ - 16, - 25, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 12, "line": 2, }, "start": Object { - "column": 4, + "column": 3, "line": 2, }, }, + "name": "a", "range": Array [ - 17, + 16, 25, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -98610,33 +98666,39 @@ Object { "line": 2, }, "start": Object { - "column": 6, + "column": 4, "line": 2, }, }, "range": Array [ - 19, + 17, 25, ], - "type": "TSStringKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, + ], "range": Array [ 15, 35, ], - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -98987,39 +99049,34 @@ Object { }, "members": Array [ Object { - "index": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, }, - "name": "key", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - "typeAnnotation": Object { + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { "loc": Object { "end": Object { "column": 23, "line": 2, }, "start": Object { - "column": 15, + "column": 12, "line": 2, }, }, + "name": "key", "range": Array [ - 28, + 25, 36, ], - "type": "TSTypeAnnotation", + "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { @@ -99027,34 +99084,40 @@ Object { "line": 2, }, "start": Object { - "column": 17, + "column": 15, "line": 2, }, }, "range": Array [ - 30, + 28, 36, ], - "type": "TSNumberKeyword", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 30, + 36, + ], + "type": "TSNumberKeyword", + }, }, }, - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, + ], "range": Array [ 15, 46, ], "readonly": true, - "static": false, "type": "TSIndexSignature", "typeAnnotation": Object { "loc": Object { @@ -99373,6 +99436,355 @@ Object { } `; +exports[`typescript fixtures/types/index-signature-without-type.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "members": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "parameters": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 16, + 25, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 25, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 15, + 27, + ], + "type": "TSIndexSignature", + "typeAnnotation": null, + }, + ], + "range": Array [ + 11, + 29, + ], + "type": "TSTypeLiteral", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/types/indexed.src 1`] = ` Object { "body": Array [ From 70dcf655e867d666d3623871d6a0352357330c39 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 12 Jan 2019 15:33:24 +0100 Subject: [PATCH 80/84] test: add missing test cases for patterns (#119) --- .../tests/ast-alignment/fixtures-to-test.ts | 15 +- .../basics/and-operator-array-object.src.js | 4 + .../basics/or-operator-array-object.src.js | 4 + .../call-expression-with-array.src.js | 1 + .../call-expression-with-object.src.js | 1 + .../callExpression/mixed-expression.src.js | 5 + .../new-expression-with-array.src.js | 2 + .../new-expression-with-object.src.js | 2 + .../call-expression-destruction-array.src.js | 1 + .../call-expression-destruction-object.src.js | 1 + .../javascript/forIn/for-in-with-rest.src.js | 2 + .../javascript/forOf/for-of-with-rest.src.js | 2 + .../javascript/spread/complex-spread.src.js | 1 + .../basics/class-with-property-values.src.ts | 7 + .../lib/__snapshots__/javascript.ts.snap | 116030 ++++++++------- .../semantic-diagnostics-enabled.ts.snap | 26 + .../lib/__snapshots__/typescript.ts.snap | 1134 + 17 files changed, 63626 insertions(+), 53612 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/javascript/basics/and-operator-array-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/basics/or-operator-array-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/callExpression/mixed-expression.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-array.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-object.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-rest.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-rest.src.js create mode 100644 packages/typescript-estree/tests/fixtures/javascript/spread/complex-spread.src.js create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-property-values.src.ts diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index eccd24ab0fef..bfdda735377a 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -168,6 +168,8 @@ tester.addFixturePatternConfig('javascript/bigIntLiterals'); tester.addFixturePatternConfig('javascript/binaryLiterals'); tester.addFixturePatternConfig('javascript/blockBindings'); +tester.addFixturePatternConfig('javascript/callExpression'); + tester.addFixturePatternConfig('javascript/classes', { ignore: [ /** @@ -200,6 +202,7 @@ tester.addFixturePatternConfig('javascript/forIn', { * babel: ArrayExpression */ 'for-in-array', + 'for-in-with-rest', /** * Error: AST difference * ts-estree: AssignmentExpression @@ -226,7 +229,8 @@ tester.addFixturePatternConfig('javascript/forOf', { * ts-estree: ArrayPattern * babel: ArrayExpression */ - 'for-of-array' + 'for-of-array', + 'for-of-with-rest' ] }); tester.addFixturePatternConfig('javascript/generators'); @@ -275,7 +279,14 @@ tester.addFixturePatternConfig('javascript/regex'); tester.addFixturePatternConfig('javascript/regexUFlag'); tester.addFixturePatternConfig('javascript/regexYFlag'); tester.addFixturePatternConfig('javascript/restParams'); -tester.addFixturePatternConfig('javascript/spread'); +tester.addFixturePatternConfig('javascript/spread', { + ignore: [ + /** + * Error: AST difference + */ + 'complex-spread' + ] +}); tester.addFixturePatternConfig('javascript/unicodeCodePointEscapes'); /* ================================================== */ diff --git a/packages/typescript-estree/tests/fixtures/javascript/basics/and-operator-array-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/and-operator-array-object.src.js new file mode 100644 index 000000000000..44480a0136b8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/basics/and-operator-array-object.src.js @@ -0,0 +1,4 @@ +var v = {} && {} && [] && "" && ("" && {}); +var x = [] && [] && {} && "" && ("" && []); +var z = [] && []; +var y = {} && {}; diff --git a/packages/typescript-estree/tests/fixtures/javascript/basics/or-operator-array-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/basics/or-operator-array-object.src.js new file mode 100644 index 000000000000..0b78444d619b --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/basics/or-operator-array-object.src.js @@ -0,0 +1,4 @@ +var v = {} || {} || [] || "" || ("" || {}); +var x = [] || [] || {} || "" || ("" || []); +var z = [] || []; +var y = {} || {}; diff --git a/packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-array.src.js new file mode 100644 index 000000000000..48530445d523 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-array.src.js @@ -0,0 +1 @@ +foo([]); diff --git a/packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-object.src.js new file mode 100644 index 000000000000..5f81d97dab3c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/callExpression/call-expression-with-object.src.js @@ -0,0 +1 @@ +foo({}); diff --git a/packages/typescript-estree/tests/fixtures/javascript/callExpression/mixed-expression.src.js b/packages/typescript-estree/tests/fixtures/javascript/callExpression/mixed-expression.src.js new file mode 100644 index 000000000000..004c3ef0eba2 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/callExpression/mixed-expression.src.js @@ -0,0 +1,5 @@ +(function () { + (function () { + this.call({}, []) + })([]); +})({}); diff --git a/packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-array.src.js new file mode 100644 index 000000000000..350613c74e84 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-array.src.js @@ -0,0 +1,2 @@ +new bar([]); +new bar([[{}]]); diff --git a/packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-object.src.js new file mode 100644 index 000000000000..33f2efff852a --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/callExpression/new-expression-with-object.src.js @@ -0,0 +1,2 @@ +new bar({}); + diff --git a/packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-array.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-array.src.js new file mode 100644 index 000000000000..1e7c8bbadd58 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-array.src.js @@ -0,0 +1 @@ +foo(...[]); diff --git a/packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-object.src.js b/packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-object.src.js new file mode 100644 index 000000000000..216754d2af12 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/destructuring/call-expression-destruction-object.src.js @@ -0,0 +1 @@ +foo(...{}); diff --git a/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-rest.src.js b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-rest.src.js new file mode 100644 index 000000000000..cef90adfddb1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forIn/for-in-with-rest.src.js @@ -0,0 +1,2 @@ +for ({ x: xx, ...rrestOff } in array) { +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-rest.src.js b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-rest.src.js new file mode 100644 index 000000000000..157c7985bb08 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/forOf/for-of-with-rest.src.js @@ -0,0 +1,2 @@ +for ({ x: xx, ...rrestOff } of array) { +} diff --git a/packages/typescript-estree/tests/fixtures/javascript/spread/complex-spread.src.js b/packages/typescript-estree/tests/fixtures/javascript/spread/complex-spread.src.js new file mode 100644 index 000000000000..d4df1f990ecf --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/javascript/spread/complex-spread.src.js @@ -0,0 +1 @@ +({x: { ka, ...nested }, y: other, f: { a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 }, ...rest} = complex); diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-property-values.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-property-values.src.ts new file mode 100644 index 000000000000..047fabd6341e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-property-values.src.ts @@ -0,0 +1,7 @@ +class Foo { + a = 2; + b = {}; + c = []; + d = ""; + e = new Array([{}, [], 2]); +} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 41a6d29bac48..22aa5f78ee77 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -9674,235 +9674,251 @@ Object { } `; -exports[`javascript fixtures/basics/delete-expression.src 1`] = ` +exports[`javascript fixtures/basics/and-operator-array-object.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "argument": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "object": Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, - "name": "foo", + "name": "v", "range": Array [ - 7, - 10, + 4, + 5, ], "type": "Identifier", }, - "property": Object { + "init": Object { + "left": Object { + "left": Object { + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 8, + 10, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "&&", + "range": Array [ + 8, + 16, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 14, + 16, + ], + "type": "ObjectExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "&&", + "range": Array [ + 8, + 22, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "ArrayExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "&&", + "range": Array [ + 8, + 28, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "type": "LogicalExpression", + }, "loc": Object { "end": Object { - "column": 14, + "column": 42, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, - "name": "bar", + "operator": "&&", "range": Array [ - 11, - 14, + 8, + 42, ], - "type": "Identifier", + "right": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "operator": "&&", + "range": Array [ + 33, + 41, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 39, + 41, + ], + "type": "ObjectExpression", + }, + "type": "LogicalExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, "range": Array [ - 7, - 14, + 4, + 42, ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "delete", - "prefix": true, - "range": Array [ - 0, - 14, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 15, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "delete", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": ".", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "type": "VariableDeclarator", }, - }, - "range": Array [ - 14, - 15, ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/basics/do-while-statements.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "EmptyStatement", - }, + "kind": "var", "loc": Object { "end": Object { - "column": 13, + "column": 43, "line": 1, }, "start": Object { @@ -9912,28 +9928,9 @@ Object { }, "range": Array [ 0, - 13, + 43, ], - "test": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "DoWhileStatement", + "type": "VariableDeclaration", }, Object { "declarations": Array [ @@ -9942,241 +9939,477 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 2, }, "start": Object { "column": 4, - "line": 3, + "line": 2, }, }, - "name": "i", + "name": "x", "range": Array [ - 19, - 20, + 48, + 49, ], "type": "Identifier", }, "init": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 23, - 24, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 24, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 25, - ], - "type": "VariableDeclaration", - }, - Object { - "body": Object { - "body": Array [ - Object { - "expression": Object { + "left": Object { "left": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, + "left": Object { + "left": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 52, + 54, + ], + "type": "ArrayExpression", }, - "start": Object { - "column": 3, - "line": 5, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, }, - }, - "name": "i", + "operator": "&&", + "range": Array [ + 52, + 60, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 58, + 60, + ], + "type": "ArrayExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "operator": "&&", "range": Array [ - 34, - 35, + 52, + 66, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "properties": Array [], + "range": Array [ + 64, + 66, + ], + "type": "ObjectExpression", + }, + "type": "LogicalExpression", }, "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 28, + "line": 2, }, "start": Object { - "column": 3, - "line": 5, + "column": 8, + "line": 2, }, }, - "operator": "+=", + "operator": "&&", "range": Array [ - 34, - 40, + 52, + 72, ], "right": Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 28, + "line": 2, }, "start": Object { - "column": 8, - "line": 5, + "column": 26, + "line": 2, }, }, "range": Array [ - 39, - 40, + 70, + 72, ], - "raw": "1", + "raw": "\\"\\"", "type": "Literal", - "value": 1, + "value": "", }, - "type": "AssignmentExpression", + "type": "LogicalExpression", }, "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 42, + "line": 2, }, "start": Object { - "column": 3, - "line": 5, + "column": 8, + "line": 2, }, }, + "operator": "&&", "range": Array [ - 34, - 41, + 52, + 86, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 6, + "right": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 77, + 79, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "operator": "&&", + "range": Array [ + 77, + 85, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 39, + "line": 2, + }, + }, + "range": Array [ + 83, + 85, + ], + "type": "ArrayExpression", + }, + "type": "LogicalExpression", + }, + "type": "LogicalExpression", }, - "start": Object { - "column": 3, - "line": 4, + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "range": Array [ + 48, + 86, + ], + "type": "VariableDeclarator", }, - "range": Array [ - 29, - 43, - ], - "type": "BlockStatement", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 16, - "line": 6, + "column": 43, + "line": 2, }, "start": Object { "column": 0, - "line": 4, + "line": 2, }, }, "range": Array [ - 26, - 58, + 44, + 87, ], - "test": Object { - "left": Object { + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "z", + "range": Array [ + 92, + 93, + ], + "type": "Identifier", + }, + "init": Object { + "left": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 96, + 98, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "operator": "&&", + "range": Array [ + 96, + 104, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 102, + 104, + ], + "type": "ArrayExpression", + }, + "type": "LogicalExpression", + }, "loc": Object { "end": Object { - "column": 10, - "line": 6, + "column": 16, + "line": 3, }, "start": Object { - "column": 9, - "line": 6, + "column": 4, + "line": 3, }, }, - "name": "i", "range": Array [ - 51, - 52, + 92, + 104, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "loc": Object { - "end": Object { - "column": 14, - "line": 6, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 88, + 105, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "y", + "range": Array [ + 110, + 111, + ], + "type": "Identifier", }, - "start": Object { - "column": 9, - "line": 6, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "properties": Array [], + "range": Array [ + 114, + 116, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "operator": "&&", + "range": Array [ + 114, + 122, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "properties": Array [], + "range": Array [ + 120, + 122, + ], + "type": "ObjectExpression", + }, + "type": "LogicalExpression", }, - }, - "operator": "<", - "range": Array [ - 51, - 56, - ], - "right": Object { "loc": Object { "end": Object { - "column": 14, - "line": 6, + "column": 16, + "line": 4, }, "start": Object { - "column": 13, - "line": 6, + "column": 4, + "line": 4, }, }, "range": Array [ - 55, - 56, + 110, + 122, ], - "raw": "5", - "type": "Literal", - "value": 5, + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, }, - "type": "BinaryExpression", }, - "type": "DoWhileStatement", + "range": Array [ + 106, + 123, + ], + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 7, + "line": 5, }, "start": Object { "column": 0, @@ -10185,14 +10418,14 @@ Object { }, "range": Array [ 0, - 59, + 124, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, + "column": 3, "line": 1, }, "start": Object { @@ -10202,87 +10435,87 @@ Object { }, "range": Array [ 0, - 2, + 3, ], "type": "Keyword", - "value": "do", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { - "column": 2, + "column": 4, "line": 1, }, }, "range": Array [ - 2, - 3, + 4, + 5, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "v", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 9, + 6, + 7, ], - "type": "Keyword", - "value": "while", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 10, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 11, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { @@ -10292,182 +10525,200 @@ Object { }, "range": Array [ 11, - 12, + 13, ], "type": "Punctuator", - "value": ")", + "value": "&&", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, - 13, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 15, + "line": 1, }, }, "range": Array [ 15, - 18, + 16, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ + 17, 19, - 20, ], - "type": "Identifier", - "value": "i", + "type": "Punctuator", + "value": "&&", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 20, + "line": 1, }, }, "range": Array [ + 20, 21, - 22, ], "type": "Punctuator", - "value": "=", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 23, - 24, + 21, + 22, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 24, + 23, 25, ], "type": "Punctuator", - "value": ";", + "value": "&&", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ 26, 28, ], - "type": "Keyword", - "value": "do", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 4, + "column": 31, + "line": 1, }, "start": Object { - "column": 3, - "line": 4, + "column": 29, + "line": 1, }, }, "range": Array [ 29, - 30, + 31, ], "type": "Punctuator", - "value": "{", + "value": "&&", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 33, + "line": 1, }, "start": Object { - "column": 3, - "line": 5, + "column": 32, + "line": 1, }, }, "range": Array [ - 34, + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, 35, ], - "type": "Identifier", - "value": "i", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 38, + "line": 1, }, "start": Object { - "column": 5, - "line": 5, + "column": 36, + "line": 1, }, }, "range": Array [ @@ -10475,35 +10726,35 @@ Object { 38, ], "type": "Punctuator", - "value": "+=", + "value": "&&", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 40, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 39, + "line": 1, }, }, "range": Array [ 39, 40, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 41, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 40, + "line": 1, }, }, "range": Array [ @@ -10511,17 +10762,35 @@ Object { 41, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 42, + "line": 1, }, "start": Object { - "column": 0, - "line": 6, + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, }, }, "range": Array [ @@ -10529,35 +10798,53 @@ Object { 43, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 6, + "column": 3, + "line": 2, }, "start": Object { - "column": 2, - "line": 6, + "column": 0, + "line": 2, }, }, "range": Array [ 44, - 49, + 47, ], "type": "Keyword", - "value": "while", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 6, + "column": 5, + "line": 2, }, "start": Object { - "column": 8, - "line": 6, + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, }, }, "range": Array [ @@ -10565,35 +10852,35 @@ Object { 51, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 6, + "column": 9, + "line": 2, }, "start": Object { - "column": 9, - "line": 6, + "column": 8, + "line": 2, }, }, "range": Array [ - 51, 52, + 53, ], - "type": "Identifier", - "value": "i", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 10, + "line": 2, }, "start": Object { - "column": 11, - "line": 6, + "column": 9, + "line": 2, }, }, "range": Array [ @@ -10601,761 +10888,687 @@ Object { 54, ], "type": "Punctuator", - "value": "<", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 6, + "column": 13, + "line": 2, }, "start": Object { - "column": 13, - "line": 6, + "column": 11, + "line": 2, }, }, "range": Array [ 55, - 56, + 57, ], - "type": "Numeric", - "value": "5", + "type": "Punctuator", + "value": "&&", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 6, + "line": 2, }, "start": Object { "column": 14, - "line": 6, + "line": 2, }, }, "range": Array [ - 56, - 57, + 58, + 59, ], "type": "Punctuator", - "value": ")", + "value": "[", }, Object { "loc": Object { "end": Object { "column": 16, - "line": 6, + "line": 2, }, "start": Object { "column": 15, - "line": 6, + "line": 2, }, }, "range": Array [ - 57, - 58, + 59, + 60, ], "type": "Punctuator", - "value": ";", + "value": "]", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/basics/identifiers-double-underscore.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "__test", - "range": Array [ - 4, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 17, - ], - "raw": "'ff'", - "type": "Literal", - "value": "ff", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 0, - 18, + 61, + 63, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "&&", }, Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 32, - 36, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "__Foo", - "range": Array [ - 26, - 31, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 21, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 20, + "line": 2, }, }, "range": Array [ - 20, - 36, + 64, + 65, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "Punctuator", + "value": "{", }, Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 17, - "line": 7, - }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, }, - "range": Array [ - 55, - 59, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, + "start": Object { + "column": 21, + "line": 2, }, - "name": "__Bar", - "range": Array [ - 47, - 52, - ], - "type": "Identifier", }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "}", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 25, + "line": 2, }, "start": Object { - "column": 0, - "line": 7, + "column": 23, + "line": 2, }, }, - "params": Array [], "range": Array [ - 38, - 59, + 67, + 69, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 10, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "&&", }, - }, - "range": Array [ - 0, - 60, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 0, - 3, + 70, + 72, ], - "type": "Keyword", - "value": "var", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 31, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 29, + "line": 2, }, }, "range": Array [ - 4, - 10, + 73, + 75, ], - "type": "Identifier", - "value": "__test", + "type": "Punctuator", + "value": "&&", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 11, - 12, + 76, + 77, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 33, + "line": 2, }, }, "range": Array [ - 13, - 17, + 77, + 79, ], "type": "String", - "value": "'ff'", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 38, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 36, + "line": 2, }, }, "range": Array [ - 17, - 18, + 80, + 82, ], "type": "Punctuator", - "value": ";", + "value": "&&", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 40, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 39, + "line": 2, }, }, "range": Array [ - 20, - 25, + 83, + 84, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 41, + "line": 2, }, "start": Object { - "column": 6, + "column": 40, + "line": 2, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 41, + "line": 2, + }, + }, + "range": Array [ + 85, + 86, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 42, + "line": 2, + }, + }, + "range": Array [ + 86, + 87, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, "line": 3, }, }, "range": Array [ - 26, - 31, + 88, + 91, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 92, + 93, ], "type": "Identifier", - "value": "__Foo", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 7, "line": 3, }, "start": Object { - "column": 12, + "column": 6, "line": 3, }, }, "range": Array [ - 32, - 33, + 94, + 95, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 9, + "line": 3, }, "start": Object { - "column": 0, - "line": 5, + "column": 8, + "line": 3, }, }, "range": Array [ - 35, - 36, + 96, + 97, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 10, + "line": 3, }, "start": Object { - "column": 0, - "line": 7, + "column": 9, + "line": 3, }, }, "range": Array [ - 38, - 46, + 97, + 98, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, + "column": 13, + "line": 3, }, "start": Object { - "column": 9, - "line": 7, + "column": 11, + "line": 3, }, }, "range": Array [ - 47, - 52, + 99, + 101, ], - "type": "Identifier", - "value": "__Bar", + "type": "Punctuator", + "value": "&&", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 7, + "line": 3, }, "start": Object { "column": 14, - "line": 7, + "line": 3, }, }, "range": Array [ - 52, - 53, + 102, + 103, ], "type": "Punctuator", - "value": "(", + "value": "[", }, Object { "loc": Object { "end": Object { "column": 16, - "line": 7, + "line": 3, }, "start": Object { "column": 15, - "line": 7, + "line": 3, }, }, "range": Array [ - 53, - 54, + 103, + 104, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 7, + "column": 17, + "line": 3, }, "start": Object { - "column": 17, - "line": 7, + "column": 16, + "line": 3, }, }, "range": Array [ - 55, - 56, + 104, + 105, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 3, + "line": 4, }, "start": Object { "column": 0, - "line": 9, + "line": 4, }, }, "range": Array [ - 58, - 59, + 106, + 109, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "var", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/basics/instanceof.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 2, - ], - "raw": "''", - "type": "Literal", - "value": "", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "start": Object { + "column": 4, + "line": 4, }, - "operator": "instanceof", - "range": Array [ - 0, - 17, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "Set", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", + }, + "range": Array [ + 110, + 111, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, }, - "type": "BinaryExpression", }, + "range": Array [ + 112, + 113, + ], + "type": "Punctuator", + "value": "=", + }, + Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 9, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 4, }, }, "range": Array [ - 0, - 17, + 114, + 115, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": "{", }, - ], - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Punctuator", + "value": "}", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 117, + 119, + ], + "type": "Punctuator", + "value": "&&", }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 0, - 2, + 120, + 121, ], - "type": "String", - "value": "''", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 3, - "line": 1, + "column": 15, + "line": 4, }, }, "range": Array [ - 3, - 13, + 121, + 122, ], - "type": "Keyword", - "value": "instanceof", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 1, + "line": 4, }, "start": Object { - "column": 14, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 14, - 17, + 122, + 123, ], - "type": "Identifier", - "value": "Set", + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/basics/new-with-member-expression.src 1`] = ` +exports[`javascript fixtures/basics/delete-expression.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "arguments": Array [], - "callee": Object { + "argument": Object { "computed": false, "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "object": Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "name": "foo", "range": Array [ - 4, 7, + 10, ], "type": "Identifier", }, "property": Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "name": "bar", "range": Array [ - 8, 11, + 14, ], "type": "Identifier", }, "range": Array [ - 4, - 11, + 7, + 14, ], "type": "MemberExpression", }, "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { @@ -11363,15 +11576,17 @@ Object { "line": 1, }, }, + "operator": "delete", + "prefix": true, "range": Array [ 0, - 13, + 14, ], - "type": "NewExpression", + "type": "UnaryExpression", }, "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { @@ -11381,7 +11596,7 @@ Object { }, "range": Array [ 0, - 14, + 15, ], "type": "ExpressionStatement", }, @@ -11398,14 +11613,14 @@ Object { }, "range": Array [ 0, - 15, + 16, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { @@ -11415,25 +11630,25 @@ Object { }, "range": Array [ 0, - 3, + 6, ], "type": "Keyword", - "value": "new", + "value": "delete", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "range": Array [ - 4, 7, + 10, ], "type": "Identifier", "value": "foo", @@ -11441,17 +11656,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 10, "line": 1, }, }, "range": Array [ - 7, - 8, + 10, + 11, ], "type": "Punctuator", "value": ".", @@ -11459,17 +11674,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, 11, + 14, ], "type": "Identifier", "value": "bar", @@ -11477,53 +11692,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { "column": 14, "line": 1, }, - "start": Object { - "column": 13, - "line": 1, - }, }, "range": Array [ - 13, 14, + 15, ], "type": "Punctuator", "value": ";", @@ -11533,52 +11712,30 @@ Object { } `; -exports[`javascript fixtures/basics/new-without-parens.src 1`] = ` +exports[`javascript fixtures/basics/do-while-statements.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 16, + "column": 3, "line": 1, }, "start": Object { - "column": 14, + "column": 2, "line": 1, }, }, "range": Array [ - 14, - 16, + 2, + 3, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "type": "EmptyStatement", }, "loc": Object { "end": Object { - "column": 16, + "column": 13, "line": 1, }, "start": Object { @@ -11586,71 +11743,273 @@ Object { "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 16, + 13, ], - "type": "FunctionDeclaration", + "test": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "DoWhileStatement", }, Object { - "expression": Object { - "arguments": Array [], - "callee": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "i", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { "column": 4, - "line": 2, + "line": 3, }, }, - "name": "X", "range": Array [ - 21, - 22, + 19, + 24, ], - "type": "Identifier", + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, }, + }, + "range": Array [ + 15, + 25, + ], + "type": "VariableDeclaration", + }, + Object { + "body": Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "name": "i", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "operator": "+=", + "range": Array [ + 34, + 40, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 1, + "line": 6, }, "start": Object { - "column": 0, - "line": 2, + "column": 3, + "line": 4, }, }, "range": Array [ - 17, - 22, + 29, + 43, ], - "type": "NewExpression", + "type": "BlockStatement", }, "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 16, + "line": 6, }, "start": Object { "column": 0, - "line": 2, + "line": 4, }, }, "range": Array [ - 17, - 23, + 26, + 58, ], - "type": "ExpressionStatement", + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "name": "i", + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "operator": "<", + "range": Array [ + 51, + 56, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "BinaryExpression", + }, + "type": "DoWhileStatement", }, ], "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 0, + "line": 7, }, "start": Object { "column": 0, @@ -11659,14 +12018,14 @@ Object { }, "range": Array [ 0, - 23, + 59, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 2, "line": 1, }, "start": Object { @@ -11676,43 +12035,61 @@ Object { }, "range": Array [ 0, - 8, + 2, ], "type": "Keyword", - "value": "function", + "value": "do", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 3, "line": 1, }, "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { "column": 9, "line": 1, }, + "start": Object { + "column": 4, + "line": 1, + }, }, "range": Array [ + 4, 9, - 10, ], - "type": "Identifier", - "value": "X", + "type": "Keyword", + "value": "while", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 12, + 9, + 10, ], "type": "Punctuator", "value": "(", @@ -11720,278 +12097,450 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 1, }, "start": Object { - "column": 12, + "column": 10, "line": 1, }, }, "range": Array [ - 12, - 13, + 10, + 11, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 12, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, "range": Array [ - 14, - 15, + 11, + 12, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 13, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, "range": Array [ - 15, - 16, + 12, + 13, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 3, - "line": 2, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 3, }, }, "range": Array [ - 17, - 20, + 15, + 18, ], "type": "Keyword", - "value": "new", + "value": "var", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 2, + "line": 3, }, "start": Object { "column": 4, - "line": 2, + "line": 3, }, }, "range": Array [ - 21, - 22, + 19, + 20, ], "type": "Identifier", - "value": "X", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 5, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ + 21, 22, - 23, ], "type": "Punctuator", - "value": ";", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/basics/typeof-expression.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 12, - ], - "raw": "'str'", - "type": "Literal", - "value": "str", + "loc": Object { + "end": Object { + "column": 9, + "line": 3, }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "start": Object { + "column": 8, + "line": 3, }, - "operator": "typeof", - "prefix": true, - "range": Array [ - 0, - 12, - ], - "type": "UnaryExpression", }, + "range": Array [ + 23, + 24, + ], + "type": "Numeric", + "value": "0", + }, + Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 10, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 3, }, }, "range": Array [ - 0, - 12, + 24, + 25, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 2, + "line": 4, }, "start": Object { "column": 0, - "line": 1, + "line": 4, }, }, "range": Array [ - 0, - 6, + 26, + 28, ], "type": "Keyword", - "value": "typeof", + "value": "do", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 4, + "line": 4, }, "start": Object { - "column": 7, - "line": 1, + "column": 3, + "line": 4, }, }, "range": Array [ - 7, - 12, + 29, + 30, ], - "type": "String", - "value": "'str'", + "type": "Punctuator", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/basics/update-expression.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "i", + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "Punctuator", + "value": "+=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 44, + 49, + ], + "type": "Keyword", + "value": "while", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 13, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 15, + "line": 6, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/identifiers-double-underscore.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "__test", "range": Array [ 4, - 5, + 10, ], "type": "Identifier", }, "init": Object { "loc": Object { "end": Object { - "column": 9, + "column": 17, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, "range": Array [ - 8, - 9, + 13, + 17, ], - "raw": "0", + "raw": "'ff'", "type": "Literal", - "value": 0, + "value": "ff", }, "loc": Object { "end": Object { - "column": 9, + "column": 17, "line": 1, }, "start": Object { @@ -12001,7 +12550,7 @@ Object { }, "range": Array [ 4, - 9, + 17, ], "type": "VariableDeclarator", }, @@ -12009,7 +12558,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { @@ -12019,180 +12568,126 @@ Object { }, "range": Array [ 0, - 10, + 18, ], "type": "VariableDeclaration", }, Object { - "async": false, "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "i", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "operator": "++", - "prefix": false, - "range": Array [ - 28, - 31, - ], - "type": "UpdateExpression", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 28, - 32, - ], - "type": "ExpressionStatement", - }, - ], + "body": Array [], "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { - "column": 13, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 24, - 34, + 32, + 36, ], - "type": "BlockStatement", + "type": "ClassBody", }, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 6, + "line": 3, }, }, - "name": "f", + "name": "__Foo", "range": Array [ - 20, - 21, + 26, + 31, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, - "line": 2, + "line": 3, }, }, - "params": Array [], "range": Array [ - 11, - 34, + 20, + 36, ], - "type": "FunctionDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 7, }, - "name": "f", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", }, + "range": Array [ + 55, + 59, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 14, + "line": 7, }, "start": Object { - "column": 0, - "line": 5, + "column": 9, + "line": 7, }, }, + "name": "__Bar", "range": Array [ - 35, - 38, + 47, + 52, ], - "type": "CallExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 1, + "line": 9, }, "start": Object { "column": 0, - "line": 5, + "line": 7, }, }, + "params": Array [], "range": Array [ - 35, - 39, + 38, + 59, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 0, + "line": 10, }, "start": Object { "column": 0, @@ -12201,7 +12696,7 @@ Object { }, "range": Array [ 0, - 39, + 60, ], "sourceType": "script", "tokens": Array [ @@ -12226,7 +12721,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 10, "line": 1, }, "start": Object { @@ -12236,25 +12731,25 @@ Object { }, "range": Array [ 4, - 5, + 10, ], "type": "Identifier", - "value": "i", + "value": "__test", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 1, }, "start": Object { - "column": 6, + "column": 11, "line": 1, }, }, "range": Array [ - 6, - 7, + 11, + 12, ], "type": "Punctuator", "value": "=", @@ -12262,35 +12757,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 17, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, "range": Array [ - 8, - 9, + 13, + 17, ], - "type": "Numeric", - "value": "0", + "type": "String", + "value": "'ff'", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 9, + "column": 17, "line": 1, }, }, "range": Array [ - 9, - 10, + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -12298,269 +12793,215 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 5, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 3, }, }, "range": Array [ - 11, - 19, + 20, + 25, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ - 20, - 21, + 26, + 31, ], "type": "Identifier", - "value": "f", + "value": "__Foo", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 13, + "line": 3, }, "start": Object { - "column": 10, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 21, - 22, + 32, + 33, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 1, + "line": 5, }, "start": Object { - "column": 11, - "line": 2, - }, + "column": 0, + "line": 5, + }, }, "range": Array [ - 22, - 23, + 35, + 36, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 8, + "line": 7, }, "start": Object { - "column": 13, - "line": 2, + "column": 0, + "line": 7, }, }, "range": Array [ - 24, - 25, + 38, + 46, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 14, + "line": 7, }, "start": Object { - "column": 2, - "line": 3, + "column": 9, + "line": 7, }, }, "range": Array [ - 28, - 29, + 47, + 52, ], "type": "Identifier", - "value": "i", + "value": "__Bar", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 15, + "line": 7, }, "start": Object { - "column": 3, - "line": 3, + "column": 14, + "line": 7, }, }, "range": Array [ - 29, - 31, + 52, + 53, ], "type": "Punctuator", - "value": "++", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 16, + "line": 7, }, "start": Object { - "column": 5, - "line": 3, + "column": 15, + "line": 7, }, }, "range": Array [ - 31, - 32, + 53, + 54, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 18, + "line": 7, }, "start": Object { - "column": 0, - "line": 4, + "column": 17, + "line": 7, }, }, "range": Array [ - 33, - 34, + 55, + 56, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 5, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, + "line": 9, }, }, "range": Array [ - 38, - 39, + 58, + 59, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/basics/void-expression.src 1`] = ` +exports[`javascript fixtures/basics/instanceof.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "argument": Object { + "left": Object { "loc": Object { "end": Object { - "column": 6, + "column": 2, "line": 1, }, "start": Object { - "column": 5, + "column": 0, "line": 1, }, }, "range": Array [ - 5, - 6, + 0, + 2, ], - "raw": "4", + "raw": "''", "type": "Literal", - "value": 4, + "value": "", }, "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 1, }, "start": Object { @@ -12568,90 +13009,52 @@ Object { "line": 1, }, }, - "operator": "void", - "prefix": true, + "operator": "instanceof", "range": Array [ 0, - 6, + 17, ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 7, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "argument": Object { + "right": Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 14, + "line": 1, }, }, + "name": "Set", "range": Array [ - 13, 14, + 17, ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, + "type": "Identifier", }, - "operator": "void", - "prefix": true, - "range": Array [ - 8, - 15, - ], - "type": "UnaryExpression", + "type": "BinaryExpression", }, "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 8, - 16, + 0, + 17, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { "column": 0, @@ -12667,7 +13070,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 4, + "column": 2, "line": 1, }, "start": Object { @@ -12677,150 +13080,115 @@ Object { }, "range": Array [ 0, - 4, + 2, ], - "type": "Keyword", - "value": "void", + "type": "String", + "value": "''", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 13, "line": 1, }, "start": Object { - "column": 5, + "column": 3, "line": 1, }, }, "range": Array [ - 5, - 6, + 3, + 13, ], - "type": "Numeric", - "value": "4", + "type": "Keyword", + "value": "instanceof", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 17, "line": 1, }, "start": Object { - "column": 6, + "column": 14, "line": 1, }, }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 8, - 12, - ], - "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Numeric", - "value": "3", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, "range": Array [ 14, - 15, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 15, - 16, + 17, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "Set", }, ], "type": "Program", } `; -exports[`javascript fixtures/bigIntLiterals/binary.src 1`] = ` +exports[`javascript fixtures/basics/new-with-member-expression.src 1`] = ` Object { "body": Array [ Object { "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 4, + 11, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 4, + "column": 13, "line": 1, }, "start": Object { @@ -12830,15 +13198,13 @@ Object { }, "range": Array [ 0, - 4, + 13, ], - "raw": "0b1n", - "type": "BigIntLiteral", - "value": "0b1", + "type": "NewExpression", }, "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 1, }, "start": Object { @@ -12848,7 +13214,7 @@ Object { }, "range": Array [ 0, - 5, + 14, ], "type": "ExpressionStatement", }, @@ -12865,14 +13231,14 @@ Object { }, "range": Array [ 0, - 6, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 3, "line": 1, }, "start": Object { @@ -12882,15 +13248,15 @@ Object { }, "range": Array [ 0, - 4, + 3, ], - "type": "Identifier", - "value": "0b1n", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -12900,201 +13266,97 @@ Object { }, "range": Array [ 4, - 5, + 7, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "foo", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/bigIntLiterals/decimal.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 2, - ], - "raw": "1n", - "type": "BigIntLiteral", - "value": "1", - }, "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 3, + 7, + 8, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ".", }, - }, - "range": Array [ - 0, - 4, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, + "column": 11, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, "range": Array [ - 0, - 2, + 8, + 11, ], "type": "Identifier", - "value": "1n", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 12, "line": 1, }, "start": Object { - "column": 2, + "column": 11, "line": 1, }, }, "range": Array [ - 2, - 3, + 11, + 12, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/bigIntLiterals/hex.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 4, - ], - "raw": "0x1n", - "type": "BigIntLiteral", - "value": "0x1", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "value": "(", }, - }, - "range": Array [ - 0, - 6, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, - 4, + 12, + 13, ], - "type": "Identifier", - "value": "0x1n", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 13, "line": 1, }, }, "range": Array [ - 4, - 5, + 13, + 14, ], "type": "Punctuator", "value": ";", @@ -13104,66 +13366,52 @@ Object { } `; -exports[`javascript fixtures/bigIntLiterals/octal.src 1`] = ` +exports[`javascript fixtures/basics/new-without-parens.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 4, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, "range": Array [ - 0, - 4, + 14, + 16, ], - "raw": "0o1n", - "type": "BigIntLiteral", - "value": "0o1", + "type": "BlockStatement", }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, - "range": Array [ - 0, - 5, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "sourceType": "script", - "tokens": Array [ - Object { "loc": Object { "end": Object { - "column": 4, + "column": 16, "line": 1, }, "start": Object { @@ -13171,81 +13419,70 @@ Object { "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 4, - ], - "type": "Identifier", - "value": "0o1n", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, + 16, ], - "type": "Punctuator", - "value": ";", + "type": "FunctionDeclaration", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/binaryLiterals/lowercase.src 1`] = ` -Object { - "body": Array [ Object { "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "X", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 5, + 17, + 22, ], - "raw": "0b101", - "type": "Literal", - "value": 5, + "type": "NewExpression", }, "loc": Object { "end": Object { "column": 6, - "line": 1, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 6, + 17, + 23, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, + "column": 6, "line": 2, }, "start": Object { @@ -13255,14 +13492,14 @@ Object { }, "range": Array [ 0, - 7, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -13272,310 +13509,151 @@ Object { }, "range": Array [ 0, - 5, + 8, ], - "type": "Numeric", - "value": "0b101", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 6, + 9, + 10, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "X", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/binaryLiterals/uppercase.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "raw": "0B101", - "type": "Literal", - "value": 5, - }, "loc": Object { "end": Object { - "column": 6, + "column": 12, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 6, + 11, + 12, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "(", }, - }, - "range": Array [ - 0, - 7, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, - 5, + 12, + 13, ], - "type": "Numeric", - "value": "0B101", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 15, "line": 1, }, "start": Object { - "column": 5, + "column": 14, "line": 1, }, }, "range": Array [ - 5, - 6, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/blockBindings/const.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 15, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, "range": Array [ - 0, + 15, 16, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 5, + 17, + 20, ], "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": "=", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 12, - 15, + 21, + 22, ], "type": "Identifier", - "value": "bar", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 15, - 16, + 22, + 23, ], "type": "Punctuator", "value": ";", @@ -13585,7 +13663,7 @@ Object { } `; -exports[`javascript fixtures/blockBindings/let.src 1`] = ` +exports[`javascript fixtures/basics/or-operator-array-object.src 1`] = ` Object { "body": Array [ Object { @@ -13594,7 +13672,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -13602,34 +13680,216 @@ Object { "line": 1, }, }, - "name": "foo", + "name": "v", "range": Array [ 4, - 7, + 5, ], "type": "Identifier", }, "init": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 10, - 13, + "left": Object { + "left": Object { + "left": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 8, + 10, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "||", + "range": Array [ + 8, + 16, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 14, + 16, + ], + "type": "ObjectExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "||", + "range": Array [ + 8, + 22, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "ArrayExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "||", + "range": Array [ + 8, + 28, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "||", + "range": Array [ + 8, + 42, ], - "type": "Identifier", + "right": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "operator": "||", + "range": Array [ + 33, + 41, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 39, + 41, + ], + "type": "ObjectExpression", + }, + "type": "LogicalExpression", + }, + "type": "LogicalExpression", }, "loc": Object { "end": Object { - "column": 13, + "column": 42, "line": 1, }, "start": Object { @@ -13639,15 +13899,15 @@ Object { }, "range": Array [ 4, - 13, + 42, ], "type": "VariableDeclarator", }, ], - "kind": "let", + "kind": "var", "loc": Object { "end": Object { - "column": 14, + "column": 43, "line": 1, }, "start": Object { @@ -13657,297 +13917,488 @@ Object { }, "range": Array [ 0, - 14, + 43, ], "type": "VariableDeclaration", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "let", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/blockBindings/let-in-switchcase.src 1`] = ` -Object { - "body": Array [ Object { - "cases": Array [ + "declarations": Array [ Object { - "consequent": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 48, + 49, + ], + "type": "Identifier", + }, + "init": Object { + "left": Object { + "left": Object { + "left": Object { + "left": Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 8, + "line": 2, }, }, - "name": "t", "range": Array [ - 31, - 32, + 52, + 54, ], - "type": "Identifier", + "type": "ArrayExpression", }, - "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "operator": "||", + "range": Array [ + 52, + 60, + ], + "right": Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 35, - 37, + 58, + 60, ], - "raw": "42", - "type": "Literal", - "value": 42, + "type": "ArrayExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "operator": "||", + "range": Array [ + 52, + 66, + ], + "right": Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 20, + "line": 2, }, }, + "properties": Array [], "range": Array [ - 31, - 37, + 64, + 66, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "let", + "type": "LogicalExpression", + }, "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 8, + "line": 2, }, }, + "operator": "||", "range": Array [ - 27, - 38, + 52, + 72, ], - "type": "VariableDeclaration", + "right": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 70, + 72, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + "type": "LogicalExpression", }, - Object { - "label": null, + "loc": Object { + "end": Object { + "column": 42, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "operator": "||", + "range": Array [ + 52, + 86, + ], + "right": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 77, + 79, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 41, + "line": 2, }, "start": Object { - "column": 39, - "line": 1, + "column": 33, + "line": 2, }, }, + "operator": "||", "range": Array [ - 39, - 45, + 77, + 85, ], - "type": "BreakStatement", + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 41, + "line": 2, + }, + "start": Object { + "column": 39, + "line": 2, + }, + }, + "range": Array [ + 83, + 85, + ], + "type": "ArrayExpression", + }, + "type": "LogicalExpression", }, - ], + "type": "LogicalExpression", + }, "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 42, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 18, - 45, + 48, + 86, ], - "test": Object { - "loc": Object { + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 43, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 44, + 87, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 23, - "line": 1, + "column": 4, + "line": 3, }, }, + "name": "z", "range": Array [ - 23, - 25, + 92, + 93, ], - "raw": "42", - "type": "Literal", - "value": 42, + "type": "Identifier", }, - "type": "SwitchCase", + "init": Object { + "left": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 96, + 98, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "operator": "||", + "range": Array [ + 96, + 104, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 102, + 104, + ], + "type": "ArrayExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 92, + 104, + ], + "type": "VariableDeclarator", }, ], - "discriminant": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 88, + 105, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "y", + "range": Array [ + 110, + 111, + ], + "type": "Identifier", }, - "start": Object { - "column": 8, - "line": 1, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "properties": Array [], + "range": Array [ + 114, + 116, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "operator": "||", + "range": Array [ + 114, + 122, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "properties": Array [], + "range": Array [ + 120, + 122, + ], + "type": "ObjectExpression", + }, + "type": "LogicalExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, }, + "range": Array [ + 110, + 122, + ], + "type": "VariableDeclarator", }, - "name": "answer", - "range": Array [ - 8, - 14, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { "column": 0, - "line": 1, + "line": 4, }, }, "range": Array [ - 0, - 47, + 106, + 123, ], - "type": "SwitchStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -13956,14 +14407,14 @@ Object { }, "range": Array [ 0, - 48, + 124, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -13973,33 +14424,51 @@ Object { }, "range": Array [ 0, - 6, + 3, ], "type": "Keyword", - "value": "switch", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "v", + }, + Object { + "loc": Object { + "end": Object { "column": 7, "line": 1, }, + "start": Object { + "column": 6, + "line": 1, + }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 9, "line": 1, }, "start": Object { @@ -14009,10 +14478,46 @@ Object { }, "range": Array [ 8, - 14, + 9, ], - "type": "Identifier", - "value": "answer", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 13, + ], + "type": "Punctuator", + "value": "||", }, Object { "loc": Object { @@ -14030,151 +14535,169 @@ Object { 15, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, "range": Array [ + 15, 16, - 17, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 1, }, "start": Object { - "column": 18, + "column": 17, "line": 1, }, }, "range": Array [ - 18, - 22, + 17, + 19, ], - "type": "Keyword", - "value": "case", + "type": "Punctuator", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 21, "line": 1, }, "start": Object { - "column": 23, + "column": 20, "line": 1, }, }, "range": Array [ - 23, - 25, + 20, + 21, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 22, "line": 1, }, "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { "column": 25, "line": 1, }, + "start": Object { + "column": 23, + "line": 1, + }, }, "range": Array [ + 23, 25, - 26, ], "type": "Punctuator", - "value": ":", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 28, "line": 1, }, "start": Object { - "column": 27, + "column": 26, "line": 1, }, }, "range": Array [ - 27, - 30, + 26, + 28, ], - "type": "Keyword", - "value": "let", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 31, "line": 1, }, "start": Object { - "column": 31, + "column": 29, "line": 1, }, }, "range": Array [ + 29, 31, - 32, ], - "type": "Identifier", - "value": "t", + "type": "Punctuator", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 33, "line": 1, }, "start": Object { - "column": 33, + "column": 32, "line": 1, }, }, "range": Array [ + 32, 33, - 34, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 35, "line": 1, }, "start": Object { - "column": 35, + "column": 33, "line": 1, }, }, "range": Array [ + 33, 35, - 37, ], - "type": "Numeric", - "value": "42", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { @@ -14183,21 +14706,21 @@ Object { "line": 1, }, "start": Object { - "column": 37, + "column": 36, "line": 1, }, }, "range": Array [ - 37, + 36, 38, ], "type": "Punctuator", - "value": ";", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 40, "line": 1, }, "start": Object { @@ -14207,1066 +14730,745 @@ Object { }, "range": Array [ 39, - 44, + 40, ], - "type": "Keyword", - "value": "break", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 45, + "column": 41, "line": 1, }, "start": Object { - "column": 44, + "column": 40, "line": 1, }, }, "range": Array [ - 44, - 45, + 40, + 41, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 47, + "column": 42, "line": 1, }, "start": Object { - "column": 46, + "column": 41, "line": 1, }, }, "range": Array [ - 46, + 41, + 42, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 44, 47, ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 50, + 51, + ], "type": "Punctuator", - "value": "}", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/class-accessor-properties.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "get", - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 18, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 14, - 18, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "set", - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 29, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 29, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 24, - 29, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 31, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 0, - 31, + 52, + 53, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 31, - 32, + 53, + 54, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "]", }, - }, - "range": Array [ - 0, - 32, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 0, - 5, + 55, + 57, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 6, - 7, + 58, + 59, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 8, - 9, + 59, + 60, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 9, - 12, + 61, + 63, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 13, - 14, + 64, + 65, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 14, - 15, + 65, + 66, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 23, + "line": 2, }, }, "range": Array [ - 15, - 16, + 67, + 69, ], "type": "Punctuator", - "value": ")", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 16, - 17, + 70, + 72, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 31, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 29, + "line": 2, }, }, "range": Array [ - 17, - 18, + 73, + 75, ], "type": "Punctuator", - "value": "}", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 19, - 22, + 76, + 77, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 33, + "line": 2, }, }, "range": Array [ - 23, - 24, + 77, + 79, ], - "type": "Identifier", - "value": "b", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 38, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 36, + "line": 2, }, }, "range": Array [ - 24, - 25, + 80, + 82, ], "type": "Punctuator", - "value": "(", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 40, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 39, + "line": 2, }, }, "range": Array [ - 25, - 26, + 83, + 84, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 41, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 40, + "line": 2, }, }, "range": Array [ - 26, - 27, + 84, + 85, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 42, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 41, + "line": 2, }, }, "range": Array [ - 27, - 28, + 85, + 86, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 43, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 42, + "line": 2, }, }, "range": Array [ - 28, - 29, + 86, + 87, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 29, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 29, - 30, + 88, + 91, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 30, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 30, - 31, + 92, + 93, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 31, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 31, - 32, + 94, + 95, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/class-computed-static-method.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 23, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 23, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 19, - 23, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 25, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 25, - ], - "superClass": null, - "type": "ClassDeclaration", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 25, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 25, - 26, + 96, + 97, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "[", }, - }, - "range": Array [ - 0, - 26, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 10, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 9, + "line": 3, }, }, "range": Array [ - 0, - 5, + 97, + 98, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 6, - "line": 1, + "column": 11, + "line": 3, }, }, "range": Array [ - 6, - 7, + 99, + 101, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 8, - 9, + 102, + 103, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 15, + "line": 3, }, }, "range": Array [ - 9, - 15, + 103, + 104, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 1, + "line": 3, }, "start": Object { "column": 16, - "line": 1, + "line": 3, }, }, "range": Array [ - 16, - 17, + 104, + 105, ], "type": "Punctuator", - "value": "[", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 17, - 18, + 106, + 109, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 18, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 18, - 19, + 110, + 111, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 7, + "line": 4, }, "start": Object { - "column": 19, - "line": 1, + "column": 6, + "line": 4, }, }, "range": Array [ - 19, - 20, + 112, + 113, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 9, + "line": 4, }, "start": Object { - "column": 20, - "line": 1, + "column": 8, + "line": 4, }, }, "range": Array [ - 20, - 21, + 114, + 115, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 10, + "line": 4, }, "start": Object { - "column": 21, - "line": 1, + "column": 9, + "line": 4, }, }, "range": Array [ - 21, - 22, + 115, + 116, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 13, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 4, }, }, "range": Array [ - 22, - 23, + 117, + 119, ], "type": "Punctuator", - "value": "}", + "value": "||", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 23, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 23, - 24, + 120, + 121, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 4, }, }, "range": Array [ - 24, - 25, + 121, + 122, ], "type": "Punctuator", "value": "}", @@ -15274,17 +15476,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 25, - 26, + 122, + 123, ], "type": "Punctuator", "value": ";", @@ -15294,16 +15496,15 @@ Object { } `; -exports[`javascript fixtures/classes/class-expression.src 1`] = ` +exports[`javascript fixtures/basics/typeof-expression.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "body": Object { - "body": Array [], + "argument": Object { "loc": Object { "end": Object { - "column": 9, + "column": 12, "line": 1, }, "start": Object { @@ -15313,31 +15514,33 @@ Object { }, "range": Array [ 7, - 9, + 12, ], - "type": "ClassBody", + "raw": "'str'", + "type": "Literal", + "value": "str", }, - "id": null, "loc": Object { "end": Object { - "column": 9, + "column": 12, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, + "operator": "typeof", + "prefix": true, "range": Array [ - 1, - 9, + 0, + 12, ], - "superClass": null, - "type": "ClassExpression", + "type": "UnaryExpression", }, "loc": Object { "end": Object { - "column": 11, + "column": 12, "line": 1, }, "start": Object { @@ -15347,15 +15550,15 @@ Object { }, "range": Array [ 0, - 11, + 12, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -15364,14 +15567,14 @@ Object { }, "range": Array [ 0, - 11, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 6, "line": 1, }, "start": Object { @@ -15381,264 +15584,281 @@ Object { }, "range": Array [ 0, - 1, + 6, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "typeof", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 12, "line": 1, }, "start": Object { - "column": 1, + "column": 7, "line": 1, }, }, "range": Array [ - 1, - 6, + 7, + 12, ], - "type": "Keyword", - "value": "class", + "type": "String", + "value": "'str'", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/basics/update-expression.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 0, "line": 1, }, }, "range": Array [ - 7, - 8, + 0, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "VariableDeclaration", }, Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/class-method-named-prototype.src 1`] = ` -Object { - "body": Array [ - Object { + "async": false, "body": Object { "body": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "prototype", - "range": Array [ - 9, - 18, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 22, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "expression": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 20, - "line": 1, + "column": 2, + "line": 3, }, }, + "name": "i", "range": Array [ - 20, - 22, + 28, + 29, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 2, + "line": 3, }, }, - "params": Array [], + "operator": "++", + "prefix": false, "range": Array [ - 18, - 22, + 28, + 31, ], - "type": "FunctionExpression", + "type": "UpdateExpression", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, }, + "range": Array [ + 28, + 32, + ], + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 8, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 8, - 23, + 24, + 34, ], - "type": "ClassBody", + "type": "BlockStatement", }, + "expression": false, + "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 9, + "line": 2, }, }, - "name": "A", + "name": "f", "range": Array [ - 6, - 7, + 20, + 21, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, + "params": Array [], "range": Array [ - 0, - 23, + 11, + 34, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "name": "f", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 35, + 38, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 4, + "line": 5, }, "start": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 23, - 24, + 35, + 39, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 4, + "line": 5, }, "start": Object { "column": 0, @@ -15647,14 +15867,14 @@ Object { }, "range": Array [ 0, - 24, + 39, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -15664,128 +15884,128 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 5, ], "type": "Identifier", - "value": "A", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { - "column": 8, + "column": 6, "line": 1, }, }, "range": Array [ - 8, - 9, + 6, + 7, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 18, ], - "type": "Identifier", - "value": "prototype", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 10, "line": 1, }, "start": Object { - "column": 18, + "column": 9, "line": 1, }, }, "range": Array [ - 18, - 19, + 9, + 10, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ + 11, 19, - 20, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ 20, 21, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ @@ -15793,17 +16013,17 @@ Object { 22, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ @@ -15811,395 +16031,166 @@ Object { 23, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 23, 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/class-method-named-static.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "static", - "range": Array [ - 9, - 15, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 19, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 19, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 15, - 19, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 21, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 0, - 21, + 28, + 29, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "Identifier", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 3, + "line": 3, }, }, "range": Array [ - 21, - 22, + 29, + 31, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "++", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "A", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 15, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + "line": 3, }, "start": Object { - "column": 16, - "line": 1, + "column": 5, + "line": 3, }, }, "range": Array [ - 16, - 17, + 31, + 32, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 17, - 18, + 33, + 34, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 18, - 19, + 35, + 36, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 2, + "line": 5, }, "start": Object { - "column": 19, - "line": 1, + "column": 1, + "line": 5, }, }, "range": Array [ - 19, - 20, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 20, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 20, - 21, + 37, + 38, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 5, }, "start": Object { - "column": 21, - "line": 1, + "column": 3, + "line": 5, }, }, "range": Array [ - 21, - 22, + 38, + 39, ], "type": "Punctuator", "value": ";", @@ -16209,147 +16200,124 @@ Object { } `; -exports[`javascript fixtures/classes/class-method-named-with-space.src 1`] = ` +exports[`javascript fixtures/basics/void-expression.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "withSpace", - "range": Array [ - 9, - 18, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, - "range": Array [ - 9, - 24, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 24, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 19, - 24, - ], - "type": "FunctionExpression", + "start": Object { + "column": 5, + "line": 1, }, }, - ], + "range": Array [ + 5, + 6, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, "loc": Object { "end": Object { - "column": 25, + "column": 6, "line": 1, }, "start": Object { - "column": 8, + "column": 0, "line": 1, }, }, + "operator": "void", + "prefix": true, "range": Array [ - 8, - 25, + 0, + 6, ], - "type": "ClassBody", + "type": "UnaryExpression", }, - "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, "loc": Object { "end": Object { "column": 7, - "line": 1, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 0, + "line": 2, }, }, - "name": "A", + "operator": "void", + "prefix": true, "range": Array [ - 6, - 7, + 8, + 15, ], - "type": "Identifier", + "type": "UnaryExpression", }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 25, + 8, + 16, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -16358,14 +16326,14 @@ Object { }, "range": Array [ 0, - 26, + 17, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { @@ -16375,79 +16343,79 @@ Object { }, "range": Array [ 0, - 5, + 4, ], "type": "Keyword", - "value": "class", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ + 5, 6, - 7, ], - "type": "Identifier", - "value": "A", + "type": "Numeric", + "value": "4", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { - "column": 8, + "column": 6, "line": 1, }, }, "range": Array [ - 8, - 9, + 6, + 7, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 4, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 9, - 18, + 8, + 12, ], - "type": "Identifier", - "value": "withSpace", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 20, + 12, + 13, ], "type": "Punctuator", "value": "(", @@ -16455,203 +16423,186 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 20, - 21, + 13, + 14, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 22, - 23, + 14, + 15, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 23, - 24, + 15, + 16, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/bigIntLiterals/binary.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0b1n", + "type": "BigIntLiteral", + "value": "0b1", + }, "loc": Object { "end": Object { - "column": 25, + "column": 5, "line": 1, }, "start": Object { - "column": 24, + "column": 0, "line": 1, }, }, "range": Array [ - 24, - 25, + 0, + 5, ], - "type": "Punctuator", - "value": "}", + "type": "ExpressionStatement", }, ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/class-one-method.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 17, - 19, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 15, - 19, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "range": Array [ - 8, - 21, - ], - "type": "ClassBody", }, - "id": Object { + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "0b1n", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/bigIntLiterals/decimal.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 7, + "column": 2, "line": 1, }, "start": Object { - "column": 6, + "column": 0, "line": 1, }, }, - "name": "A", "range": Array [ - 6, - 7, + 0, + 2, ], - "type": "Identifier", + "raw": "1n", + "type": "BigIntLiteral", + "value": "1", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 3, + "line": 1, }, "start": Object { "column": 0, @@ -16660,33 +16611,15 @@ Object { }, "range": Array [ 0, - 21, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "start": Object { - "column": 1, - "line": 3, - }, - }, - "range": Array [ - 21, - 22, + 3, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -16695,14 +16628,14 @@ Object { }, "range": Array [ 0, - 22, + 4, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, "line": 1, }, "start": Object { @@ -16712,169 +16645,318 @@ Object { }, "range": Array [ 0, - 5, + 2, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "1n", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { - "column": 6, + "column": 2, "line": 1, }, }, "range": Array [ - 6, - 7, + 2, + 3, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/bigIntLiterals/hex.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0x1n", + "type": "BigIntLiteral", + "value": "0x1", + }, "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { - "column": 8, + "column": 0, "line": 1, }, }, "range": Array [ - 8, - 9, + 0, + 5, ], - "type": "Punctuator", - "value": "{", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 4, ], "type": "Identifier", - "value": "a", + "value": "0x1n", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 4, + "line": 1, }, }, "range": Array [ - 15, - 16, + 4, + 5, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/bigIntLiterals/octal.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "raw": "0o1n", + "type": "BigIntLiteral", + "value": "0o1", + }, "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 16, - 17, + 0, + 5, ], - "type": "Punctuator", - "value": ")", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 4, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 17, - 18, + 0, + 4, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "0o1n", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 4, + "line": 1, }, }, "range": Array [ - 18, - 19, + 4, + 5, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/binaryLiterals/invalid.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/binaryLiterals/lowercase.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0b101", + "type": "Literal", + "value": 5, + }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 6, + "line": 1, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 20, - 21, + 0, + 6, ], - "type": "Punctuator", - "value": "}", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Numeric", + "value": "0b101", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 6, + "line": 1, }, "start": Object { - "column": 1, - "line": 3, + "column": 5, + "line": 1, }, }, "range": Array [ - 21, - 22, + 5, + 6, ], "type": "Punctuator", "value": ";", @@ -16884,182 +16966,33 @@ Object { } `; -exports[`javascript fixtures/classes/class-one-method-super.src 1`] = ` +exports[`javascript fixtures/binaryLiterals/uppercase.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 41, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 27, - 32, - ], - "type": "Super", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 27, - 34, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 27, - 35, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 17, - 41, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 15, - 41, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 43, - ], - "type": "ClassBody", - }, - "id": Object { + "expression": Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 0, "line": 1, }, }, - "name": "A", "range": Array [ - 6, - 7, + 0, + 5, ], - "type": "Identifier", + "raw": "0B101", + "type": "Literal", + "value": 5, }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 6, + "line": 1, }, "start": Object { "column": 0, @@ -17068,33 +17001,15 @@ Object { }, "range": Array [ 0, - 43, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "range": Array [ - 43, - 44, + 6, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -17103,7 +17018,7 @@ Object { }, "range": Array [ 0, - 45, + 7, ], "sourceType": "script", "tokens": Array [ @@ -17122,239 +17037,399 @@ Object { 0, 5, ], - "type": "Keyword", - "value": "class", + "type": "Numeric", + "value": "0B101", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ + 5, 6, - 7, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/blockBindings/const.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 0, "line": 1, }, }, "range": Array [ - 8, - 9, + 0, + 16, ], - "type": "Punctuator", - "value": "{", + "type": "VariableDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 5, - "line": 2, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 14, - 15, + 0, + 5, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 15, - 16, + 6, + 9, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 16, - 17, + 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 17, - 18, + 12, + 15, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 15, + "line": 1, }, }, "range": Array [ - 27, - 32, + 15, + 16, ], - "type": "Keyword", - "value": "super", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/blockBindings/let.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { "column": 14, - "line": 3, + "line": 1, }, "start": Object { - "column": 13, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 32, - 33, + 0, + 14, ], - "type": "Punctuator", - "value": "(", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 3, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 33, - 34, + 0, + 3, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 7, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 4, + "line": 1, }, }, "range": Array [ - 34, - 35, + 4, + 7, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 9, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 8, + "line": 1, }, }, "range": Array [ - 40, - 41, + 8, + 9, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 13, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 42, - 43, + 10, + 13, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 14, + "line": 1, }, "start": Object { - "column": 1, - "line": 5, - }, + "column": 13, + "line": 1, + }, }, "range": Array [ - 43, - 44, + 13, + 14, ], "type": "Punctuator", "value": ";", @@ -17364,128 +17439,163 @@ Object { } `; -exports[`javascript fixtures/classes/class-static-method.src 1`] = ` +exports[`javascript fixtures/blockBindings/let-in-switchcase.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "t", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 37, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 17, + "column": 38, "line": 1, }, "start": Object { - "column": 16, + "column": 27, "line": 1, }, }, - "name": "a", "range": Array [ - 16, - 17, + 27, + 38, ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "type": "VariableDeclaration", }, - "range": Array [ - 9, - 21, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 21, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + Object { + "label": null, "loc": Object { "end": Object { - "column": 21, + "column": 45, "line": 1, }, "start": Object { - "column": 17, + "column": 39, "line": 1, }, }, - "params": Array [], "range": Array [ - 17, - 21, + 39, + 45, ], - "type": "FunctionExpression", + "type": "BreakStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, }, }, - ], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, + "range": Array [ + 18, + 45, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "42", + "type": "Literal", + "value": 42, }, + "type": "SwitchCase", }, - "range": Array [ - 8, - 23, - ], - "type": "ClassBody", - }, - "id": Object { + ], + "discriminant": Object { "loc": Object { "end": Object { - "column": 7, + "column": 14, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, - "name": "A", + "name": "answer", "range": Array [ - 6, - 7, + 8, + 14, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 23, + "column": 47, "line": 1, }, "start": Object { @@ -17495,33 +17605,15 @@ Object { }, "range": Array [ 0, - 23, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, + 47, ], - "type": "EmptyStatement", + "type": "SwitchStatement", }, ], "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -17530,14 +17622,14 @@ Object { }, "range": Array [ 0, - 24, + 48, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { @@ -17547,33 +17639,33 @@ Object { }, "range": Array [ 0, - 5, + 6, ], "type": "Keyword", - "value": "class", + "value": "switch", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 8, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 1, }, "start": Object { @@ -17583,10 +17675,10 @@ Object { }, "range": Array [ 8, - 9, + 14, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "answer", }, Object { "loc": Object { @@ -17595,16 +17687,16 @@ Object { "line": 1, }, "start": Object { - "column": 9, + "column": 14, "line": 1, }, }, "range": Array [ - 9, + 14, 15, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -17621,95 +17713,149 @@ Object { 16, 17, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 22, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "case", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 25, "line": 1, }, "start": Object { - "column": 18, + "column": 23, "line": 1, }, }, "range": Array [ - 18, - 19, + 23, + 25, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 26, "line": 1, }, "start": Object { - "column": 19, + "column": 25, "line": 1, }, }, "range": Array [ - 19, - 20, + 25, + 26, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 30, "line": 1, }, "start": Object { - "column": 20, + "column": 27, "line": 1, }, }, "range": Array [ - 20, - 21, + 27, + 30, + ], + "type": "Keyword", + "value": "let", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + "value": "t", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 37, "line": 1, }, "start": Object { - "column": 21, + "column": 35, "line": 1, }, }, "range": Array [ - 21, - 22, + 35, + 37, + ], + "type": "Numeric", + "value": "42", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, ], "type": "Punctuator", "value": ";", @@ -17717,167 +17863,124 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 44, "line": 1, }, "start": Object { - "column": 22, + "column": 39, "line": 1, }, }, "range": Array [ - 22, - 23, + 39, + 44, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "break", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 45, "line": 1, }, "start": Object { - "column": 23, + "column": 44, "line": 1, }, }, "range": Array [ - 23, - 24, + 44, + 45, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`javascript fixtures/classes/class-static-method-named-prototype.src 1`] = ` +exports[`javascript fixtures/callExpression/call-expression-with-array.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ + "expression": Object { + "arguments": Array [ Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 28, - ], - "raw": "\\"prototype\\"", - "type": "Literal", - "value": "prototype", - }, - "kind": "method", + "elements": Array [], "loc": Object { "end": Object { - "column": 33, + "column": 6, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, "range": Array [ - 9, - 33, + 4, + 6, ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 33, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 29, - 33, - ], - "type": "FunctionExpression", - }, + "type": "ArrayExpression", }, ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 34, + "column": 7, "line": 1, }, "start": Object { - "column": 8, + "column": 0, "line": 1, }, }, "range": Array [ - 8, - 34, + 0, + 7, ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", + "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 34, + "column": 8, "line": 1, }, "start": Object { @@ -17887,33 +17990,15 @@ Object { }, "range": Array [ 0, - 34, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 35, + 8, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -17922,14 +18007,14 @@ Object { }, "range": Array [ 0, - 35, + 9, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -17939,79 +18024,43 @@ Object { }, "range": Array [ 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, + 3, ], "type": "Identifier", - "value": "A", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 4, "line": 1, }, "start": Object { - "column": 8, + "column": 3, "line": 1, }, }, "range": Array [ - 8, - 9, + 3, + 4, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 15, - ], - "type": "Keyword", - "value": "static", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 5, "line": 1, }, "start": Object { - "column": 16, + "column": 4, "line": 1, }, }, "range": Array [ - 16, - 17, + 4, + 5, ], "type": "Punctuator", "value": "[", @@ -18019,35 +18068,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 28, - ], - "type": "String", - "value": "\\"prototype\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, + "column": 6, "line": 1, }, "start": Object { - "column": 28, + "column": 5, "line": 1, }, }, "range": Array [ - 28, - 29, + 5, + 6, ], "type": "Punctuator", "value": "]", @@ -18055,35 +18086,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, + "column": 7, "line": 1, }, "start": Object { - "column": 30, + "column": 6, "line": 1, }, }, "range": Array [ - 30, - 31, + 6, + 7, ], "type": "Punctuator", "value": ")", @@ -18091,71 +18104,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, + "column": 8, "line": 1, }, "start": Object { - "column": 34, + "column": 7, "line": 1, }, }, "range": Array [ - 34, - 35, + 7, + 8, ], "type": "Punctuator", "value": ";", @@ -18165,128 +18124,68 @@ Object { } `; -exports[`javascript fixtures/classes/class-static-method-named-static.src 1`] = ` +exports[`javascript fixtures/callExpression/call-expression-with-object.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ + "expression": Object { + "arguments": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "static", - "range": Array [ - 16, - 22, - ], - "type": "Identifier", - }, - "kind": "method", "loc": Object { "end": Object { - "column": 26, + "column": 6, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, + "properties": Array [], "range": Array [ - 9, - 26, + 4, + 6, ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 22, - 26, - ], - "type": "FunctionExpression", - }, + "type": "ObjectExpression", }, ], - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", }, - "range": Array [ - 8, - 28, - ], - "type": "ClassBody", - }, - "id": Object { "loc": Object { "end": Object { "column": 7, "line": 1, }, "start": Object { - "column": 6, + "column": 0, "line": 1, }, }, - "name": "A", "range": Array [ - 6, + 0, 7, ], - "type": "Identifier", + "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 28, + "column": 8, "line": 1, }, "start": Object { @@ -18296,33 +18195,15 @@ Object { }, "range": Array [ 0, - 28, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 29, + 8, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -18331,14 +18212,14 @@ Object { }, "range": Array [ 0, - 29, + 9, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -18348,97 +18229,25 @@ Object { }, "range": Array [ 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, + 3, ], "type": "Identifier", - "value": "A", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 15, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 22, - ], - "type": "Keyword", - "value": "static", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 4, "line": 1, }, "start": Object { - "column": 22, + "column": 3, "line": 1, }, }, "range": Array [ - 22, - 23, + 3, + 4, ], "type": "Punctuator", "value": "(", @@ -18446,35 +18255,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, + "column": 5, "line": 1, }, "start": Object { - "column": 24, + "column": 4, "line": 1, }, }, "range": Array [ - 24, - 25, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -18482,17 +18273,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, + "column": 6, "line": 1, }, "start": Object { - "column": 25, + "column": 5, "line": 1, }, }, "range": Array [ - 25, - 26, + 5, + 6, ], "type": "Punctuator", "value": "}", @@ -18500,360 +18291,350 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 7, "line": 1, }, "start": Object { - "column": 26, + "column": 6, "line": 1, }, }, "range": Array [ - 26, - 27, + 6, + 7, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 8, "line": 1, }, "start": Object { - "column": 27, + "column": 7, "line": 1, }, }, "range": Array [ - 27, - 28, + 7, + 8, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": ";", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` +exports[`javascript fixtures/callExpression/mixed-expression.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ + "expression": Object { + "arguments": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "method", "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 5, }, "start": Object { - "column": 9, - "line": 1, + "column": 3, + "line": 5, }, }, + "properties": Array [], "range": Array [ - 9, - 21, + 67, + 69, ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 21, - "line": 1, + "type": "ObjectExpression", + }, + ], + "callee": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 59, + 61, + ], + "type": "ArrayExpression", + }, + ], + "callee": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 46, + 48, + ], + "type": "ObjectExpression", + }, + Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 50, + 52, + ], + "type": "ArrayExpression", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 40, + ], + "type": "ThisExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "call", + "range": Array [ + 41, + 45, + ], + "type": "Identifier", + }, + "range": Array [ + 36, + 45, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 53, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 53, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 30, + 57, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 18, + 57, + ], + "type": "FunctionExpression", }, - "start": Object { - "column": 19, - "line": 1, + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 2, + }, }, + "range": Array [ + 17, + 62, + ], + "type": "CallExpression", }, - "range": Array [ - 19, - 21, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 17, - 21, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "kind": "get", - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 38, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 9, + "line": 4, }, "start": Object { - "column": 36, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 36, - 38, + 17, + 63, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 34, - 38, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 51, - "line": 1, - }, - "start": Object { - "column": 50, - "line": 1, - }, + "type": "ExpressionStatement", }, - "name": "a", - "range": Array [ - 50, - 51, - ], - "type": "Identifier", - }, - "kind": "set", + ], "loc": Object { "end": Object { - "column": 56, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 39, + "column": 13, "line": 1, }, }, "range": Array [ - 39, - 56, + 13, + 65, ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 54, - "line": 1, - }, - }, - "range": Array [ - 54, - 56, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 51, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 1, - }, - "start": Object { - "column": 52, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 52, - 53, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 51, - 56, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 58, - "line": 1, + "type": "BlockStatement", }, - "start": Object { - "column": 8, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 1, + }, }, + "params": Array [], + "range": Array [ + 1, + 65, + ], + "type": "FunctionExpression", }, - "range": Array [ - 8, - 58, - ], - "type": "ClassBody", - }, - "id": Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 6, + "line": 5, }, "start": Object { - "column": 6, + "column": 0, "line": 1, }, }, - "name": "A", "range": Array [ - 6, - 7, + 0, + 70, ], - "type": "Identifier", + "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 58, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { "column": 0, @@ -18862,33 +18643,15 @@ Object { }, "range": Array [ 0, - 58, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 59, - "line": 1, - }, - "start": Object { - "column": 58, - "line": 1, - }, - }, - "range": Array [ - 58, - 59, + 71, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 59, - "line": 1, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -18897,14 +18660,14 @@ Object { }, "range": Array [ 0, - 59, + 72, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -18914,92 +18677,92 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, "range": Array [ - 6, - 7, + 1, + 9, ], - "type": "Identifier", - "value": "A", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, "range": Array [ - 9, - 15, + 11, + 12, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 1, }, "start": Object { - "column": 16, + "column": 13, "line": 1, }, }, "range": Array [ - 16, - 17, + 13, + 14, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ @@ -19012,125 +18775,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 3, + "line": 2, }, }, "range": Array [ 18, - 19, + 26, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 19, - 20, + 28, + 29, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 20, - 21, + 30, + 31, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 8, + "line": 3, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 22, - 28, + 36, + 40, ], "type": "Keyword", - "value": "static", + "value": "this", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 29, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 29, - 32, + 40, + 41, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 33, - "line": 1, + "column": 9, + "line": 3, }, }, "range": Array [ - 33, - 34, + 41, + 45, ], "type": "Identifier", - "value": "a", + "value": "call", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 14, + "line": 3, }, "start": Object { - "column": 34, - "line": 1, + "column": 13, + "line": 3, }, }, "range": Array [ - 34, - 35, + 45, + 46, ], "type": "Punctuator", "value": "(", @@ -19138,125 +18919,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 35, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 35, - 36, + 46, + 47, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 36, - "line": 1, + "column": 15, + "line": 3, }, }, "range": Array [ - 36, - 37, + 47, + 48, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 17, + "line": 3, }, "start": Object { - "column": 37, - "line": 1, + "column": 16, + "line": 3, }, }, "range": Array [ - 37, - 38, + 48, + 49, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 19, + "line": 3, }, "start": Object { - "column": 39, - "line": 1, + "column": 18, + "line": 3, }, }, "range": Array [ - 39, - 45, + 50, + 51, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 1, + "column": 20, + "line": 3, }, "start": Object { - "column": 46, - "line": 1, + "column": 19, + "line": 3, }, }, "range": Array [ - 46, - 49, + 51, + 52, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 51, - "line": 1, + "column": 21, + "line": 3, }, "start": Object { - "column": 50, - "line": 1, + "column": 20, + "line": 3, }, }, "range": Array [ - 50, - 51, + 52, + 53, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 52, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 51, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 51, - 52, + 56, + 57, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 58, + 59, ], "type": "Punctuator", "value": "(", @@ -19264,35 +19081,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 53, - "line": 1, + "column": 6, + "line": 4, }, "start": Object { - "column": 52, - "line": 1, + "column": 5, + "line": 4, }, }, "range": Array [ - 52, - 53, + 59, + 60, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 54, - "line": 1, + "column": 7, + "line": 4, }, "start": Object { - "column": 53, - "line": 1, + "column": 6, + "line": 4, }, }, "range": Array [ - 53, - 54, + 60, + 61, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "range": Array [ + 61, + 62, ], "type": "Punctuator", "value": ")", @@ -19300,35 +19135,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 55, - "line": 1, + "column": 9, + "line": 4, }, "start": Object { - "column": 54, - "line": 1, + "column": 8, + "line": 4, }, }, "range": Array [ - 54, - 55, + 62, + 63, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 55, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 55, - 56, + 64, + 65, ], "type": "Punctuator", "value": "}", @@ -19336,17 +19171,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 58, - "line": 1, + "column": 2, + "line": 5, }, "start": Object { - "column": 57, - "line": 1, + "column": 1, + "line": 5, }, }, "range": Array [ - 57, - 58, + 65, + 66, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 68, + 69, ], "type": "Punctuator", "value": "}", @@ -19354,17 +19243,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 59, - "line": 1, + "column": 6, + "line": 5, }, "start": Object { - "column": 58, - "line": 1, + "column": 5, + "line": 5, }, }, "range": Array [ - 58, - 59, + 69, + 70, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 70, + 71, ], "type": "Punctuator", "value": ";", @@ -19374,206 +19281,68 @@ Object { } `; -exports[`javascript fixtures/classes/class-two-computed-static-methods.src 1`] = ` +exports[`javascript fixtures/callExpression/new-expression-with-array.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ + "expression": Object { + "arguments": Array [ Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "method", + "elements": Array [], "loc": Object { "end": Object { - "column": 22, + "column": 10, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ - 9, - 22, + 8, + 10, ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 22, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 18, - 22, - ], - "type": "FunctionExpression", + "type": "ArrayExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 37, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 37, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 33, - 37, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "name": "bar", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", }, - "range": Array [ - 8, - 38, - ], - "type": "ClassBody", - }, - "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 11, "line": 1, }, "start": Object { - "column": 6, + "column": 0, "line": 1, }, }, - "name": "A", "range": Array [ - 6, - 7, + 0, + 11, ], - "type": "Identifier", + "type": "NewExpression", }, "loc": Object { "end": Object { - "column": 38, + "column": 12, "line": 1, }, "start": Object { @@ -19583,33 +19352,125 @@ Object { }, "range": Array [ 0, - 38, + 12, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ExpressionStatement", }, Object { + "expression": Object { + "arguments": Array [ + Object { + "elements": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "properties": Array [], + "range": Array [ + 23, + 25, + ], + "type": "ObjectExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "ArrayExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 21, + 27, + ], + "type": "ArrayExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 13, + 28, + ], + "type": "NewExpression", + }, "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 38, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 38, - 39, + 13, + 29, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 0, + "line": 3, }, "start": Object { "column": 0, @@ -19618,14 +19479,14 @@ Object { }, "range": Array [ 0, - 39, + 30, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -19635,10 +19496,10 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "new", }, Object { "loc": Object { @@ -19647,152 +19508,152 @@ Object { "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, + 4, 7, ], "type": "Identifier", - "value": "A", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "range": Array [ + 7, 8, - 9, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 15, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 16, + 9, + 10, ], "type": "Punctuator", - "value": "[", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { - "column": 16, + "column": 10, "line": 1, }, }, "range": Array [ - 16, - 17, + 10, + 11, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 17, + "column": 11, "line": 1, }, }, "range": Array [ - 17, - 18, + 11, + 12, ], "type": "Punctuator", - "value": "]", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 18, - 19, + 13, + 16, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, + 17, 20, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ @@ -19800,17 +19661,17 @@ Object { 21, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ @@ -19818,17 +19679,17 @@ Object { 22, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ @@ -19836,76 +19697,76 @@ Object { 23, ], "type": "Punctuator", - "value": ";", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ + 23, 24, - 30, ], - "type": "Keyword", - "value": "static", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 30, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 30, - 31, + 24, + 25, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 31, - 32, + 25, + 26, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 32, - 33, + 26, + 27, ], "type": "Punctuator", "value": "]", @@ -19913,89 +19774,222 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 33, - 34, + 27, + 28, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 34, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 34, - 35, + 28, + 29, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/callExpression/new-expression-with-object.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 8, + 10, + ], + "type": "ObjectExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", }, - "start": Object { - "column": 35, - "line": 1, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 11, + ], + "type": "NewExpression", }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": "{", - }, - Object { "loc": Object { "end": Object { - "column": 37, + "column": 12, "line": 1, }, "start": Object { - "column": 36, + "column": 0, "line": 1, }, }, "range": Array [ - 36, - 37, + 0, + 12, ], - "type": "Punctuator", - "value": "}", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 38, + "column": 3, "line": 1, }, "start": Object { - "column": 37, + "column": 0, "line": 1, }, }, "range": Array [ - 37, - 38, + 0, + 3, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, ], "type": "Punctuator", "value": "}", @@ -20003,17 +19997,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 39, + "column": 11, "line": 1, }, "start": Object { - "column": 38, + "column": 10, "line": 1, }, }, "range": Array [ - 38, - 39, + 10, + 11, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, ], "type": "Punctuator", "value": ";", @@ -20023,7 +20035,7 @@ Object { } `; -exports[`javascript fixtures/classes/class-two-methods.src 1`] = ` +exports[`javascript fixtures/classes/class-accessor-properties.src 1`] = ` Object { "body": Array [ Object { @@ -20034,25 +20046,25 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 13, "line": 1, }, }, "name": "a", "range": Array [ - 9, - 10, + 13, + 14, ], "type": "Identifier", }, - "kind": "method", + "kind": "get", "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { @@ -20062,7 +20074,7 @@ Object { }, "range": Array [ 9, - 14, + 18, ], "static": false, "type": "MethodDefinition", @@ -20072,17 +20084,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 14, + 16, + 18, ], "type": "BlockStatement", }, @@ -20091,18 +20103,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "params": Array [], "range": Array [ - 10, 14, + 18, ], "type": "FunctionExpression", }, @@ -20112,35 +20124,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 24, "line": 1, }, "start": Object { - "column": 14, + "column": 23, "line": 1, }, }, "name": "b", "range": Array [ - 14, - 15, + 23, + 24, ], "type": "Identifier", }, - "kind": "method", + "kind": "set", "loc": Object { "end": Object { - "column": 19, + "column": 29, "line": 1, }, "start": Object { - "column": 14, + "column": 19, "line": 1, }, }, "range": Array [ - 14, 19, + 29, ], "static": false, "type": "MethodDefinition", @@ -20150,17 +20162,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 19, + "column": 29, "line": 1, }, "start": Object { - "column": 17, + "column": 27, "line": 1, }, }, "range": Array [ - 17, - 19, + 27, + 29, ], "type": "BlockStatement", }, @@ -20169,18 +20181,37 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 19, + "column": 29, "line": 1, }, "start": Object { - "column": 15, + "column": 24, "line": 1, }, }, - "params": Array [], + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + ], "range": Array [ - 15, - 19, + 24, + 29, ], "type": "FunctionExpression", }, @@ -20188,7 +20219,7 @@ Object { ], "loc": Object { "end": Object { - "column": 20, + "column": 31, "line": 1, }, "start": Object { @@ -20198,7 +20229,7 @@ Object { }, "range": Array [ 8, - 20, + 31, ], "type": "ClassBody", }, @@ -20222,7 +20253,7 @@ Object { }, "loc": Object { "end": Object { - "column": 20, + "column": 31, "line": 1, }, "start": Object { @@ -20232,7 +20263,7 @@ Object { }, "range": Array [ 0, - 20, + 31, ], "superClass": null, "type": "ClassDeclaration", @@ -20240,24 +20271,24 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 32, "line": 1, }, "start": Object { - "column": 20, + "column": 31, "line": 1, }, }, "range": Array [ - 20, - 21, + 31, + 32, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 21, + "column": 32, "line": 1, }, "start": Object { @@ -20267,7 +20298,7 @@ Object { }, "range": Array [ 0, - 21, + 32, ], "sourceType": "script", "tokens": Array [ @@ -20328,7 +20359,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -20338,7 +20369,25 @@ Object { }, "range": Array [ 9, - 10, + 12, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, ], "type": "Identifier", "value": "a", @@ -20346,17 +20395,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], "type": "Punctuator", "value": "(", @@ -20364,17 +20413,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, - 12, + 15, + 16, ], "type": "Punctuator", "value": ")", @@ -20382,17 +20431,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 13, + 16, + 17, ], "type": "Punctuator", "value": "{", @@ -20400,17 +20449,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "range": Array [ - 13, - 14, + 17, + 18, ], "type": "Punctuator", "value": "}", @@ -20418,17 +20467,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { - "column": 14, + "column": 19, "line": 1, }, }, "range": Array [ - 14, - 15, + 19, + 22, + ], + "type": "Identifier", + "value": "set", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, ], "type": "Identifier", "value": "b", @@ -20436,17 +20503,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 24, "line": 1, }, }, "range": Array [ - 15, - 16, + 24, + 25, ], "type": "Punctuator", "value": "(", @@ -20454,17 +20521,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 26, "line": 1, }, "start": Object { - "column": 16, + "column": 25, "line": 1, }, }, "range": Array [ - 16, - 17, + 25, + 26, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, ], "type": "Punctuator", "value": ")", @@ -20472,17 +20557,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 28, "line": 1, }, "start": Object { - "column": 17, + "column": 27, "line": 1, }, }, "range": Array [ - 17, - 18, + 27, + 28, ], "type": "Punctuator", "value": "{", @@ -20490,17 +20575,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 29, "line": 1, }, "start": Object { - "column": 18, + "column": 28, "line": 1, }, }, "range": Array [ - 18, - 19, + 28, + 29, ], "type": "Punctuator", "value": "}", @@ -20508,17 +20593,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 30, "line": 1, }, "start": Object { - "column": 19, + "column": 29, "line": 1, }, }, "range": Array [ - 19, - 20, + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, ], "type": "Punctuator", "value": "}", @@ -20526,17 +20629,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 32, "line": 1, }, "start": Object { - "column": 20, + "column": 31, "line": 1, }, }, "range": Array [ - 20, - 21, + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -20546,128 +20649,48 @@ Object { } `; -exports[`javascript fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` +exports[`javascript fixtures/classes/class-computed-static-method.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 22, - ], - "raw": "\\"constructor\\"", - "type": "Literal", - "value": "constructor", - }, - "kind": "constructor", - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 26, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 22, - 26, - ], - "type": "FunctionExpression", - }, - }, Object { "computed": true, "key": Object { "loc": Object { "end": Object { - "column": 41, + "column": 18, "line": 1, }, "start": Object { - "column": 28, + "column": 17, "line": 1, }, }, + "name": "a", "range": Array [ - 28, - 41, + 17, + 18, ], - "raw": "\\"constructor\\"", - "type": "Literal", - "value": "constructor", + "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 46, + "column": 23, "line": 1, }, "start": Object { - "column": 27, + "column": 9, "line": 1, }, }, "range": Array [ - 27, - 46, + 9, + 23, ], - "static": false, + "static": true, "type": "MethodDefinition", "value": Object { "async": false, @@ -20675,17 +20698,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 46, + "column": 23, "line": 1, }, "start": Object { - "column": 44, + "column": 21, "line": 1, }, }, "range": Array [ - 44, - 46, + 21, + 23, ], "type": "BlockStatement", }, @@ -20694,18 +20717,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 46, + "column": 23, "line": 1, }, "start": Object { - "column": 42, + "column": 19, "line": 1, }, }, "params": Array [], "range": Array [ - 42, - 46, + 19, + 23, ], "type": "FunctionExpression", }, @@ -20713,7 +20736,7 @@ Object { ], "loc": Object { "end": Object { - "column": 47, + "column": 25, "line": 1, }, "start": Object { @@ -20723,7 +20746,7 @@ Object { }, "range": Array [ 8, - 47, + 25, ], "type": "ClassBody", }, @@ -20747,7 +20770,7 @@ Object { }, "loc": Object { "end": Object { - "column": 47, + "column": 25, "line": 1, }, "start": Object { @@ -20757,7 +20780,7 @@ Object { }, "range": Array [ 0, - 47, + 25, ], "superClass": null, "type": "ClassDeclaration", @@ -20765,24 +20788,24 @@ Object { Object { "loc": Object { "end": Object { - "column": 48, + "column": 26, "line": 1, }, "start": Object { - "column": 47, + "column": 25, "line": 1, }, }, "range": Array [ - 47, - 48, + 25, + 26, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 48, + "column": 26, "line": 1, }, "start": Object { @@ -20792,7 +20815,7 @@ Object { }, "range": Array [ 0, - 48, + 26, ], "sourceType": "script", "tokens": Array [ @@ -20853,7 +20876,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 15, "line": 1, }, "start": Object { @@ -20863,25 +20886,79 @@ Object { }, "range": Array [ 9, - 22, + 15, ], - "type": "String", - "value": "\\"constructor\\"", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, ], "type": "Punctuator", "value": "(", @@ -20889,17 +20966,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 1, }, "start": Object { - "column": 23, + "column": 20, "line": 1, }, }, "range": Array [ - 23, - 24, + 20, + 21, ], "type": "Punctuator", "value": ")", @@ -20907,17 +20984,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 22, "line": 1, }, "start": Object { - "column": 24, + "column": 21, "line": 1, }, }, "range": Array [ - 24, - 25, + 21, + 22, ], "type": "Punctuator", "value": "{", @@ -20925,17 +21002,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, + "column": 23, "line": 1, }, "start": Object { - "column": 25, + "column": 22, "line": 1, }, }, "range": Array [ - 25, - 26, + 22, + 23, ], "type": "Punctuator", "value": "}", @@ -20943,71 +21020,150 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { - "column": 27, + "column": 23, "line": 1, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", - "value": "[", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 25, "line": 1, }, "start": Object { - "column": 28, + "column": 24, "line": 1, }, }, "range": Array [ - 28, - 41, + 24, + 25, ], - "type": "String", - "value": "\\"constructor\\"", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 26, "line": 1, }, "start": Object { - "column": 41, + "column": 25, "line": 1, }, }, "range": Array [ - 41, - 42, + 25, + 26, ], "type": "Punctuator", - "value": "]", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/class-expression.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "superClass": null, + "type": "ClassExpression", + }, "loc": Object { "end": Object { - "column": 43, + "column": 11, "line": 1, }, "start": Object { - "column": 42, + "column": 0, "line": 1, }, }, "range": Array [ - 42, - 43, + 0, + 11, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, ], "type": "Punctuator", "value": "(", @@ -21015,35 +21171,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 44, + "column": 6, "line": 1, }, "start": Object { - "column": 43, + "column": 1, "line": 1, }, }, "range": Array [ - 43, - 44, + 1, + 6, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 45, + "column": 8, "line": 1, }, "start": Object { - "column": 44, + "column": 7, "line": 1, }, }, "range": Array [ - 44, - 45, + 7, + 8, ], "type": "Punctuator", "value": "{", @@ -21051,17 +21207,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 46, + "column": 9, "line": 1, }, "start": Object { - "column": 45, + "column": 8, "line": 1, }, }, "range": Array [ - 45, - 46, + 8, + 9, ], "type": "Punctuator", "value": "}", @@ -21069,35 +21225,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 47, + "column": 10, "line": 1, }, "start": Object { - "column": 46, + "column": 9, "line": 1, }, }, "range": Array [ - 46, - 47, + 9, + 10, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 48, + "column": 11, "line": 1, }, "start": Object { - "column": 47, + "column": 10, "line": 1, }, }, "range": Array [ - 47, - 48, + 10, + 11, ], "type": "Punctuator", "value": ";", @@ -21107,7 +21263,7 @@ Object { } `; -exports[`javascript fixtures/classes/class-two-methods-semi.src 1`] = ` +exports[`javascript fixtures/classes/class-method-named-prototype.src 1`] = ` Object { "body": Array [ Object { @@ -21118,7 +21274,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { @@ -21126,17 +21282,17 @@ Object { "line": 1, }, }, - "name": "a", + "name": "prototype", "range": Array [ 9, - 10, + 18, ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 14, + "column": 22, "line": 1, }, "start": Object { @@ -21146,7 +21302,7 @@ Object { }, "range": Array [ 9, - 14, + 22, ], "static": false, "type": "MethodDefinition", @@ -21156,95 +21312,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 14, + "column": 22, "line": 1, }, "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 14, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 10, - 14, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 20, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { "column": 20, "line": 1, }, - "start": Object { - "column": 18, - "line": 1, - }, }, "range": Array [ - 18, 20, + 22, ], "type": "BlockStatement", }, @@ -21253,18 +21331,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 20, + "column": 22, "line": 1, }, "start": Object { - "column": 16, + "column": 18, "line": 1, }, }, "params": Array [], "range": Array [ - 16, - 20, + 18, + 22, ], "type": "FunctionExpression", }, @@ -21272,7 +21350,7 @@ Object { ], "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { @@ -21282,7 +21360,7 @@ Object { }, "range": Array [ 8, - 21, + 23, ], "type": "ClassBody", }, @@ -21306,7 +21384,7 @@ Object { }, "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { @@ -21316,7 +21394,7 @@ Object { }, "range": Array [ 0, - 21, + 23, ], "superClass": null, "type": "ClassDeclaration", @@ -21324,24 +21402,24 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 24, "line": 1, }, "start": Object { - "column": 21, + "column": 23, "line": 1, }, }, "range": Array [ - 21, - 22, + 23, + 24, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 22, + "column": 24, "line": 1, }, "start": Object { @@ -21351,7 +21429,7 @@ Object { }, "range": Array [ 0, - 22, + 24, ], "sourceType": "script", "tokens": Array [ @@ -21412,7 +21490,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { @@ -21422,25 +21500,25 @@ Object { }, "range": Array [ 9, - 10, + 18, ], "type": "Identifier", - "value": "a", + "value": "prototype", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 19, "line": 1, }, "start": Object { - "column": 10, + "column": 18, "line": 1, }, }, "range": Array [ - 10, - 11, + 18, + 19, ], "type": "Punctuator", "value": "(", @@ -21448,17 +21526,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 20, "line": 1, }, "start": Object { - "column": 11, + "column": 19, "line": 1, }, }, "range": Array [ - 11, - 12, + 19, + 20, ], "type": "Punctuator", "value": ")", @@ -21466,17 +21544,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 21, "line": 1, }, "start": Object { - "column": 12, + "column": 20, "line": 1, }, }, "range": Array [ - 12, - 13, + 20, + 21, ], "type": "Punctuator", "value": "{", @@ -21484,17 +21562,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 22, "line": 1, }, "start": Object { - "column": 13, + "column": 21, "line": 1, }, }, "range": Array [ - 13, - 14, + 21, + 22, ], "type": "Punctuator", "value": "}", @@ -21502,270 +21580,84 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { - "column": 16, + "column": 22, "line": 1, }, }, "range": Array [ - 16, - 17, + 22, + 23, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 24, "line": 1, }, "start": Object { - "column": 17, + "column": 23, "line": 1, }, }, "range": Array [ - 17, - 18, + 23, + 24, ], "type": "Punctuator", - "value": ")", + "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/class-two-methods-three-semi.src 1`] = ` -Object { - "body": Array [ + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/class-method-named-static.src 1`] = ` +Object { + "body": Array [ Object { "body": Object { "body": Array [ Object { "computed": false, "key": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 15, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 15, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, - "params": Array [], + "name": "static", "range": Array [ - 11, + 9, 15, ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 16, - 17, - ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 16, + "column": 9, "line": 1, }, }, "range": Array [ - 16, - 21, + 9, + 19, ], "static": false, "type": "MethodDefinition", @@ -21775,17 +21667,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 19, + "column": 17, "line": 1, }, }, "range": Array [ + 17, 19, - 21, ], "type": "BlockStatement", }, @@ -21794,18 +21686,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, "params": Array [], "range": Array [ - 17, - 21, + 15, + 19, ], "type": "FunctionExpression", }, @@ -21813,7 +21705,7 @@ Object { ], "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 1, }, "start": Object { @@ -21823,7 +21715,7 @@ Object { }, "range": Array [ 8, - 23, + 21, ], "type": "ClassBody", }, @@ -21847,7 +21739,7 @@ Object { }, "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 1, }, "start": Object { @@ -21857,7 +21749,7 @@ Object { }, "range": Array [ 0, - 23, + 21, ], "superClass": null, "type": "ClassDeclaration", @@ -21865,24 +21757,24 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 22, "line": 1, }, "start": Object { - "column": 23, + "column": 21, "line": 1, }, }, "range": Array [ - 23, - 24, + 21, + 22, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 24, + "column": 22, "line": 1, }, "start": Object { @@ -21892,7 +21784,7 @@ Object { }, "range": Array [ 0, - 24, + 22, ], "sourceType": "script", "tokens": Array [ @@ -21953,7 +21845,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 15, "line": 1, }, "start": Object { @@ -21963,100 +21855,10 @@ Object { }, "range": Array [ 9, - 10, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, 15, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { @@ -22074,7 +21876,7 @@ Object { 16, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { @@ -22091,8 +21893,8 @@ Object { 16, 17, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -22110,7 +21912,7 @@ Object { 18, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { @@ -22128,7 +21930,7 @@ Object { 19, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { @@ -22146,7 +21948,7 @@ Object { 20, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { @@ -22184,48 +21986,12 @@ Object { "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ";", - }, ], "type": "Program", } `; -exports[`javascript fixtures/classes/class-two-methods-two-semi.src 1`] = ` +exports[`javascript fixtures/classes/class-method-named-with-space.src 1`] = ` Object { "body": Array [ Object { @@ -22236,7 +22002,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { @@ -22244,17 +22010,17 @@ Object { "line": 1, }, }, - "name": "a", + "name": "withSpace", "range": Array [ 9, - 10, + 18, ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 14, + "column": 24, "line": 1, }, "start": Object { @@ -22264,85 +22030,7 @@ Object { }, "range": Array [ 9, - 14, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 14, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 10, - 14, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 20, + 24, ], "static": false, "type": "MethodDefinition", @@ -22352,17 +22040,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 1, }, "start": Object { - "column": 18, + "column": 22, "line": 1, }, }, "range": Array [ - 18, - 20, + 22, + 24, ], "type": "BlockStatement", }, @@ -22371,18 +22059,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 1, }, "start": Object { - "column": 16, + "column": 19, "line": 1, }, }, "params": Array [], "range": Array [ - 16, - 20, + 19, + 24, ], "type": "FunctionExpression", }, @@ -22390,7 +22078,7 @@ Object { ], "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { @@ -22400,7 +22088,7 @@ Object { }, "range": Array [ 8, - 22, + 25, ], "type": "ClassBody", }, @@ -22424,7 +22112,7 @@ Object { }, "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { @@ -22434,33 +22122,16 @@ Object { }, "range": Array [ 0, - 22, + 25, ], "superClass": null, "type": "ClassDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "EmptyStatement", - }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -22469,7 +22140,7 @@ Object { }, "range": Array [ 0, - 23, + 26, ], "sourceType": "script", "tokens": Array [ @@ -22530,7 +22201,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { @@ -22540,25 +22211,25 @@ Object { }, "range": Array [ 9, - 10, + 18, ], "type": "Identifier", - "value": "a", + "value": "withSpace", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 20, "line": 1, }, "start": Object { - "column": 10, + "column": 19, "line": 1, }, }, "range": Array [ - 10, - 11, + 19, + 20, ], "type": "Punctuator", "value": "(", @@ -22566,17 +22237,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 21, "line": 1, }, "start": Object { - "column": 11, + "column": 20, "line": 1, }, }, "range": Array [ - 11, - 12, + 20, + 21, ], "type": "Punctuator", "value": ")", @@ -22584,17 +22255,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 22, "line": 1, }, }, "range": Array [ - 12, - 13, + 22, + 23, ], "type": "Punctuator", "value": "{", @@ -22602,125 +22273,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 24, "line": 1, }, "start": Object { - "column": 13, + "column": 23, "line": 1, }, }, "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, + 23, + 24, ], "type": "Punctuator", "value": "}", @@ -22728,63 +22291,27 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 21, + "column": 24, "line": 1, }, }, "range": Array [ - 21, - 22, + 24, + 25, ], "type": "Punctuator", "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ";", - }, ], "type": "Program", } `; -exports[`javascript fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` +exports[`javascript fixtures/classes/class-one-method.src 1`] = ` Object { "body": Array [ Object { @@ -22795,115 +22322,37 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "constructor", + "name": "a", "range": Array [ - 16, - 27, + 14, + 15, ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 31, - ], - "static": true, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 27, - 31, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "name": "constructor", - "range": Array [ - 39, - 50, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 54, - "line": 1, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 32, - 54, + 14, + 19, ], - "static": true, + "static": false, "type": "MethodDefinition", "value": Object { "async": false, @@ -22911,17 +22360,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 54, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 52, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 52, - 54, + 17, + 19, ], "type": "BlockStatement", }, @@ -22930,18 +22379,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 54, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 50, - "line": 1, + "column": 5, + "line": 2, }, }, "params": Array [], "range": Array [ - 50, - 54, + 15, + 19, ], "type": "FunctionExpression", }, @@ -22949,8 +22398,8 @@ Object { ], "loc": Object { "end": Object { - "column": 55, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 8, @@ -22959,7 +22408,7 @@ Object { }, "range": Array [ 8, - 55, + 21, ], "type": "ClassBody", }, @@ -22983,8 +22432,8 @@ Object { }, "loc": Object { "end": Object { - "column": 55, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -22993,7 +22442,7 @@ Object { }, "range": Array [ 0, - 55, + 21, ], "superClass": null, "type": "ClassDeclaration", @@ -23001,25 +22450,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 56, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { - "column": 55, - "line": 1, + "column": 1, + "line": 3, }, }, "range": Array [ - 55, - 56, + 21, + 22, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 56, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { "column": 0, @@ -23028,7 +22477,7 @@ Object { }, "range": Array [ 0, - 56, + 22, ], "sourceType": "script", "tokens": Array [ @@ -23089,53 +22538,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, + 14, 15, ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 27, - ], "type": "Identifier", - "value": "constructor", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 27, - 28, + 15, + 16, ], "type": "Punctuator", "value": "(", @@ -23143,17 +22574,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 28, - 29, + 16, + 17, ], "type": "Punctuator", "value": ")", @@ -23161,17 +22592,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 29, - 30, + 17, + 18, ], "type": "Punctuator", "value": "{", @@ -23179,17 +22610,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 30, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 30, - 31, + 18, + 19, ], "type": "Punctuator", "value": "}", @@ -23197,107 +22628,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 50, - ], - "type": "Identifier", - "value": "constructor", - }, - Object { - "loc": Object { - "end": Object { - "column": 51, - "line": 1, - }, - "start": Object { - "column": 50, - "line": 1, - }, - }, - "range": Array [ - 50, - 51, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 1, - }, - "start": Object { - "column": 51, - "line": 1, - }, - }, - "range": Array [ - 51, - 52, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 1, - }, - "start": Object { - "column": 52, - "line": 1, - }, - }, - "range": Array [ - 52, - 53, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 53, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 53, - 54, + 20, + 21, ], "type": "Punctuator", "value": "}", @@ -23305,45 +22646,27 @@ Object { Object { "loc": Object { "end": Object { - "column": 55, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { - "column": 54, - "line": 1, + "column": 1, + "line": 3, }, }, "range": Array [ - 54, - 55, + 21, + 22, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 55, - "line": 1, - }, - }, - "range": Array [ - 55, - 56, - ], - "type": "Punctuator", - "value": ";", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/classes/class-with-constructor.src 1`] = ` +exports[`javascript fixtures/classes/class-one-method-super.src 1`] = ` Object { "body": Array [ Object { @@ -23354,55 +22677,108 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "constructor", + "name": "a", "range": Array [ - 9, - 20, + 14, + 15, ], "type": "Identifier", }, - "kind": "constructor", + "kind": "method", "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 24, + 14, + 41, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, "body": Object { - "body": Array [], + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 32, + ], + "type": "Super", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 34, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 22, - 24, + 17, + 41, ], "type": "BlockStatement", }, @@ -23411,18 +22787,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, }, "params": Array [], "range": Array [ - 20, - 24, + 15, + 41, ], "type": "FunctionExpression", }, @@ -23430,8 +22806,8 @@ Object { ], "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 8, @@ -23440,7 +22816,7 @@ Object { }, "range": Array [ 8, - 25, + 43, ], "type": "ClassBody", }, @@ -23464,8 +22840,8 @@ Object { }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, @@ -23474,7 +22850,7 @@ Object { }, "range": Array [ 0, - 25, + 43, ], "superClass": null, "type": "ClassDeclaration", @@ -23482,25 +22858,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 2, + "line": 5, }, "start": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 5, }, }, "range": Array [ - 25, - 26, + 43, + 44, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -23509,7 +22885,7 @@ Object { }, "range": Array [ 0, - 26, + 45, ], "sourceType": "script", "tokens": Array [ @@ -23570,35 +22946,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 20, + 14, + 15, ], "type": "Identifier", - "value": "constructor", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 20, - 21, + 15, + 16, ], "type": "Punctuator", "value": "(", @@ -23606,17 +22982,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 21, - 22, + 16, + 17, ], "type": "Punctuator", "value": ")", @@ -23624,17 +23000,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 22, - 23, + 17, + 18, ], "type": "Punctuator", "value": "{", @@ -23642,17 +23018,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 23, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 23, - 24, + 27, + 32, + ], + "type": "Keyword", + "value": "super", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 40, + 41, ], "type": "Punctuator", "value": "}", @@ -23660,17 +23108,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 24, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 24, - 25, + 42, + 43, ], "type": "Punctuator", "value": "}", @@ -23678,17 +23126,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 2, + "line": 5, }, "start": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 5, }, }, "range": Array [ - 25, - 26, + 43, + 44, ], "type": "Punctuator", "value": ";", @@ -23698,7 +23146,7 @@ Object { } `; -exports[`javascript fixtures/classes/class-with-constructor-parameters.src 1`] = ` +exports[`javascript fixtures/classes/class-static-method.src 1`] = ` Object { "body": Array [ Object { @@ -23709,25 +23157,25 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 20, + "column": 17, "line": 1, }, "start": Object { - "column": 9, + "column": 16, "line": 1, }, }, - "name": "constructor", + "name": "a", "range": Array [ - 9, - 20, + 16, + 17, ], "type": "Identifier", }, - "kind": "constructor", + "kind": "method", "loc": Object { "end": Object { - "column": 32, + "column": 21, "line": 1, }, "start": Object { @@ -23737,9 +23185,9 @@ Object { }, "range": Array [ 9, - 32, + 21, ], - "static": false, + "static": true, "type": "MethodDefinition", "value": Object { "async": false, @@ -23747,17 +23195,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 32, + "column": 21, "line": 1, }, "start": Object { - "column": 30, + "column": 19, "line": 1, }, }, "range": Array [ - 30, - 32, + 19, + 21, ], "type": "BlockStatement", }, @@ -23766,55 +23214,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 32, + "column": 21, "line": 1, }, "start": Object { - "column": 20, + "column": 17, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - ], + "params": Array [], "range": Array [ - 20, - 32, + 17, + 21, ], "type": "FunctionExpression", }, @@ -23822,7 +23233,7 @@ Object { ], "loc": Object { "end": Object { - "column": 33, + "column": 23, "line": 1, }, "start": Object { @@ -23832,7 +23243,7 @@ Object { }, "range": Array [ 8, - 33, + 23, ], "type": "ClassBody", }, @@ -23856,7 +23267,7 @@ Object { }, "loc": Object { "end": Object { - "column": 33, + "column": 23, "line": 1, }, "start": Object { @@ -23866,16 +23277,33 @@ Object { }, "range": Array [ 0, - 33, + 23, ], "superClass": null, "type": "ClassDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { "column": 0, @@ -23884,7 +23312,7 @@ Object { }, "range": Array [ 0, - 34, + 24, ], "sourceType": "script", "tokens": Array [ @@ -23945,7 +23373,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 15, "line": 1, }, "start": Object { @@ -23955,133 +23383,133 @@ Object { }, "range": Array [ 9, - 20, + 15, ], - "type": "Identifier", - "value": "constructor", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 17, "line": 1, }, "start": Object { - "column": 20, + "column": 16, "line": 1, }, }, "range": Array [ - 20, - 21, + 16, + 17, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 18, "line": 1, }, "start": Object { - "column": 21, + "column": 17, "line": 1, }, }, "range": Array [ - 21, - 24, + 17, + 18, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 19, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "range": Array [ - 24, - 25, + 18, + 19, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { - "column": 26, + "column": 19, "line": 1, }, }, "range": Array [ - 26, - 29, + 19, + 20, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 21, "line": 1, }, "start": Object { - "column": 29, + "column": 20, "line": 1, }, }, "range": Array [ - 29, - 30, + 20, + 21, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 22, "line": 1, }, "start": Object { - "column": 30, + "column": 21, "line": 1, }, }, "range": Array [ - 30, - 31, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 23, "line": 1, }, "start": Object { - "column": 31, + "column": 22, "line": 1, }, }, "range": Array [ - 31, - 32, + 22, + 23, ], "type": "Punctuator", "value": "}", @@ -24089,56 +23517,57 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, + "column": 24, "line": 1, }, "start": Object { - "column": 32, + "column": 23, "line": 1, }, }, "range": Array [ - 32, - 33, + 23, + 24, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/classes/class-with-constructor-with-space.src 1`] = ` +exports[`javascript fixtures/classes/class-static-method-named-prototype.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { - "computed": false, + "computed": true, "key": Object { "loc": Object { "end": Object { - "column": 20, + "column": 28, "line": 1, }, "start": Object { - "column": 9, + "column": 17, "line": 1, }, }, - "name": "constructor", "range": Array [ - 9, - 20, + 17, + 28, ], - "type": "Identifier", + "raw": "\\"prototype\\"", + "type": "Literal", + "value": "prototype", }, - "kind": "constructor", + "kind": "method", "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { @@ -24148,9 +23577,9 @@ Object { }, "range": Array [ 9, - 25, + 33, ], - "static": false, + "static": true, "type": "MethodDefinition", "value": Object { "async": false, @@ -24158,17 +23587,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { - "column": 23, + "column": 31, "line": 1, }, }, "range": Array [ - 23, - 25, + 31, + 33, ], "type": "BlockStatement", }, @@ -24177,18 +23606,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { - "column": 21, + "column": 29, "line": 1, }, }, "params": Array [], "range": Array [ - 21, - 25, + 29, + 33, ], "type": "FunctionExpression", }, @@ -24196,7 +23625,7 @@ Object { ], "loc": Object { "end": Object { - "column": 26, + "column": 34, "line": 1, }, "start": Object { @@ -24206,7 +23635,7 @@ Object { }, "range": Array [ 8, - 26, + 34, ], "type": "ClassBody", }, @@ -24230,7 +23659,7 @@ Object { }, "loc": Object { "end": Object { - "column": 26, + "column": 34, "line": 1, }, "start": Object { @@ -24240,7 +23669,7 @@ Object { }, "range": Array [ 0, - 26, + 34, ], "superClass": null, "type": "ClassDeclaration", @@ -24248,25 +23677,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 35, "line": 1, }, "start": Object { - "column": 26, + "column": 34, "line": 1, }, }, "range": Array [ - 26, - 27, + 34, + 35, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 35, + "line": 1, }, "start": Object { "column": 0, @@ -24275,7 +23704,7 @@ Object { }, "range": Array [ 0, - 28, + 35, ], "sourceType": "script", "tokens": Array [ @@ -24336,7 +23765,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 15, "line": 1, }, "start": Object { @@ -24346,25 +23775,79 @@ Object { }, "range": Array [ 9, - 20, + 15, ], - "type": "Identifier", - "value": "constructor", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 17, "line": 1, }, "start": Object { - "column": 21, + "column": 16, "line": 1, }, }, "range": Array [ - 21, - 22, + 16, + 17, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 28, + ], + "type": "String", + "value": "\\"prototype\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", "value": "(", @@ -24372,17 +23855,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 31, "line": 1, }, "start": Object { - "column": 22, + "column": 30, "line": 1, }, }, "range": Array [ - 22, - 23, + 30, + 31, ], "type": "Punctuator", "value": ")", @@ -24390,17 +23873,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 32, "line": 1, }, "start": Object { - "column": 23, + "column": 31, "line": 1, }, }, "range": Array [ - 23, - 24, + 31, + 32, ], "type": "Punctuator", "value": "{", @@ -24408,17 +23891,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { - "column": 24, + "column": 32, "line": 1, }, }, "range": Array [ - 24, - 25, + 32, + 33, ], "type": "Punctuator", "value": "}", @@ -24426,17 +23909,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, + "column": 34, "line": 1, }, "start": Object { - "column": 25, + "column": 33, "line": 1, }, }, "range": Array [ - 25, - 26, + 33, + 34, ], "type": "Punctuator", "value": "}", @@ -24444,17 +23927,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 35, "line": 1, }, "start": Object { - "column": 26, + "column": 34, "line": 1, }, }, "range": Array [ - 26, - 27, + 34, + 35, ], "type": "Punctuator", "value": ";", @@ -24464,120 +23947,125 @@ Object { } `; -exports[`javascript fixtures/classes/derived-class-assign-to-var.src 1`] = ` +exports[`javascript fixtures/classes/class-static-method-named-static.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 27, - ], - "type": "ClassBody", - }, - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, - "name": "A", + "name": "static", "range": Array [ - 14, - 15, + 16, + 22, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 27, + "column": 26, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, - 27, + 9, + 26, ], - "superClass": Object { + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 25, + "column": 26, "line": 1, }, "start": Object { - "column": 24, + "column": 22, "line": 1, }, }, + "params": Array [], "range": Array [ - 24, - 25, + 22, + 26, ], - "raw": "0", - "type": "Literal", - "value": 0, + "type": "FunctionExpression", }, - "type": "ClassExpression", }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 28, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 28, @@ -24592,12 +24080,30 @@ Object { 0, 28, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 28, + "column": 29, "line": 1, }, "start": Object { @@ -24607,14 +24113,14 @@ Object { }, "range": Array [ 0, - 28, + 29, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -24624,82 +24130,82 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "range": Array [ - 6, - 7, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, - 13, + 9, + 15, ], "type": "Keyword", - "value": "class", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, - 15, + 16, + 22, ], - "type": "Identifier", - "value": "A", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { @@ -24708,16 +24214,34 @@ Object { "line": 1, }, "start": Object { - "column": 16, + "column": 22, "line": 1, }, }, "range": Array [ - 16, + 22, 23, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -24734,8 +24258,8 @@ Object { 24, 25, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -24753,7 +24277,7 @@ Object { 26, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { @@ -24771,7 +24295,7 @@ Object { 27, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { @@ -24789,93 +24313,364 @@ Object { 28, ], "type": "Punctuator", - "value": ";", + "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/derived-class-expression.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 18, - ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "ClassExpression", - }, "loc": Object { "end": Object { - "column": 20, + "column": 29, "line": 1, }, "start": Object { - "column": 0, + "column": 28, "line": 1, }, }, "range": Array [ - 0, - 20, + 28, + 29, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": ";", }, ], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/class-static-methods-and-accessor-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 21, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 17, + 21, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 38, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 34, + 38, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 56, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 56, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 51, + 56, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 58, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 58, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 58, + "line": 1, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 59, + "line": 1, }, "start": Object { "column": 0, @@ -24884,14 +24679,14 @@ Object { }, "range": Array [ 0, - 20, + 59, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -24901,64 +24696,64 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, 6, + 7, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, - 14, + 8, + 9, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 15, - 16, ], - "type": "Numeric", - "value": "0", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { @@ -24975,8 +24770,8 @@ Object { 16, 17, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -24994,7 +24789,7 @@ Object { 18, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { @@ -25030,340 +24825,274 @@ Object { 20, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/empty-class.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 10, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 10, + "column": 21, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 10, + 20, + 21, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 28, "line": 1, }, "start": Object { - "column": 10, + "column": 22, "line": 1, }, }, "range": Array [ - 10, - 11, + 22, + 28, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "static", }, - }, - "range": Array [ - 0, - 11, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 32, "line": 1, }, "start": Object { - "column": 0, + "column": 29, "line": 1, }, }, "range": Array [ - 0, - 5, + 29, + 32, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 34, "line": 1, }, "start": Object { - "column": 6, + "column": 33, "line": 1, }, }, "range": Array [ - 6, - 7, + 33, + 34, ], "type": "Identifier", - "value": "A", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 35, "line": 1, }, "start": Object { - "column": 8, + "column": 34, "line": 1, }, }, "range": Array [ - 8, - 9, + 34, + 35, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 36, "line": 1, }, "start": Object { - "column": 9, + "column": 35, "line": 1, }, }, "range": Array [ - 9, - 10, + 35, + 36, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 37, "line": 1, }, "start": Object { - "column": 10, + "column": 36, "line": 1, }, }, "range": Array [ - 10, - 11, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/empty-class-double-semi.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, }, - "range": Array [ - 8, - 10, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 37, + "line": 1, }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "}", + }, + Object { "loc": Object { "end": Object { - "column": 10, + "column": 45, "line": 1, }, "start": Object { - "column": 0, + "column": 39, "line": 1, }, }, "range": Array [ - 0, - 10, + 39, + 45, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 49, "line": 1, }, "start": Object { - "column": 10, + "column": 46, "line": 1, }, }, "range": Array [ - 10, - 11, + 46, + 49, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 11, - "line": 1, + "type": "Identifier", + "value": "set", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Identifier", + "value": "a", }, - }, - "range": Array [ - 0, - 11, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 52, "line": 1, }, "start": Object { - "column": 0, + "column": 51, "line": 1, }, }, "range": Array [ - 0, - 5, + 51, + 52, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 53, "line": 1, }, "start": Object { - "column": 6, + "column": 52, "line": 1, }, }, "range": Array [ - 6, - 7, + 52, + 53, ], "type": "Identifier", - "value": "A", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 54, "line": 1, }, "start": Object { - "column": 8, + "column": 53, "line": 1, }, }, "range": Array [ - 8, - 9, + 53, + 54, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 55, ], "type": "Punctuator", "value": "{", @@ -25371,17 +25100,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 56, "line": 1, }, "start": Object { - "column": 9, + "column": 55, "line": 1, }, }, "range": Array [ - 9, - 10, + 55, + 56, ], "type": "Punctuator", "value": "}", @@ -25389,17 +25118,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 58, "line": 1, }, "start": Object { - "column": 10, + "column": 57, "line": 1, }, }, "range": Array [ - 10, - 11, + 57, + 58, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 58, + "line": 1, + }, + }, + "range": Array [ + 58, + 59, ], "type": "Punctuator", "value": ";", @@ -25409,15 +25156,172 @@ Object { } `; -exports[`javascript fixtures/classes/empty-class-semi.src 1`] = ` +exports[`javascript fixtures/classes/class-two-computed-static-methods.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], + "body": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 18, + 22, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 37, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 33, + 37, + ], + "type": "FunctionExpression", + }, + }, + ], "loc": Object { "end": Object { - "column": 11, + "column": 38, "line": 1, }, "start": Object { @@ -25427,7 +25331,7 @@ Object { }, "range": Array [ 8, - 11, + 38, ], "type": "ClassBody", }, @@ -25451,7 +25355,7 @@ Object { }, "loc": Object { "end": Object { - "column": 11, + "column": 38, "line": 1, }, "start": Object { @@ -25461,7 +25365,7 @@ Object { }, "range": Array [ 0, - 11, + 38, ], "superClass": null, "type": "ClassDeclaration", @@ -25469,24 +25373,24 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 39, "line": 1, }, "start": Object { - "column": 11, + "column": 38, "line": 1, }, }, "range": Array [ - 11, - 12, + 38, + 39, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 12, + "column": 39, "line": 1, }, "start": Object { @@ -25496,7 +25400,7 @@ Object { }, "range": Array [ 0, - 12, + 39, ], "sourceType": "script", "tokens": Array [ @@ -25557,7 +25461,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 15, "line": 1, }, "start": Object { @@ -25567,416 +25471,313 @@ Object { }, "range": Array [ 9, - 10, + 15, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 15, "line": 1, }, }, "range": Array [ - 10, - 11, + 15, + 16, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 17, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 17, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "a", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/empty-literal-derived-class.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, }, - "range": Array [ - 18, - 20, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 17, + "line": 1, }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "]", + }, + Object { "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { - "column": 0, + "column": 18, "line": 1, }, }, "range": Array [ - 0, - 20, + 18, + 19, ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "ClassDeclaration", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 20, + "column": 19, "line": 1, }, }, "range": Array [ + 19, 20, - 21, ], - "type": "EmptyStatement", + "type": "Punctuator", + "value": ")", }, - ], - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 21, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 5, + 20, + 21, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 22, "line": 1, }, "start": Object { - "column": 6, + "column": 21, "line": 1, }, }, "range": Array [ - 6, - 7, + 21, + 22, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 23, "line": 1, }, "start": Object { - "column": 8, + "column": 22, "line": 1, }, }, "range": Array [ - 8, - 15, + 22, + 23, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 30, "line": 1, }, "start": Object { - "column": 16, + "column": 24, "line": 1, }, }, "range": Array [ - 16, - 17, + 24, + 30, ], - "type": "Numeric", - "value": "0", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 30, "line": 1, }, }, "range": Array [ - 18, - 19, + 30, + 31, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 32, "line": 1, }, "start": Object { - "column": 19, + "column": 31, "line": 1, }, }, "range": Array [ - 19, - 20, + 31, + 32, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 33, "line": 1, }, "start": Object { - "column": 20, + "column": 32, "line": 1, }, }, "range": Array [ - 20, - 21, + 32, + 33, ], "type": "Punctuator", - "value": ";", + "value": "]", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/invalid-class-declaration.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 8, - ], - "type": "ClassBody", - }, - "id": null, "loc": Object { "end": Object { - "column": 8, + "column": 34, "line": 1, }, "start": Object { - "column": 0, + "column": 33, "line": 1, }, }, "range": Array [ - 0, - 8, + 33, + 34, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 35, "line": 1, }, "start": Object { - "column": 8, + "column": 34, "line": 1, }, }, "range": Array [ - 8, - 9, + 34, + 35, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ")", }, - }, - "range": Array [ - 0, - 10, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 36, "line": 1, }, "start": Object { - "column": 0, + "column": 35, "line": 1, }, }, "range": Array [ - 0, - 5, + 35, + 36, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 37, "line": 1, }, "start": Object { - "column": 6, + "column": 36, "line": 1, }, }, "range": Array [ - 6, - 7, + 36, + 37, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 38, "line": 1, }, "start": Object { - "column": 7, + "column": 37, "line": 1, }, }, "range": Array [ - 7, - 8, + 37, + 38, ], "type": "Punctuator", "value": "}", @@ -25984,17 +25785,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 39, "line": 1, }, "start": Object { - "column": 8, + "column": 38, "line": 1, }, }, "range": Array [ - 8, - 9, + 38, + 39, ], "type": "Punctuator", "value": ";", @@ -26004,7 +25805,7 @@ Object { } `; -exports[`javascript fixtures/classes/invalid-class-setter-declaration.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods.src 1`] = ` Object { "body": Array [ Object { @@ -26015,7 +25816,85 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 17, + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 10, + 14, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, "line": 1, }, "start": Object { @@ -26023,27 +25902,27 @@ Object { "line": 1, }, }, - "name": "foo", + "name": "b", "range": Array [ 14, - 17, + 15, ], "type": "Identifier", }, - "kind": "set", + "kind": "method", "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 22, + 14, + 19, ], "static": false, "type": "MethodDefinition", @@ -26053,17 +25932,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 1, }, "start": Object { - "column": 20, + "column": 17, "line": 1, }, }, "range": Array [ - 20, - 22, + 17, + 19, ], "type": "BlockStatement", }, @@ -26072,18 +25951,18 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, "params": Array [], "range": Array [ - 17, - 22, + 15, + 19, ], "type": "FunctionExpression", }, @@ -26091,7 +25970,7 @@ Object { ], "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { @@ -26101,7 +25980,7 @@ Object { }, "range": Array [ 8, - 23, + 20, ], "type": "ClassBody", }, @@ -26125,7 +26004,7 @@ Object { }, "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { @@ -26135,7 +26014,7 @@ Object { }, "range": Array [ 0, - 23, + 20, ], "superClass": null, "type": "ClassDeclaration", @@ -26143,25 +26022,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 1, }, "start": Object { - "column": 23, + "column": 20, "line": 1, }, }, "range": Array [ - 23, - 24, + 20, + 21, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { "column": 0, @@ -26170,7 +26049,7 @@ Object { }, "range": Array [ 0, - 25, + 21, ], "sourceType": "script", "tokens": Array [ @@ -26231,7 +26110,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, "line": 1, }, "start": Object { @@ -26241,15 +26138,69 @@ Object { }, "range": Array [ 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, 13, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, "line": 1, }, "start": Object { @@ -26259,25 +26210,25 @@ Object { }, "range": Array [ 14, - 17, + 15, ], "type": "Identifier", - "value": "foo", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, "range": Array [ - 17, - 18, + 15, + 16, ], "type": "Punctuator", "value": "(", @@ -26285,17 +26236,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { - "column": 18, + "column": 16, "line": 1, }, }, "range": Array [ - 18, - 19, + 16, + 17, ], "type": "Punctuator", "value": ")", @@ -26303,17 +26254,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 18, "line": 1, }, "start": Object { - "column": 20, + "column": 17, "line": 1, }, }, "range": Array [ - 20, - 21, + 17, + 18, ], "type": "Punctuator", "value": "{", @@ -26321,17 +26272,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 1, }, "start": Object { - "column": 21, + "column": 18, "line": 1, }, }, "range": Array [ - 21, - 22, + 18, + 19, ], "type": "Punctuator", "value": "}", @@ -26339,17 +26290,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { - "column": 22, + "column": 19, "line": 1, }, }, "range": Array [ - 22, - 23, + 19, + 20, ], "type": "Punctuator", "value": "}", @@ -26357,17 +26308,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 21, "line": 1, }, "start": Object { - "column": 23, + "column": 20, "line": 1, }, }, "range": Array [ - 23, - 24, + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -26377,69 +26328,208 @@ Object { } `; -exports[`javascript fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; - -exports[`javascript fixtures/classes/named-class-expression.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-computed-constructor.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", }, - }, - "range": Array [ - 9, - 11, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, - "start": Object { - "column": 7, - "line": 1, + "range": Array [ + 9, + 26, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 22, + 26, + ], + "type": "FunctionExpression", }, }, - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 41, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 46, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 46, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 42, + 46, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, + "range": Array [ + 8, + 47, + ], + "type": "ClassBody", + }, + "id": Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, + "name": "A", "range": Array [ - 1, - 11, + 6, + 7, ], - "superClass": null, - "type": "ClassExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 13, + "column": 47, "line": 1, }, "start": Object { @@ -26449,14 +26539,32 @@ Object { }, "range": Array [ 0, - 13, + 47, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 13, + "column": 48, "line": 1, }, "start": Object { @@ -26466,14 +26574,14 @@ Object { }, "range": Array [ 0, - 13, + 48, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -26483,51 +26591,51 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, 6, + 7, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, 8, + 9, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 1, }, "start": Object { @@ -26537,43 +26645,43 @@ Object { }, "range": Array [ 9, - 10, + 22, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"constructor\\"", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 23, "line": 1, }, "start": Object { - "column": 10, + "column": 22, "line": 1, }, }, "range": Array [ - 10, - 11, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 24, "line": 1, }, "start": Object { - "column": 11, + "column": 23, "line": 1, }, }, "range": Array [ - 11, - 12, + 23, + 24, ], "type": "Punctuator", "value": ")", @@ -26581,239 +26689,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 25, "line": 1, }, "start": Object { - "column": 12, + "column": 24, "line": 1, }, }, "range": Array [ - 12, - 13, + 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/classes/named-derived-class-expression.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 20, - ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "ClassExpression", - }, "loc": Object { "end": Object { - "column": 22, + "column": 26, "line": 1, }, "start": Object { - "column": 0, + "column": 25, "line": 1, }, }, "range": Array [ - 0, - 22, + 25, + 26, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 28, "line": 1, }, "start": Object { - "column": 0, + "column": 27, "line": 1, }, }, "range": Array [ - 0, - 1, + 27, + 28, ], "type": "Punctuator", - "value": "(", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 41, "line": 1, }, "start": Object { - "column": 1, + "column": 28, "line": 1, }, }, "range": Array [ - 1, - 6, + 28, + 41, ], - "type": "Keyword", - "value": "class", + "type": "String", + "value": "\\"constructor\\"", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 42, "line": 1, }, "start": Object { - "column": 7, + "column": 41, "line": 1, }, }, "range": Array [ - 7, - 8, + 41, + 42, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 43, "line": 1, }, "start": Object { - "column": 9, + "column": 42, "line": 1, }, }, "range": Array [ - 9, - 16, + 42, + 43, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 44, "line": 1, }, "start": Object { - "column": 17, + "column": 43, "line": 1, }, }, "range": Array [ - 17, - 18, + 43, + 44, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 45, "line": 1, }, "start": Object { - "column": 18, + "column": 44, "line": 1, }, }, "range": Array [ - 18, - 19, + 44, + 45, ], "type": "Punctuator", "value": "{", @@ -26821,17 +26833,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 46, "line": 1, }, "start": Object { - "column": 19, + "column": 45, "line": 1, }, }, "range": Array [ - 19, - 20, + 45, + 46, ], "type": "Punctuator", "value": "}", @@ -26839,35 +26851,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 47, "line": 1, }, "start": Object { - "column": 20, + "column": 46, "line": 1, }, }, "range": Array [ - 20, - 21, + 46, + 47, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 48, "line": 1, }, "start": Object { - "column": 21, + "column": 47, "line": 1, }, }, "range": Array [ - 21, - 22, + 47, + 48, ], "type": "Punctuator", "value": ";", @@ -26877,7 +26889,7 @@ Object { } `; -exports[`javascript fixtures/defaultParams/class-constructor.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-semi.src 1`] = ` Object { "body": Array [ Object { @@ -26888,35 +26900,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, - "name": "constructor", + "name": "a", "range": Array [ - 14, - 25, + 9, + 10, ], "type": "Identifier", }, - "kind": "constructor", + "kind": "method", "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ + 9, 14, - 44, ], "static": false, "type": "MethodDefinition", @@ -26926,17 +26938,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 27, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 37, - 44, + 12, + 14, ], "type": "BlockStatement", }, @@ -26945,73 +26957,96 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 10, + 14, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, }, "start": Object { "column": 15, - "line": 2, + "line": 1, }, }, - "params": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, + "name": "b", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, }, - "range": Array [ - 26, - 35, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 30, - 35, - ], - "raw": "'bar'", - "type": "Literal", - "value": "bar", + "start": Object { + "column": 18, + "line": 1, }, - "type": "AssignmentPattern", }, - ], + "range": Array [ + 18, + 20, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [], "range": Array [ - 25, - 44, + 16, + 20, ], "type": "FunctionExpression", }, @@ -27019,8 +27054,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 21, + "line": 1, }, "start": Object { "column": 8, @@ -27029,7 +27064,7 @@ Object { }, "range": Array [ 8, - 46, + 21, ], "type": "ClassBody", }, @@ -27053,8 +27088,8 @@ Object { }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 21, + "line": 1, }, "start": Object { "column": 0, @@ -27063,16 +27098,33 @@ Object { }, "range": Array [ 0, - 46, + 21, ], "superClass": null, "type": "ClassDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 22, + "line": 1, }, "start": Object { "column": 0, @@ -27081,7 +27133,7 @@ Object { }, "range": Array [ 0, - 47, + 22, ], "sourceType": "script", "tokens": Array [ @@ -27142,35 +27194,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 14, - 25, + 9, + 10, ], "type": "Identifier", - "value": "constructor", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 25, - 26, + 10, + 11, ], "type": "Punctuator", "value": "(", @@ -27178,71 +27230,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 26, - 29, + 11, + 12, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 29, - 30, + 12, + 13, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 30, - 35, + 13, + 14, ], - "type": "String", - "value": "'bar'", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 25, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 35, - 36, + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, ], "type": "Punctuator", "value": ")", @@ -27250,17 +27356,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 27, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 37, - 38, + 18, + 19, ], "type": "Punctuator", "value": "{", @@ -27268,17 +27374,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 19, + "line": 1, }, }, "range": Array [ - 43, - 44, + 19, + 20, ], "type": "Punctuator", "value": "}", @@ -27286,27 +27392,45 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 21, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 20, + "line": 1, }, }, "range": Array [ - 45, - 46, + 20, + 21, ], "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`javascript fixtures/defaultParams/class-method.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-three-semi.src 1`] = ` Object { "body": Array [ Object { @@ -27317,35 +27441,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 10, + "line": 1, }, }, - "name": "foo", + "name": "a", "range": Array [ - 14, - 17, + 10, + 11, ], "type": "Identifier", }, "kind": "method", "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 14, - 36, + 10, + 15, ], "static": false, "type": "MethodDefinition", @@ -27355,17 +27479,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 29, - 36, + 13, + 15, ], "type": "BlockStatement", }, @@ -27374,134 +27498,174 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 11, + "line": 1, }, }, - "params": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 18, - 27, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 27, - ], - "raw": "'baz'", - "type": "Literal", - "value": "baz", - }, - "type": "AssignmentPattern", - }, - ], + "params": Array [], "range": Array [ - 17, - 36, + 11, + 15, ], "type": "FunctionExpression", }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 38, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 17, + 21, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { "column": 0, "line": 1, }, }, "range": Array [ 0, - 38, + 23, ], "superClass": null, "type": "ClassDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 24, + "line": 1, }, "start": Object { "column": 0, @@ -27510,7 +27674,7 @@ Object { }, "range": Array [ 0, - 39, + 24, ], "sourceType": "script", "tokens": Array [ @@ -27571,107 +27735,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 17, - 18, + 9, + 10, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 18, - 21, + 10, + 11, ], "type": "Identifier", - "value": "bar", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 2, + "line": 1, }, "start": Object { "column": 11, - "line": 2, + "line": 1, }, }, "range": Array [ - 21, - 22, + 11, + 12, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 27, - ], - "type": "String", - "value": "'baz'", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, + "line": 1, }, }, "range": Array [ - 27, - 28, + 12, + 13, ], "type": "Punctuator", "value": ")", @@ -27679,17 +27807,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 29, - 30, + 13, + 14, ], "type": "Punctuator", "value": "{", @@ -27697,226 +27825,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/defaultParams/declaration.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 20, + "column": 15, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, - "params": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 16, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "AssignmentPattern", - }, - ], "range": Array [ - 0, - 20, + 14, + 15, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, "range": Array [ - 0, - 8, + 15, + 16, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 17, "line": 1, }, "start": Object { - "column": 9, + "column": 16, "line": 1, }, }, "range": Array [ - 9, - 10, + 16, + 17, ], "type": "Identifier", - "value": "f", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 18, "line": 1, }, "start": Object { - "column": 10, + "column": 17, "line": 1, }, }, "range": Array [ - 10, - 11, + 17, + 18, ], "type": "Punctuator", "value": "(", @@ -27924,250 +27897,312 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 19, "line": 1, }, "start": Object { - "column": 11, + "column": 18, "line": 1, }, }, "range": Array [ - 11, - 12, + 18, + 19, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 19, "line": 1, }, }, "range": Array [ - 13, - 14, + 19, + 20, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 21, "line": 1, }, "start": Object { - "column": 15, + "column": 20, "line": 1, }, }, "range": Array [ - 15, - 16, + 20, + 21, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 22, "line": 1, }, "start": Object { - "column": 16, + "column": 21, "line": 1, }, }, "range": Array [ - 16, - 17, + 21, + 22, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 23, "line": 1, }, "start": Object { - "column": 18, + "column": 22, "line": 1, }, }, "range": Array [ - 18, - 19, + 22, + 23, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 1, }, "start": Object { - "column": 19, + "column": 23, "line": 1, }, }, "range": Array [ - 19, - 20, + 23, + 24, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/defaultParams/expression.src 1`] = ` +exports[`javascript fixtures/classes/class-two-methods-two-semi.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 22, - ], - "right": Object { - "async": false, - "body": Object { - "body": Array [], + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 22, + "column": 14, "line": 1, }, "start": Object { - "column": 20, + "column": 9, "line": 1, }, }, "range": Array [ - 20, - 22, + 9, + 14, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "params": Array [ - Object { - "left": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { "column": 14, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, - "name": "y", "range": Array [ - 13, + 12, 14, ], - "type": "Identifier", + "type": "BlockStatement", }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 18, + "column": 14, "line": 1, }, "start": Object { - "column": 13, + "column": 10, "line": 1, }, }, + "params": Array [], "range": Array [ - 13, - 18, + 10, + 14, ], - "right": Object { + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 20, ], - "raw": "1", - "type": "Literal", - "value": 1, + "type": "BlockStatement", }, - "type": "AssignmentPattern", + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 16, + 20, + ], + "type": "FunctionExpression", }, - ], - "range": Array [ - 4, - 22, - ], - "type": "FunctionExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - "type": "AssignmentExpression", + "range": Array [ + 8, + 22, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, "loc": Object { "end": Object { @@ -28183,12 +28218,30 @@ Object { 0, 22, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 1, }, "start": Object { @@ -28198,14 +28251,14 @@ Object { }, "range": Array [ 0, - 22, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -28215,28 +28268,82 @@ Object { }, "range": Array [ 0, - 1, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 9, "line": 1, }, "start": Object { - "column": 2, + "column": 8, "line": 1, }, }, "range": Array [ - 2, - 3, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -28245,16 +28352,16 @@ Object { "line": 1, }, "start": Object { - "column": 4, + "column": 11, "line": 1, }, }, "range": Array [ - 4, + 11, 12, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -28272,7 +28379,7 @@ Object { 13, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { @@ -28289,8 +28396,26 @@ Object { 13, 14, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { @@ -28307,8 +28432,26 @@ Object { 15, 16, ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { @@ -28325,8 +28468,8 @@ Object { 17, 18, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -28344,7 +28487,25 @@ Object { 19, ], "type": "Punctuator", - "value": ")", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -28362,7 +28523,7 @@ Object { 21, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { @@ -28382,207 +28543,229 @@ Object { "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`javascript fixtures/defaultParams/method.src 1`] = ` +exports[`javascript fixtures/classes/class-two-static-methods-named-constructor.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 27, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 16, + 27, + ], + "type": "Identifier", }, - "start": Object { - "column": 4, - "line": 1, + "kind": "method", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "range": Array [ + 9, + 31, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 7, + "column": 31, "line": 1, }, "start": Object { - "column": 6, + "column": 29, "line": 1, }, }, - "name": "f", "range": Array [ - 6, - 7, + 29, + 31, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "init", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 25, + "column": 31, "line": 1, }, "start": Object { - "column": 6, + "column": 27, "line": 1, }, }, - "method": false, + "params": Array [], "range": Array [ - 6, - 25, + 27, + 31, ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 25, - ], - "type": "BlockStatement", + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, }, - "expression": false, - "generator": false, - "id": null, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 39, + 50, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 54, + ], + "static": true, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 25, + "column": 54, "line": 1, }, "start": Object { - "column": 9, + "column": 52, "line": 1, }, }, - "params": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 21, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "AssignmentPattern", - }, - ], "range": Array [ - 9, - 25, + 52, + 54, ], - "type": "FunctionExpression", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 54, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, }, + "params": Array [], + "range": Array [ + 50, + 54, + ], + "type": "FunctionExpression", }, - ], - "range": Array [ - 4, - 27, - ], - "type": "ObjectExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - "type": "AssignmentExpression", + "range": Array [ + 8, + 55, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 27, + "column": 55, "line": 1, }, "start": Object { @@ -28592,14 +28775,32 @@ Object { }, "range": Array [ 0, - 27, + 55, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 27, + "column": 56, "line": 1, }, "start": Object { @@ -28609,14 +28810,14 @@ Object { }, "range": Array [ 0, - 27, + 56, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -28626,43 +28827,43 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, "range": Array [ - 2, - 3, + 6, + 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 8, "line": 1, }, }, "range": Array [ - 4, - 5, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -28670,143 +28871,179 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 15, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, "range": Array [ - 6, - 7, + 9, + 15, + ], + "type": "Keyword", + "value": "static", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 27, ], "type": "Identifier", - "value": "f", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 28, "line": 1, }, "start": Object { - "column": 7, + "column": 27, "line": 1, }, }, "range": Array [ - 7, - 8, + 27, + 28, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 29, "line": 1, }, "start": Object { - "column": 9, + "column": 28, "line": 1, }, }, "range": Array [ - 9, - 17, + 28, + 29, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 30, "line": 1, }, "start": Object { - "column": 17, + "column": 29, "line": 1, }, }, "range": Array [ - 17, - 18, + 29, + 30, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 30, "line": 1, }, }, "range": Array [ - 18, - 19, + 30, + 31, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 38, "line": 1, }, "start": Object { - "column": 19, + "column": 32, "line": 1, }, }, "range": Array [ - 19, - 20, + 32, + 38, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 50, "line": 1, }, "start": Object { - "column": 20, + "column": 39, "line": 1, }, }, "range": Array [ - 20, - 21, + 39, + 50, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 51, "line": 1, }, "start": Object { - "column": 21, + "column": 50, "line": 1, }, }, "range": Array [ - 21, - 22, + 50, + 51, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 51, + "line": 1, + }, + }, + "range": Array [ + 51, + 52, ], "type": "Punctuator", "value": ")", @@ -28814,17 +29051,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 53, "line": 1, }, "start": Object { - "column": 23, + "column": 52, "line": 1, }, }, "range": Array [ - 23, - 24, + 52, + 53, ], "type": "Punctuator", "value": "{", @@ -28832,17 +29069,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 54, "line": 1, }, "start": Object { - "column": 24, + "column": 53, "line": 1, }, }, "range": Array [ - 24, - 25, + 53, + 54, ], "type": "Punctuator", "value": "}", @@ -28850,202 +29087,166 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 55, "line": 1, }, "start": Object { - "column": 26, + "column": 54, "line": 1, }, }, "range": Array [ - 26, - 27, + 54, + 55, ], "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`javascript fixtures/defaultParams/not-all-params.src 1`] = ` +exports[`javascript fixtures/classes/class-with-constructor.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [], + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 35, + "column": 20, "line": 1, }, "start": Object { - "column": 33, + "column": 9, "line": 1, }, }, + "name": "constructor", "range": Array [ - 33, - 35, + 9, + 20, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, + "kind": "constructor", "loc": Object { "end": Object { - "column": 35, + "column": 24, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, - "params": Array [ - Object { + "range": Array [ + 9, + 24, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 1, }, "start": Object { - "column": 19, + "column": 22, "line": 1, }, }, - "name": "a", "range": Array [ - 19, - 20, + 22, + 24, ], - "type": "Identifier", + "type": "BlockStatement", }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 28, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 28, - ], - "raw": "42", - "type": "Literal", - "value": 42, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, }, - "type": "AssignmentPattern", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, + "start": Object { + "column": 20, + "line": 1, }, - "name": "c", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", }, - ], - "range": Array [ - 10, - 35, - ], - "type": "FunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "params": Array [], + "range": Array [ + 20, + 24, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 4, - 35, - ], - "type": "VariableDeclarator", + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - ], - "kind": "var", + "range": Array [ + 8, + 25, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 36, + "column": 25, "line": 1, }, "start": Object { @@ -29055,14 +29256,32 @@ Object { }, "range": Array [ 0, - 36, + 25, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 36, + "column": 26, "line": 1, }, "start": Object { @@ -29072,14 +29291,14 @@ Object { }, "range": Array [ 0, - 36, + 26, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -29089,10 +29308,10 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { @@ -29101,16 +29320,16 @@ Object { "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, + 6, 7, ], "type": "Identifier", - "value": "foo", + "value": "A", }, Object { "loc": Object { @@ -29128,40 +29347,40 @@ Object { 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ - 10, - 18, + 9, + 20, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 21, "line": 1, }, "start": Object { - "column": 18, + "column": 20, "line": 1, }, }, "range": Array [ - 18, - 19, + 20, + 21, ], "type": "Punctuator", "value": "(", @@ -29169,56 +29388,56 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 22, "line": 1, }, "start": Object { - "column": 19, + "column": 21, "line": 1, }, }, "range": Array [ - 19, - 20, + 21, + 22, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 20, + "column": 22, "line": 1, }, }, "range": Array [ - 20, - 21, + 22, + 23, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, "range": Array [ - 22, 23, + 24, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -29236,94 +29455,271 @@ Object { 25, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 26, "line": 1, }, "start": Object { - "column": 26, + "column": 25, "line": 1, }, }, "range": Array [ + 25, 26, - 28, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/class-with-constructor-parameters.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "constructor", + "range": Array [ + 9, + 20, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 32, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 20, + 32, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 33, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 29, + "column": 33, "line": 1, }, "start": Object { - "column": 28, + "column": 0, "line": 1, }, }, "range": Array [ - 28, - 29, + 0, + 33, ], - "type": "Punctuator", - "value": ",", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 31, + "column": 5, "line": 1, }, "start": Object { - "column": 30, + "column": 0, "line": 1, }, }, "range": Array [ - 30, - 31, + 0, + 5, ], - "type": "Identifier", - "value": "c", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 7, "line": 1, }, "start": Object { - "column": 31, + "column": 6, "line": 1, }, }, "range": Array [ - 31, - 32, + 6, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 9, "line": 1, }, "start": Object { - "column": 33, + "column": 8, "line": 1, }, }, "range": Array [ - 33, - 34, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -29331,475 +29727,292 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 20, "line": 1, }, "start": Object { - "column": 34, + "column": 9, "line": 1, }, }, "range": Array [ - 34, - 35, + 9, + 20, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 21, "line": 1, }, "start": Object { - "column": 35, + "column": 20, "line": 1, }, }, "range": Array [ - 35, - 36, + 20, + 21, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/array-member.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "elements": Array [ - Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "ok", - "range": Array [ - 1, - 3, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "v", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "range": Array [ - 1, - 5, - ], - "type": "MemberExpression", - }, - ], - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 11, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "20", - "type": "Literal", - "value": 20, - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 1, - ], - "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 24, "line": 1, }, "start": Object { - "column": 1, + "column": 21, "line": 1, }, }, "range": Array [ - 1, - 3, + 21, + 24, ], "type": "Identifier", - "value": "ok", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 25, "line": 1, }, "start": Object { - "column": 3, + "column": 24, "line": 1, }, }, "range": Array [ - 3, - 4, + 24, + 25, ], "type": "Punctuator", - "value": ".", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 29, "line": 1, }, "start": Object { - "column": 4, + "column": 26, "line": 1, }, }, "range": Array [ - 4, - 5, + 26, + 29, ], "type": "Identifier", - "value": "v", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 30, "line": 1, }, "start": Object { - "column": 5, + "column": 29, "line": 1, }, }, "range": Array [ - 5, - 6, + 29, + 30, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 31, "line": 1, }, "start": Object { - "column": 7, + "column": 30, "line": 1, }, }, "range": Array [ - 7, - 8, + 30, + 31, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 32, "line": 1, }, "start": Object { - "column": 9, + "column": 31, "line": 1, }, }, "range": Array [ - 9, - 11, + 31, + 32, ], - "type": "Numeric", - "value": "20", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 33, "line": 1, }, "start": Object { - "column": 11, + "column": 32, "line": 1, }, }, "range": Array [ - 11, - 12, + 32, + 33, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/array-to-array.src 1`] = ` +exports[`javascript fixtures/classes/class-with-constructor-with-space.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "elements": Array [ - Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 2, + "column": 20, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, - "name": "a", + "name": "constructor", "range": Array [ - 1, - 2, + 9, + 20, ], "type": "Identifier", }, - Object { + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 25, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 5, + "column": 25, "line": 1, }, "start": Object { - "column": 4, + "column": 21, "line": 1, }, }, - "name": "b", + "params": Array [], "range": Array [ - 4, - 5, + 21, + 25, ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "FunctionExpression", }, }, - "range": Array [ - 0, - 6, - ], - "type": "ArrayPattern", - }, + ], "loc": Object { "end": Object { - "column": 15, + "column": 26, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, - "operator": "=", "range": Array [ - 0, - 15, + 8, + 26, ], - "right": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, }, - "range": Array [ - 9, - 15, - ], - "type": "ArrayExpression", }, - "type": "AssignmentExpression", + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 26, "line": 1, }, "start": Object { @@ -29809,15 +30022,33 @@ Object { }, "range": Array [ 0, - 16, + 26, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -29826,14 +30057,14 @@ Object { }, "range": Array [ 0, - 16, + 28, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -29843,244 +30074,188 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 2, + 6, + 7, ], "type": "Identifier", - "value": "a", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 9, "line": 1, }, "start": Object { - "column": 2, + "column": 8, "line": 1, }, }, "range": Array [ - 2, - 3, + 8, + 9, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 20, "line": 1, }, "start": Object { - "column": 4, + "column": 9, "line": 1, }, }, "range": Array [ - 4, - 5, + 9, + 20, ], "type": "Identifier", - "value": "b", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 22, "line": 1, }, "start": Object { - "column": 5, + "column": 21, "line": 1, }, }, "range": Array [ - 5, - 6, + 21, + 22, ], "type": "Punctuator", - "value": "]", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 23, "line": 1, }, "start": Object { - "column": 7, + "column": 22, "line": 1, }, }, "range": Array [ - 7, - 8, + 22, + 23, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 24, "line": 1, }, "start": Object { - "column": 9, + "column": 23, "line": 1, }, }, "range": Array [ - 9, - 10, + 23, + 24, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 25, "line": 1, }, "start": Object { - "column": 10, + "column": 24, "line": 1, }, }, "range": Array [ - 10, - 11, + 24, + 25, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 26, "line": 1, }, "start": Object { - "column": 11, + "column": 25, "line": 1, }, }, "range": Array [ - 11, - 12, + 25, + 26, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 26, "line": 1, }, }, "range": Array [ - 13, - 14, + 26, + 27, ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ";", + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/array-var-undefined.src 1`] = ` +exports[`javascript fixtures/classes/derived-class-assign-to-var.src 1`] = ` Object { "body": Array [ Object { "declarations": Array [ Object { "id": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - ], "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -30088,33 +30263,88 @@ Object { "line": 1, }, }, + "name": "x", "range": Array [ 4, - 7, + 5, ], - "type": "ArrayPattern", + "type": "Identifier", }, "init": Object { - "elements": Array [], + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 27, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 12, + "column": 27, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 12, + 8, + 27, ], - "type": "ArrayExpression", + "superClass": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassExpression", }, "loc": Object { "end": Object { - "column": 12, + "column": 27, "line": 1, }, "start": Object { @@ -30124,7 +30354,7 @@ Object { }, "range": Array [ 4, - 12, + 27, ], "type": "VariableDeclarator", }, @@ -30132,7 +30362,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 13, + "column": 28, "line": 1, }, "start": Object { @@ -30142,14 +30372,14 @@ Object { }, "range": Array [ 0, - 13, + 28, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 13, + "column": 28, "line": 1, }, "start": Object { @@ -30159,7 +30389,7 @@ Object { }, "range": Array [ 0, - 13, + 28, ], "sourceType": "script", "tokens": Array [ @@ -30196,113 +30426,149 @@ Object { 4, 5, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "range": Array [ - 5, 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, ], "type": "Identifier", - "value": "a", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 23, "line": 1, }, "start": Object { - "column": 6, + "column": 16, "line": 1, }, }, "range": Array [ - 6, - 7, + 16, + 23, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 25, "line": 1, }, "start": Object { - "column": 8, + "column": 24, "line": 1, }, }, "range": Array [ - 8, - 9, + 24, + 25, ], - "type": "Punctuator", - "value": "=", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 26, "line": 1, }, "start": Object { - "column": 10, + "column": 25, "line": 1, }, }, "range": Array [ - 10, - 11, + 25, + 26, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 27, "line": 1, }, "start": Object { - "column": 11, + "column": 26, "line": 1, }, }, "range": Array [ - 11, - 12, + 26, + 27, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 28, "line": 1, }, "start": Object { - "column": 12, + "column": 27, "line": 1, }, }, "range": Array [ - 12, - 13, + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -30312,185 +30578,69 @@ Object { } `; -exports[`javascript fixtures/destructuring/class-constructor-params-array.src 1`] = ` +exports[`javascript fixtures/classes/derived-class-expression.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "consturctor", - "range": Array [ - 14, - 25, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, }, - "range": Array [ - 14, - 45, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 38, - 45, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "params": Array [ - Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 36, - ], - "type": "ArrayPattern", - }, - ], - "range": Array [ - 25, - 45, - ], - "type": "FunctionExpression", + "start": Object { + "column": 16, + "line": 1, }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "range": Array [ + 16, + 18, + ], + "type": "ClassBody", }, - "range": Array [ - 8, - 47, - ], - "type": "ClassBody", - }, - "id": Object { + "id": null, "loc": Object { "end": Object { - "column": 7, + "column": 18, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, - "name": "A", "range": Array [ - 6, - 7, + 1, + 18, ], - "type": "Identifier", + "superClass": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 20, + "line": 1, }, "start": Object { "column": 0, @@ -30499,16 +30649,15 @@ Object { }, "range": Array [ 0, - 47, + 20, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 20, + "line": 1, }, "start": Object { "column": 0, @@ -30517,14 +30666,14 @@ Object { }, "range": Array [ 0, - 48, + 20, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -30534,205 +30683,283 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, "range": Array [ + 1, 6, - 7, ], - "type": "Identifier", - "value": "A", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "range": Array [ - 8, - 9, + 7, + 14, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 14, - 25, + 15, + 16, ], - "type": "Identifier", - "value": "consturctor", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 25, - 26, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 26, - 27, + 17, + 18, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 27, - 30, + 18, + 19, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 30, - 31, + 19, + 20, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/empty-class.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 10, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 32, - 35, + 0, + 10, ], - "type": "Identifier", - "value": "bar", + "superClass": null, + "type": "ClassDeclaration", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 25, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 35, - 36, + 10, + 11, ], - "type": "Punctuator", - "value": "]", + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 26, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 36, - 37, + 0, + 5, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 7, + "line": 1, }, "start": Object { - "column": 28, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 38, - 39, + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -30740,17 +30967,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 44, - 45, + 9, + 10, ], "type": "Punctuator", "value": "}", @@ -30758,243 +30985,36 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 11, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 10, + "line": 1, }, }, "range": Array [ - 46, - 47, + 10, + 11, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` +exports[`javascript fixtures/classes/empty-class-double-semi.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "consturctor", - "range": Array [ - 14, - 25, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 49, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 42, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "params": Array [ - Object { - "elements": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 27, - 32, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "AssignmentPattern", - }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 34, - 39, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 38, - 39, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, - "type": "AssignmentPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 30, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 40, - ], - "type": "ArrayPattern", - }, - ], - "range": Array [ - 25, - 49, - ], - "type": "FunctionExpression", - }, - }, - ], + "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 10, + "line": 1, }, "start": Object { "column": 8, @@ -31003,7 +31023,7 @@ Object { }, "range": Array [ 8, - 51, + 10, ], "type": "ClassBody", }, @@ -31027,8 +31047,8 @@ Object { }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 10, + "line": 1, }, "start": Object { "column": 0, @@ -31037,16 +31057,33 @@ Object { }, "range": Array [ 0, - 51, + 10, ], "superClass": null, "type": "ClassDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 11, + "line": 1, }, "start": Object { "column": 0, @@ -31055,7 +31092,7 @@ Object { }, "range": Array [ 0, - 52, + 11, ], "sourceType": "script", "tokens": Array [ @@ -31116,233 +31153,443 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 25, - ], - "type": "Identifier", - "value": "consturctor", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 25, - 26, + 9, + 10, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 26, - 27, + 10, + 11, ], "type": "Punctuator", - "value": "[", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/empty-class-semi.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 27, - 30, + 0, + 11, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, ], "type": "Identifier", - "value": "foo", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 30, - 31, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 21, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 31, - 32, + 9, + 10, ], - "type": "Numeric", - "value": "3", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 32, - 33, + 10, + 11, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 34, - 37, + 11, + 12, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/empty-literal-derived-class.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 27, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 37, - 38, + 0, + 20, ], - "type": "Punctuator", - "value": "=", + "superClass": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassDeclaration", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 28, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 38, - 39, + 20, + 21, ], - "type": "Numeric", - "value": "4", + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 29, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 39, - 40, + 0, + 5, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 2, + "column": 7, + "line": 1, }, "start": Object { - "column": 30, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 40, - 41, + 6, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 32, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 42, - 43, + 8, + 15, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, ], "type": "Punctuator", "value": "{", @@ -31350,17 +31597,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 19, + "line": 1, }, }, "range": Array [ - 48, - 49, + 19, + 20, ], "type": "Punctuator", "value": "}", @@ -31368,312 +31615,257 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 21, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 20, + "line": 1, }, }, "range": Array [ - 50, - 51, + 20, + 21, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` +exports[`javascript fixtures/classes/invalid-class-declaration.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "consturctor", - "range": Array [ - 14, - 25, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 49, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 42, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 27, - 32, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 27, - 32, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 34, - 39, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 34, - 39, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 38, - 39, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 26, - 40, - ], - "type": "ObjectPattern", + "body": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/invalid-class-setter-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, + }, + "name": "foo", + "range": Array [ + 14, + 17, ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 22, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "params": Array [], "range": Array [ - 25, - 49, + 17, + 22, ], "type": "FunctionExpression", }, @@ -31681,8 +31873,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 23, + "line": 1, }, "start": Object { "column": 8, @@ -31691,7 +31883,7 @@ Object { }, "range": Array [ 8, - 51, + 23, ], "type": "ClassBody", }, @@ -31715,8 +31907,8 @@ Object { }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 23, + "line": 1, }, "start": Object { "column": 0, @@ -31725,16 +31917,33 @@ Object { }, "range": Array [ 0, - 51, + 23, ], "superClass": null, "type": "ClassDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 2, }, "start": Object { "column": 0, @@ -31743,7 +31952,7 @@ Object { }, "range": Array [ 0, - 52, + 25, ], "sourceType": "script", "tokens": Array [ @@ -31804,197 +32013,331 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 14, - 25, + 10, + 13, ], "type": "Identifier", - "value": "consturctor", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 25, - 26, + 14, + 17, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 26, - 27, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 27, - 30, + 18, + 19, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 21, - "line": 2, + "line": 1, }, "start": Object { "column": 20, - "line": 2, + "line": 1, }, }, "range": Array [ - 30, - 31, + 20, + 21, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 22, - "line": 2, + "line": 1, }, "start": Object { "column": 21, - "line": 2, + "line": 1, }, }, "range": Array [ - 31, - 32, + 21, + 22, ], - "type": "Numeric", - "value": "3", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 2, + "line": 1, }, "start": Object { "column": 22, - "line": 2, + "line": 1, }, }, "range": Array [ - 32, - 33, + 22, + 23, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 34, - 37, + 23, + 24, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/invalid-class-two-super-classes.src 1`] = `"Classes can only extend a single class."`; + +exports[`javascript fixtures/classes/named-class-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 11, + ], + "superClass": null, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 1, + "line": 1, }, "start": Object { - "column": 27, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 37, - 38, + 0, + 1, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 6, + "line": 1, }, "start": Object { - "column": 28, - "line": 2, + "column": 1, + "line": 1, }, }, "range": Array [ - 38, - 39, + 1, + 6, ], - "type": "Numeric", - "value": "4", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 29, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 39, - 40, + 7, + 8, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, ], "type": "Punctuator", "value": "}", @@ -32002,17 +32345,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 30, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 40, - 41, + 11, + 12, ], "type": "Punctuator", "value": ")", @@ -32020,63 +32363,303 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 32, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 42, - 43, + 12, + 13, ], "type": "Punctuator", - "value": "{", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/classes/named-derived-class-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 20, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "ClassExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 1, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 48, - 49, + 0, + 1, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { "column": 1, - "line": 4, + "line": 1, + }, + }, + "range": Array [ + 1, + 6, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 7, + "line": 1, }, }, "range": Array [ - 50, - 51, + 7, + 8, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 16, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, ], "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/class-constructor-params-object.src 1`] = ` +exports[`javascript fixtures/defaultParams/class-constructor.src 1`] = ` Object { "body": Array [ Object { @@ -32095,14 +32678,14 @@ Object { "line": 2, }, }, - "name": "consturctor", + "name": "constructor", "range": Array [ 14, 25, ], "type": "Identifier", }, - "kind": "method", + "kind": "constructor", "loc": Object { "end": Object { "column": 5, @@ -32115,7 +32698,7 @@ Object { }, "range": Array [ 14, - 45, + 44, ], "static": false, "type": "MethodDefinition", @@ -32129,13 +32712,13 @@ Object { "line": 3, }, "start": Object { - "column": 28, + "column": 27, "line": 2, }, }, "range": Array [ - 38, - 45, + 37, + 44, ], "type": "BlockStatement", }, @@ -32154,142 +32737,63 @@ Object { }, "params": Array [ Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 2, + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, }, - "start": Object { + "name": "foo", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { "column": 16, "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 27, - 30, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 32, - 35, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - }, - ], "range": Array [ 26, - 36, + 35, ], - "type": "ObjectPattern", + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 35, + ], + "raw": "'bar'", + "type": "Literal", + "value": "bar", + }, + "type": "AssignmentPattern", }, ], "range": Array [ 25, - 45, + 44, ], "type": "FunctionExpression", }, @@ -32307,7 +32811,7 @@ Object { }, "range": Array [ 8, - 47, + 46, ], "type": "ClassBody", }, @@ -32341,7 +32845,7 @@ Object { }, "range": Array [ 0, - 47, + 46, ], "superClass": null, "type": "ClassDeclaration", @@ -32359,7 +32863,7 @@ Object { }, "range": Array [ 0, - 48, + 47, ], "sourceType": "script", "tokens": Array [ @@ -32433,7 +32937,7 @@ Object { 25, ], "type": "Identifier", - "value": "consturctor", + "value": "constructor", }, Object { "loc": Object { @@ -32456,7 +32960,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 2, }, "start": Object { @@ -32466,25 +32970,7 @@ Object { }, "range": Array [ 26, - 27, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 27, - 30, + 29, ], "type": "Identifier", "value": "foo", @@ -32492,20 +32978,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 2, }, "start": Object { - "column": 20, + "column": 19, "line": 2, }, }, "range": Array [ + 29, 30, - 31, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { @@ -32514,16 +33000,16 @@ Object { "line": 2, }, "start": Object { - "column": 22, + "column": 20, "line": 2, }, }, "range": Array [ - 32, + 30, 35, ], - "type": "Identifier", - "value": "bar", + "type": "String", + "value": "'bar'", }, Object { "loc": Object { @@ -32541,40 +33027,22 @@ Object { 36, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 28, "line": 2, }, "start": Object { - "column": 28, + "column": 27, "line": 2, }, }, "range": Array [ + 37, 38, - 39, ], "type": "Punctuator", "value": "{", @@ -32591,8 +33059,8 @@ Object { }, }, "range": Array [ + 43, 44, - 45, ], "type": "Punctuator", "value": "}", @@ -32609,8 +33077,8 @@ Object { }, }, "range": Array [ + 45, 46, - 47, ], "type": "Punctuator", "value": "}", @@ -32620,7 +33088,7 @@ Object { } `; -exports[`javascript fixtures/destructuring/class-method-params-array.src 1`] = ` +exports[`javascript fixtures/defaultParams/class-method.src 1`] = ` Object { "body": Array [ Object { @@ -32659,7 +33127,7 @@ Object { }, "range": Array [ 14, - 37, + 36, ], "static": false, "type": "MethodDefinition", @@ -32673,13 +33141,13 @@ Object { "line": 3, }, "start": Object { - "column": 20, + "column": 19, "line": 2, }, }, "range": Array [ - 30, - 37, + 29, + 36, ], "type": "BlockStatement", }, @@ -32698,47 +33166,27 @@ Object { }, "params": Array [ Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, + "left": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, }, - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, + "start": Object { + "column": 8, + "line": 2, }, - "name": "baz", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", }, - ], + "name": "bar", + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 2, }, "start": Object { @@ -32748,14 +33196,33 @@ Object { }, "range": Array [ 18, - 28, + 27, ], - "type": "ArrayPattern", + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 27, + ], + "raw": "'baz'", + "type": "Literal", + "value": "baz", + }, + "type": "AssignmentPattern", }, ], "range": Array [ 17, - 37, + 36, ], "type": "FunctionExpression", }, @@ -32773,7 +33240,7 @@ Object { }, "range": Array [ 8, - 39, + 38, ], "type": "ClassBody", }, @@ -32807,7 +33274,7 @@ Object { }, "range": Array [ 0, - 39, + 38, ], "superClass": null, "type": "ClassDeclaration", @@ -32825,7 +33292,7 @@ Object { }, "range": Array [ 0, - 40, + 39, ], "sourceType": "script", "tokens": Array [ @@ -32922,7 +33389,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 2, }, "start": Object { @@ -32932,25 +33399,7 @@ Object { }, "range": Array [ 18, - 19, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 22, + 21, ], "type": "Identifier", "value": "bar", @@ -32958,20 +33407,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 2, }, "start": Object { - "column": 12, + "column": 11, "line": 2, }, }, "range": Array [ + 21, 22, - 23, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { @@ -32980,16 +33429,16 @@ Object { "line": 2, }, "start": Object { - "column": 14, + "column": 12, "line": 2, }, }, "range": Array [ - 24, + 22, 27, ], - "type": "Identifier", - "value": "baz", + "type": "String", + "value": "'baz'", }, Object { "loc": Object { @@ -33007,40 +33456,22 @@ Object { 28, ], "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 2, }, "start": Object { - "column": 20, + "column": 19, "line": 2, }, }, "range": Array [ + 29, 30, - 31, ], "type": "Punctuator", "value": "{", @@ -33057,8 +33488,8 @@ Object { }, }, "range": Array [ + 35, 36, - 37, ], "type": "Punctuator", "value": "}", @@ -33075,8 +33506,8 @@ Object { }, }, "range": Array [ + 37, 38, - 39, ], "type": "Punctuator", "value": "}", @@ -33086,275 +33517,126 @@ Object { } `; -exports[`javascript fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` +exports[`javascript fixtures/defaultParams/declaration.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "body": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", }, - "kind": "method", + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "right": Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 14, - 41, + 15, + 16, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 34, - 41, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "params": Array [ - Object { - "elements": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 24, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 24, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "AssignmentPattern", - }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 31, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, - "type": "AssignmentPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 18, - 32, - ], - "type": "ArrayPattern", - }, - ], - "range": Array [ - 17, - 41, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 43, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + "raw": "1", + "type": "Literal", + "value": 1, }, + "type": "AssignmentPattern", }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, + ], "range": Array [ 0, - 43, + 20, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 20, + "line": 1, }, "start": Object { "column": 0, @@ -33363,14 +33645,14 @@ Object { }, "range": Array [ 0, - 44, + 20, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -33380,205 +33662,79 @@ Object { }, "range": Array [ 0, - 5, + 8, ], "type": "Keyword", - "value": "class", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "A", - }, - Object { - "loc": Object { - "end": Object { "column": 9, "line": 1, }, - "start": Object { - "column": 8, - "line": 1, - }, }, "range": Array [ - 8, 9, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 17, + 10, ], "type": "Identifier", - "value": "foo", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 17, - 18, + 10, + 11, ], "type": "Punctuator", "value": "(", }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "[", - }, Object { "loc": Object { "end": Object { "column": 12, - "line": 2, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 19, - 22, + 11, + 12, ], "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "=", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 2, + "line": 1, }, "start": Object { "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Numeric", - "value": "3", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, + "line": 1, }, }, "range": Array [ - 29, - 30, + 13, + 14, ], "type": "Punctuator", "value": "=", @@ -33586,53 +33742,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 30, - 31, + 15, + 16, ], "type": "Numeric", - "value": "4", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": "]", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 32, - 33, + 16, + 17, ], "type": "Punctuator", "value": ")", @@ -33640,17 +33778,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 34, - 35, + 18, + 19, ], "type": "Punctuator", "value": "{", @@ -33658,35 +33796,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, + "column": 20, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 19, + "line": 1, }, }, "range": Array [ - 42, - 43, + 19, + 20, ], "type": "Punctuator", "value": "}", @@ -33696,335 +33816,145 @@ Object { } `; -exports[`javascript fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` +exports[`javascript fixtures/defaultParams/expression.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 22, + ], + "right": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, }, }, "range": Array [ - 14, - 41, + 20, + 22, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 13, + "line": 1, }, }, + "name": "y", "range": Array [ - 34, - 41, + 13, + 14, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 13, + "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 19, - 24, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 24, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 24, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 26, - 31, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "baz", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 31, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 18, - 32, - ], - "type": "ObjectPattern", - }, - ], "range": Array [ - 17, - 41, + 13, + 18, ], - "type": "FunctionExpression", + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 43, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + ], + "range": Array [ + 4, + 22, + ], + "type": "FunctionExpression", }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 22, + "line": 1, }, "start": Object { "column": 0, @@ -34033,16 +33963,15 @@ Object { }, "range": Array [ 0, - 43, + 22, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 22, + "line": 1, }, "start": Object { "column": 0, @@ -34051,14 +33980,14 @@ Object { }, "range": Array [ 0, - 44, + 22, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -34068,205 +33997,436 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { - "column": 6, + "column": 2, "line": 1, }, }, "range": Array [ - 6, - 7, + 2, + 3, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 12, "line": 1, }, "start": Object { - "column": 8, + "column": 4, "line": 1, }, }, "range": Array [ - 8, - 9, + 4, + 12, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 14, - 17, + 12, + 13, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 17, - 18, + 13, + 14, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 18, - 19, + 15, + 16, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 19, - 22, + 17, + 18, ], - "type": "Identifier", - "value": "bar", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 22, - 23, + 18, + 19, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 23, - 24, + 20, + 21, ], - "type": "Numeric", - "value": "3", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 24, - 25, + 21, + 22, ], "type": "Punctuator", - "value": ",", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/defaultParams/method.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 27, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 9, + 25, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 4, + 27, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 1, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 26, - 29, + 0, + 1, ], "type": "Identifier", - "value": "baz", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 3, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 2, + "line": 1, }, }, "range": Array [ - 29, - 30, + 2, + 3, ], "type": "Punctuator", "value": "=", @@ -34274,53 +34434,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 5, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 4, + "line": 1, }, }, "range": Array [ - 30, - 31, + 4, + 5, ], - "type": "Numeric", - "value": "3", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 7, + "line": 1, }, "start": Object { - "column": 21, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 31, - 32, + 6, + 7, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, }, "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { "column": 22, - "line": 2, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, }, }, "range": Array [ - 32, - 33, + 21, + 22, ], "type": "Punctuator", "value": ")", @@ -34328,17 +34596,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 34, - 35, + 23, + 24, ], "type": "Punctuator", "value": "{", @@ -34346,17 +34614,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 40, - 41, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -34364,17 +34632,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 27, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 42, - 43, + 26, + 27, ], "type": "Punctuator", "value": "}", @@ -34384,263 +34652,183 @@ Object { } `; -exports[`javascript fixtures/destructuring/class-method-params-object.src 1`] = ` +exports[`javascript fixtures/defaultParams/not-all-params.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 35, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 33, + "line": 1, }, }, - "name": "foo", "range": Array [ - 14, - 17, + 33, + 35, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "method", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 35, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 10, + "line": 1, }, }, - "range": Array [ - 14, - 37, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 19, + "line": 1, }, }, + "name": "a", "range": Array [ - 30, - 37, + 19, + 20, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 2, - }, + "type": "Identifier", }, - "params": Array [ - Object { + Object { + "left": Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 22, + "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 19, - 22, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, + "name": "b", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 28, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": "baz", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 24, - 27, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "name": "baz", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, + "start": Object { + "column": 26, + "line": 1, }, - ], + }, "range": Array [ - 18, + 26, 28, ], - "type": "ObjectPattern", + "raw": "42", + "type": "Literal", + "value": 42, }, - ], - "range": Array [ - 17, - 37, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 39, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, + "type": "AssignmentPattern", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 10, + 35, + ], + "type": "FunctionExpression", }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 35, + ], + "type": "VariableDeclarator", }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { "column": 0, @@ -34649,16 +34837,15 @@ Object { }, "range": Array [ 0, - 39, + 36, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 36, + "line": 1, }, "start": Object { "column": 0, @@ -34667,14 +34854,14 @@ Object { }, "range": Array [ 0, - 40, + 36, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -34684,10 +34871,10 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "var", }, Object { "loc": Object { @@ -34696,16 +34883,16 @@ Object { "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, + 4, 7, ], "type": "Identifier", - "value": "A", + "value": "foo", }, Object { "loc": Object { @@ -34723,40 +34910,40 @@ Object { 9, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 14, - 17, + 10, + 18, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Punctuator", "value": "(", @@ -34764,102 +34951,102 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 18, 19, + 20, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 19, - 22, + 20, + 21, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ 22, 23, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ 24, - 27, + 25, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ - 27, + 26, 28, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ @@ -34867,40 +35054,76 @@ Object { 29, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 31, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 30, + "line": 1, }, }, "range": Array [ 30, 31, ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], "type": "Punctuator", "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 35, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 34, + "line": 1, }, }, "range": Array [ - 36, - 37, + 34, + 35, ], "type": "Punctuator", "value": "}", @@ -34908,27 +35131,27 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 35, + "line": 1, }, }, "range": Array [ - 38, - 39, + 35, + 36, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-array.src 1`] = ` +exports[`javascript fixtures/destructuring/array-member.src 1`] = ` Object { "body": Array [ Object { @@ -34936,10 +35159,21 @@ Object { "left": Object { "elements": Array [ Object { - "left": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "object": Object { "loc": Object { "end": Object { - "column": 2, + "column": 3, "line": 1, }, "start": Object { @@ -34947,47 +35181,36 @@ Object { "line": 1, }, }, - "name": "x", + "name": "ok", "range": Array [ 1, - 2, + 3, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 5, - ], - "right": Object { + "property": Object { "loc": Object { "end": Object { "column": 5, "line": 1, }, "start": Object { - "column": 3, + "column": 4, "line": 1, }, }, + "name": "v", "range": Array [ - 3, + 4, 5, ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "Identifier", }, - "type": "AssignmentPattern", + "range": Array [ + 1, + 5, + ], + "type": "MemberExpression", }, ], "loc": Object { @@ -35008,7 +35231,7 @@ Object { }, "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { @@ -35019,12 +35242,12 @@ Object { "operator": "=", "range": Array [ 0, - 10, + 11, ], "right": Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { @@ -35032,18 +35255,19 @@ Object { "line": 1, }, }, - "name": "x", "range": Array [ 9, - 10, + 11, ], - "type": "Identifier", + "raw": "20", + "type": "Literal", + "value": 20, }, "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -35053,14 +35277,14 @@ Object { }, "range": Array [ 0, - 10, + 12, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -35070,7 +35294,7 @@ Object { }, "range": Array [ 0, - 10, + 12, ], "sourceType": "script", "tokens": Array [ @@ -35095,7 +35319,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, + "column": 3, "line": 1, }, "start": Object { @@ -35105,28 +35329,28 @@ Object { }, "range": Array [ 1, - 2, + 3, ], "type": "Identifier", - "value": "x", + "value": "ok", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 4, "line": 1, }, "start": Object { - "column": 2, + "column": 3, "line": 1, }, }, "range": Array [ - 2, 3, + 4, ], "type": "Punctuator", - "value": "=", + "value": ".", }, Object { "loc": Object { @@ -35135,16 +35359,16 @@ Object { "line": 1, }, "start": Object { - "column": 3, + "column": 4, "line": 1, }, }, "range": Array [ - 3, + 4, 5, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "v", }, Object { "loc": Object { @@ -35185,7 +35409,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { @@ -35195,242 +35419,169 @@ Object { }, "range": Array [ 9, - 10, + 11, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "20", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-array-all.src 1`] = ` +exports[`javascript fixtures/destructuring/array-to-array.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, }, - "range": Array [ - 5, - 11, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, + "start": Object { + "column": 1, + "line": 1, }, - "type": "AssignmentPattern", }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "name": "a", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 13, - 18, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "raw": "5", - "type": "Literal", - "value": 5, + "start": Object { + "column": 4, + "line": 1, }, - "type": "AssignmentPattern", }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + "name": "b", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 15, + ], + "right": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, }, - "range": Array [ - 20, - 25, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "raw": "1", - "type": "Literal", - "value": 1, + "start": Object { + "column": 10, + "line": 1, }, - "type": "AssignmentPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, }, + "name": "b", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", }, - "range": Array [ - 4, - 26, - ], - "type": "ArrayPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", }, - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, + ], "loc": Object { "end": Object { - "column": 30, + "column": 15, "line": 1, }, "start": Object { - "column": 4, + "column": 9, "line": 1, }, }, "range": Array [ - 4, - 30, + 9, + 15, ], - "type": "VariableDeclarator", + "type": "ArrayExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { - "column": 31, + "column": 16, "line": 1, }, "start": Object { @@ -35440,14 +35591,14 @@ Object { }, "range": Array [ 0, - 31, + 16, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 31, + "column": 16, "line": 1, }, "start": Object { @@ -35457,14 +35608,14 @@ Object { }, "range": Array [ 0, - 31, + 16, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -35474,10 +35625,46 @@ Object { }, "range": Array [ 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, 3, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -35494,8 +35681,8 @@ Object { 4, 5, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -35512,8 +35699,8 @@ Object { 5, 6, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { @@ -35536,7 +35723,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { @@ -35546,10 +35733,28 @@ Object { }, "range": Array [ 9, + 10, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, 11, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -35585,235 +35790,61 @@ Object { 14, ], "type": "Identifier", - "value": "y", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 16, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, "range": Array [ - 17, - 18, + 15, + 16, ], - "type": "Numeric", - "value": "5", + "type": "Punctuator", + "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - "value": "z", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` -Object { - "body": Array [ + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/array-var-undefined.src 1`] = ` +Object { + "body": Array [ Object { "declarations": Array [ Object { "id": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ + "elements": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 1, }, "start": Object { @@ -35821,268 +35852,51 @@ Object { "line": 1, }, }, - "method": false, + "name": "a", "range": Array [ 5, - 9, + 6, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, + "type": "Identifier", }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 11, - 15, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, + ], + "loc": Object { + "end": Object { + "column": 7, + "line": 1, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 17, - 32, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 22, - 31, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 31, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 20, - 32, - ], - "type": "ObjectPattern", - }, + "start": Object { + "column": 4, + "line": 1, }, - ], + }, "range": Array [ 4, - 34, + 7, ], - "type": "ObjectPattern", + "type": "ArrayPattern", }, "init": Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 38, + "column": 12, "line": 1, }, "start": Object { - "column": 37, + "column": 10, "line": 1, }, }, - "name": "b", "range": Array [ - 37, - 38, + 10, + 12, ], - "type": "Identifier", + "type": "ArrayExpression", }, "loc": Object { "end": Object { - "column": 38, + "column": 12, "line": 1, }, "start": Object { @@ -36092,7 +35906,7 @@ Object { }, "range": Array [ 4, - 38, + 12, ], "type": "VariableDeclarator", }, @@ -36100,7 +35914,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 39, + "column": 13, "line": 1, }, "start": Object { @@ -36110,14 +35924,14 @@ Object { }, "range": Array [ 0, - 39, + 13, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 39, + "column": 13, "line": 1, }, "start": Object { @@ -36127,7 +35941,7 @@ Object { }, "range": Array [ 0, - 39, + 13, ], "sourceType": "script", "tokens": Array [ @@ -36165,7 +35979,7 @@ Object { 5, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { @@ -36183,7 +35997,7 @@ Object { 6, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { @@ -36201,7 +36015,7 @@ Object { 7, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { @@ -36218,26 +36032,26 @@ Object { 8, 9, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", - "value": ",", + "value": "[", }, Object { "loc": Object { @@ -36254,8 +36068,8 @@ Object { 11, 12, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { @@ -36273,274 +36087,244 @@ Object { 13, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - "value": "y", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/call-expression-destruction-array.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - "value": "z", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, + "expression": Object { + "arguments": Array [ + Object { + "argument": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 9, + ], + "type": "SpreadElement", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", }, - "start": Object { - "column": 18, - "line": 1, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 10, + ], + "type": "CallExpression", }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": ":", - }, - Object { "loc": Object { "end": Object { - "column": 21, + "column": 11, "line": 1, }, "start": Object { - "column": 20, + "column": 0, "line": 1, }, }, "range": Array [ - 20, - 21, + 0, + 11, ], - "type": "Punctuator", - "value": "{", + "type": "ExpressionStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - "value": "a", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ":", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 12, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 26, + "column": 3, "line": 1, }, "start": Object { - "column": 25, + "column": 0, "line": 1, }, }, "range": Array [ - 25, - 26, + 0, + 3, ], "type": "Identifier", - "value": "a", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 4, "line": 1, }, "start": Object { - "column": 27, + "column": 3, "line": 1, }, }, "range": Array [ - 27, - 28, + 3, + 4, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "Numeric", - "value": "10", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 7, "line": 1, }, "start": Object { - "column": 31, + "column": 4, "line": 1, }, }, "range": Array [ - 31, - 32, + 4, + 7, ], "type": "Punctuator", - "value": "}", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 8, "line": 1, }, "start": Object { - "column": 33, + "column": 7, "line": 1, }, }, "range": Array [ - 33, - 34, + 7, + 8, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 9, "line": 1, }, "start": Object { - "column": 35, + "column": 8, "line": 1, }, }, "range": Array [ - 35, - 36, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 10, "line": 1, }, "start": Object { - "column": 37, + "column": 9, "line": 1, }, }, "range": Array [ - 37, - 38, + 9, + 10, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 11, "line": 1, }, "start": Object { - "column": 38, + "column": 10, "line": 1, }, }, "range": Array [ - 38, - 39, + 10, + 11, ], "type": "Punctuator", "value": ";", @@ -36550,108 +36334,34 @@ Object { } `; -exports[`javascript fixtures/destructuring/defaults-array-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/call-expression-destruction-object.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 11, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "expression": Object { + "arguments": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, }, - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, + "start": Object { + "column": 7, + "line": 1, }, - "name": "z", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", }, - ], + "properties": Array [], + "range": Array [ + 7, + 9, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 18, + "column": 9, "line": 1, }, "start": Object { @@ -36661,49 +36371,48 @@ Object { }, "range": Array [ 4, - 18, - ], - "type": "ArrayPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 21, - 22, + 9, ], - "type": "Identifier", + "type": "SpreadElement", }, + ], + "callee": Object { "loc": Object { "end": Object { - "column": 22, + "column": 3, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, + "name": "foo", "range": Array [ - 4, - 22, + 0, + 3, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - ], - "kind": "var", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 23, + "column": 11, "line": 1, }, "start": Object { @@ -36713,15 +36422,15 @@ Object { }, "range": Array [ 0, - 23, + 11, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -36730,7 +36439,7 @@ Object { }, "range": Array [ 0, - 23, + 12, ], "sourceType": "script", "tokens": Array [ @@ -36749,44 +36458,44 @@ Object { 0, 3, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 4, "line": 1, }, "start": Object { - "column": 4, + "column": 3, "line": 1, }, }, "range": Array [ + 3, 4, - 5, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 4, "line": 1, }, }, "range": Array [ - 5, - 6, + 4, + 7, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { @@ -36804,367 +36513,246 @@ Object { 8, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { "column": 9, "line": 1, }, - }, - "range": Array [ - 9, - 11, - ], - "type": "Numeric", - "value": "10", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ - 11, - 12, + 8, + 9, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { - "column": 13, + "column": 9, "line": 1, }, }, "range": Array [ - 13, - 14, + 9, + 10, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 14, + "column": 10, "line": 1, }, }, "range": Array [ - 14, - 15, + 10, + 11, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - "value": "z", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ";", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-array-nested-all.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-array.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, }, + }, + "name": "consturctor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 45, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 5, - 11, + 38, + 45, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, }, - "type": "AssignmentPattern", }, - Object { - "elements": Array [ - Object { - "left": Object { + "params": Array [ + Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 2, }, }, - "name": "z", + "name": "foo", "range": Array [ - 15, - 16, + 27, + 30, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 21, - ], - "right": Object { + Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 22, + "line": 2, }, }, + "name": "bar", "range": Array [ - 19, - 21, + 32, + 35, ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, }, - "type": "AssignmentPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, }, + "range": Array [ + 26, + 36, + ], + "type": "ArrayPattern", }, - "range": Array [ - 13, - 22, - ], - "type": "ArrayPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "range": Array [ + 25, + 45, + ], + "type": "FunctionExpression", }, - "range": Array [ - 4, - 23, - ], - "type": "ArrayPattern", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 27, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 47, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -37173,15 +36761,16 @@ Object { }, "range": Array [ 0, - 28, + 47, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -37190,14 +36779,14 @@ Object { }, "range": Array [ 0, - 28, + 48, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -37207,115 +36796,97 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { "column": 6, "line": 1, }, - "start": Object { - "column": 5, - "line": 1, - }, }, "range": Array [ - 5, 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 11, + 14, + 25, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "consturctor", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 11, - 12, + 25, + 26, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 13, - 14, + 26, + 27, ], "type": "Punctuator", "value": "[", @@ -37323,71 +36894,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 15, - 16, + 27, + 30, ], "type": "Identifier", - "value": "z", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 17, - 18, + 30, + 31, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 19, - 21, + 32, + 35, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 26, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 25, + "line": 2, }, }, "range": Array [ - 21, - 22, + 35, + 36, ], "type": "Punctuator", "value": "]", @@ -37395,236 +36966,331 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 22, - 23, + 36, + 37, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 29, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 24, - 25, + 38, + 39, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 26, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 26, - 27, + 44, + 45, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 27, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 27, - 28, + 46, + 47, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-defaults-array.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, }, + }, + "name": "consturctor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 49, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 5, - 11, + 42, + 49, ], - "right": Object { + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentPattern", + }, + ], "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 30, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 9, - 11, + 26, + 40, ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "type": "ArrayPattern", }, - "range": Array [ - 13, - 18, - ], - "type": "ArrayPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "range": Array [ + 25, + 49, + ], + "type": "FunctionExpression", }, - "range": Array [ - 4, - 19, - ], - "type": "ArrayPattern", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 23, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 51, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -37633,15 +37299,16 @@ Object { }, "range": Array [ 0, - 24, + 51, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -37650,14 +37317,14 @@ Object { }, "range": Array [ 0, - 24, + 52, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -37667,115 +37334,97 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { "column": 6, "line": 1, }, - "start": Object { - "column": 5, - "line": 1, - }, }, "range": Array [ - 5, 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 11, + 14, + 25, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "consturctor", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 11, - 12, + 25, + 26, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 13, - 14, + 26, + 27, ], "type": "Punctuator", "value": "[", @@ -37783,71 +37432,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - "value": "z", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, + "line": 2, }, }, "range": Array [ - 18, - 19, + 27, + 30, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { "column": 21, - "line": 1, + "line": 2, }, "start": Object { "column": 20, - "line": 1, + "line": 2, }, }, "range": Array [ - 20, - 21, + 30, + 31, ], "type": "Punctuator", "value": "=", @@ -37855,724 +37468,517 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 23, - 24, + 31, + 32, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "3", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/defaults-object.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 5, - 11, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 11, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 4, - 12, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 0, - 16, + 32, + 33, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 0, - 3, + 34, + 37, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 27, + "line": 2, }, }, "range": Array [ - 4, - 5, + 37, + 38, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 29, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 5, - 6, + 38, + 39, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "4", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 30, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 29, + "line": 2, }, }, "range": Array [ - 7, - 8, + 39, + 40, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 31, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 30, + "line": 2, }, }, "range": Array [ - 9, - 11, + 40, + 41, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 11, - 12, + 42, + 43, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 13, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 13, - 14, + 48, + 49, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 15, - 16, + 50, + 51, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-object-all.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-defaults-object.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "consturctor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", + "range": Array [ + 14, + 49, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 32, + "line": 2, }, }, - "method": false, "range": Array [ - 5, - 11, + 42, + 49, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 30, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 16, + "line": 2, }, }, - "range": Array [ - 5, - 11, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 13, - 18, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, }, - "start": Object { - "column": 13, - "line": 1, + "method": false, + "range": Array [ + 27, + 32, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 32, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", }, }, - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 18, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", }, - }, - "range": Array [ - 17, - 18, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 20, - 25, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, }, - "start": Object { - "column": 20, - "line": 1, + "method": false, + "range": Array [ + 34, + 39, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 39, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 39, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentPattern", }, }, - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, + ], "range": Array [ - 20, - 25, + 26, + 40, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "AssignmentPattern", + "type": "ObjectPattern", }, - }, - ], - "range": Array [ - 4, - 26, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, + ], + "range": Array [ + 25, + 49, + ], + "type": "FunctionExpression", }, - "name": "a", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 30, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 51, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -38581,15 +37987,16 @@ Object { }, "range": Array [ 0, - 31, + 51, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -38598,14 +38005,14 @@ Object { }, "range": Array [ 0, - 31, + 52, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -38615,133 +38022,133 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 9, "line": 1, }, "start": Object { - "column": 5, + "column": 8, "line": 1, }, }, "range": Array [ - 5, - 6, + 8, + 9, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 7, - 8, + 14, + 25, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "consturctor", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 9, - 11, + 25, + 26, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 11, - 12, + 26, + 27, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 13, - 14, + 27, + 30, ], "type": "Identifier", - "value": "y", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 15, - 16, + 30, + 31, ], "type": "Punctuator", "value": "=", @@ -38749,35 +38156,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 17, - 18, + 31, + 32, ], "type": "Numeric", - "value": "5", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 18, - 19, + 32, + 33, ], "type": "Punctuator", "value": ",", @@ -38785,35 +38192,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 20, - 21, + 34, + 37, ], "type": "Identifier", - "value": "z", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 27, + "line": 2, }, }, "range": Array [ - 22, - 23, + 37, + 38, ], "type": "Punctuator", "value": "=", @@ -38821,35 +38228,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 29, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 24, - 25, + 38, + 39, ], "type": "Numeric", - "value": "1", + "value": "4", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 30, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 29, + "line": 2, }, }, "range": Array [ - 25, - 26, + 39, + 40, ], "type": "Punctuator", "value": "}", @@ -38857,311 +38264,337 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 31, + "line": 2, }, "start": Object { - "column": 27, - "line": 1, + "column": 30, + "line": 2, }, }, "range": Array [ - 27, - 28, + 40, + 41, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 29, - 30, + 42, + 43, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 30, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 30, - 31, + 48, + 49, ], "type": "Punctuator", - "value": ";", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-object-assign.src 1`] = ` +exports[`javascript fixtures/destructuring/class-constructor-params-object.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "Object", - "range": Array [ - 3, - 9, - ], - "type": "Identifier", - }, - "kind": "init", + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 3, - "line": 1, + "column": 4, + "line": 2, }, }, - "method": false, + "name": "consturctor", "range": Array [ - 3, - 11, + 14, + 25, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "Object", - "range": Array [ - 3, - 9, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 11, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "AssignmentPattern", + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, }, }, - Object { - "computed": false, - "key": Object { + "range": Array [ + 14, + 45, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 13, - "line": 1, + "column": 28, + "line": 2, }, }, - "name": "String", "range": Array [ - 13, - 19, + 38, + 45, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "init", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 13, - "line": 1, + "column": 15, + "line": 2, }, }, - "method": false, - "range": Array [ - 13, - 21, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 26, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 2, }, }, - "name": "String", - "range": Array [ - 13, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 21, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 27, + 30, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, }, - }, - "range": Array [ - 20, - 21, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 1, - 23, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "operator": "=", + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 32, + 35, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 32, + 35, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 26, + 36, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 25, + 45, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, "range": Array [ - 1, - 28, + 8, + 47, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, }, - "properties": Array [], - "range": Array [ - 26, - 28, - ], - "type": "ObjectExpression", }, - "type": "AssignmentExpression", + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -39170,15 +38603,16 @@ Object { }, "range": Array [ 0, - 29, + 47, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -39187,14 +38621,14 @@ Object { }, "range": Array [ 0, - 30, + 48, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -39204,28 +38638,28 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 2, + 6, + 7, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { @@ -39234,139 +38668,139 @@ Object { "line": 1, }, "start": Object { - "column": 3, + "column": 8, "line": 1, }, }, "range": Array [ - 3, + 8, 9, ], - "type": "Identifier", - "value": "Object", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 10, + 14, + 25, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "consturctor", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 10, - 11, + 25, + 26, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 11, - 12, + 26, + 27, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 13, - 19, + 27, + 30, ], "type": "Identifier", - "value": "String", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 19, - 20, + 30, + 31, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 20, - 21, + 32, + 35, ], - "type": "Numeric", - "value": "0", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 26, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 25, + "line": 2, }, }, "range": Array [ - 22, - 23, + 35, + 36, ], "type": "Punctuator", "value": "}", @@ -39374,35 +38808,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 27, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 24, - 25, + 36, + 37, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 29, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 28, + "line": 2, }, }, "range": Array [ - 26, - 27, + 38, + 39, ], "type": "Punctuator", "value": "{", @@ -39410,17 +38844,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 27, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 27, - 28, + 44, + 45, ], "type": "Punctuator", "value": "}", @@ -39428,184 +38862,205 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 28, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 28, - 29, + 46, + 47, ], "type": "Punctuator", - "value": ")", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-object-longform.src 1`] = ` +exports[`javascript fixtures/destructuring/class-method-params-array.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "init", + "range": Array [ + 14, + 37, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 6, - "line": 1, + "column": 20, + "line": 2, }, }, - "method": false, "range": Array [ - 6, - 15, + 30, + 37, ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, }, - "start": Object { - "column": 9, - "line": 1, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, }, + "name": "baz", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, + ], "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 9, - 15, + 18, + 28, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 15, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", + "type": "ArrayPattern", }, - }, - ], - "range": Array [ - 4, - 17, - ], - "type": "ObjectPattern", + ], + "range": Array [ + 17, + 37, + ], + "type": "FunctionExpression", + }, }, - "init": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -39614,15 +39069,16 @@ Object { }, "range": Array [ 0, - 22, + 39, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -39631,14 +39087,14 @@ Object { }, "range": Array [ 0, - 22, + 40, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -39648,25 +39104,43 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -39675,513 +39149,456 @@ Object { "loc": Object { "end": Object { "column": 7, - "line": 1, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 6, - 7, + 14, + 17, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 1, + "line": 2, }, "start": Object { "column": 7, - "line": 1, + "line": 2, }, }, "range": Array [ - 7, - 8, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, }, "start": Object { "column": 9, - "line": 1, + "line": 2, }, }, "range": Array [ - 9, - 10, + 19, + 22, ], "type": "Identifier", - "value": "x", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 11, - 12, + 22, + 23, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 13, - 15, + 24, + 27, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 16, - 17, + 27, + 28, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { "column": 19, - "line": 1, + "line": 2, }, "start": Object { "column": 18, - "line": 1, + "line": 2, }, }, "range": Array [ - 18, - 19, + 28, + 29, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 21, - "line": 1, + "line": 2, }, "start": Object { "column": 20, - "line": 1, + "line": 2, }, }, "range": Array [ - 20, - 21, + 30, + 31, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 21, - 22, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-object-longform-all.src 1`] = ` +exports[`javascript fixtures/destructuring/class-method-params-defaults-array.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 24, + "line": 2, }, }, - "method": false, "range": Array [ - 5, - 14, + 34, + 41, ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", }, - "start": Object { - "column": 8, - "line": 1, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 24, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "raw": "3", + "type": "Literal", + "value": 3, }, + "type": "AssignmentPattern", }, - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + "type": "AssignmentPattern", + }, + ], "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { "column": 8, - "line": 1, + "line": 2, }, }, "range": Array [ - 8, - 14, + 18, + 32, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 14, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 16, - 25, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 25, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 25, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 27, - 28, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 27, - 36, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 36, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 36, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", + "type": "ArrayPattern", }, - }, - ], - "range": Array [ - 4, - 37, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, + ], + "range": Array [ + 17, + 41, + ], + "type": "FunctionExpression", }, - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 41, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -40190,15 +39607,16 @@ Object { }, "range": Array [ 0, - 42, + 43, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -40207,14 +39625,14 @@ Object { }, "range": Array [ 0, - 42, + 44, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -40224,97 +39642,133 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 9, "line": 1, }, "start": Object { - "column": 5, + "column": 8, "line": 1, }, }, "range": Array [ - 5, - 6, + 8, + 9, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 1, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 6, - 7, + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 2, }, "start": Object { "column": 8, - "line": 1, + "line": 2, }, }, "range": Array [ - 8, - 9, + 18, + 19, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, ], "type": "Identifier", - "value": "x", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 10, - 11, + 22, + 23, ], "type": "Punctuator", "value": "=", @@ -40323,34 +39777,34 @@ Object { "loc": Object { "end": Object { "column": 14, - "line": 1, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 12, - 14, + 23, + 24, ], "type": "Numeric", - "value": "10", + "value": "3", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 1, + "line": 2, }, "start": Object { "column": 14, - "line": 1, + "line": 2, }, }, "range": Array [ - 14, - 15, + 24, + 25, ], "type": "Punctuator", "value": ",", @@ -40358,683 +39812,687 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { "column": 16, - "line": 1, + "line": 2, }, }, "range": Array [ - 16, - 17, + 26, + 29, ], "type": "Identifier", - "value": "y", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 17, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 17, - 18, + 29, + 30, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 19, - 20, + 30, + 31, ], - "type": "Identifier", - "value": "y", + "type": "Numeric", + "value": "4", }, Object { "loc": Object { "end": Object { "column": 22, - "line": 1, + "line": 2, }, "start": Object { "column": 21, - "line": 1, + "line": 2, }, }, "range": Array [ - 21, - 22, + 31, + 32, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 23, - 25, + 32, + 33, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 25, - 26, + 34, + 35, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 27, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 27, - 28, + 40, + 41, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 28, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 28, - 29, + 42, + 43, ], "type": "Punctuator", - "value": ":", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/class-method-params-defaults-object.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 19, + 24, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 24, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 26, + 31, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 18, + 32, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 17, + 41, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 30, + "column": 0, "line": 1, }, }, "range": Array [ - 30, - 31, + 0, + 43, ], - "type": "Identifier", - "value": "z", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 44, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 33, + "column": 5, "line": 1, }, "start": Object { - "column": 32, + "column": 0, "line": 1, }, }, "range": Array [ - 32, - 33, + 0, + 5, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 7, "line": 1, }, "start": Object { - "column": 34, + "column": 6, "line": 1, }, }, "range": Array [ - 34, - 36, + 6, + 7, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 9, "line": 1, }, "start": Object { - "column": 36, + "column": 8, "line": 1, }, }, "range": Array [ - 36, - 37, + 8, + 9, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 38, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 38, - 39, + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 40, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 40, - 41, + 18, + 19, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, ], "type": "Identifier", - "value": "a", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 41, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 41, - 42, + 22, + 23, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 5, - 9, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 11, - 20, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 20, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 22, - 26, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 4, - 27, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 31, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 32, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 32, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 8, - 9, + 23, + 24, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 9, - 10, + 24, + 25, ], "type": "Punctuator", "value": ",", @@ -41042,71 +40500,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 14, - 15, + 26, + 29, ], "type": "Identifier", - "value": "y", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 16, - 17, + 29, + 30, ], "type": "Punctuator", "value": "=", @@ -41114,442 +40536,373 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 18, - 20, + 30, + 31, ], "type": "Numeric", - "value": "10", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 20, - 21, + 31, + 32, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 1, + "line": 2, }, "start": Object { "column": 22, - "line": 1, + "line": 2, }, }, "range": Array [ - 22, - 23, + 32, + 33, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 23, - 24, + 34, + 35, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 25, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 25, - 26, + 40, + 41, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 26, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 26, - 27, + 42, + 43, ], "type": "Punctuator", "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": ";", - }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/class-method-params-object.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", + "range": Array [ + 14, + 37, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 20, + "line": 2, }, }, - "method": false, "range": Array [ - 5, - 6, + 30, + 37, ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, }, }, - Object { - "computed": false, - "key": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 8, - "line": 1, + "line": 2, }, }, - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 8, - 17, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", }, - "start": Object { - "column": 11, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 19, + 22, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", }, }, - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 17, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", }, - "start": Object { - "column": 15, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 24, + 27, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "name": "baz", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", }, }, - "range": Array [ - 15, - 17, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 19, - 20, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 19, - 20, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "z", "range": Array [ - 19, - 20, + 18, + 28, ], - "type": "Identifier", + "type": "ObjectPattern", }, - }, - ], - "range": Array [ - 4, - 21, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, + ], + "range": Array [ + 17, + 37, + ], + "type": "FunctionExpression", }, - "name": "a", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -41558,15 +40911,16 @@ Object { }, "range": Array [ 0, - 26, + 39, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 0, + "line": 5, }, "start": Object { "column": 0, @@ -41575,14 +40929,14 @@ Object { }, "range": Array [ 0, - 26, + 40, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -41592,289 +40946,537 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 9, "line": 1, }, "start": Object { - "column": 5, + "column": 8, "line": 1, }, }, "range": Array [ - 5, - 6, + 8, + 9, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 1, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 6, - 7, + 14, + 17, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 2, }, "start": Object { "column": 8, - "line": 1, + "line": 2, }, }, "range": Array [ - 8, - 9, + 18, + 19, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { "column": 9, - "line": 1, + "line": 2, }, }, "range": Array [ - 9, - 10, + 19, + 22, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { "column": 12, - "line": 1, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 11, - 12, + 24, + 27, ], "type": "Identifier", - "value": "y", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 13, - 14, + 27, + 28, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 1, + 2, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 10, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 0, "line": 1, }, }, "range": Array [ - 15, - 17, + 0, + 10, ], - "type": "Numeric", - "value": "10", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 10, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, + "column": 1, "line": 1, }, "start": Object { - "column": 17, + "column": 0, "line": 1, }, }, "range": Array [ - 17, - 18, + 0, + 1, ], "type": "Punctuator", - "value": ",", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 2, "line": 1, }, "start": Object { - "column": 19, + "column": 1, "line": 1, }, }, "range": Array [ - 19, - 20, + 1, + 2, ], "type": "Identifier", - "value": "z", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 3, "line": 1, }, "start": Object { - "column": 20, + "column": 2, "line": 1, }, }, "range": Array [ - 20, - 21, + 2, + 3, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 5, "line": 1, }, "start": Object { - "column": 22, + "column": 3, "line": 1, }, }, "range": Array [ - 22, - 23, + 3, + 5, ], - "type": "Punctuator", - "value": "=", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 6, "line": 1, }, "start": Object { - "column": 24, + "column": 5, "line": 1, }, }, "range": Array [ - 24, - 25, + 5, + 6, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 8, "line": 1, }, "start": Object { - "column": 25, + "column": 7, "line": 1, }, }, "range": Array [ - 25, - 26, + 7, + 8, ], "type": "Punctuator", - "value": ";", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/defaults-object-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-all.src 1`] = ` Object { "body": Array [ Object { "declarations": Array [ Object { "id": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ + "elements": Array [ Object { - "computed": false, - "key": Object { + "left": Object { "loc": Object { "end": Object { "column": 6, @@ -41892,7 +41494,6 @@ Object { ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { "column": 11, @@ -41903,71 +41504,33 @@ Object { "line": 1, }, }, - "method": false, "range": Array [ 5, 11, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, + "right": Object { "loc": Object { "end": Object { "column": 11, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, + 9, 11, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", + "raw": "10", + "type": "Literal", + "value": 10, }, + "type": "AssignmentPattern", }, Object { - "computed": false, - "key": Object { + "left": Object { "loc": Object { "end": Object { "column": 14, @@ -41985,10 +41548,9 @@ Object { ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { @@ -41996,117 +41558,123 @@ Object { "line": 1, }, }, - "method": false, "range": Array [ 13, - 14, + 18, ], - "shorthand": true, - "type": "Property", - "value": Object { + "right": Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, - "name": "y", "range": Array [ - 13, - 14, + 17, + 18, ], - "type": "Identifier", + "raw": "5", + "type": "Literal", + "value": 5, }, + "type": "AssignmentPattern", }, Object { - "computed": false, - "key": Object { + "left": Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "name": "z", "range": Array [ - 16, - 17, + 20, + 21, ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, - "method": false, "range": Array [ - 16, - 17, + 20, + 25, ], - "shorthand": true, - "type": "Property", - "value": Object { + "right": Object { "loc": Object { "end": Object { - "column": 17, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 24, "line": 1, }, }, - "name": "z", "range": Array [ - 16, - 17, + 24, + 25, ], - "type": "Identifier", + "raw": "1", + "type": "Literal", + "value": 1, }, + "type": "AssignmentPattern", }, ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ 4, - 18, + 26, ], - "type": "ObjectPattern", + "type": "ArrayPattern", }, "init": Object { "loc": Object { "end": Object { - "column": 22, + "column": 30, "line": 1, }, "start": Object { - "column": 21, + "column": 29, "line": 1, }, }, "name": "a", "range": Array [ - 21, - 22, + 29, + 30, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 30, "line": 1, }, "start": Object { @@ -42116,7 +41684,7 @@ Object { }, "range": Array [ 4, - 22, + 30, ], "type": "VariableDeclarator", }, @@ -42124,7 +41692,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 23, + "column": 31, "line": 1, }, "start": Object { @@ -42134,14 +41702,14 @@ Object { }, "range": Array [ 0, - 23, + 31, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 23, + "column": 31, "line": 1, }, "start": Object { @@ -42151,7 +41719,7 @@ Object { }, "range": Array [ 0, - 23, + 31, ], "sourceType": "script", "tokens": Array [ @@ -42189,7 +41757,7 @@ Object { 5, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { @@ -42284,71 +41852,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, + 16, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 18, ], - "type": "Identifier", - "value": "z", + "type": "Numeric", + "value": "5", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { - "column": 19, + "column": 20, "line": 1, }, }, "range": Array [ - 19, 20, + 21, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, ], "type": "Punctuator", "value": "=", @@ -42356,17 +41942,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 21, + "column": 24, "line": 1, }, }, "range": Array [ - 21, - 22, + 24, + 25, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Identifier", "value": "a", @@ -42374,17 +42014,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 31, "line": 1, }, "start": Object { - "column": 22, + "column": 30, "line": 1, }, }, "range": Array [ - 22, - 23, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -42394,7 +42034,7 @@ Object { } `; -exports[`javascript fixtures/destructuring/defaults-object-nested-all.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-longform-nested-multi.src 1`] = ` Object { "body": Array [ Object { @@ -42403,7 +42043,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 26, + "column": 34, "line": 1, }, "start": Object { @@ -42435,7 +42075,7 @@ Object { "kind": "init", "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { @@ -42446,63 +42086,84 @@ Object { "method": false, "range": Array [ 5, - 11, + 9, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 11, + "column": 12, "line": 1, }, "start": Object { - "column": 5, + "column": 11, "line": 1, }, }, + "name": "y", "range": Array [ - 5, 11, + 12, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 15, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, }, - "type": "AssignmentPattern", + "name": "y", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", }, }, Object { @@ -42510,47 +42171,47 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, - "name": "y", + "name": "z", "range": Array [ - 13, - 14, + 17, + 18, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 25, + "column": 32, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "method": false, "range": Array [ - 13, - 25, + 17, + 32, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 25, + "column": 32, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, @@ -42560,86 +42221,86 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 19, + "column": 23, "line": 1, }, "start": Object { - "column": 18, + "column": 22, "line": 1, }, }, - "name": "z", + "name": "a", "range": Array [ - 18, - 19, + 22, + 23, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 24, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 22, "line": 1, }, }, "method": false, "range": Array [ - 18, - 24, + 22, + 31, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "left": Object { "loc": Object { "end": Object { - "column": 19, + "column": 26, "line": 1, }, "start": Object { - "column": 18, + "column": 25, "line": 1, }, }, - "name": "z", + "name": "a", "range": Array [ - 18, - 19, + 25, + 26, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 24, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 25, "line": 1, }, }, "range": Array [ - 18, - 24, + 25, + 31, ], "right": Object { "loc": Object { "end": Object { - "column": 24, + "column": 31, "line": 1, }, "start": Object { - "column": 22, + "column": 29, "line": 1, }, }, "range": Array [ - 22, - 24, + 29, + 31, ], "raw": "10", "type": "Literal", @@ -42650,8 +42311,8 @@ Object { }, ], "range": Array [ - 16, - 25, + 20, + 32, ], "type": "ObjectPattern", }, @@ -42659,31 +42320,31 @@ Object { ], "range": Array [ 4, - 26, + 34, ], "type": "ObjectPattern", }, "init": Object { "loc": Object { "end": Object { - "column": 30, + "column": 38, "line": 1, }, "start": Object { - "column": 29, + "column": 37, "line": 1, }, }, - "name": "a", + "name": "b", "range": Array [ - 29, - 30, + 37, + 38, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 30, + "column": 38, "line": 1, }, "start": Object { @@ -42693,7 +42354,7 @@ Object { }, "range": Array [ 4, - 30, + 38, ], "type": "VariableDeclarator", }, @@ -42701,7 +42362,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 31, + "column": 39, "line": 1, }, "start": Object { @@ -42711,14 +42372,14 @@ Object { }, "range": Array [ 0, - 31, + 39, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 31, + "column": 39, "line": 1, }, "start": Object { @@ -42728,7 +42389,7 @@ Object { }, "range": Array [ 0, - 31, + 39, ], "sourceType": "script", "tokens": Array [ @@ -42789,25 +42450,43 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, "line": 1, }, "start": Object { @@ -42817,10 +42496,10 @@ Object { }, "range": Array [ 9, - 11, + 10, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -42837,26 +42516,26 @@ Object { 11, 12, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 14, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { @@ -42873,26 +42552,44 @@ Object { 14, 15, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, "range": Array [ + 15, 16, - 17, ], "type": "Punctuator", - "value": "{", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "z", }, Object { "loc": Object { @@ -42909,8 +42606,8 @@ Object { 18, 19, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { @@ -42928,12 +42625,12 @@ Object { 21, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { @@ -42943,28 +42640,28 @@ Object { }, "range": Array [ 22, - 24, + 23, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 24, "line": 1, }, "start": Object { - "column": 24, + "column": 23, "line": 1, }, }, "range": Array [ + 23, 24, - 25, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { @@ -42981,8 +42678,8 @@ Object { 25, 26, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -43005,7 +42702,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, + "column": 31, "line": 1, }, "start": Object { @@ -43015,25 +42712,97 @@ Object { }, "range": Array [ 29, - 30, + 31, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 32, "line": 1, }, "start": Object { - "column": 30, + "column": 31, "line": 1, }, }, "range": Array [ - 30, 31, + 32, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, ], "type": "Punctuator", "value": ";", @@ -43043,27 +42812,16 @@ Object { } `; -exports[`javascript fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-multi.src 1`] = ` Object { "body": Array [ Object { "declarations": Array [ Object { "id": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ + "elements": Array [ Object { - "computed": false, - "key": Object { + "left": Object { "loc": Object { "end": Object { "column": 6, @@ -43081,7 +42839,6 @@ Object { ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { "column": 11, @@ -43092,92 +42849,35 @@ Object { "line": 1, }, }, - "method": false, "range": Array [ 5, 11, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, + "right": Object { "loc": Object { "end": Object { "column": 11, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, + 9, 11, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", + "raw": "10", + "type": "Literal", + "value": 10, }, + "type": "AssignmentPattern", }, Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { - "column": 21, + "column": 14, "line": 1, }, "start": Object { @@ -43185,118 +42885,69 @@ Object { "line": 1, }, }, - "method": false, + "name": "y", "range": Array [ 13, - 21, + 14, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 18, - 19, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 16, - 21, - ], - "type": "ObjectPattern", }, + "name": "z", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", }, ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ 4, - 22, + 18, ], - "type": "ObjectPattern", + "type": "ArrayPattern", }, "init": Object { "loc": Object { "end": Object { - "column": 26, + "column": 22, "line": 1, }, "start": Object { - "column": 25, + "column": 21, "line": 1, }, }, "name": "a", "range": Array [ - 25, - 26, + 21, + 22, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 26, + "column": 22, "line": 1, }, "start": Object { @@ -43306,7 +42957,7 @@ Object { }, "range": Array [ 4, - 26, + 22, ], "type": "VariableDeclarator", }, @@ -43314,7 +42965,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { @@ -43324,14 +42975,14 @@ Object { }, "range": Array [ 0, - 27, + 23, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { @@ -43341,7 +42992,7 @@ Object { }, "range": Array [ 0, - 27, + 23, ], "sourceType": "script", "tokens": Array [ @@ -43379,7 +43030,7 @@ Object { 5, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { @@ -43487,7 +43138,7 @@ Object { 15, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { @@ -43504,44 +43155,44 @@ Object { 16, 17, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 18, "line": 1, }, "start": Object { - "column": 18, + "column": 17, "line": 1, }, }, "range": Array [ + 17, 18, - 19, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 20, + "column": 19, "line": 1, }, }, "range": Array [ + 19, 20, - 21, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { @@ -43558,59 +43209,23 @@ Object { 21, 22, ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], "type": "Identifier", "value": "a", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 22, "line": 1, }, }, "range": Array [ - 26, - 27, + 22, + 23, ], "type": "Punctuator", "value": ";", @@ -43620,406 +43235,215 @@ Object { } `; -exports[`javascript fixtures/destructuring/destructured-array-catch.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-array-nested-all.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "block": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "method": false, - "range": Array [ - 35, - 36, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 34, - 37, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 34, - 41, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "left": Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 6, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 5, + "line": 1, }, }, + "name": "x", "range": Array [ - 30, - 42, + 5, + 6, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 2, + "type": "Identifier", }, - }, - "range": Array [ - 24, - 46, - ], - "type": "BlockStatement", - }, - "finalizer": null, - "handler": Object { - "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 11, + "line": 1, }, "start": Object { - "column": 17, - "line": 5, + "column": 5, + "line": 1, }, }, "range": Array [ - 64, - 69, + 5, + 11, ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 3, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 5, + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, }, + "type": "AssignmentPattern", }, - "param": Object { + Object { "elements": Array [ Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 14, - "line": 5, + "column": 21, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 15, + "line": 1, }, }, - "name": "stack", "range": Array [ - 56, - 61, + 15, + 21, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", }, ], "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 13, + "line": 1, }, }, "range": Array [ - 55, - 62, + 13, + 22, ], "type": "ArrayPattern", }, - "range": Array [ - 49, - 69, - ], - "type": "CatchClause", - }, + ], "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 23, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 4, + "line": 1, }, }, "range": Array [ - 20, - 69, + 4, + 23, ], - "type": "TryStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 71, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, + "type": "ArrayPattern", }, - "start": Object { - "column": 9, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { "loc": Object { "end": Object { - "column": 14, + "column": 27, "line": 1, }, "start": Object { - "column": 11, + "column": 4, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 12, - 13, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - }, - ], "range": Array [ - 11, - 14, + 4, + 27, ], - "type": "ObjectPattern", + "type": "VariableDeclarator", }, ], - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - Object { + "kind": "var", "loc": Object { "end": Object { - "column": 2, - "line": 7, + "column": 28, + "line": 1, }, "start": Object { - "column": 1, - "line": 7, + "column": 0, + "line": 1, }, }, "range": Array [ - 71, - 72, + 0, + 28, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 7, + "column": 28, + "line": 1, }, "start": Object { "column": 0, @@ -44028,14 +43452,14 @@ Object { }, "range": Array [ 0, - 72, + 28, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 3, "line": 1, }, "start": Object { @@ -44045,25 +43469,43 @@ Object { }, "range": Array [ 0, - 8, + 3, ], "type": "Keyword", - "value": "function", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 5, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, "range": Array [ - 9, - 10, + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, ], "type": "Identifier", "value": "x", @@ -44071,56 +43513,56 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 10, + "column": 7, "line": 1, }, }, "range": Array [ - 10, - 11, + 7, + 8, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 11, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 11, - 12, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 13, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -44138,400 +43580,572 @@ Object { 14, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, + 16, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 20, - 23, + 19, + 21, ], - "type": "Keyword", - "value": "try", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 24, - 25, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 22, + "line": 1, }, }, "range": Array [ - 30, - 33, + 22, + 23, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 34, - 35, + 24, + 25, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 27, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, + "column": 26, + "line": 1, }, }, "range": Array [ - 35, - 36, + 26, + 27, ], "type": "Identifier", - "value": "b", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 36, - 37, + 27, + 28, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Punctuator", - "value": "=", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-array-nested-multi.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 18, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 19, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 23, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 40, - 41, + 0, + 24, ], - "type": "Identifier", - "value": "a", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 24, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 3, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 41, - 42, + 0, + 3, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 5, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 4, + "line": 1, }, }, "range": Array [ - 45, - 46, + 4, + 5, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 6, + "line": 1, }, "start": Object { - "column": 2, - "line": 5, + "column": 5, + "line": 1, }, }, "range": Array [ - 49, - 54, + 5, + 6, ], - "type": "Keyword", - "value": "catch", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 5, + "line": 1, }, "start": Object { "column": 7, - "line": 5, + "line": 1, }, }, "range": Array [ - 54, - 55, + 7, + 8, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 11, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 9, + "line": 1, }, }, "range": Array [ - 55, - 56, + 9, + 11, ], - "type": "Punctuator", - "value": "[", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 5, + "column": 12, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 11, + "line": 1, }, }, "range": Array [ - 56, - 61, + 11, + 12, ], - "type": "Identifier", - "value": "stack", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 14, + "line": 1, }, "start": Object { - "column": 14, - "line": 5, + "column": 13, + "line": 1, }, }, "range": Array [ - 61, - 62, + 13, + 14, ], "type": "Punctuator", - "value": "]", + "value": "[", }, Object { "loc": Object { "end": Object { "column": 16, - "line": 5, + "line": 1, }, "start": Object { "column": 15, - "line": 5, + "line": 1, }, }, "range": Array [ - 62, - 63, + 15, + 16, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { "column": 18, - "line": 5, + "line": 1, }, "start": Object { "column": 17, - "line": 5, + "line": 1, }, }, "range": Array [ - 64, - 65, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 19, + "line": 1, }, "start": Object { - "column": 2, - "line": 6, + "column": 18, + "line": 1, }, }, "range": Array [ - 68, - 69, + 18, + 19, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 21, + "line": 1, }, "start": Object { - "column": 0, - "line": 7, + "column": 20, + "line": 1, }, }, "range": Array [ - 70, - 71, + 20, + 21, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 7, + "column": 23, + "line": 1, }, "start": Object { - "column": 1, - "line": 7, + "column": 22, + "line": 1, }, }, "range": Array [ - 71, - 72, + 22, + 23, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -44541,445 +44155,9578 @@ Object { } `; -exports[`javascript fixtures/destructuring/destructured-object-catch.src 1`] = ` +exports[`javascript fixtures/destructuring/defaults-object.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "block": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "method": false, - "range": Array [ - 35, - 36, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "name": "b", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 34, - 37, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 40, - 41, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 34, - 41, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 6, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 5, + "line": 1, }, }, + "name": "x", "range": Array [ - 30, - 42, + 5, + 6, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 2, + "type": "Identifier", }, - }, - "range": Array [ - 24, - 46, - ], - "type": "BlockStatement", - }, - "finalizer": null, - "handler": Object { - "body": Object { - "body": Array [], + "kind": "init", "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 11, + "line": 1, }, "start": Object { - "column": 17, - "line": 5, + "column": 5, + "line": 1, }, }, + "method": false, "range": Array [ - 64, - 69, + 5, + 11, ], - "type": "BlockStatement", - }, - "loc": Object { - "end": Object { - "column": 3, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "param": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 9, - "line": 5, - }, + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, }, - "name": "stack", - "range": Array [ - 56, - 61, - ], - "type": "Identifier", }, - "kind": "init", + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { "loc": Object { "end": Object { - "column": 14, - "line": 5, + "column": 11, + "line": 1, }, "start": Object { "column": 9, - "line": 5, + "line": 1, }, }, - "method": false, "range": Array [ - 56, - 61, + 9, + 11, ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 9, - "line": 5, - }, - }, - "name": "stack", - "range": Array [ - 56, - 61, - ], - "type": "Identifier", - }, + "raw": "10", + "type": "Literal", + "value": 10, }, - ], - "range": Array [ - 55, - 62, - ], - "type": "ObjectPattern", + "type": "AssignmentPattern", + }, }, - "range": Array [ - 49, - 69, - ], - "type": "CatchClause", - }, + ], + "range": Array [ + 4, + 12, + ], + "type": "ObjectPattern", + }, + "init": Object { "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 16, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 15, + "line": 1, }, }, + "name": "x", "range": Array [ - 20, - 69, + 15, + 16, ], - "type": "TryStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 7, + "type": "Identifier", }, - "start": Object { - "column": 16, - "line": 1, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", }, - "range": Array [ - 16, - 71, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", }, + "range": Array [ + 0, + 16, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ + Object { "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 3, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [ + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "x", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 1, }, "start": Object { - "column": 12, + "column": 5, "line": 1, }, }, - "name": "a", + "method": false, "range": Array [ - 12, - 13, + 5, + 11, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 18, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 20, + 25, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 4, + 26, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Numeric", + "value": "5", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-assign.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "Object", + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "Object", + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "String", + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "String", + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 28, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 26, + 28, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + "value": "Object", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + "value": "String", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ")", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-longform.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 15, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 4, + 17, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 21, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-longform-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 14, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 27, + 36, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 36, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 36, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 4, + 37, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 41, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 36, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-longform-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 20, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 22, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 27, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 31, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-mixed-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 6, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 8, + 17, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 19, + 20, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 21, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 14, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 18, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-nested-all.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 18, + 24, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 24, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 16, + 25, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 4, + 26, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 24, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/defaults-object-nested-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 21, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 18, + 19, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 16, + 21, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 4, + 22, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 26, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/destructured-array-catch.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "block": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "method": false, + "range": Array [ + 35, + 36, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 34, + 37, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 42, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 46, + ], + "type": "BlockStatement", + }, + "finalizer": null, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 69, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "param": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "name": "stack", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 55, + 62, + ], + "type": "ArrayPattern", + }, + "range": Array [ + 49, + 69, + ], + "type": "CatchClause", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 69, + ], + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 71, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 11, + 14, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 49, + 54, + ], + "type": "Keyword", + "value": "catch", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + "value": "stack", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/destructured-object-catch.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "block": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "method": false, + "range": Array [ + 35, + 36, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 34, + 37, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 42, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 46, + ], + "type": "BlockStatement", + }, + "finalizer": null, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 69, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "param": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "name": "stack", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "method": false, + "range": Array [ + 56, + 61, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "name": "stack", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 55, + 62, + ], + "type": "ObjectPattern", + }, + "range": Array [ + 49, + 69, + ], + "type": "CatchClause", + }, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 69, + ], + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 71, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 11, + 14, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 71, + ], + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 72, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 49, + 54, + ], + "type": "Keyword", + "value": "catch", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 7, + "line": 5, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + "value": "stack", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 71, + 72, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "Object", + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "Object", + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "String", + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "String", + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 29, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 9, + ], + "type": "Identifier", + "value": "Object", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 19, + ], + "type": "Identifier", + "value": "String", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/named-param.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "responseText", + "range": Array [ + 3, + 15, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 21, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "text", + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 29, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "res", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 15, + ], + "type": "Identifier", + "value": "responseText", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + "value": "text", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "res", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/nested-array.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + null, + Object { + "elements": Array [ + null, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 15, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "ArrayPattern", + }, + "init": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + ], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 29, + ], + "type": "ArrayExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 30, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 30, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/nested-object.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 22, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 20, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 14, + 22, + ], + "type": "ObjectPattern", + }, + }, + ], + "range": Array [ + 4, + 24, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 29, + 35, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 35, + ], + "raw": "\\"3\\"", + "type": "Literal", + "value": "3", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", }, - }, - "method": false, - "range": Array [ - 12, - 13, - ], - "shorthand": true, - "type": "Property", - "value": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 13, + "column": 50, "line": 1, }, "start": Object { - "column": 12, + "column": 37, "line": 1, }, }, - "name": "a", + "method": false, "range": Array [ - 12, - 13, + 37, + 50, ], - "type": "Identifier", + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 42, + 48, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 48, + ], + "raw": "\\"b\\"", + "type": "Literal", + "value": "b", + }, + }, + ], + "range": Array [ + 40, + 50, + ], + "type": "ObjectExpression", + }, }, + ], + "range": Array [ + 27, + 52, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 52, + "line": 1, }, - ], + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ - 11, - 14, + 4, + 52, ], - "type": "ObjectPattern", + "type": "VariableDeclarator", }, ], - "range": Array [ - 0, - 71, - ], - "type": "FunctionDeclaration", - }, - Object { + "kind": "var", "loc": Object { "end": Object { - "column": 2, - "line": 7, + "column": 53, + "line": 1, }, "start": Object { - "column": 1, - "line": 7, + "column": 0, + "line": 1, }, }, "range": Array [ - 71, - 72, + 0, + 53, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 7, + "column": 53, + "line": 1, }, "start": Object { "column": 0, @@ -44988,14 +53735,14 @@ Object { }, "range": Array [ 0, - 72, + 53, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 3, "line": 1, }, "start": Object { @@ -45005,25 +53752,43 @@ Object { }, "range": Array [ 0, - 8, + 3, ], "type": "Keyword", - "value": "function", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 5, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, "range": Array [ - 9, - 10, + 4, + 5, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, ], "type": "Identifier", "value": "x", @@ -45031,74 +53796,92 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 1, }, "start": Object { - "column": 10, + "column": 6, "line": 1, }, }, "range": Array [ - 10, - 11, + 6, + 7, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 9, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ - 11, - 12, + 8, + 9, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 10, "line": 1, }, "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { "column": 12, "line": 1, }, + "start": Object { + "column": 11, + "line": 1, + }, }, "range": Array [ + 11, 12, - 13, ], "type": "Identifier", - "value": "a", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 14, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { @@ -45116,7 +53899,7 @@ Object { 15, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { @@ -45133,329 +53916,311 @@ Object { 16, 17, ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 20, - 23, - ], - "type": "Keyword", - "value": "try", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 24, - 25, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 19, + "line": 1, }, }, "range": Array [ - 30, - 33, + 19, + 20, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 34, - 35, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 9, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 35, - 36, + 23, + 24, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 26, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 25, + "line": 1, }, }, "range": Array [ - 36, - 37, + 25, + 26, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 12, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 38, - 39, + 27, + 28, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 30, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 29, + "line": 1, }, }, "range": Array [ - 40, - 41, + 29, + 30, ], "type": "Identifier", - "value": "a", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 31, + "line": 1, }, "start": Object { - "column": 15, - "line": 3, + "column": 30, + "line": 1, }, }, "range": Array [ - 41, - 42, + 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 35, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 32, + "line": 1, }, }, "range": Array [ - 45, - 46, + 32, + 35, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"3\\"", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 36, + "line": 1, }, "start": Object { - "column": 2, - "line": 5, + "column": 35, + "line": 1, }, }, "range": Array [ - 49, - 54, + 35, + 36, ], - "type": "Keyword", - "value": "catch", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 38, + "line": 1, }, "start": Object { - "column": 7, - "line": 5, + "column": 37, + "line": 1, }, }, "range": Array [ - 54, - 55, + 37, + 38, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 39, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 38, + "line": 1, }, }, "range": Array [ - 55, - 56, + 38, + 39, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 5, + "column": 41, + "line": 1, }, "start": Object { - "column": 9, - "line": 5, + "column": 40, + "line": 1, }, }, "range": Array [ - 56, - 61, + 40, + 41, ], - "type": "Identifier", - "value": "stack", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 43, + "line": 1, }, "start": Object { - "column": 14, - "line": 5, + "column": 42, + "line": 1, }, }, "range": Array [ - 61, - 62, + 42, + 43, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 5, + "column": 44, + "line": 1, }, "start": Object { - "column": 15, - "line": 5, + "column": 43, + "line": 1, }, }, "range": Array [ - 62, - 63, + 43, + 44, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 48, + "line": 1, }, "start": Object { - "column": 17, - "line": 5, + "column": 45, + "line": 1, }, }, - "range": Array [ - 64, - 65, + "range": Array [ + 45, + 48, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"b\\"", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 50, + "line": 1, }, "start": Object { - "column": 2, - "line": 6, + "column": 49, + "line": 1, }, }, "range": Array [ - 68, - 69, + 49, + 50, ], "type": "Punctuator", "value": "}", @@ -45463,17 +54228,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 52, + "line": 1, }, "start": Object { - "column": 0, - "line": 7, + "column": 51, + "line": 1, }, }, "range": Array [ - 70, - 71, + 51, + 52, ], "type": "Punctuator", "value": "}", @@ -45481,17 +54246,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 7, + "column": 53, + "line": 1, }, "start": Object { - "column": 1, - "line": 7, + "column": 52, + "line": 1, }, }, "range": Array [ - 71, - 72, + 52, + 53, ], "type": "Punctuator", "value": ";", @@ -45501,254 +54266,127 @@ Object { } `; -exports[`javascript fixtures/destructuring/invalid-defaults-object-assign.src 1`] = ` +exports[`javascript fixtures/destructuring/object-var-named.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "Object", - "range": Array [ - 3, - 9, - ], - "type": "Identifier", + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, + "start": Object { + "column": 4, + "line": 1, }, - "method": false, - "range": Array [ - 3, - 11, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 1, }, "start": Object { - "column": 3, + "column": 5, "line": 1, }, }, - "name": "Object", + "name": "a", "range": Array [ - 3, - 9, + 5, + 6, ], "type": "Identifier", }, + "kind": "init", "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 3, + "column": 5, "line": 1, }, }, + "method": false, "range": Array [ - 3, - 11, + 5, + 8, ], - "right": Object { + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 10, + "column": 7, "line": 1, }, }, + "name": "b", "range": Array [ - 10, - 11, + 7, + 8, ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "type": "Identifier", }, - "name": "String", - "range": Array [ - 13, - 19, - ], - "type": "Identifier", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + ], + "range": Array [ + 4, + 9, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, }, - "method": false, - "range": Array [ - 13, - 21, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "String", - "range": Array [ - 13, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 21, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "AssignmentPattern", + "start": Object { + "column": 12, + "line": 1, }, }, - ], - "range": Array [ - 1, - 23, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "properties": Array [], + "range": Array [ + 12, + 14, + ], + "type": "ObjectExpression", }, - }, - "operator": "=", - "range": Array [ - 0, - 29, - ], - "right": Object { "loc": Object { "end": Object { - "column": 29, + "column": 14, "line": 1, }, "start": Object { - "column": 27, + "column": 4, "line": 1, }, }, - "properties": Array [], "range": Array [ - 27, - 29, + 4, + 14, ], - "type": "ObjectExpression", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 29, + "column": 15, "line": 1, }, "start": Object { @@ -45758,15 +54396,15 @@ Object { }, "range": Array [ 0, - 29, + 15, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { "column": 0, @@ -45775,14 +54413,14 @@ Object { }, "range": Array [ 0, - 30, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -45792,25 +54430,25 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 5, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, - 2, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -45818,143 +54456,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 1, }, "start": Object { - "column": 3, + "column": 5, "line": 1, }, }, "range": Array [ - 3, - 9, + 5, + 6, ], "type": "Identifier", - "value": "Object", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Numeric", - "value": "0", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 7, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, "range": Array [ - 11, - 12, + 6, + 7, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 8, "line": 1, }, "start": Object { - "column": 13, + "column": 7, "line": 1, }, }, "range": Array [ - 13, - 19, + 7, + 8, ], "type": "Identifier", - "value": "String", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Numeric", - "value": "0", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 9, "line": 1, }, "start": Object { - "column": 22, + "column": 8, "line": 1, }, }, "range": Array [ - 22, - 23, + 8, + 9, ], "type": "Punctuator", "value": "}", @@ -45962,199 +54528,201 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 11, "line": 1, }, "start": Object { - "column": 23, + "column": 10, "line": 1, }, }, "range": Array [ - 23, - 24, + 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 13, "line": 1, }, "start": Object { - "column": 25, + "column": 12, "line": 1, }, }, "range": Array [ - 25, - 26, + 12, + 13, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 14, "line": 1, }, "start": Object { - "column": 27, + "column": 13, "line": 1, }, }, "range": Array [ - 27, - 28, + 13, + 14, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 15, "line": 1, }, "start": Object { - "column": 28, + "column": 14, "line": 1, }, }, "range": Array [ - 28, - 29, + 14, + 15, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/named-param.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "responseText", - "range": Array [ - 3, - 15, - ], - "type": "Identifier", +exports[`javascript fixtures/destructuring/object-var-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, + "start": Object { + "column": 4, + "line": 1, }, - "method": false, - "range": Array [ - 3, - 21, - ], - "shorthand": false, - "type": "Property", - "value": Object { + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 21, + "column": 6, "line": 1, }, "start": Object { - "column": 17, + "column": 5, "line": 1, }, }, - "name": "text", + "method": false, "range": Array [ - 17, - 21, + 5, + 6, ], - "type": "Identifier", + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, }, - }, - ], - "range": Array [ - 1, - 23, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, + ], + "range": Array [ + 4, + 7, + ], + "type": "ObjectPattern", }, - "start": Object { - "column": 1, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 10, + 12, + ], + "type": "ObjectExpression", }, - }, - "operator": "=", - "range": Array [ - 1, - 29, - ], - "right": Object { "loc": Object { "end": Object { - "column": 29, + "column": 12, "line": 1, }, "start": Object { - "column": 26, + "column": 4, "line": 1, }, }, - "name": "res", "range": Array [ - 26, - 29, + 4, + 12, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 31, + "column": 13, "line": 1, }, "start": Object { @@ -46164,14 +54732,14 @@ Object { }, "range": Array [ 0, - 31, + 13, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 31, + "column": 13, "line": 1, }, "start": Object { @@ -46181,14 +54749,14 @@ Object { }, "range": Array [ 0, - 31, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -46198,97 +54766,61 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ 3, - 15, ], - "type": "Identifier", - "value": "responseText", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 5, "line": 1, }, "start": Object { - "column": 15, + "column": 4, "line": 1, }, }, "range": Array [ - 15, - 16, + 4, + 5, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 6, "line": 1, }, "start": Object { - "column": 17, + "column": 5, "line": 1, }, }, "range": Array [ - 17, - 21, + 5, + 6, ], "type": "Identifier", - "value": "text", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 7, "line": 1, }, "start": Object { - "column": 22, + "column": 6, "line": 1, }, }, "range": Array [ - 22, - 23, + 6, + 7, ], "type": "Punctuator", "value": "}", @@ -46296,17 +54828,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 9, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, "range": Array [ - 24, - 25, + 8, + 9, ], "type": "Punctuator", "value": "=", @@ -46314,53 +54846,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 11, "line": 1, }, "start": Object { - "column": 26, + "column": 10, "line": 1, }, }, "range": Array [ - 26, - 29, + 10, + 11, ], - "type": "Identifier", - "value": "res", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 12, "line": 1, }, "start": Object { - "column": 29, + "column": 11, "line": 1, }, }, "range": Array [ - 29, - 30, + 11, + 12, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 13, "line": 1, }, "start": Object { - "column": 30, + "column": 12, "line": 1, }, }, "range": Array [ - 30, - 31, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -46370,240 +54902,144 @@ Object { } `; -exports[`javascript fixtures/destructuring/nested-array.src 1`] = ` +exports[`javascript fixtures/destructuring/param-defaults-array.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ Object { - "id": Object { - "elements": Array [ - Object { + "elements": Array [ + Object { + "left": Object { "loc": Object { "end": Object { - "column": 6, + "column": 13, "line": 1, }, "start": Object { - "column": 5, + "column": 12, "line": 1, }, }, "name": "x", "range": Array [ - 5, - 6, + 12, + 13, ], "type": "Identifier", }, - null, - Object { - "elements": Array [ - null, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, }, - "range": Array [ - 10, - 15, - ], - "type": "ArrayPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "ArrayPattern", - }, - "init": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + "start": Object { + "column": 12, + "line": 1, }, - "range": Array [ - 20, - 21, - ], - "raw": "1", - "type": "Literal", - "value": 1, }, - Object { + "range": Array [ + 12, + 18, + ], + "right": Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 18, ], - "raw": "2", + "raw": "10", "type": "Literal", - "value": 2, - }, - Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, - ], - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 29, - ], - "type": "ArrayExpression", - }, - ], - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, + "value": 10, }, + "type": "AssignmentPattern", }, - "range": Array [ - 19, - 30, - ], - "type": "ArrayExpression", - }, + ], "loc": Object { "end": Object { - "column": 30, + "column": 19, "line": 1, }, "start": Object { - "column": 4, + "column": 11, "line": 1, }, }, "range": Array [ - 4, - 30, + 11, + 19, ], - "type": "VariableDeclarator", + "type": "ArrayPattern", }, ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, "range": Array [ 0, - 31, + 23, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 31, + "column": 23, "line": 1, }, "start": Object { @@ -46613,14 +55049,14 @@ Object { }, "range": Array [ 0, - 31, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -46630,840 +55066,934 @@ Object { }, "range": Array [ 0, - 3, + 8, ], "type": "Keyword", - "value": "var", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 10, "line": 1, }, "start": Object { - "column": 4, + "column": 9, "line": 1, }, }, "range": Array [ - 4, - 5, + 9, + 10, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 11, "line": 1, }, "start": Object { - "column": 5, + "column": 10, "line": 1, }, }, "range": Array [ - 5, - 6, + 10, + 11, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 1, }, "start": Object { - "column": 6, + "column": 11, "line": 1, }, }, "range": Array [ - 6, - 7, + 11, + 12, ], "type": "Punctuator", - "value": ",", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 12, "line": 1, }, }, "range": Array [ - 8, - 9, + 12, + 13, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], "type": "Punctuator", - "value": "[", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 18, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 18, ], - "type": "Punctuator", - "value": ",", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 19, "line": 1, }, "start": Object { - "column": 13, + "column": 18, "line": 1, }, }, "range": Array [ - 13, - 14, + 18, + 19, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 20, "line": 1, }, "start": Object { - "column": 14, + "column": 19, "line": 1, }, }, "range": Array [ - 14, - 15, + 19, + 20, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 15, + "column": 21, "line": 1, }, }, "range": Array [ - 15, - 16, + 21, + 22, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 1, }, "start": Object { - "column": 17, + "column": 22, "line": 1, }, }, "range": Array [ - 17, - 18, + 22, + 23, ], "type": "Punctuator", - "value": "=", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/param-defaults-object.src 1`] = ` +Object { + "body": Array [ Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 20, + "column": 23, "line": 1, }, "start": Object { - "column": 19, + "column": 0, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 18, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 11, + 19, + ], + "type": "ObjectPattern", + }, + ], "range": Array [ - 19, - 20, + 0, + 23, ], - "type": "Punctuator", - "value": "[", + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 21, + "column": 8, "line": 1, }, "start": Object { - "column": 20, + "column": 0, "line": 1, }, }, "range": Array [ - 20, - 21, + 0, + 8, ], - "type": "Numeric", - "value": "1", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 10, "line": 1, }, "start": Object { - "column": 21, + "column": 9, "line": 1, }, }, "range": Array [ - 21, - 22, + 9, + 10, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 11, "line": 1, }, "start": Object { - "column": 22, + "column": 10, "line": 1, }, }, "range": Array [ - 22, - 23, + 10, + 11, ], - "type": "Numeric", - "value": "2", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 12, "line": 1, }, "start": Object { - "column": 23, + "column": 11, "line": 1, }, }, "range": Array [ - 23, - 24, + 11, + 12, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 13, "line": 1, }, "start": Object { - "column": 24, + "column": 12, "line": 1, }, }, "range": Array [ - 24, - 25, + 12, + 13, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { - "column": 25, + "column": 14, "line": 1, }, }, "range": Array [ - 25, - 26, + 14, + 15, ], - "type": "Numeric", - "value": "3", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 18, "line": 1, }, "start": Object { - "column": 26, + "column": 16, "line": 1, }, }, "range": Array [ - 26, - 27, + 16, + 18, ], - "type": "Punctuator", - "value": ",", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 19, "line": 1, }, "start": Object { - "column": 27, + "column": 18, "line": 1, }, }, "range": Array [ - 27, - 28, + 18, + 19, ], - "type": "Numeric", - "value": "4", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { - "column": 28, + "column": 19, "line": 1, }, }, "range": Array [ - 28, - 29, + 19, + 20, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 22, "line": 1, }, "start": Object { - "column": 29, + "column": 21, "line": 1, }, }, "range": Array [ - 29, - 30, + 21, + 22, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 23, "line": 1, }, "start": Object { - "column": 30, + "column": 22, "line": 1, }, }, "range": Array [ - 30, - 31, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/nested-object.src 1`] = ` +exports[`javascript fixtures/destructuring/param-defaults-object-nested.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 9, + "column": 13, "line": 1, }, "start": Object { - "column": 5, + "column": 12, "line": 1, }, }, - "method": false, + "name": "x", "range": Array [ - 5, - 9, + 12, + 13, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, }, }, - Object { - "computed": false, - "key": Object { + "method": false, + "range": Array [ + 12, + 18, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, - "name": "z", + "name": "x", "range": Array [ - 11, 12, + 13, ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 22, + "column": 18, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, - "method": false, "range": Array [ - 11, - 22, + 12, + 18, ], - "shorthand": false, - "type": "Property", - "value": Object { + "right": Object { "loc": Object { "end": Object { - "column": 22, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 16, - 20, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - }, - ], "range": Array [ - 14, - 22, + 16, + 18, ], - "type": "ObjectPattern", + "raw": "10", + "type": "Literal", + "value": 10, }, - }, - ], - "range": Array [ - 4, - 24, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, + "type": "AssignmentPattern", }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - "kind": "init", + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 35, + "column": 21, "line": 1, }, "start": Object { - "column": 29, + "column": 20, "line": 1, }, }, - "method": false, + "name": "y", "range": Array [ - 29, - 35, + 20, + 21, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 35, - ], - "raw": "\\"3\\"", - "type": "Literal", - "value": "3", - }, + "type": "Identifier", }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 37, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 37, - 38, - ], - "type": "Identifier", + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, }, - "kind": "init", + "start": Object { + "column": 20, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 20, + 33, + ], + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 50, + "column": 33, "line": 1, }, "start": Object { - "column": 37, + "column": 23, "line": 1, }, }, - "method": false, - "range": Array [ - 37, - 50, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", }, - "start": Object { - "column": 40, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "method": false, + "range": Array [ + 25, + 31, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { "loc": Object { "end": Object { - "column": 43, + "column": 26, "line": 1, }, "start": Object { - "column": 42, + "column": 25, "line": 1, }, }, - "name": "a", + "name": "z", "range": Array [ - 42, - 43, + 25, + 26, ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 48, + "column": 31, "line": 1, }, "start": Object { - "column": 42, + "column": 25, "line": 1, }, }, - "method": false, "range": Array [ - 42, - 48, + 25, + 31, ], - "shorthand": false, - "type": "Property", - "value": Object { + "right": Object { "loc": Object { "end": Object { - "column": 48, + "column": 31, "line": 1, }, "start": Object { - "column": 45, + "column": 29, "line": 1, }, }, "range": Array [ - 45, - 48, + 29, + 31, ], - "raw": "\\"b\\"", + "raw": "10", "type": "Literal", - "value": "b", + "value": 10, }, + "type": "AssignmentPattern", }, - ], - "range": Array [ - 40, - 50, - ], - "type": "ObjectExpression", - }, + }, + ], + "range": Array [ + 23, + 33, + ], + "type": "ObjectPattern", }, - ], - "range": Array [ - 27, - 52, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 52, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, }, - }, + ], "range": Array [ - 4, - 52, + 11, + 34, ], - "type": "VariableDeclarator", + "type": "ObjectPattern", }, ], - "kind": "var", + "range": Array [ + 0, + 38, + ], + "type": "FunctionDeclaration", + }, + Object { "loc": Object { "end": Object { - "column": 53, + "column": 39, "line": 1, }, "start": Object { - "column": 0, + "column": 38, "line": 1, }, }, "range": Array [ - 0, - 53, + 38, + 39, ], - "type": "VariableDeclaration", + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 53, + "column": 39, "line": 1, }, "start": Object { @@ -47473,14 +56003,14 @@ Object { }, "range": Array [ 0, - 53, + 39, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -47489,101 +56019,47 @@ Object { }, }, "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, + 0, + 8, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, 9, + 10, ], "type": "Identifier", - "value": "y", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { @@ -47600,8 +56076,8 @@ Object { 11, 12, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -47618,8 +56094,8 @@ Object { 12, 13, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -47637,12 +56113,12 @@ Object { 15, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { @@ -47652,46 +56128,46 @@ Object { }, "range": Array [ 16, - 17, + 18, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { - "column": 19, + "column": 20, "line": 1, }, }, "range": Array [ - 19, 20, + 21, ], "type": "Identifier", - "value": "b", + "value": "y", }, Object { "loc": Object { @@ -47709,7 +56185,7 @@ Object { 22, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { @@ -47727,7 +56203,7 @@ Object { 24, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { @@ -47744,8 +56220,8 @@ Object { 25, 26, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { @@ -47763,12 +56239,12 @@ Object { 28, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 31, "line": 1, }, "start": Object { @@ -47778,33 +56254,15 @@ Object { }, "range": Array [ 29, - 30, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, 31, ], - "type": "Punctuator", - "value": ":", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 1, }, "start": Object { @@ -47814,79 +56272,61 @@ Object { }, "range": Array [ 32, - 35, - ], - "type": "String", - "value": "\\"3\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 36, + 33, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 38, + "column": 34, "line": 1, }, "start": Object { - "column": 37, + "column": 33, "line": 1, }, }, "range": Array [ - 37, - 38, + 33, + 34, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 35, "line": 1, }, "start": Object { - "column": 38, + "column": 34, "line": 1, }, }, "range": Array [ - 38, - 39, + 34, + 35, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 37, "line": 1, }, "start": Object { - "column": 40, + "column": 36, "line": 1, }, }, "range": Array [ - 40, - 41, + 36, + 37, ], "type": "Punctuator", "value": "{", @@ -47894,339 +56334,194 @@ Object { Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 42, - "line": 1, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 44, + "column": 38, "line": 1, }, "start": Object { - "column": 43, + "column": 37, "line": 1, }, }, "range": Array [ - 43, - 44, + 37, + 38, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 48, - "line": 1, - }, - "start": Object { - "column": 45, - "line": 1, - }, - }, - "range": Array [ - 45, - 48, - ], - "type": "String", - "value": "\\"b\\"", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 50, + "column": 39, "line": 1, }, "start": Object { - "column": 49, + "column": 38, "line": 1, }, }, "range": Array [ - 49, - 50, + 38, + 39, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/params-array.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 1, + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, }, - "start": Object { - "column": 51, - "line": 1, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, - "range": Array [ - 51, - 52, - ], - "type": "Punctuator", - "value": "}", - }, - Object { "loc": Object { "end": Object { - "column": 53, + "column": 22, "line": 1, }, "start": Object { - "column": 52, + "column": 0, "line": 1, }, }, - "range": Array [ - 52, - 53, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/object-var-named.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ + "params": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - "method": false, - "range": Array [ - 5, - 8, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", + "start": Object { + "column": 16, + "line": 1, }, }, - ], - "range": Array [ - 4, - 9, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", }, - "properties": Array [], - "range": Array [ - 12, - 14, - ], - "type": "ObjectExpression", - }, + ], "loc": Object { "end": Object { - "column": 14, + "column": 19, "line": 1, }, "start": Object { - "column": 4, + "column": 11, "line": 1, }, }, "range": Array [ - 4, - 14, + 11, + 19, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "ArrayPattern", }, - }, - "range": Array [ - 0, - 15, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, + 22, ], - "type": "Punctuator", - "value": "{", + "type": "FunctionDeclaration", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 23, "line": 1, }, "start": Object { - "column": 5, + "column": 22, "line": 1, }, }, "range": Array [ - 5, - 6, + 22, + 23, ], - "type": "Identifier", - "value": "a", + "type": "EmptyStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": ":", + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { @@ -48234,34 +56529,34 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 0, "line": 1, }, }, "range": Array [ - 7, + 0, 8, ], - "type": "Identifier", - "value": "b", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, 9, + 10, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -48279,25 +56574,25 @@ Object { 11, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 13, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { @@ -48314,8 +56609,8 @@ Object { 13, 14, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -48333,268 +56628,76 @@ Object { 15, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/object-var-undefined.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 5, - 6, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 4, - 7, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 10, - 12, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 1, }, "start": Object { - "column": 5, + "column": 16, "line": 1, }, }, "range": Array [ - 5, - 6, + 16, + 17, ], "type": "Identifier", - "value": "a", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 19, "line": 1, }, "start": Object { - "column": 6, + "column": 18, "line": 1, }, }, "range": Array [ - 6, - 7, + 18, + 19, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 19, "line": 1, }, }, "range": Array [ - 8, - 9, + 19, + 20, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 20, "line": 1, }, }, "range": Array [ - 10, - 11, + 20, + 21, ], "type": "Punctuator", "value": "{", @@ -48602,17 +56705,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 21, "line": 1, }, }, "range": Array [ - 11, - 12, + 21, + 22, ], "type": "Punctuator", "value": "}", @@ -48620,17 +56723,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 22, "line": 1, }, }, "range": Array [ - 12, - 13, + 22, + 23, ], "type": "Punctuator", "value": ";", @@ -48640,144 +56743,143 @@ Object { } `; -exports[`javascript fixtures/destructuring/param-defaults-array.src 1`] = ` +exports[`javascript fixtures/destructuring/params-array-wrapped.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, }, - "start": Object { - "column": 21, - "line": 1, + "range": Array [ + 21, + 23, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", }, - "range": Array [ - 21, - 23, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 23, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "elements": Array [ - Object { - "left": Object { + "params": Array [ + Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 12, - 13, + 14, + 15, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 18, - ], - "right": Object { + Object { "loc": Object { "end": Object { "column": 18, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, + "name": "b", "range": Array [ - 16, + 17, 18, ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, }, - "type": "AssignmentPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, }, + "range": Array [ + 12, + 20, + ], + "type": "ArrayPattern", }, - "range": Array [ - 11, - 19, - ], - "type": "ArrayPattern", + ], + "range": Array [ + 1, + 23, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, }, - ], + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 23, + 25, ], - "type": "FunctionDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 23, + "column": 25, "line": 1, }, "start": Object { @@ -48787,14 +56889,14 @@ Object { }, "range": Array [ 0, - 23, + 25, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -48804,28 +56906,28 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, "range": Array [ + 1, 9, - 10, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -48842,8 +56944,8 @@ Object { 10, 11, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -48861,7 +56963,7 @@ Object { 12, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { @@ -48878,26 +56980,44 @@ Object { 12, 13, ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, + 16, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { @@ -48906,31 +57026,31 @@ Object { "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, + 17, 18, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 20, "line": 1, }, "start": Object { - "column": 18, + "column": 19, "line": 1, }, }, "range": Array [ - 18, 19, + 20, ], "type": "Punctuator", "value": "]", @@ -48938,17 +57058,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { - "column": 19, + "column": 20, "line": 1, }, }, "range": Array [ - 19, 20, + 21, ], "type": "Punctuator", "value": ")", @@ -48989,12 +57109,48 @@ Object { "type": "Punctuator", "value": "}", }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/param-defaults-object.src 1`] = ` +exports[`javascript fixtures/destructuring/params-multi-object.src 1`] = ` Object { "body": Array [ Object { @@ -49003,17 +57159,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 23, + "column": 22, "line": 1, }, "start": Object { - "column": 21, + "column": 20, "line": 1, }, }, "range": Array [ - 21, - 23, + 20, + 22, ], "type": "BlockStatement", }, @@ -49030,7 +57186,7 @@ Object { "line": 1, }, }, - "name": "a", + "name": "x", "range": Array [ 9, 10, @@ -49039,7 +57195,7 @@ Object { }, "loc": Object { "end": Object { - "column": 23, + "column": 22, "line": 1, }, "start": Object { @@ -49051,7 +57207,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 12, "line": 1, }, "start": Object { @@ -49059,103 +57215,85 @@ Object { "line": 1, }, }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, "properties": Array [ Object { "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, - "name": "x", + "name": "b", "range": Array [ - 12, - 13, + 16, + 17, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "method": false, "range": Array [ - 12, - 18, + 16, + 17, ], "shorthand": true, "type": "Property", "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, + "name": "b", "range": Array [ - 12, - 18, + 16, + 17, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", + "type": "Identifier", }, }, ], "range": Array [ - 11, + 14, 19, ], "type": "ObjectPattern", @@ -49163,15 +57301,32 @@ Object { ], "range": Array [ 0, - 23, + 22, ], "type": "FunctionDeclaration", }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", + }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -49180,7 +57335,7 @@ Object { }, "range": Array [ 0, - 23, + 24, ], "sourceType": "script", "tokens": Array [ @@ -49218,7 +57373,7 @@ Object { 10, ], "type": "Identifier", - "value": "a", + "value": "x", }, Object { "loc": Object { @@ -49253,8 +57408,8 @@ Object { 11, 12, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -49271,8 +57426,8 @@ Object { 12, 13, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -49290,12 +57445,12 @@ Object { 15, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { @@ -49305,10 +57460,10 @@ Object { }, "range": Array [ 16, - 18, + 17, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -49346,6 +57501,24 @@ Object { "type": "Punctuator", "value": ")", }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "{", + }, Object { "loc": Object { "end": Object { @@ -49362,7 +57535,7 @@ Object { 22, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { @@ -49380,14 +57553,14 @@ Object { 23, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring/param-defaults-object-nested.src 1`] = ` +exports[`javascript fixtures/destructuring/params-nested-array.src 1`] = ` Object { "body": Array [ Object { @@ -49396,17 +57569,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 38, + "column": 27, "line": 1, }, "start": Object { - "column": 36, + "column": 25, "line": 1, }, }, "range": Array [ - 36, - 38, + 25, + 27, ], "type": "BlockStatement", }, @@ -49432,7 +57605,7 @@ Object { }, "loc": Object { "end": Object { - "column": 38, + "column": 27, "line": 1, }, "start": Object { @@ -49442,41 +57615,11 @@ Object { }, "params": Array [ Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "properties": Array [ + "elements": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { @@ -49484,254 +57627,97 @@ Object { "line": 1, }, }, - "method": false, + "name": "x", "range": Array [ 12, - 18, + 13, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { + "type": "Identifier", + }, + null, + Object { + "elements": Array [ + null, + Object { "loc": Object { "end": Object { - "column": 13, + "column": 21, "line": 1, }, "start": Object { - "column": 12, + "column": 20, "line": 1, }, }, - "name": "x", + "name": "z", "range": Array [ - 12, - 13, + 20, + 21, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 18, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 18, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "kind": "init", + ], "loc": Object { "end": Object { - "column": 33, + "column": 22, "line": 1, }, "start": Object { - "column": 20, + "column": 17, "line": 1, }, }, - "method": false, "range": Array [ - 20, - 33, + 17, + 22, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 25, - 31, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 31, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 23, - 33, - ], - "type": "ObjectPattern", - }, + "type": "ArrayPattern", }, ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, "range": Array [ 11, - 34, + 23, ], - "type": "ObjectPattern", + "type": "ArrayPattern", }, ], "range": Array [ 0, - 38, + 27, ], "type": "FunctionDeclaration", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 28, "line": 1, }, "start": Object { - "column": 38, + "column": 27, "line": 1, }, }, "range": Array [ - 38, - 39, + 27, + 28, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 39, + "column": 28, "line": 1, }, "start": Object { @@ -49741,7 +57727,7 @@ Object { }, "range": Array [ 0, - 39, + 28, ], "sourceType": "script", "tokens": Array [ @@ -49815,7 +57801,7 @@ Object { 12, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { @@ -49838,53 +57824,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ + 13, 14, - 15, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { "column": 16, "line": 1, }, - }, - "range": Array [ - 16, - 18, - ], - "type": "Numeric", - "value": "10", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, "start": Object { - "column": 18, + "column": 15, "line": 1, }, }, "range": Array [ - 18, - 19, + 15, + 16, ], "type": "Punctuator", "value": ",", @@ -49892,71 +57860,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, + "column": 18, "line": 1, }, "start": Object { - "column": 21, + "column": 17, "line": 1, }, }, "range": Array [ - 21, - 22, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 1, }, "start": Object { - "column": 23, + "column": 18, "line": 1, }, }, "range": Array [ - 23, - 24, + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 21, "line": 1, }, "start": Object { - "column": 25, + "column": 20, "line": 1, }, }, "range": Array [ - 25, - 26, + 20, + 21, ], "type": "Identifier", "value": "z", @@ -49964,89 +57914,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "Numeric", - "value": "10", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, + "column": 22, "line": 1, }, "start": Object { - "column": 32, + "column": 21, "line": 1, }, }, "range": Array [ - 32, - 33, + 21, + 22, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 23, "line": 1, }, "start": Object { - "column": 33, + "column": 22, "line": 1, }, }, "range": Array [ - 33, - 34, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 24, "line": 1, }, "start": Object { - "column": 34, + "column": 23, "line": 1, }, }, "range": Array [ - 34, - 35, + 23, + 24, ], "type": "Punctuator", "value": ")", @@ -50054,17 +57968,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 37, + "column": 26, "line": 1, }, "start": Object { - "column": 36, + "column": 25, "line": 1, }, }, "range": Array [ - 36, - 37, + 25, + 26, ], "type": "Punctuator", "value": "{", @@ -50072,17 +57986,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 38, + "column": 27, "line": 1, }, "start": Object { - "column": 37, + "column": 26, "line": 1, }, }, "range": Array [ - 37, - 38, + 26, + 27, ], "type": "Punctuator", "value": "}", @@ -50090,17 +58004,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 39, + "column": 28, "line": 1, }, "start": Object { - "column": 38, + "column": 27, "line": 1, }, }, "range": Array [ - 38, - 39, + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -50110,7 +58024,7 @@ Object { } `; -exports[`javascript fixtures/destructuring/params-array.src 1`] = ` +exports[`javascript fixtures/destructuring/params-nested-object.src 1`] = ` Object { "body": Array [ Object { @@ -50119,17 +58033,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 22, + "column": 35, "line": 1, }, "start": Object { - "column": 20, + "column": 33, "line": 1, }, }, "range": Array [ - 20, - 22, + 33, + 35, ], "type": "BlockStatement", }, @@ -50146,7 +58060,7 @@ Object { "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ 9, 10, @@ -50155,7 +58069,7 @@ Object { }, "loc": Object { "end": Object { - "column": 22, + "column": 35, "line": 1, }, "start": Object { @@ -50165,88 +58079,224 @@ Object { }, "params": Array [ Object { - "elements": Array [ + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, - "name": "a", + "method": false, "range": Array [ - 13, - 14, + 12, + 16, ], - "type": "Identifier", + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, }, Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 29, "line": 1, }, "start": Object { - "column": 16, + "column": 18, "line": 1, }, }, - "name": "b", + "method": false, "range": Array [ - 16, - 17, + 18, + 29, ], - "type": "Identifier", + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 23, + 27, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 21, + 29, + ], + "type": "ObjectPattern", + }, }, ], - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, "range": Array [ 11, - 19, + 31, ], - "type": "ArrayPattern", + "type": "ObjectPattern", }, ], "range": Array [ 0, - 22, + 35, ], "type": "FunctionDeclaration", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 36, "line": 1, }, "start": Object { - "column": 22, + "column": 35, "line": 1, }, }, "range": Array [ - 22, - 23, + 35, + 36, ], "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 23, + "column": 36, "line": 1, }, "start": Object { @@ -50256,7 +58306,7 @@ Object { }, "range": Array [ 0, - 23, + 36, ], "sourceType": "script", "tokens": Array [ @@ -50281,71 +58331,197 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 18, "line": 1, }, }, "range": Array [ - 9, - 10, + 18, + 19, ], "type": "Identifier", - "value": "x", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 20, "line": 1, }, "start": Object { - "column": 10, + "column": 19, "line": 1, }, }, "range": Array [ - 10, - 11, + 19, + 20, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 21, "line": 1, }, }, "range": Array [ - 11, - 12, + 21, + 22, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 24, "line": 1, }, "start": Object { - "column": 13, + "column": 23, "line": 1, }, }, "range": Array [ - 13, - 14, + 23, + 24, ], "type": "Identifier", "value": "a", @@ -50353,35 +58529,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 25, "line": 1, }, "start": Object { - "column": 14, + "column": 24, "line": 1, }, }, "range": Array [ - 14, - 15, + 24, + 25, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 27, "line": 1, }, "start": Object { - "column": 16, + "column": 26, "line": 1, }, }, "range": Array [ - 16, - 17, + 26, + 27, ], "type": "Identifier", "value": "b", @@ -50389,35 +58565,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 29, "line": 1, }, "start": Object { - "column": 18, + "column": 28, "line": 1, }, }, "range": Array [ - 18, - 19, + 28, + 29, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 31, "line": 1, }, "start": Object { - "column": 19, + "column": 30, "line": 1, }, }, "range": Array [ - 19, - 20, + 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, ], "type": "Punctuator", "value": ")", @@ -50425,17 +58619,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 34, "line": 1, }, "start": Object { - "column": 20, + "column": 33, "line": 1, }, }, "range": Array [ - 20, - 21, + 33, + 34, ], "type": "Punctuator", "value": "{", @@ -50443,17 +58637,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 35, "line": 1, }, "start": Object { - "column": 21, + "column": 34, "line": 1, }, }, "range": Array [ - 21, - 22, + 34, + 35, ], "type": "Punctuator", "value": "}", @@ -50461,17 +58655,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 36, "line": 1, }, "start": Object { - "column": 22, + "column": 35, "line": 1, }, }, "range": Array [ - 22, - 23, + 35, + 36, ], "type": "Punctuator", "value": ";", @@ -50481,143 +58675,221 @@ Object { } `; -exports[`javascript fixtures/destructuring/params-array-wrapped.src 1`] = ` +exports[`javascript fixtures/destructuring/params-object.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, }, - "range": Array [ - 21, - 23, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "start": Object { + "column": 20, + "line": 1, }, - "name": "x", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 23, + "column": 10, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, - "params": Array [ - Object { - "elements": Array [ - Object { + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "name": "a", "range": Array [ + 13, 14, - 15, ], "type": "Identifier", }, - Object { + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 14, + ], + "shorthand": true, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 18, + "column": 14, "line": 1, }, "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { "column": 17, "line": 1, }, + "start": Object { + "column": 16, + "line": 1, + }, }, "name": "b", "range": Array [ + 16, 17, - 18, ], "type": "Identifier", }, - ], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, }, - "start": Object { - "column": 12, - "line": 1, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", }, }, - "range": Array [ - 12, - 20, - ], - "type": "ArrayPattern", - }, - ], - "range": Array [ - 1, - 23, - ], - "type": "FunctionExpression", - }, + ], + "range": Array [ + 11, + 19, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 22, + ], + "type": "FunctionDeclaration", + }, + Object { "loc": Object { "end": Object { - "column": 25, + "column": 23, "line": 1, }, "start": Object { - "column": 0, + "column": 22, "line": 1, }, }, "range": Array [ - 0, - 25, + 22, + 23, ], - "type": "ExpressionStatement", + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 25, + "column": 23, "line": 1, }, "start": Object { @@ -50627,14 +58899,14 @@ Object { }, "range": Array [ 0, - 25, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -50644,28 +58916,28 @@ Object { }, "range": Array [ 0, - 1, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, "range": Array [ - 1, 9, + 10, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -50682,8 +58954,8 @@ Object { 10, 11, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -50701,25 +58973,25 @@ Object { 12, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -50736,44 +59008,44 @@ Object { 14, 15, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 17, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -50791,7 +59063,7 @@ Object { 20, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { @@ -50809,7 +59081,7 @@ Object { 21, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { @@ -50827,7 +59099,7 @@ Object { 22, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { @@ -50845,226 +59117,229 @@ Object { 23, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/params-multi-object.src 1`] = ` -Object { - "body": Array [ - Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 22, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/params-object-wrapped.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 12, + "column": 23, "line": 1, }, "start": Object { - "column": 11, + "column": 21, "line": 1, }, }, - "name": "a", "range": Array [ - 11, - 12, + 21, + 23, ], - "type": "Identifier", + "type": "BlockStatement", }, - Object { + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 19, + "column": 11, "line": 1, }, "start": Object { - "column": 14, + "column": 10, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "name": "x", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, - "name": "b", + "method": false, "range": Array [ - 16, - 17, + 14, + 15, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", }, }, - "method": false, - "range": Array [ - 16, - 17, - ], - "shorthand": true, - "type": "Property", - "value": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, - "name": "b", + "method": false, "range": Array [ - 16, 17, + 18, ], - "type": "Identifier", + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, }, - }, - ], - "range": Array [ - 14, - 19, - ], - "type": "ObjectPattern", - }, - ], - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - Object { + ], + "range": Array [ + 12, + 20, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 1, + 23, + ], + "type": "FunctionExpression", + }, "loc": Object { "end": Object { - "column": 23, + "column": 25, "line": 1, }, "start": Object { - "column": 22, + "column": 0, "line": 1, }, }, "range": Array [ - 22, - 23, + 0, + 25, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { "column": 0, @@ -51073,14 +59348,14 @@ Object { }, "range": Array [ 0, - 24, + 25, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -51090,28 +59365,28 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, "range": Array [ + 1, 9, - 10, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -51128,8 +59403,8 @@ Object { 10, 11, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -51146,8 +59421,8 @@ Object { 11, 12, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -51165,7 +59440,7 @@ Object { 13, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { @@ -51182,44 +59457,44 @@ Object { 14, 15, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, "range": Array [ + 15, 16, - 17, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 18, "line": 1, }, "start": Object { - "column": 18, + "column": 17, "line": 1, }, }, "range": Array [ + 17, 18, - 19, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -51237,7 +59512,7 @@ Object { 20, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { @@ -51255,7 +59530,7 @@ Object { 21, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { @@ -51273,7 +59548,7 @@ Object { 22, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { @@ -51291,252 +59566,192 @@ Object { 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring/params-nested-array.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, }, - "range": Array [ - 25, - 27, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "start": Object { + "column": 23, + "line": 1, }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { "loc": Object { "end": Object { - "column": 27, + "column": 25, "line": 1, }, "start": Object { - "column": 0, + "column": 24, "line": 1, }, }, - "params": Array [ - Object { + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring/sparse-array.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { "elements": Array [ Object { "loc": Object { "end": Object { - "column": 13, + "column": 2, "line": 1, }, "start": Object { - "column": 12, + "column": 1, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 12, - 13, + 1, + 2, ], "type": "Identifier", }, null, Object { - "elements": Array [ - null, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - ], "loc": Object { "end": Object { - "column": 22, + "column": 5, "line": 1, }, "start": Object { - "column": 17, + "column": 4, "line": 1, }, }, + "name": "b", "range": Array [ - 17, - 22, + 4, + 5, ], - "type": "ArrayPattern", + "type": "Identifier", }, ], "loc": Object { "end": Object { - "column": 23, + "column": 6, "line": 1, }, "start": Object { - "column": 11, + "column": 0, "line": 1, }, }, "range": Array [ - 11, - 23, + 0, + 6, ], "type": "ArrayPattern", }, - ], - "range": Array [ - 0, - 27, - ], - "type": "FunctionDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 28, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, - "start": Object { - "column": 9, - "line": 1, + "operator": "=", + "range": Array [ + 0, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "array", + "range": Array [ + 9, + 14, + ], + "type": "Identifier", }, + "type": "AssignmentExpression", }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "a", - }, - Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 0, "line": 1, }, }, "range": Array [ - 10, - 11, + 0, + 15, ], - "type": "Punctuator", - "value": "(", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 15, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 1, "line": 1, }, "start": Object { - "column": 11, + "column": 0, "line": 1, }, }, "range": Array [ - 11, - 12, + 0, + 1, ], "type": "Punctuator", "value": "[", @@ -51544,53 +59759,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 2, "line": 1, }, "start": Object { - "column": 12, + "column": 1, "line": 1, }, }, "range": Array [ - 12, - 13, + 1, + 2, ], "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": ",", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 3, "line": 1, }, "start": Object { - "column": 15, + "column": 2, "line": 1, }, }, "range": Array [ - 15, - 16, + 2, + 3, ], "type": "Punctuator", "value": ",", @@ -51598,35 +59795,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, + "column": 4, "line": 1, }, "start": Object { - "column": 18, + "column": 3, "line": 1, }, }, "range": Array [ - 18, - 19, + 3, + 4, ], "type": "Punctuator", "value": ",", @@ -51634,53 +59813,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 5, "line": 1, }, "start": Object { - "column": 20, + "column": 4, "line": 1, }, }, "range": Array [ - 20, - 21, + 4, + 5, ], "type": "Identifier", - "value": "z", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "]", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 6, "line": 1, }, "start": Object { - "column": 22, + "column": 5, "line": 1, }, }, "range": Array [ - 22, - 23, + 5, + 6, ], "type": "Punctuator", "value": "]", @@ -51688,71 +59849,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, + "column": 8, "line": 1, }, "start": Object { - "column": 25, + "column": 7, "line": 1, }, }, "range": Array [ - 25, - 26, + 7, + 8, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 14, "line": 1, }, "start": Object { - "column": 26, + "column": 9, "line": 1, }, }, "range": Array [ - 26, - 27, + 9, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "array", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 15, "line": 1, }, "start": Object { - "column": 27, + "column": 14, "line": 1, }, }, "range": Array [ - 27, - 28, + 14, + 15, ], "type": "Punctuator", "value": ";", @@ -51762,279 +59905,108 @@ Object { } `; -exports[`javascript fixtures/destructuring/params-nested-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, - "range": Array [ - 33, - 35, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { "column": 10, "line": 1, }, "start": Object { - "column": 9, + "column": 0, "line": 1, }, }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 12, - 16, - ], - "shorthand": false, - "type": "Property", - "value": Object { + "params": Array [ + Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 16, + "column": 3, "line": 1, }, "start": Object { - "column": 15, + "column": 2, "line": 1, }, }, "name": "y", "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 18, - 19, + 2, + 3, ], "type": "Identifier", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 4, + "line": 1, }, - "method": false, - "range": Array [ - 18, - 29, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 23, - 27, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 21, - 29, - ], - "type": "ObjectPattern", + "start": Object { + "column": 1, + "line": 1, }, }, - ], - "range": Array [ - 11, - 31, - ], - "type": "ObjectPattern", - }, - ], - "range": Array [ - 0, - 35, - ], - "type": "FunctionDeclaration", - }, - Object { + "range": Array [ + 1, + 4, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 10, + ], + "type": "ArrowFunctionExpression", + }, "loc": Object { "end": Object { - "column": 36, + "column": 11, "line": 1, }, "start": Object { - "column": 35, + "column": 0, "line": 1, }, }, "range": Array [ - 35, - 36, + 0, + 11, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 36, + "column": 11, "line": 1, }, "start": Object { @@ -52044,14 +60016,14 @@ Object { }, "range": Array [ 0, - 36, + 11, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -52061,295 +60033,452 @@ Object { }, "range": Array [ 0, - 8, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 3, "line": 1, }, "start": Object { - "column": 9, + "column": 2, "line": 1, }, }, "range": Array [ - 9, - 10, + 2, + 3, ], "type": "Identifier", - "value": "a", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 4, "line": 1, }, "start": Object { - "column": 10, + "column": 3, "line": 1, }, }, "range": Array [ - 10, - 11, + 3, + 4, ], "type": "Punctuator", - "value": "(", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 5, "line": 1, }, "start": Object { - "column": 11, + "column": 4, "line": 1, }, }, "range": Array [ - 11, - 12, + 4, + 5, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 8, "line": 1, }, "start": Object { - "column": 12, + "column": 6, "line": 1, }, }, "range": Array [ - 12, - 13, + 6, + 8, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { - "column": 13, + "column": 9, "line": 1, }, }, "range": Array [ - 13, - 14, + 9, + 10, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 10, "line": 1, }, }, "range": Array [ - 15, - 16, + 10, + 11, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "expression": true, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "ArrayPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 9, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 15, + ], + "type": "ArrowFunctionExpression", + }, "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ + 0, 16, - 17, ], - "type": "Punctuator", - "value": ",", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, + "column": 1, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 19, + 0, + 1, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 2, "line": 1, }, "start": Object { - "column": 19, + "column": 1, "line": 1, }, }, "range": Array [ - 19, - 20, + 1, + 2, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 3, "line": 1, }, "start": Object { - "column": 21, + "column": 2, "line": 1, }, }, "range": Array [ - 21, - 22, + 2, + 3, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 4, "line": 1, }, "start": Object { - "column": 23, + "column": 3, "line": 1, }, }, "range": Array [ - 23, - 24, + 3, + 4, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 6, "line": 1, }, "start": Object { - "column": 24, + "column": 5, "line": 1, }, }, "range": Array [ - 24, - 25, + 5, + 6, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 7, "line": 1, }, "start": Object { - "column": 26, + "column": 6, "line": 1, }, }, "range": Array [ - 26, - 27, + 6, + 7, ], "type": "Identifier", - "value": "b", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 8, "line": 1, }, "start": Object { - "column": 28, + "column": 7, "line": 1, }, }, "range": Array [ - 28, - 29, + 7, + 8, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 9, "line": 1, }, "start": Object { - "column": 30, + "column": 8, "line": 1, }, }, "range": Array [ - 30, - 31, + 8, + 9, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 10, "line": 1, }, "start": Object { - "column": 31, + "column": 9, "line": 1, }, }, "range": Array [ - 31, - 32, + 9, + 10, ], "type": "Punctuator", "value": ")", @@ -52357,53 +60486,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 13, "line": 1, }, "start": Object { - "column": 33, + "column": 11, "line": 1, }, }, "range": Array [ - 33, - 34, + 11, + 13, ], "type": "Punctuator", - "value": "{", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 15, "line": 1, }, "start": Object { - "column": 34, + "column": 14, "line": 1, }, }, "range": Array [ - 34, - 35, + 14, + 15, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 16, "line": 1, }, "start": Object { - "column": 35, + "column": 15, "line": 1, }, }, "range": Array [ - 35, - 36, + 15, + 16, ], "type": "Punctuator", "value": ";", @@ -52413,221 +60542,262 @@ Object { } `; -exports[`javascript fixtures/destructuring/params-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", }, - "range": Array [ - 20, - 22, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 10, + "column": 17, "line": 1, }, "start": Object { - "column": 9, + "column": 0, "line": 1, }, }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "start": Object { + "column": 1, + "line": 1, }, - "method": false, - "range": Array [ - 13, - 14, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", }, - "name": "a", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 3, "line": 1, }, "start": Object { - "column": 16, + "column": 2, "line": 1, }, }, - "name": "b", + "method": false, "range": Array [ - 16, - 17, + 2, + 3, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", }, }, - "method": false, - "range": Array [ - 16, - 17, - ], - "shorthand": true, - "type": "Property", - "value": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 10, "line": 1, }, "start": Object { - "column": 16, + "column": 5, "line": 1, }, }, - "name": "b", + "method": false, "range": Array [ - 16, - 17, + 5, + 10, ], - "type": "Identifier", + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 8, + 9, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 7, + 10, + ], + "type": "ObjectPattern", + }, }, - }, - ], - "range": Array [ - 11, - 19, - ], - "type": "ObjectPattern", - }, - ], - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - Object { + ], + "range": Array [ + 1, + 11, + ], + "type": "ObjectPattern", + }, + ], + "range": Array [ + 0, + 17, + ], + "type": "ArrowFunctionExpression", + }, "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 22, + "column": 0, "line": 1, }, }, "range": Array [ - 22, - 23, + 0, + 18, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { @@ -52637,14 +60807,14 @@ Object { }, "range": Array [ 0, - 23, + 18, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -52654,79 +60824,79 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 2, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, "range": Array [ - 9, - 10, + 1, + 2, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 3, "line": 1, }, "start": Object { - "column": 10, + "column": 2, "line": 1, }, }, "range": Array [ - 10, - 11, + 2, + 3, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 4, "line": 1, }, "start": Object { - "column": 11, + "column": 3, "line": 1, }, }, "range": Array [ - 11, - 12, + 3, + 4, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 6, "line": 1, }, "start": Object { - "column": 13, + "column": 5, "line": 1, }, }, "range": Array [ - 13, - 14, + 5, + 6, ], "type": "Identifier", "value": "a", @@ -52734,53 +60904,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 7, "line": 1, }, "start": Object { - "column": 14, + "column": 6, "line": 1, }, }, "range": Array [ - 14, - 15, + 6, + 7, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 8, "line": 1, }, "start": Object { - "column": 16, + "column": 7, "line": 1, }, }, "range": Array [ - 16, - 17, + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, ], "type": "Identifier", - "value": "b", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 10, "line": 1, }, "start": Object { - "column": 18, + "column": 9, "line": 1, }, }, "range": Array [ - 18, - 19, + 9, + 10, ], "type": "Punctuator", "value": "}", @@ -52788,71 +60976,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 19, + "column": 10, "line": 1, }, }, "range": Array [ - 19, - 20, + 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 12, "line": 1, }, "start": Object { - "column": 20, + "column": 11, "line": 1, }, }, "range": Array [ - 20, - 21, + 11, + 12, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 15, "line": 1, }, "start": Object { - "column": 21, + "column": 13, "line": 1, }, }, "range": Array [ - 21, - 22, + 13, + 15, ], "type": "Punctuator", - "value": "}", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -52862,57 +61068,40 @@ Object { } `; -exports[`javascript fixtures/destructuring/params-object-wrapped.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 23, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 11, + "column": 27, "line": 1, }, "start": Object { - "column": 10, + "column": 26, "line": 1, }, }, "name": "x", "range": Array [ - 10, - 11, + 26, + 27, ], "type": "Identifier", }, + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 23, + "column": 27, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, @@ -52920,11 +61109,11 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { - "column": 12, + "column": 1, "line": 1, }, }, @@ -52934,54 +61123,54 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 5, "line": 1, }, "start": Object { - "column": 14, + "column": 2, "line": 1, }, }, - "name": "a", + "name": "foo", "range": Array [ - 14, - 15, + 2, + 5, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 15, + "column": 8, "line": 1, }, "start": Object { - "column": 14, + "column": 2, "line": 1, }, }, "method": false, "range": Array [ - 14, - 15, + 2, + 8, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 15, + "column": 8, "line": 1, }, "start": Object { - "column": 14, + "column": 7, "line": 1, }, }, - "name": "a", + "name": "y", "range": Array [ - 14, - 15, + 7, + 8, ], "type": "Identifier", }, @@ -52991,75 +61180,133 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 17, + "column": 10, "line": 1, }, }, - "name": "b", + "name": "a", "range": Array [ - 17, - 18, + 10, + 11, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 17, + "column": 10, "line": 1, }, }, "method": false, "range": Array [ - 17, - 18, + 10, + 20, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 17, + "column": 12, "line": 1, }, }, - "name": "b", + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 13, + 19, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + }, + ], "range": Array [ - 17, - 18, + 12, + 20, ], - "type": "Identifier", + "type": "ObjectPattern", }, }, ], - "range": Array [ - 12, - 20, + "range": Array [ + 1, + 21, ], "type": "ObjectPattern", }, ], "range": Array [ - 1, - 23, + 0, + 27, ], - "type": "FunctionExpression", + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 25, + "column": 28, "line": 1, }, "start": Object { @@ -53069,14 +61316,14 @@ Object { }, "range": Array [ 0, - 25, + 28, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 25, + "column": 28, "line": 1, }, "start": Object { @@ -53086,7 +61333,7 @@ Object { }, "range": Array [ 0, - 25, + 28, ], "sourceType": "script", "tokens": Array [ @@ -53111,7 +61358,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 2, "line": 1, }, "start": Object { @@ -53121,10 +61368,82 @@ Object { }, "range": Array [ 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 5, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "y", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, 9, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -53142,7 +61461,7 @@ Object { 11, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { @@ -53160,7 +61479,7 @@ Object { 12, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { @@ -53183,56 +61502,56 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ - 14, - 15, + 13, + 16, ], "type": "Identifier", - "value": "a", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 17, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Identifier", - "value": "b", + "value": "x", }, Object { "loc": Object { @@ -53268,7 +61587,7 @@ Object { 21, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { @@ -53286,58 +61605,58 @@ Object { 22, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 25, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, "range": Array [ - 22, 23, + 25, ], "type": "Punctuator", - "value": "}", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 27, "line": 1, }, "start": Object { - "column": 23, + "column": 26, "line": 1, }, }, "range": Array [ - 23, - 24, + 26, + 27, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 28, "line": 1, }, "start": Object { - "column": 24, + "column": 27, "line": 1, }, }, "range": Array [ - 24, - 25, + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -53347,70 +61666,36 @@ Object { } `; -exports[`javascript fixtures/destructuring/sparse-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - null, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - ], + "async": false, + "body": Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 0, + "column": 9, "line": 1, }, }, + "name": "x", "range": Array [ - 0, - 6, + 9, + 10, ], - "type": "ArrayPattern", + "type": "Identifier", }, + "expression": true, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { @@ -53418,34 +61703,93 @@ Object { "line": 1, }, }, - "operator": "=", + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 3, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 1, + 4, + ], + "type": "ObjectPattern", + }, + ], "range": Array [ 0, - 14, + 10, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "array", - "range": Array [ - 9, - 14, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -53455,14 +61799,14 @@ Object { }, "range": Array [ 0, - 15, + 11, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -53472,7 +61816,7 @@ Object { }, "range": Array [ 0, - 15, + 11, ], "sourceType": "script", "tokens": Array [ @@ -53492,7 +61836,7 @@ Object { 1, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { @@ -53509,8 +61853,8 @@ Object { 1, 2, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -53527,8 +61871,8 @@ Object { 2, 3, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { @@ -53546,7 +61890,7 @@ Object { 4, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { @@ -53563,26 +61907,8 @@ Object { 4, 5, ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { @@ -53591,21 +61917,21 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ - 7, + 6, 8, ], "type": "Punctuator", - "value": "=", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { @@ -53615,25 +61941,25 @@ Object { }, "range": Array [ 9, - 14, + 10, ], "type": "Identifier", - "value": "array", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 14, + "column": 10, "line": 1, }, }, "range": Array [ - 14, - 15, + 10, + 11, ], "type": "Punctuator", "value": ";", @@ -53643,7 +61969,7 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` Object { "body": Array [ Object { @@ -53652,18 +61978,18 @@ Object { "body": Object { "loc": Object { "end": Object { - "column": 10, + "column": 15, "line": 1, }, "start": Object { - "column": 9, + "column": 14, "line": 1, }, }, "name": "x", "range": Array [ - 9, - 10, + 14, + 15, ], "type": "Identifier", }, @@ -53672,7 +61998,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 10, + "column": 15, "line": 1, }, "start": Object { @@ -53684,9 +62010,27 @@ Object { Object { "elements": Array [ Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -53694,17 +62038,35 @@ Object { "line": 1, }, }, - "name": "y", "range": Array [ 2, - 3, + 8, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", }, ], "loc": Object { "end": Object { - "column": 4, + "column": 9, "line": 1, }, "start": Object { @@ -53714,20 +62076,20 @@ Object { }, "range": Array [ 1, - 4, + 9, ], "type": "ArrayPattern", }, ], "range": Array [ 0, - 10, + 15, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -53737,14 +62099,14 @@ Object { }, "range": Array [ 0, - 11, + 15, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -53754,7 +62116,7 @@ Object { }, "range": Array [ 0, - 11, + 15, ], "sourceType": "script", "tokens": Array [ @@ -53810,61 +62172,61 @@ Object { 3, ], "type": "Identifier", - "value": "y", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { - "column": 3, + "column": 4, "line": 1, }, }, "range": Array [ - 3, 4, + 5, ], "type": "Punctuator", - "value": "]", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 8, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "range": Array [ - 6, 8, + 9, ], "type": "Punctuator", - "value": "=>", + "value": "]", }, Object { "loc": Object { @@ -53881,33 +62243,51 @@ Object { 9, 10, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, "range": Array [ - 10, 11, + 13, ], "type": "Punctuator", - "value": ";", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "x", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` Object { "body": Array [ Object { @@ -53946,11 +62326,41 @@ Object { }, "params": Array [ Object { - "elements": Array [ + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -53958,66 +62368,74 @@ Object { "line": 1, }, }, - "name": "y", + "method": false, "range": Array [ 2, - 3, + 8, ], - "type": "Identifier", - }, - Object { - "elements": Array [ - Object { + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { - "column": 6, + "column": 2, "line": 1, }, }, "name": "x", "range": Array [ - 6, - 7, + 2, + 3, ], "type": "Identifier", }, - ], - "loc": Object { - "end": Object { - "column": 8, - "line": 1, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, }, - "start": Object { - "column": 5, - "line": 1, + "range": Array [ + 2, + 8, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "raw": "10", + "type": "Literal", + "value": 10, }, + "type": "AssignmentPattern", }, - "range": Array [ - 5, - 8, - ], - "type": "ArrayPattern", }, ], - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, "range": Array [ 1, 9, ], - "type": "ArrayPattern", + "type": "ObjectPattern", }, ], "range": Array [ @@ -54028,7 +62446,7 @@ Object { }, "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { @@ -54038,14 +62456,14 @@ Object { }, "range": Array [ 0, - 16, + 15, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { @@ -54055,7 +62473,7 @@ Object { }, "range": Array [ 0, - 16, + 15, ], "sourceType": "script", "tokens": Array [ @@ -54093,7 +62511,7 @@ Object { 2, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { @@ -54111,48 +62529,30 @@ Object { 3, ], "type": "Identifier", - "value": "y", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { - "column": 3, + "column": 4, "line": 1, }, }, "range": Array [ - 3, 4, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ 5, - 6, ], "type": "Punctuator", - "value": "[", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { @@ -54162,28 +62562,10 @@ Object { }, "range": Array [ 6, - 7, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, 8, ], - "type": "Punctuator", - "value": "]", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { @@ -54201,7 +62583,7 @@ Object { 9, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { @@ -54257,59 +62639,78 @@ Object { "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ";", - }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "async": false, "body": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + ], "loc": Object { "end": Object { - "column": 17, + "column": 35, "line": 1, }, "start": Object { - "column": 16, + "column": 29, "line": 1, }, }, - "name": "x", "range": Array [ - 16, - 17, + 29, + 35, ], - "type": "Identifier", + "type": "ArrayExpression", }, "expression": true, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 17, + "column": 35, "line": 1, }, "start": Object { @@ -54321,7 +62722,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 24, "line": 1, }, "start": Object { @@ -54343,7 +62744,7 @@ Object { "line": 1, }, }, - "name": "y", + "name": "x", "range": Array [ 2, 3, @@ -54353,7 +62754,7 @@ Object { "kind": "init", "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -54364,14 +62765,32 @@ Object { "method": false, "range": Array [ 2, - 3, + 8, ], "shorthand": true, "type": "Property", "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -54379,12 +62798,30 @@ Object { "line": 1, }, }, - "name": "y", "range": Array [ 2, - 3, + 8, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", }, }, Object { @@ -54392,47 +62829,47 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 6, + "column": 11, "line": 1, }, "start": Object { - "column": 5, + "column": 10, "line": 1, }, }, - "name": "a", + "name": "y", "range": Array [ - 5, - 6, + 10, + 11, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 10, + "column": 23, "line": 1, }, "start": Object { - "column": 5, + "column": 10, "line": 1, }, }, "method": false, "range": Array [ - 5, 10, + 23, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 10, + "column": 23, "line": 1, }, "start": Object { - "column": 7, + "column": 13, "line": 1, }, }, @@ -54442,62 +62879,98 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, - "name": "x", + "name": "z", "range": Array [ - 8, - 9, + 15, + 16, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 9, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, "method": false, "range": Array [ - 8, - 9, + 15, + 21, ], "shorthand": true, "type": "Property", "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 9, + "column": 21, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, - "name": "x", "range": Array [ - 8, - 9, + 15, + 21, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "AssignmentPattern", }, }, ], "range": Array [ - 7, - 10, + 13, + 23, ], "type": "ObjectPattern", }, @@ -54505,82 +62978,208 @@ Object { ], "range": Array [ 1, - 11, + 24, ], "type": "ObjectPattern", }, ], "range": Array [ 0, - 17, + 35, ], "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 18, + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 8, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, "range": Array [ - 0, - 18, + 8, + 9, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 18, - "line": 1, + "type": "Punctuator", + "value": ",", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "y", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 12, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 1, + 11, + 12, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 14, "line": 1, }, "start": Object { - "column": 1, + "column": 13, "line": 1, }, }, "range": Array [ - 1, - 2, + 13, + 14, ], "type": "Punctuator", "value": "{", @@ -54588,463 +63187,306 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 16, "line": 1, }, "start": Object { - "column": 2, + "column": 15, "line": 1, }, }, "range": Array [ - 2, - 3, + 15, + 16, ], "type": "Identifier", - "value": "y", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 18, "line": 1, }, "start": Object { - "column": 3, + "column": 17, "line": 1, }, }, "range": Array [ - 3, - 4, + 17, + 18, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 21, "line": 1, }, "start": Object { - "column": 5, + "column": 19, "line": 1, }, }, "range": Array [ - 5, - 6, + 19, + 21, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 23, "line": 1, }, "start": Object { - "column": 6, + "column": 22, "line": 1, }, }, "range": Array [ - 6, - 7, + 22, + 23, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 24, "line": 1, }, "start": Object { - "column": 7, + "column": 23, "line": 1, }, }, "range": Array [ - 7, - 8, + 23, + 24, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 25, "line": 1, }, "start": Object { - "column": 8, + "column": 24, "line": 1, }, }, "range": Array [ - 8, - 9, + 24, + 25, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 28, "line": 1, }, "start": Object { - "column": 9, + "column": 26, "line": 1, }, }, "range": Array [ - 9, - 10, + 26, + 28, ], "type": "Punctuator", - "value": "}", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 30, "line": 1, }, "start": Object { - "column": 10, + "column": 29, "line": 1, }, }, "range": Array [ - 10, - 11, + 29, + 30, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 31, "line": 1, }, "start": Object { - "column": 11, + "column": 30, "line": 1, }, }, "range": Array [ - 11, - 12, + 30, + 31, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 32, "line": 1, }, "start": Object { - "column": 13, + "column": 31, "line": 1, }, }, "range": Array [ - 13, - 15, + 31, + 32, ], "type": "Punctuator", - "value": "=>", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 34, "line": 1, }, "start": Object { - "column": 16, + "column": 33, "line": 1, }, }, "range": Array [ - 16, - 17, + 33, + 34, ], "type": "Identifier", - "value": "x", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 35, "line": 1, }, "start": Object { - "column": 17, + "column": 34, "line": 1, }, }, "range": Array [ - 17, - 18, + 34, + 35, ], "type": "Punctuator", - "value": ";", + "value": "]", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 2, - 5, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { "column": 8, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, - "method": false, + "name": "a", "range": Array [ - 2, + 7, 8, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, + "type": "Identifier", }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 10, - 20, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 13, - 19, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 12, - 20, - ], - "type": "ObjectPattern", - }, + ], + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, }, + }, + "range": Array [ + 6, + 9, ], + "type": "ArrayPattern", + }, + "init": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, "range": Array [ - 1, - 21, + 12, + 14, ], - "type": "ObjectPattern", + "type": "ArrayExpression", }, - ], - "range": Array [ - 0, - 27, - ], - "type": "ArrowFunctionExpression", - }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 28, + "column": 15, "line": 1, }, "start": Object { @@ -55054,14 +63496,14 @@ Object { }, "range": Array [ 0, - 28, + 15, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 28, + "column": 15, "line": 1, }, "start": Object { @@ -55071,14 +63513,14 @@ Object { }, "range": Array [ 0, - 28, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -55088,64 +63530,28 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, 5, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "range": Array [ - 5, 6, + 7, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { @@ -55163,7 +63569,7 @@ Object { 8, ], "type": "Identifier", - "value": "y", + "value": "a", }, Object { "loc": Object { @@ -55181,7 +63587,7 @@ Object { 9, ], "type": "Punctuator", - "value": ",", + "value": "]", }, Object { "loc": Object { @@ -55198,203 +63604,320 @@ Object { 10, 11, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 13, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "ArrayPattern", + }, + "init": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "ArrayExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { "column": 13, "line": 1, }, + "start": Object { + "column": 0, + "line": 1, + }, }, "range": Array [ + 0, 13, - 16, ], - "type": "Identifier", - "value": "bar", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, + "column": 3, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, - 17, + 0, + 3, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 5, "line": 1, }, "start": Object { - "column": 18, + "column": 4, "line": 1, }, }, "range": Array [ - 18, - 19, + 4, + 5, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 6, "line": 1, }, "start": Object { - "column": 19, + "column": 5, "line": 1, }, }, "range": Array [ - 19, - 20, + 5, + 6, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 7, "line": 1, }, "start": Object { - "column": 20, + "column": 6, "line": 1, }, }, "range": Array [ - 20, - 21, + 6, + 7, ], "type": "Punctuator", - "value": "}", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 9, "line": 1, }, "start": Object { - "column": 21, + "column": 8, "line": 1, }, }, "range": Array [ - 21, - 22, + 8, + 9, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 11, "line": 1, }, "start": Object { - "column": 23, + "column": 10, "line": 1, }, }, "range": Array [ - 23, - 25, + 10, + 11, ], "type": "Punctuator", - "value": "=>", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 12, "line": 1, }, "start": Object { - "column": 26, + "column": 11, "line": 1, }, }, "range": Array [ - 26, - 27, + 11, + 12, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 13, "line": 1, }, "start": Object { - "column": 27, + "column": 12, "line": 1, }, }, "range": Array [ - 27, - 28, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -55404,52 +63927,20 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 4, + "column": 11, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, @@ -55459,75 +63950,104 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, - "name": "y", + "name": "a", "range": Array [ - 2, - 3, + 7, + 8, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 3, + "column": 10, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, "method": false, "range": Array [ - 2, - 3, + 7, + 10, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 3, + "column": 10, "line": 1, }, "start": Object { - "column": 2, + "column": 9, "line": 1, }, }, - "name": "y", + "name": "b", "range": Array [ - 2, - 3, + 9, + 10, ], "type": "Identifier", }, }, ], "range": Array [ - 1, - 4, + 6, + 11, ], "type": "ObjectPattern", }, - ], - "range": Array [ - 0, - 10, - ], - "type": "ArrowFunctionExpression", - }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 14, + 16, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { @@ -55537,14 +64057,14 @@ Object { }, "range": Array [ 0, - 11, + 17, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 11, + "column": 17, "line": 1, }, "start": Object { @@ -55554,14 +64074,14 @@ Object { }, "range": Array [ 0, - 11, + 17, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -55571,25 +64091,25 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 2, + 6, + 7, ], "type": "Punctuator", "value": "{", @@ -55597,234 +64117,270 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, "range": Array [ - 2, - 3, + 7, + 8, ], "type": "Identifier", - "value": "y", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 9, "line": 1, }, "start": Object { - "column": 3, + "column": 8, "line": 1, }, }, "range": Array [ - 3, - 4, + 8, + 9, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 10, "line": 1, }, "start": Object { - "column": 4, + "column": 9, "line": 1, }, }, "range": Array [ - 4, - 5, + 9, + 10, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 6, + "column": 10, "line": 1, }, }, "range": Array [ - 6, - 8, + 10, + 11, ], "type": "Punctuator", - "value": "=>", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 13, "line": 1, }, "start": Object { - "column": 9, + "column": 12, "line": 1, }, }, "range": Array [ - 9, - 10, + 12, + 13, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - "params": Array [ - Object { - "elements": Array [ + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "properties": Array [ Object { - "left": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 2, - 3, + 7, + 8, ], "type": "Identifier", }, + "kind": "init", "loc": Object { "end": Object { "column": 8, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, + "method": false, "range": Array [ - 2, + 7, 8, ], - "right": Object { + "shorthand": true, + "type": "Property", + "value": Object { "loc": Object { "end": Object { "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, + "name": "a", "range": Array [ - 6, + 7, 8, ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "Identifier", }, - "type": "AssignmentPattern", }, ], + "range": Array [ + 6, + 9, + ], + "type": "ObjectPattern", + }, + "init": Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 1, }, "start": Object { - "column": 1, + "column": 12, "line": 1, }, }, + "properties": Array [], "range": Array [ - 1, - 9, + 12, + 14, ], - "type": "ArrayPattern", + "type": "ObjectExpression", }, - ], - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { "column": 15, @@ -55839,7 +64395,7 @@ Object { 0, 15, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { @@ -55861,7 +64417,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -55871,136 +64427,118 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 2, + 6, + 7, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, "range": Array [ - 2, - 3, + 7, + 8, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { "column": 8, "line": 1, }, - "start": Object { - "column": 6, - "line": 1, - }, }, "range": Array [ - 6, 8, + 9, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", - "value": "]", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 13, "line": 1, }, "start": Object { - "column": 9, + "column": 12, "line": 1, }, }, "range": Array [ - 9, - 10, + 12, + 13, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "range": Array [ - 11, 13, + 14, ], "type": "Punctuator", - "value": "=>", + "value": "}", }, Object { "loc": Object { @@ -56017,60 +64555,28 @@ Object { 14, 15, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { "column": 9, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, @@ -56080,18 +64586,18 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { - "column": 2, + "column": 5, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 2, - 3, + 5, + 6, ], "type": "Identifier", }, @@ -56102,86 +64608,79 @@ Object { "line": 1, }, "start": Object { - "column": 2, + "column": 5, "line": 1, }, }, "method": false, "range": Array [ - 2, + 5, 8, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { "column": 8, "line": 1, }, "start": Object { - "column": 2, + "column": 7, "line": 1, }, }, + "name": "b", "range": Array [ - 2, + 7, 8, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 8, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", + "type": "Identifier", }, }, ], "range": Array [ - 1, + 4, 9, ], "type": "ObjectPattern", }, - ], - "range": Array [ - 0, - 15, - ], - "type": "ArrowFunctionExpression", - }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 12, + 14, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { "column": 15, @@ -56196,7 +64695,7 @@ Object { 0, 15, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { @@ -56218,7 +64717,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -56228,25 +64727,25 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 5, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, - 2, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -56254,38 +64753,38 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { - "column": 2, + "column": 5, "line": 1, }, }, "range": Array [ - 2, - 3, + 5, + 6, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { @@ -56294,16 +64793,16 @@ Object { "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, + 7, 8, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -56326,20 +64825,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { @@ -56348,16 +64847,34 @@ Object { "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, + 12, 13, ], "type": "Punctuator", - "value": "=>", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -56374,97 +64891,28 @@ Object { 14, 15, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ";", }, ], "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "async": false, - "body": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 35, - ], - "type": "ArrayExpression", - }, - "expression": true, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { +} +`; + +exports[`javascript fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 24, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, @@ -56474,262 +64922,104 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { - "column": 2, + "column": 5, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 2, - 3, + 5, + 6, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { - "column": 2, + "column": 5, "line": 1, }, }, "method": false, "range": Array [ - 2, - 8, + 5, + 6, ], "shorthand": true, "type": "Property", "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 8, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 8, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - Object { - "computed": false, - "key": Object { "loc": Object { "end": Object { - "column": 11, + "column": 6, "line": 1, }, "start": Object { - "column": 10, + "column": 5, "line": 1, }, }, - "name": "y", + "name": "a", "range": Array [ - 10, - 11, + 5, + 6, ], "type": "Identifier", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 10, - 23, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 15, - 21, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 21, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 21, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 13, - 23, - ], - "type": "ObjectPattern", - }, }, ], "range": Array [ - 1, - 24, + 4, + 7, ], "type": "ObjectPattern", }, - ], - "range": Array [ - 0, - 35, - ], - "type": "ArrowFunctionExpression", - }, + "init": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 10, + 12, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 12, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", "loc": Object { "end": Object { - "column": 35, + "column": 13, "line": 1, }, "start": Object { @@ -56739,14 +65029,14 @@ Object { }, "range": Array [ 0, - 35, + 13, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 35, + "column": 13, "line": 1, }, "start": Object { @@ -56756,14 +65046,14 @@ Object { }, "range": Array [ 0, - 35, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -56773,25 +65063,25 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 5, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, - 2, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -56799,43 +65089,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { "column": 5, "line": 1, }, - "start": Object { - "column": 4, - "line": 1, - }, }, "range": Array [ - 4, 5, + 6, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 1, }, "start": Object { @@ -56845,10 +65117,10 @@ Object { }, "range": Array [ 6, - 8, + 7, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -56866,7 +65138,7 @@ Object { 9, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { @@ -56883,8 +65155,8 @@ Object { 10, 11, ], - "type": "Identifier", - "value": "y", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -56902,115 +65174,183 @@ Object { 12, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 14, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, }, + "range": Array [ + 22, + 24, + ], + "type": "BlockStatement", }, - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - "value": "z", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": "=", - }, - Object { "loc": Object { "end": Object { - "column": 21, + "column": 24, "line": 1, }, "start": Object { - "column": 19, + "column": 0, "line": 1, }, }, - "range": Array [ - 19, - 21, - ], - "type": "Numeric", - "value": "10", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, + "params": Array [ + Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 20, + ], + "right": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", }, - }, - "range": Array [ - 22, - 23, ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, "range": Array [ - 23, + 0, 24, ], - "type": "Punctuator", - "value": "}", + "type": "FunctionDeclaration", }, Object { "loc": Object { @@ -57027,266 +65367,165 @@ Object { 24, 25, ], - "type": "Punctuator", - "value": ")", + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 28, + "column": 8, "line": 1, }, "start": Object { - "column": 26, + "column": 0, "line": 1, }, }, "range": Array [ - 26, - 28, + 0, + 8, ], - "type": "Punctuator", - "value": "=>", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 10, "line": 1, }, "start": Object { - "column": 29, + "column": 9, "line": 1, }, }, "range": Array [ - 29, - 30, + 9, + 10, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 11, "line": 1, }, "start": Object { - "column": 30, + "column": 10, "line": 1, }, }, "range": Array [ - 30, - 31, + 10, + 11, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 12, "line": 1, }, "start": Object { - "column": 31, + "column": 11, "line": 1, }, }, "range": Array [ - 31, - 32, + 11, + 12, ], "type": "Punctuator", - "value": ",", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 13, "line": 1, }, "start": Object { - "column": 33, + "column": 12, "line": 1, }, }, "range": Array [ - 33, - 34, + 12, + 13, ], "type": "Identifier", - "value": "z", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 14, "line": 1, }, "start": Object { - "column": 34, + "column": 13, "line": 1, }, }, "range": Array [ - 34, - 35, + 13, + 14, ], "type": "Punctuator", "value": "]", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-blockBindings/array-const-undefined.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 9, - ], - "type": "ArrayPattern", - }, - "init": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 14, - ], - "type": "ArrayExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, "range": Array [ - 0, 15, + 16, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 18, "line": 1, }, "start": Object { - "column": 6, + "column": 17, "line": 1, }, }, "range": Array [ - 6, - 7, + 17, + 18, ], "type": "Punctuator", "value": "[", @@ -57294,35 +65533,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 19, "line": 1, }, "start": Object { - "column": 7, + "column": 18, "line": 1, }, }, "range": Array [ - 7, - 8, + 18, + 19, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 19, "line": 1, }, }, "range": Array [ - 8, - 9, + 19, + 20, ], "type": "Punctuator", "value": "]", @@ -57330,71 +65569,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 20, "line": 1, }, }, "range": Array [ - 10, - 11, + 20, + 21, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 22, "line": 1, }, }, "range": Array [ - 12, - 13, + 22, + 23, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 24, "line": 1, }, "start": Object { - "column": 13, + "column": 23, "line": 1, }, }, "range": Array [ - 13, - 14, + 23, + 24, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 25, "line": 1, }, "start": Object { - "column": 14, + "column": 24, "line": 1, }, }, "range": Array [ - 14, - 15, + 24, + 25, ], "type": "Punctuator", "value": ";", @@ -57404,88 +65643,260 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-blockBindings/array-let-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 30, + ], + "right": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { "loc": Object { "end": Object { - "column": 6, + "column": 16, "line": 1, }, "start": Object { - "column": 5, + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 14, + 15, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 26, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 19, "line": 1, }, - }, - "name": "a", + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 20, + 25, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], "range": Array [ - 5, - 6, + 19, + 26, ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "ArrayPattern", - }, - "init": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, + "type": "ObjectExpression", }, + "type": "AssignmentPattern", }, - "range": Array [ - 10, - 12, - ], - "type": "ArrayExpression", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, + ], "range": Array [ 4, - 12, + 30, ], - "type": "VariableDeclarator", + "type": "FunctionExpression", }, - ], - "kind": "let", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { - "column": 13, + "column": 31, "line": 1, }, "start": Object { @@ -57495,14 +65906,14 @@ Object { }, "range": Array [ 0, - 13, + 31, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 13, + "column": 31, "line": 1, }, "start": Object { @@ -57512,14 +65923,14 @@ Object { }, "range": Array [ 0, - 13, + 31, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -57529,325 +65940,151 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "let", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { - "column": 4, + "column": 2, "line": 1, }, }, "range": Array [ - 4, - 5, + 2, + 3, ], "type": "Punctuator", - "value": "[", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 12, "line": 1, }, "start": Object { - "column": 5, + "column": 4, "line": 1, }, }, "range": Array [ - 5, - 6, + 4, + 12, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 12, "line": 1, }, }, "range": Array [ - 6, - 7, + 12, + 13, ], "type": "Punctuator", - "value": "]", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, "range": Array [ - 8, - 9, + 13, + 14, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, - 12, + 15, + 16, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 18, "line": 1, }, "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-blockBindings/object-const-named.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 7, - 10, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 6, - 11, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 14, - 16, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { "column": 17, "line": 1, }, - "start": Object { - "column": 0, - "line": 1, - }, }, "range": Array [ - 0, 17, + 18, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 20, "line": 1, }, "start": Object { - "column": 6, + "column": 19, "line": 1, }, }, "range": Array [ - 6, - 7, + 19, + 20, ], "type": "Punctuator", "value": "{", @@ -57855,35 +66092,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 21, "line": 1, }, "start": Object { - "column": 7, + "column": 20, "line": 1, }, }, "range": Array [ - 7, - 8, + 20, + 21, ], "type": "Identifier", - "value": "a", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 22, "line": 1, }, "start": Object { - "column": 8, + "column": 21, "line": 1, }, }, "range": Array [ - 8, - 9, + 21, + 22, ], "type": "Punctuator", "value": ":", @@ -57891,35 +66128,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 25, "line": 1, }, "start": Object { - "column": 9, + "column": 23, "line": 1, }, }, "range": Array [ - 9, - 10, + 23, + 25, ], - "type": "Identifier", - "value": "b", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 26, "line": 1, }, "start": Object { - "column": 10, + "column": 25, "line": 1, }, }, "range": Array [ - 10, - 11, + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -57927,35 +66164,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 27, "line": 1, }, "start": Object { - "column": 12, + "column": 26, "line": 1, }, }, "range": Array [ - 12, - 13, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 29, "line": 1, }, "start": Object { - "column": 14, + "column": 28, "line": 1, }, }, "range": Array [ - 14, - 15, + 28, + 29, ], "type": "Punctuator", "value": "{", @@ -57963,17 +66200,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 30, "line": 1, }, "start": Object { - "column": 15, + "column": 29, "line": 1, }, }, "range": Array [ - 15, - 16, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -57981,17 +66218,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 31, "line": 1, }, "start": Object { - "column": 16, + "column": 30, "line": 1, }, }, "range": Array [ - 16, - 17, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -58001,127 +66238,282 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-blockBindings/object-const-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", + "expression": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, }, - "kind": "init", + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": true, + "range": Array [ + 2, + 21, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 8, + "column": 21, "line": 1, }, "start": Object { - "column": 7, + "column": 19, "line": 1, }, }, - "method": false, "range": Array [ - 7, - 8, + 19, + 21, ], - "shorthand": true, - "type": "Property", - "value": Object { + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 5, + 6, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 4, + 7, + ], + "type": "ObjectPattern", + }, "loc": Object { "end": Object { - "column": 8, + "column": 17, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, - "name": "a", "range": Array [ - 7, - 8, + 4, + 17, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 11, + 16, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], + "range": Array [ + 10, + 17, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", }, - }, - ], - "range": Array [ - 6, - 9, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 12, - 14, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, + ], + "range": Array [ + 3, + 21, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", + ], + "range": Array [ + 1, + 22, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 15, + "column": 24, "line": 1, }, "start": Object { @@ -58131,14 +66523,14 @@ Object { }, "range": Array [ 0, - 15, + 24, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 15, + "column": 24, "line": 1, }, "start": Object { @@ -58148,14 +66540,14 @@ Object { }, "range": Array [ 0, - 15, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -58165,25 +66557,25 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 2, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, "range": Array [ - 6, - 7, + 1, + 2, ], "type": "Punctuator", "value": "{", @@ -58191,89 +66583,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 3, "line": 1, }, "start": Object { - "column": 7, + "column": 2, "line": 1, }, }, "range": Array [ - 7, - 8, + 2, + 3, ], "type": "Identifier", - "value": "a", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 4, "line": 1, }, "start": Object { - "column": 8, + "column": 3, "line": 1, }, }, "range": Array [ - 8, - 9, + 3, + 4, ], "type": "Punctuator", - "value": "}", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 5, "line": 1, }, "start": Object { - "column": 10, + "column": 4, "line": 1, }, }, "range": Array [ - 10, - 11, + 4, + 5, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 6, "line": 1, }, "start": Object { - "column": 12, + "column": 5, "line": 1, }, }, "range": Array [ - 12, - 13, + 5, + 6, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 7, "line": 1, }, "start": Object { - "column": 13, + "column": 6, "line": 1, }, }, "range": Array [ - 13, - 14, + 6, + 7, ], "type": "Punctuator", "value": "}", @@ -58281,353 +66673,215 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 1, }, "start": Object { - "column": 14, + "column": 8, "line": 1, }, }, "range": Array [ - 14, - 15, + 8, + 9, ], "type": "Punctuator", - "value": ";", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-blockBindings/object-let-named.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 5, - 8, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 4, - 9, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 12, - 14, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 0, + "column": 10, "line": 1, }, }, "range": Array [ - 0, - 15, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 12, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 3, + 11, + 12, ], - "type": "Keyword", - "value": "let", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 4, + "column": 12, "line": 1, }, }, "range": Array [ - 4, - 5, + 12, + 13, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 16, "line": 1, }, "start": Object { - "column": 5, + "column": 14, "line": 1, }, }, "range": Array [ - 5, - 6, + 14, + 16, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 17, "line": 1, }, "start": Object { - "column": 6, + "column": 16, "line": 1, }, }, "range": Array [ - 6, - 7, + 16, + 17, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 17, "line": 1, }, }, "range": Array [ - 7, - 8, + 17, + 18, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 19, "line": 1, }, }, "range": Array [ - 8, - 9, + 19, + 20, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 20, "line": 1, }, }, "range": Array [ - 10, - 11, + 20, + 21, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 22, "line": 1, }, "start": Object { - "column": 12, + "column": 21, "line": 1, }, }, "range": Array [ - 12, - 13, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 22, "line": 1, }, }, "range": Array [ - 13, - 14, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 24, "line": 1, }, "start": Object { - "column": 14, + "column": 23, "line": 1, }, }, "range": Array [ - 14, - 15, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -58637,189 +66891,434 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-blockBindings/object-let-undefined.src 1`] = ` +exports[`javascript fixtures/destructuring-and-defaultParams/param-object-wrapped.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 7, + "column": 31, "line": 1, }, "start": Object { - "column": 4, + "column": 2, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", + "method": false, + "range": Array [ + 2, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 6, + "column": 31, "line": 1, }, "start": Object { - "column": 5, + "column": 29, "line": 1, }, }, - "method": false, "range": Array [ - 5, - 6, + 29, + 31, ], - "shorthand": true, - "type": "Property", - "value": Object { + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 15, + 16, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 14, + 17, + ], + "type": "ObjectPattern", + }, "loc": Object { "end": Object { - "column": 6, + "column": 27, "line": 1, }, "start": Object { - "column": 5, + "column": 14, "line": 1, }, }, - "name": "a", "range": Array [ - 5, - 6, + 14, + 27, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 21, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + }, + ], + "range": Array [ + 20, + 27, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", }, - }, - ], - "range": Array [ - 4, - 7, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 10, - 12, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + ], + "range": Array [ + 5, + 31, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 4, - 12, - ], - "type": "VariableDeclarator", + ], + "range": Array [ + 1, + 32, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, }, + }, + "range": Array [ + 3, + 4, ], - "kind": "let", + "type": "Punctuator", + "value": ":", + }, + Object { "loc": Object { "end": Object { "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 5, "line": 1, }, }, "range": Array [ - 0, + 5, 13, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "function", }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 14, "line": 1, }, "start": Object { - "column": 0, + "column": 13, "line": 1, }, }, "range": Array [ - 0, - 3, + 13, + 14, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 15, "line": 1, }, "start": Object { - "column": 4, + "column": 14, "line": 1, }, }, "range": Array [ - 4, - 5, + 14, + 15, ], "type": "Punctuator", "value": "{", @@ -58827,35 +67326,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 16, "line": 1, }, "start": Object { - "column": 5, + "column": 15, "line": 1, }, }, "range": Array [ - 5, - 6, + 15, + 16, ], "type": "Identifier", - "value": "a", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 17, "line": 1, }, "start": Object { - "column": 6, + "column": 16, "line": 1, }, }, "range": Array [ - 6, - 7, + 16, + 17, ], "type": "Punctuator", "value": "}", @@ -58863,17 +67362,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 19, "line": 1, }, "start": Object { - "column": 8, + "column": 18, "line": 1, }, }, "range": Array [ - 8, - 9, + 18, + 19, ], "type": "Punctuator", "value": "=", @@ -58881,17 +67380,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 20, "line": 1, }, }, "range": Array [ - 10, - 11, + 20, + 21, ], "type": "Punctuator", "value": "{", @@ -58899,371 +67398,348 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 21, "line": 1, }, }, "range": Array [ - 11, - 12, + 21, + 22, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { - "column": 12, + "column": 22, "line": 1, }, }, "range": Array [ - 12, - 13, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-defaultParams/param-array.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, }, - "range": Array [ - 22, - 24, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "start": Object { + "column": 24, + "line": 1, }, - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", }, + "range": Array [ + 24, + 26, + ], + "type": "Numeric", + "value": "10", + }, + Object { "loc": Object { "end": Object { - "column": 24, + "column": 27, "line": 1, }, "start": Object { - "column": 0, + "column": 26, "line": 1, }, }, - "params": Array [ - Object { - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 20, - ], - "right": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - ], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 20, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", - }, - ], "range": Array [ - 0, - 24, + 26, + 27, ], - "type": "FunctionDeclaration", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 28, "line": 1, }, "start": Object { - "column": 24, + "column": 27, "line": 1, }, }, "range": Array [ - 24, - 25, + 27, + 28, ], - "type": "EmptyStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, + "type": "Punctuator", + "value": ")", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", }, - }, - "range": Array [ - 0, - 25, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 31, "line": 1, }, "start": Object { - "column": 0, + "column": 30, "line": 1, }, }, "range": Array [ - 0, - 8, + 30, + 31, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 32, "line": 1, }, "start": Object { - "column": 9, + "column": 31, "line": 1, }, }, "range": Array [ - 9, - 10, + 31, + 32, ], - "type": "Identifier", - "value": "f", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 33, "line": 1, }, "start": Object { - "column": 10, + "column": 32, "line": 1, }, }, "range": Array [ - 10, - 11, + 32, + 33, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 34, "line": 1, }, "start": Object { - "column": 11, + "column": 33, "line": 1, }, }, "range": Array [ - 11, - 12, + 33, + 34, ], "type": "Punctuator", - "value": "[", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-forOf/loop.src 1`] = ` +Object { + "body": Array [ Object { + "await": false, + "body": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "EmptyStatement", + }, + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "ArrayPattern", + }, "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 0, "line": 1, }, }, "range": Array [ - 12, - 13, + 0, + 17, ], - "type": "Identifier", - "value": "x", + "right": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "type": "ForOfStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 14, + "column": 3, "line": 1, }, "start": Object { - "column": 13, + "column": 0, "line": 1, }, }, "range": Array [ - 13, - 14, + 0, + 3, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 5, "line": 1, }, "start": Object { - "column": 15, + "column": 4, "line": 1, }, }, "range": Array [ - 15, - 16, + 4, + 5, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 6, "line": 1, }, "start": Object { - "column": 17, + "column": 5, "line": 1, }, }, "range": Array [ - 17, - 18, + 5, + 6, ], "type": "Punctuator", "value": "[", @@ -59271,35 +67747,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 7, "line": 1, }, "start": Object { - "column": 18, + "column": 6, "line": 1, }, }, "range": Array [ - 18, - 19, + 6, + 7, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 8, "line": 1, }, "start": Object { - "column": 19, + "column": 7, "line": 1, }, }, "range": Array [ - 19, - 20, + 7, + 8, ], "type": "Punctuator", "value": "]", @@ -59307,71 +67783,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 11, "line": 1, }, "start": Object { - "column": 20, + "column": 9, "line": 1, }, }, "range": Array [ - 20, - 21, + 9, + 11, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { - "column": 22, + "column": 12, "line": 1, }, }, "range": Array [ - 22, - 23, + 12, + 15, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 16, "line": 1, }, "start": Object { - "column": 23, + "column": 15, "line": 1, }, }, "range": Array [ - 23, - 24, + 15, + 16, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 17, "line": 1, }, "start": Object { - "column": 24, + "column": 16, "line": 1, }, }, "range": Array [ - 24, - 25, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -59381,376 +67857,298 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-defaultParams/param-object.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 30, - ], - "right": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 30, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "params": Array [ + "elements": Array [ Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "init", + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 4, "line": 1, }, "start": Object { - "column": 14, + "column": 3, "line": 1, }, }, - "method": false, + "name": "a", "range": Array [ - 14, - 15, + 3, + 4, ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 13, - 16, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 26, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, + "type": "Identifier", }, - "start": Object { - "column": 19, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + "method": false, + "range": Array [ + 3, + 4, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, }, - "name": "x", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", }, - "kind": "init", + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 25, + "column": 7, "line": 1, }, "start": Object { - "column": 20, + "column": 6, "line": 1, }, }, - "method": false, + "name": "b", "range": Array [ - 20, - 25, + 6, + 7, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, }, - "range": Array [ - 23, - 25, - ], - "raw": "10", - "type": "Literal", - "value": 10, }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, - ], + }, + ], + "range": Array [ + 1, + 9, + ], + "type": "ObjectPattern", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "c", "range": Array [ - 19, - 26, + 14, + 15, ], - "type": "ObjectExpression", + "type": "Identifier", }, - "type": "AssignmentPattern", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 15, + ], + "type": "RestElement", }, ], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ - 4, - 30, + 0, + 16, ], - "type": "FunctionExpression", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 31, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 31, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "ArrayPattern", }, - }, - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, - "start": Object { - "column": 2, - "line": 1, + "operator": "=", + "range": Array [ + 0, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", }, + "type": "AssignmentExpression", }, - "range": Array [ - 2, - 3, - ], - "type": "Punctuator", - "value": "=", - }, - Object { "loc": Object { "end": Object { - "column": 12, + "column": 21, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, "range": Array [ - 4, - 12, + 0, + 21, ], - "type": "Keyword", - "value": "function", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, + "column": 1, "line": 1, }, "start": Object { - "column": 12, + "column": 0, "line": 1, }, }, "range": Array [ - 12, - 13, + 0, + 1, ], "type": "Punctuator", - "value": "(", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 2, "line": 1, }, "start": Object { - "column": 13, + "column": 1, "line": 1, }, }, "range": Array [ - 13, - 14, + 1, + 2, ], "type": "Punctuator", "value": "{", @@ -59758,215 +68156,197 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 4, "line": 1, }, "start": Object { - "column": 14, + "column": 3, "line": 1, }, }, "range": Array [ - 14, - 15, + 3, + 4, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 5, "line": 1, }, "start": Object { - "column": 15, + "column": 4, "line": 1, }, }, "range": Array [ - 15, - 16, + 4, + 5, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 7, "line": 1, }, "start": Object { - "column": 17, + "column": 6, "line": 1, }, }, "range": Array [ - 17, - 18, + 6, + 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 9, "line": 1, }, "start": Object { - "column": 19, + "column": 8, "line": 1, }, }, "range": Array [ - 19, - 20, + 8, + 9, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - "value": "x", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 10, "line": 1, }, "start": Object { - "column": 21, + "column": 9, "line": 1, }, }, "range": Array [ - 21, - 22, + 9, + 10, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 14, "line": 1, }, "start": Object { - "column": 23, + "column": 11, "line": 1, }, }, "range": Array [ - 23, - 25, + 11, + 14, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 15, "line": 1, }, "start": Object { - "column": 25, + "column": 14, "line": 1, }, }, "range": Array [ - 25, - 26, + 14, + 15, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 16, "line": 1, }, "start": Object { - "column": 26, + "column": 15, "line": 1, }, }, "range": Array [ - 26, - 27, + 15, + 16, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 18, "line": 1, }, "start": Object { - "column": 28, + "column": 17, "line": 1, }, }, "range": Array [ - 28, - 29, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 20, "line": 1, }, "start": Object { - "column": 29, + "column": 19, "line": 1, }, }, "range": Array [ - 29, - 30, + 19, + 20, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "d", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 21, "line": 1, }, "start": Object { - "column": 30, + "column": 20, "line": 1, }, }, "range": Array [ - 30, - 31, + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -59976,282 +68356,158 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-defaultParams/param-object-short.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "left": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 3, + "column": 2, "line": 1, }, "start": Object { - "column": 2, + "column": 1, "line": 1, }, }, - "name": "f", + "name": "a", "range": Array [ + 1, 2, - 3, ], "type": "Identifier", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": true, - "range": Array [ - 2, - 21, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 21, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "params": Array [ - Object { - "left": Object { + Object { + "argument": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 8, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 5, - 6, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - }, - ], + "name": "b", "range": Array [ - 4, - 7, + 8, + 9, ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "type": "Identifier", }, - "range": Array [ - 4, - 17, - ], - "right": Object { + Object { "loc": Object { "end": Object { - "column": 17, + "column": 12, "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 11, - 16, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - }, - ], + "name": "c", "range": Array [ - 10, - 17, + 11, + 12, ], - "type": "ObjectExpression", + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, - "type": "AssignmentPattern", }, - ], + "range": Array [ + 7, + 13, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ - 3, - 21, + 4, + 13, ], - "type": "FunctionExpression", + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, }, - ], + "range": Array [ + 0, + 14, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", "range": Array [ - 1, - 22, + 0, + 18, ], - "type": "ObjectExpression", + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 1, }, "start": Object { @@ -60261,15 +68517,15 @@ Object { }, "range": Array [ 0, - 24, + 19, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -60278,7 +68534,7 @@ Object { }, "range": Array [ 0, - 24, + 20, ], "sourceType": "script", "tokens": Array [ @@ -60298,7 +68554,7 @@ Object { 1, ], "type": "Punctuator", - "value": "(", + "value": "[", }, Object { "loc": Object { @@ -60315,8 +68571,8 @@ Object { 1, 2, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -60333,31 +68589,13 @@ Object { 2, 3, ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 4, - ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -60367,46 +68605,28 @@ Object { }, "range": Array [ 4, - 5, + 7, ], "type": "Punctuator", - "value": "{", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { "column": 7, "line": 1, }, - "start": Object { - "column": 6, - "line": 1, - }, }, "range": Array [ - 6, 7, + 8, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { @@ -60423,26 +68643,26 @@ Object { 8, 9, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 11, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { @@ -60460,7 +68680,7 @@ Object { 12, ], "type": "Identifier", - "value": "x", + "value": "c", }, Object { "loc": Object { @@ -60478,43 +68698,43 @@ Object { 13, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ + 13, 14, - 16, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, "range": Array [ + 15, 16, - 17, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { @@ -60531,95 +68751,23 @@ Object { 17, 18, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "d", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { "column": 19, "line": 1, }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, + "column": 18, "line": 1, }, }, "range": Array [ - 23, - 24, + 18, + 19, ], "type": "Punctuator", "value": ";", @@ -60629,299 +68777,197 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-defaultParams/param-object-wrapped.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 1, }, "start": Object { - "column": 1, + "column": 28, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 3, + "column": 13, "line": 1, }, "start": Object { - "column": 2, + "column": 12, "line": 1, }, }, - "name": "f", + "name": "a", "range": Array [ - 2, - 3, + 12, + 13, ], "type": "Identifier", }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 31, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + Object { "loc": Object { "end": Object { - "column": 31, + "column": 16, "line": 1, }, "start": Object { - "column": 5, + "column": 15, "line": 1, }, }, - "params": Array [ - Object { - "left": Object { + "name": "b", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 14, + "column": 22, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 15, - 16, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - }, - ], + "name": "ok", "range": Array [ - 14, - 17, + 22, + 24, ], - "type": "ObjectPattern", + "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, }, - "range": Array [ - 14, - 27, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 21, - 26, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 26, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - }, - ], - "range": Array [ - 20, - 27, - ], - "type": "ObjectExpression", + "start": Object { + "column": 21, + "line": 1, }, - "type": "AssignmentPattern", }, - ], + "range": Array [ + 21, + 25, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, "range": Array [ - 5, - 31, + 18, + 25, ], - "type": "FunctionExpression", + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, }, }, - ], - "range": Array [ - 1, - 32, - ], - "type": "ObjectExpression", - }, + "range": Array [ + 11, + 26, + ], + "type": "ArrayPattern", + }, + ], + "range": Array [ + 0, + 30, + ], + "type": "FunctionDeclaration", + }, + Object { "loc": Object { "end": Object { - "column": 34, + "column": 31, "line": 1, }, "start": Object { - "column": 0, + "column": 30, "line": 1, }, }, "range": Array [ - 0, - 34, + 30, + 31, ], - "type": "ExpressionStatement", + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 34, + "column": 31, "line": 1, }, "start": Object { @@ -60931,14 +68977,14 @@ Object { }, "range": Array [ 0, - 34, + 31, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -60948,64 +68994,64 @@ Object { }, "range": Array [ 0, - 1, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 10, "line": 1, }, "start": Object { - "column": 1, + "column": 9, "line": 1, }, }, "range": Array [ - 1, - 2, + 9, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 11, "line": 1, }, "start": Object { - "column": 2, + "column": 10, "line": 1, }, }, "range": Array [ - 2, - 3, + 10, + 11, ], - "type": "Identifier", - "value": "f", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 12, "line": 1, }, "start": Object { - "column": 3, + "column": 11, "line": 1, }, }, "range": Array [ - 3, - 4, + 11, + 12, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { @@ -61014,16 +69060,16 @@ Object { "line": 1, }, "start": Object { - "column": 5, + "column": 12, "line": 1, }, }, "range": Array [ - 5, + 12, 13, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { @@ -61041,25 +69087,7 @@ Object { 14, ], "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { @@ -61077,7 +69105,7 @@ Object { 16, ], "type": "Identifier", - "value": "x", + "value": "b", }, Object { "loc": Object { @@ -61095,12 +69123,12 @@ Object { 17, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 21, "line": 1, }, "start": Object { @@ -61110,64 +69138,64 @@ Object { }, "range": Array [ 18, - 19, + 21, ], "type": "Punctuator", - "value": "=", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 22, "line": 1, }, "start": Object { - "column": 20, + "column": 21, "line": 1, }, }, "range": Array [ - 20, 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 24, "line": 1, }, "start": Object { - "column": 21, + "column": 22, "line": 1, }, }, "range": Array [ - 21, 22, + 24, ], "type": "Identifier", - "value": "x", + "value": "ok", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 25, "line": 1, }, "start": Object { - "column": 22, + "column": 24, "line": 1, }, }, "range": Array [ - 22, - 23, + 24, + 25, ], "type": "Punctuator", - "value": ":", + "value": "]", }, Object { "loc": Object { @@ -61176,16 +69204,16 @@ Object { "line": 1, }, "start": Object { - "column": 24, + "column": 25, "line": 1, }, }, "range": Array [ - 24, + 25, 26, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { @@ -61203,25 +69231,25 @@ Object { 27, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 29, "line": 1, }, "start": Object { - "column": 27, + "column": 28, "line": 1, }, }, "range": Array [ - 27, 28, + 29, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { @@ -61239,7 +69267,7 @@ Object { 30, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { @@ -61257,337 +69285,6 @@ Object { 31, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-forOf/loop.src 1`] = ` -Object { - "body": Array [ - Object { - "await": false, - "body": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "EmptyStatement", - }, - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 8, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 17, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "for", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "type": "Identifier", - "value": "of", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 15, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", "value": ";", }, ], @@ -61595,7 +69292,7 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/complex-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` Object { "body": Array [ Object { @@ -61603,9 +69300,27 @@ Object { "left": Object { "elements": Array [ Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { @@ -61613,60 +69328,77 @@ Object { "line": 1, }, }, + "range": Array [ + 1, + 5, + ], + "type": "RestElement", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, "properties": Array [ Object { "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 4, + "column": 10, "line": 1, }, "start": Object { - "column": 3, + "column": 9, "line": 1, }, }, "name": "a", "range": Array [ - 3, - 4, + 9, + 10, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 4, + "column": 10, "line": 1, }, "start": Object { - "column": 3, + "column": 9, "line": 1, }, }, "method": false, "range": Array [ - 3, - 4, + 9, + 10, ], "shorthand": true, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 4, + "column": 10, "line": 1, }, "start": Object { - "column": 3, + "column": 9, "line": 1, }, }, "name": "a", "range": Array [ - 3, - 4, + 9, + 10, ], "type": "Identifier", }, @@ -61676,99 +69408,64 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 12, "line": 1, }, }, "name": "b", "range": Array [ - 6, - 7, + 12, + 13, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 12, "line": 1, }, }, "method": false, "range": Array [ - 6, - 7, + 12, + 13, ], "shorthand": true, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 12, "line": 1, }, }, "name": "b", "range": Array [ - 6, - 7, + 12, + 13, ], "type": "Identifier", }, }, ], "range": Array [ - 1, - 9, - ], - "type": "ObjectPattern", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, + 7, 15, ], - "type": "RestElement", + "type": "ObjectPattern", }, ], "loc": Object { @@ -61841,8 +69538,8 @@ Object { ], "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -61851,7 +69548,7 @@ Object { }, "range": Array [ 0, - 21, + 22, ], "sourceType": "script", "tokens": Array [ @@ -61876,7 +69573,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, + "column": 4, "line": 1, }, "start": Object { @@ -61886,43 +69583,43 @@ Object { }, "range": Array [ 1, - 2, + 4, ], "type": "Punctuator", - "value": "{", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { - "column": 3, + "column": 4, "line": 1, }, }, "range": Array [ - 3, 4, + 5, ], "type": "Identifier", - "value": "a", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, 5, + 6, ], "type": "Punctuator", "value": ",", @@ -61930,53 +69627,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 8, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, 9, + 10, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", "value": ",", @@ -61984,20 +69681,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, - 14, + 12, + 13, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -62014,8 +69711,8 @@ Object { 14, 15, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -62094,7 +69791,283 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/destructured-array-literal.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/invalid-not-final-array-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 12, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` Object { "body": Array [ Object { @@ -62121,47 +70094,9 @@ Object { }, Object { "argument": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - ], "loc": Object { "end": Object { - "column": 13, + "column": 8, "line": 1, }, "start": Object { @@ -62169,15 +70104,16 @@ Object { "line": 1, }, }, + "name": "b", "range": Array [ 7, - 13, + 8, ], - "type": "ArrayPattern", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 13, + "column": 8, "line": 1, }, "start": Object { @@ -62187,14 +70123,14 @@ Object { }, "range": Array [ 4, - 13, + 8, ], "type": "RestElement", }, ], "loc": Object { "end": Object { - "column": 14, + "column": 9, "line": 1, }, "start": Object { @@ -62204,13 +70140,13 @@ Object { }, "range": Array [ 0, - 14, + 9, ], "type": "ArrayPattern", }, "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { @@ -62221,23 +70157,23 @@ Object { "operator": "=", "range": Array [ 0, - 18, + 13, ], "right": Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { - "column": 17, + "column": 12, "line": 1, }, }, - "name": "d", + "name": "c", "range": Array [ - 17, - 18, + 12, + 13, ], "type": "Identifier", }, @@ -62245,7 +70181,7 @@ Object { }, "loc": Object { "end": Object { - "column": 19, + "column": 14, "line": 1, }, "start": Object { @@ -62255,15 +70191,15 @@ Object { }, "range": Array [ 0, - 19, + 14, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { "column": 0, @@ -62272,7 +70208,7 @@ Object { }, "range": Array [ 0, - 20, + 14, ], "sourceType": "script", "tokens": Array [ @@ -62363,8 +70299,8 @@ Object { 7, 8, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -62381,44 +70317,26 @@ Object { 8, 9, ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], "type": "Punctuator", - "value": ",", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 11, "line": 1, }, "start": Object { - "column": 11, + "column": 10, "line": 1, }, }, "range": Array [ + 10, 11, - 12, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { @@ -62435,8 +70353,8 @@ Object { 12, 13, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { @@ -62454,60 +70372,6 @@ Object { 14, ], "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - "value": "d", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", "value": ";", }, ], @@ -62515,197 +70379,138 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/destructuring-param.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/not-final-array.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 30, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { + "expression": Object { + "left": Object { "elements": Array [ Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - Object { "loc": Object { "end": Object { - "column": 16, + "column": 5, "line": 1, }, "start": Object { - "column": 15, + "column": 1, "line": 1, }, }, - "name": "b", "range": Array [ - 15, - 16, + 1, + 5, ], - "type": "Identifier", + "type": "RestElement", }, Object { - "argument": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "ok", - "range": Array [ - 22, - 24, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 25, - ], - "type": "ArrayPattern", - }, "loc": Object { "end": Object { - "column": 25, + "column": 8, "line": 1, }, "start": Object { - "column": 18, + "column": 7, "line": 1, }, }, + "name": "b", "range": Array [ - 18, - 25, + 7, + 8, ], - "type": "RestElement", + "type": "Identifier", }, ], "loc": Object { "end": Object { - "column": 26, + "column": 9, "line": 1, }, "start": Object { - "column": 11, + "column": 0, "line": 1, }, }, "range": Array [ - 11, - 26, + 0, + 9, ], "type": "ArrayPattern", }, - ], - "range": Array [ - 0, - 30, - ], - "type": "FunctionDeclaration", - }, - Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 13, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { - "column": 31, + "column": 14, "line": 1, }, "start": Object { - "column": 30, + "column": 0, "line": 1, }, }, "range": Array [ - 30, - 31, + 0, + 14, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 31, + "column": 14, "line": 1, }, "start": Object { @@ -62715,14 +70520,14 @@ Object { }, "range": Array [ 0, - 31, + 14, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -62732,25 +70537,43 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 4, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, "range": Array [ - 9, - 10, + 1, + 4, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Identifier", "value": "a", @@ -62758,38 +70581,74 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 6, "line": 1, }, "start": Object { - "column": 10, + "column": 5, "line": 1, }, }, "range": Array [ - 10, - 11, + 5, + 6, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, "line": 1, }, "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { "column": 11, "line": 1, }, + "start": Object { + "column": 10, + "line": 1, + }, }, "range": Array [ + 10, 11, - 12, ], "type": "Punctuator", - "value": "[", + "value": "=", }, Object { "loc": Object { @@ -62807,7 +70666,7 @@ Object { 13, ], "type": "Identifier", - "value": "a", + "value": "c", }, Object { "loc": Object { @@ -62825,76 +70684,154 @@ Object { 14, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/destructuring-and-spread/single-destructured.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, + "expression": Object { + "left": Object { + "elements": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 5, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ArrayPattern", }, - "start": Object { - "column": 15, - "line": 1, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 10, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, + "type": "AssignmentExpression", }, - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - "value": "b", - }, - Object { "loc": Object { "end": Object { - "column": 17, + "column": 11, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, - 17, + 0, + 11, ], - "type": "Punctuator", - "value": ",", + "type": "ExpressionStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 21, - ], - "type": "Punctuator", - "value": "...", + ], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 1, "line": 1, }, "start": Object { - "column": 21, + "column": 0, "line": 1, }, }, "range": Array [ - 21, - 22, + 0, + 1, ], "type": "Punctuator", "value": "[", @@ -62902,125 +70839,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 24, - ], - "type": "Identifier", - "value": "ok", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, + "column": 4, "line": 1, }, "start": Object { - "column": 24, + "column": 1, "line": 1, }, }, "range": Array [ - 24, - 25, + 1, + 4, ], "type": "Punctuator", - "value": "]", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 5, "line": 1, }, "start": Object { - "column": 25, + "column": 4, "line": 1, }, }, "range": Array [ - 25, - 26, + 4, + 5, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 6, "line": 1, }, "start": Object { - "column": 26, + "column": 5, "line": 1, }, }, "range": Array [ - 26, - 27, + 5, + 6, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 8, "line": 1, }, "start": Object { - "column": 28, + "column": 7, "line": 1, }, }, "range": Array [ - 28, - 29, + 7, + 8, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 10, "line": 1, }, "start": Object { - "column": 29, + "column": 9, "line": 1, }, }, "range": Array [ - 29, - 30, + 9, + 10, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 11, "line": 1, }, "start": Object { - "column": 30, + "column": 10, "line": 1, }, }, "range": Array [ - 30, - 31, + 10, + 11, ], "type": "Punctuator", "value": ";", @@ -63030,236 +70949,238 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "elements": Array [ - Object { - "argument": Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, - "name": "c", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 5, - ], - "type": "RestElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, - "name": "a", + "method": false, "range": Array [ - 9, - 10, + 7, + 8, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", }, }, - "method": false, - "range": Array [ - 9, - 10, - ], - "shorthand": true, - "type": "Property", - "value": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, - "name": "a", + "method": false, "range": Array [ - 9, 10, + 11, ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "b", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", }, - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", }, - "kind": "init", + ], + "range": Array [ + 5, + 13, + ], + "type": "ObjectPattern", + }, + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 13, + "column": 19, "line": 1, }, "start": Object { - "column": 12, + "column": 18, "line": 1, }, }, - "method": false, + "name": "c", "range": Array [ - 12, - 13, + 18, + 19, ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, }, }, - ], - "range": Array [ - 7, - 15, - ], - "type": "ObjectPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 15, + 19, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 20, + ], + "type": "ArrayPattern", }, - "range": Array [ - 0, - 16, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", }, - }, - "operator": "=", - "range": Array [ - 0, - 20, - ], - "right": Object { "loc": Object { "end": Object { - "column": 20, + "column": 24, "line": 1, }, "start": Object { - "column": 19, + "column": 4, "line": 1, }, }, - "name": "d", "range": Array [ - 19, - 20, + 4, + 24, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { @@ -63269,15 +71190,15 @@ Object { }, "range": Array [ 0, - 21, + 25, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { "column": 0, @@ -63286,14 +71207,14 @@ Object { }, "range": Array [ 0, - 22, + 25, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -63303,28 +71224,10 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 4, + 3, ], - "type": "Punctuator", - "value": "...", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { @@ -63341,8 +71244,8 @@ Object { 4, 5, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { @@ -63360,7 +71263,7 @@ Object { 6, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { @@ -63377,26 +71280,26 @@ Object { 7, 8, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 10, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -63413,8 +71316,8 @@ Object { 10, 11, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { @@ -63431,31 +71334,31 @@ Object { 12, 13, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ + 13, 14, - 15, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { @@ -63465,28 +71368,28 @@ Object { }, "range": Array [ 15, - 16, + 18, ], "type": "Punctuator", - "value": "]", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 19, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 19, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { @@ -63503,23 +71406,59 @@ Object { 19, 20, ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], "type": "Identifier", "value": "d", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 20, + "column": 24, "line": 1, }, }, "range": Array [ - 20, - 21, + 24, + 25, ], "type": "Punctuator", "value": ";", @@ -63529,103 +71468,160 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/invalid-not-final-array-empty.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "elements": Array [ - Object { - "argument": Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "name": "a", "range": Array [ - 4, 5, + 6, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, + Object { + "argument": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 17, + ], + "type": "ArrayPattern", }, - "start": Object { - "column": 1, - "line": 1, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, + "range": Array [ + 8, + 17, + ], + "type": "RestElement", + }, + ], + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, - "range": Array [ - 1, - 5, - ], - "type": "RestElement", - }, - ], - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, }, + "range": Array [ + 4, + 18, + ], + "type": "ArrayPattern", }, - "range": Array [ - 0, - 8, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", }, - }, - "operator": "=", - "range": Array [ - 0, - 12, - ], - "right": Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 4, "line": 1, }, }, - "name": "b", "range": Array [ - 11, - 12, + 4, + 22, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { @@ -63635,14 +71631,14 @@ Object { }, "range": Array [ 0, - 13, + 23, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 13, + "column": 23, "line": 1, }, "start": Object { @@ -63652,14 +71648,14 @@ Object { }, "range": Array [ 0, - 13, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -63669,28 +71665,10 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 4, + 3, ], - "type": "Punctuator", - "value": "...", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { @@ -63707,263 +71685,77 @@ Object { 4, 5, ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 6, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-spread/multi-destructured.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 1, - 2, - ], - "type": "Identifier", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 8, - ], - "type": "RestElement", - }, - ], - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 9, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 13, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, }, - "type": "AssignmentExpression", }, + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + "value": "a", + }, + Object { "loc": Object { "end": Object { - "column": 14, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 6, "line": 1, }, }, "range": Array [ - 0, - 14, + 6, + 7, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + "type": "Punctuator", + "value": ",", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Punctuator", + "value": "...", }, - }, - "range": Array [ - 0, - 14, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 12, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 1, + 11, + 12, ], "type": "Punctuator", "value": "[", @@ -63971,35 +71763,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, + "column": 13, "line": 1, }, "start": Object { - "column": 1, + "column": 12, "line": 1, }, }, "range": Array [ - 1, - 2, + 12, + 13, ], "type": "Identifier", - "value": "a", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 14, "line": 1, }, "start": Object { - "column": 2, + "column": 13, "line": 1, }, }, "range": Array [ - 2, - 3, + 13, + 14, ], "type": "Punctuator", "value": ",", @@ -64007,53 +71799,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 16, "line": 1, }, "start": Object { - "column": 4, + "column": 15, "line": 1, }, }, "range": Array [ - 4, - 7, + 15, + 16, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 17, "line": 1, }, "start": Object { - "column": 7, + "column": 16, "line": 1, }, }, "range": Array [ - 7, - 8, + 16, + 17, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { - "column": 8, + "column": 17, "line": 1, }, }, "range": Array [ - 8, - 9, + 17, + 18, ], "type": "Punctuator", "value": "]", @@ -64061,17 +71853,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 20, "line": 1, }, "start": Object { - "column": 10, + "column": 19, "line": 1, }, }, "range": Array [ - 10, - 11, + 19, + 20, ], "type": "Punctuator", "value": "=", @@ -64079,35 +71871,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 22, "line": 1, }, "start": Object { - "column": 12, + "column": 21, "line": 1, }, }, "range": Array [ - 12, - 13, + 21, + 22, ], "type": "Identifier", - "value": "c", + "value": "d", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 22, "line": 1, }, }, "range": Array [ - 13, - 14, + 22, + 23, ], "type": "Punctuator", "value": ";", @@ -64117,121 +71909,123 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/not-final-array.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "elements": Array [ - Object { - "argument": Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "name": "a", "range": Array [ - 4, 5, + 6, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", }, - "start": Object { - "column": 1, - "line": 1, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, + "range": Array [ + 8, + 12, + ], + "type": "RestElement", }, - "range": Array [ - 1, - 5, - ], - "type": "RestElement", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, - "name": "b", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, }, + "range": Array [ + 4, + 13, + ], + "type": "ArrayPattern", }, - "range": Array [ - 0, - 9, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", }, - }, - "operator": "=", - "range": Array [ - 0, - 13, - ], - "right": Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 4, "line": 1, }, }, - "name": "c", "range": Array [ - 12, - 13, + 4, + 17, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { @@ -64241,14 +72035,14 @@ Object { }, "range": Array [ 0, - 14, + 18, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { @@ -64258,14 +72052,14 @@ Object { }, "range": Array [ 0, - 14, + 18, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -64275,43 +72069,43 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, 4, + 5, ], "type": "Punctuator", - "value": "...", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, 5, + 6, ], "type": "Identifier", "value": "a", @@ -64319,17 +72113,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "range": Array [ - 5, 6, + 7, ], "type": "Punctuator", "value": ",", @@ -64337,17 +72131,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, 8, + 11, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, ], "type": "Identifier", "value": "b", @@ -64355,17 +72167,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 12, "line": 1, }, }, "range": Array [ - 8, - 9, + 12, + 13, ], "type": "Punctuator", "value": "]", @@ -64373,17 +72185,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], "type": "Punctuator", "value": "=", @@ -64391,17 +72203,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 13, + 16, + 17, ], "type": "Identifier", "value": "c", @@ -64409,17 +72221,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "range": Array [ - 13, - 14, + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -64429,103 +72241,105 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/single-destructured.src 1`] = ` +exports[`javascript fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "elements": Array [ - Object { - "argument": Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, - "name": "a", "range": Array [ - 4, 5, + 9, ], - "type": "Identifier", + "type": "RestElement", }, - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, }, - "range": Array [ - 1, - 5, - ], - "type": "RestElement", - }, - ], - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, }, + "range": Array [ + 4, + 10, + ], + "type": "ArrayPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", }, - "range": Array [ - 0, - 6, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 10, - ], - "right": Object { "loc": Object { "end": Object { - "column": 10, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, - "name": "b", "range": Array [ - 9, - 10, + 4, + 14, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -64535,14 +72349,14 @@ Object { }, "range": Array [ 0, - 11, + 15, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -64552,14 +72366,14 @@ Object { }, "range": Array [ 0, - 11, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -64569,7 +72383,25 @@ Object { }, "range": Array [ 0, - 1, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Punctuator", "value": "[", @@ -64577,17 +72409,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 4, + "column": 8, "line": 1, }, "start": Object { - "column": 1, + "column": 5, "line": 1, }, }, "range": Array [ - 1, - 4, + 5, + 8, ], "type": "Punctuator", "value": "...", @@ -64595,17 +72427,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 8, "line": 1, }, }, "range": Array [ - 4, - 5, + 8, + 9, ], "type": "Identifier", "value": "a", @@ -64613,17 +72445,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 6, + 9, + 10, ], "type": "Punctuator", "value": "]", @@ -64631,17 +72463,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { - "column": 7, + "column": 11, "line": 1, }, }, "range": Array [ - 7, - 8, + 11, + 12, ], "type": "Punctuator", "value": "=", @@ -64649,17 +72481,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 13, "line": 1, }, }, "range": Array [ - 9, - 10, + 13, + 14, ], "type": "Identifier", "value": "b", @@ -64667,17 +72499,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], "type": "Punctuator", "value": ";", @@ -64687,256 +72519,219 @@ Object { } `; -exports[`javascript fixtures/destructuring-and-spread/var-complex-destructured.src 1`] = ` +exports[`javascript fixtures/directives/block.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 7, - 8, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 10, - 11, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 5, - 13, - ], - "type": "ObjectPattern", + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 19, + 31, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, }, + }, + "range": Array [ + 19, + 32, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ Object { - "argument": Object { + "id": Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 6, + "line": 3, }, }, - "name": "c", + "name": "a", "range": Array [ - 18, - 19, + 39, + 40, ], "type": "Identifier", }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 15, - 19, + 39, + 44, ], - "type": "RestElement", + "type": "VariableDeclarator", }, ], + "kind": "var", "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 4, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 4, - 20, + 35, + 45, ], - "type": "ArrayPattern", + "type": "VariableDeclaration", }, - "init": Object { + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 48, + 60, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 23, - "line": 1, + "column": 2, + "line": 4, }, }, - "name": "d", "range": Array [ - 23, - 24, + 48, + 61, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 15, + "line": 1, }, - "range": Array [ - 4, - 24, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 15, + 63, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 25, + 63, ], - "type": "VariableDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -64945,14 +72740,14 @@ Object { }, "range": Array [ 0, - 25, + 64, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -64962,422 +72757,851 @@ Object { }, "range": Array [ 0, - 3, + 8, ], "type": "Keyword", - "value": "var", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 12, "line": 1, }, "start": Object { - "column": 4, + "column": 9, "line": 1, }, }, "range": Array [ - 4, - 5, + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 14, "line": 1, }, "start": Object { - "column": 5, + "column": 13, "line": 1, }, }, "range": Array [ - 5, - 6, + 13, + 14, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 16, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 8, + 15, + 16, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 19, + 31, + ], + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 8, - 9, + 31, + 32, ], "type": "Punctuator", - "value": ",", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 10, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 10, - 11, + 35, + 38, ], - "type": "Identifier", - "value": "b", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 12, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 12, - 13, + 39, + 40, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 13, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 13, - 14, + 41, + 42, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 15, - 18, + 43, + 44, ], - "type": "Punctuator", - "value": "...", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 11, + "line": 3, }, }, "range": Array [ - 18, - 19, + 44, + 45, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 4, }, "start": Object { - "column": 19, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 19, - 20, + 48, + 60, ], - "type": "Punctuator", - "value": "]", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 21, - 22, + 60, + 61, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 23, - 24, + 62, + 63, ], - "type": "Identifier", - "value": "d", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/directives/directive-in-class.src 1`] = ` +Object { + "body": Array [ Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 25, + "column": 13, "line": 1, }, "start": Object { - "column": 24, + "column": 0, "line": 1, }, }, "range": Array [ - 24, - 25, + 0, + 13, ], - "type": "Punctuator", - "value": ";", + "type": "ExpressionStatement", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-spread/var-destructured-array-literal.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "constructor", + "range": Array [ + 31, + 42, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 31, + 75, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 56, + 68, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 56, + 69, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 46, + 75, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 43, + 75, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "name": "foo", + "range": Array [ + 85, + 88, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 81, + 121, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 102, + 114, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 102, + 115, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 10, }, "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 92, + 121, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "params": Array [], + "range": Array [ + 89, + 121, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 12, + }, + "start": Object { + "column": 8, + "line": 12, + }, + }, + "name": "foo", + "range": Array [ + 131, + 134, + ], + "type": "Identifier", + }, + "kind": "set", + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "range": Array [ + 127, + 172, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 153, + 165, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 13, + }, + "start": Object { + "column": 8, + "line": 13, + }, + }, + "range": Array [ + 153, + 166, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { "column": 5, - "line": 1, + "line": 14, + }, + "start": Object { + "column": 20, + "line": 12, }, }, - "name": "a", "range": Array [ - 5, - 6, + 143, + 172, ], - "type": "Identifier", + "type": "BlockStatement", }, - Object { - "argument": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 12, + "line": 12, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 12, }, - Object { + "start": Object { + "column": 13, + "line": 12, + }, + }, + "name": "value", + "range": Array [ + 136, + 141, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 135, + 172, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 16, + }, + "start": Object { + "column": 4, + "line": 16, + }, + }, + "name": "method", + "range": Array [ + 178, + 184, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 18, + }, + "start": Object { + "column": 4, + "line": 16, + }, + }, + "range": Array [ + 178, + 217, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 20, + "line": 17, }, "start": Object { - "column": 15, - "line": 1, + "column": 8, + "line": 17, }, }, - "name": "c", "range": Array [ - 15, - 16, + 198, + 210, ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "start": Object { - "column": 11, - "line": 1, + "loc": Object { + "end": Object { + "column": 21, + "line": 17, + }, + "start": Object { + "column": 8, + "line": 17, + }, }, + "range": Array [ + 198, + 211, + ], + "type": "ExpressionStatement", }, - "range": Array [ - 11, - 17, - ], - "type": "ArrayPattern", - }, + ], "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 5, + "line": 18, }, "start": Object { - "column": 8, - "line": 1, + "column": 14, + "line": 16, }, }, "range": Array [ - 8, - 17, + 188, + 217, ], - "type": "RestElement", - }, - ], - "loc": Object { - "end": Object { - "column": 18, - "line": 1, + "type": "BlockStatement", }, - "start": Object { - "column": 4, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 18, + }, + "start": Object { + "column": 11, + "line": 16, + }, }, + "params": Array [], + "range": Array [ + 185, + 217, + ], + "type": "FunctionExpression", }, - "range": Array [ - 4, - 18, - ], - "type": "ArrayPattern", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "d", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 19, }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "start": Object { + "column": 10, + "line": 3, }, - "range": Array [ - 4, - 22, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 25, + 219, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 1, + "line": 19, }, "start": Object { "column": 0, - "line": 1, + "line": 3, }, }, "range": Array [ - 0, - 23, + 15, + 219, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 20, }, "start": Object { "column": 0, @@ -65386,14 +73610,14 @@ Object { }, "range": Array [ 0, - 23, + 220, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 12, "line": 1, }, "start": Object { @@ -65403,861 +73627,665 @@ Object { }, "range": Array [ 0, - 3, + 12, ], - "type": "Keyword", - "value": "var", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 4, + "column": 12, "line": 1, }, }, "range": Array [ - 4, - 5, + 12, + 13, ], "type": "Punctuator", - "value": "[", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 5, - 6, + 15, + 20, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { "column": 6, - "line": 1, + "line": 3, }, }, "range": Array [ - 6, - 7, + 21, + 24, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 1, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 8, - 11, + 25, + 26, ], "type": "Punctuator", - "value": "...", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 15, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 11, - 12, + 31, + 42, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "range": Array [ + 43, + 44, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 12, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 12, - 13, + 44, + 45, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 20, + "line": 4, }, "start": Object { - "column": 13, - "line": 1, + "column": 19, + "line": 4, }, }, "range": Array [ - 13, - 14, + 46, + 47, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 20, + "line": 5, }, "start": Object { - "column": 15, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 15, - 16, + 56, + 68, ], - "type": "Identifier", - "value": "c", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 21, + "line": 5, }, "start": Object { - "column": 16, - "line": 1, + "column": 20, + "line": 5, }, }, "range": Array [ - 16, - 17, + 68, + 69, ], "type": "Punctuator", - "value": "]", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 5, + "line": 6, }, "start": Object { - "column": 17, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 17, - 18, + 74, + 75, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 7, + "line": 8, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 19, - 20, + 81, + 84, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 85, + 88, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 89, + 90, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 21, - "line": 1, + "column": 13, + "line": 8, }, }, "range": Array [ - 21, - 22, + 90, + 91, ], - "type": "Identifier", - "value": "d", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 16, + "line": 8, }, "start": Object { - "column": 22, - "line": 1, + "column": 15, + "line": 8, }, }, "range": Array [ - 22, - 23, + 92, + 93, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-spread/var-multi-destructured.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 12, - ], - "type": "RestElement", - }, - ], - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 13, - ], - "type": "ArrayPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 17, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 20, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 9, }, }, "range": Array [ - 0, - 18, + 102, + 114, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "String", + "value": "\\"use strict\\"", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 21, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 20, + "line": 9, }, }, "range": Array [ - 0, - 3, + 114, + 115, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 10, }, "start": Object { "column": 4, - "line": 1, + "line": 10, }, }, "range": Array [ - 4, - 5, + 120, + 121, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 7, + "line": 12, }, "start": Object { - "column": 5, - "line": 1, + "column": 4, + "line": 12, }, }, "range": Array [ - 5, - 6, + 127, + 130, ], "type": "Identifier", - "value": "a", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 11, + "line": 12, }, "start": Object { - "column": 6, - "line": 1, + "column": 8, + "line": 12, }, }, "range": Array [ - 6, - 7, + 131, + 134, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 12, }, "start": Object { - "column": 8, - "line": 1, + "column": 12, + "line": 12, }, }, "range": Array [ - 8, - 11, + 135, + 136, ], "type": "Punctuator", - "value": "...", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 18, + "line": 12, }, "start": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 12, }, }, "range": Array [ - 11, - 12, + 136, + 141, ], "type": "Identifier", - "value": "b", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 19, + "line": 12, }, "start": Object { - "column": 12, - "line": 1, + "column": 18, + "line": 12, }, }, "range": Array [ - 12, - 13, + 141, + 142, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 21, + "line": 12, }, "start": Object { - "column": 14, - "line": 1, + "column": 20, + "line": 12, }, }, "range": Array [ - 14, - 15, + 143, + 144, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 20, + "line": 13, }, "start": Object { - "column": 16, - "line": 1, + "column": 8, + "line": 13, }, }, "range": Array [ - 16, - 17, + 153, + 165, ], - "type": "Identifier", - "value": "c", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 21, + "line": 13, }, "start": Object { - "column": 17, - "line": 1, + "column": 20, + "line": 13, }, }, "range": Array [ - 17, - 18, + 165, + 166, ], "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/destructuring-and-spread/var-single-destructured.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 9, - ], - "type": "RestElement", - }, - ], - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 10, - ], - "type": "ArrayPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 5, + "line": 14, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 14, }, }, "range": Array [ - 0, - 15, + 171, + 172, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 10, + "line": 16, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 16, }, }, "range": Array [ - 0, - 3, + 178, + 184, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "method", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 12, + "line": 16, }, "start": Object { - "column": 4, - "line": 1, + "column": 11, + "line": 16, }, }, "range": Array [ - 4, - 5, + 185, + 186, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 13, + "line": 16, }, "start": Object { - "column": 5, - "line": 1, + "column": 12, + "line": 16, }, }, "range": Array [ - 5, - 8, + 186, + 187, ], "type": "Punctuator", - "value": "...", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 15, + "line": 16, }, "start": Object { - "column": 8, - "line": 1, + "column": 14, + "line": 16, }, }, "range": Array [ - 8, - 9, + 188, + 189, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 20, + "line": 17, }, "start": Object { - "column": 9, - "line": 1, + "column": 8, + "line": 17, }, }, "range": Array [ - 9, - 10, + 198, + 210, ], - "type": "Punctuator", - "value": "]", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 21, + "line": 17, }, "start": Object { - "column": 11, - "line": 1, + "column": 20, + "line": 17, }, }, "range": Array [ - 11, - 12, + 210, + 211, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 5, + "line": 18, }, "start": Object { - "column": 13, - "line": 1, + "column": 4, + "line": 18, }, }, "range": Array [ - 13, - 14, + 216, + 217, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 19, }, "start": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 19, }, }, "range": Array [ - 14, - 15, + 218, + 219, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/directives/block.src 1`] = ` +exports[`javascript fixtures/directives/function-non-strict.src 1`] = ` Object { "body": Array [ Object { @@ -66265,11 +74293,11 @@ Object { "body": Object { "body": Array [ Object { - "directive": "use strict", + "directive": "use smth", "expression": Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 2, }, "start": Object { @@ -66278,16 +74306,16 @@ Object { }, }, "range": Array [ - 19, - 31, + 20, + 30, ], - "raw": "\\"use strict\\"", + "raw": "\\"use smth\\"", "type": "Literal", - "value": "use strict", + "value": "use smth", }, "loc": Object { "end": Object { - "column": 15, + "column": 12, "line": 2, }, "start": Object { @@ -66296,118 +74324,81 @@ Object { }, }, "range": Array [ - 19, - 32, + 20, + 30, ], "type": "ExpressionStatement", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 43, - 44, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, + "expression": Object { + "left": Object { "loc": Object { "end": Object { - "column": 11, + "column": 3, "line": 3, }, "start": Object { - "column": 6, + "column": 2, "line": 3, }, }, "range": Array [ - 39, - 44, + 33, + 34, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, + "raw": "1", + "type": "Literal", + "value": 1, }, - }, - "range": Array [ - 35, - 45, - ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 5, + "line": 3, }, "start": Object { "column": 2, - "line": 4, + "line": 3, }, }, + "operator": "+", "range": Array [ - 48, - 60, + 33, + 36, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", + "right": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "type": "BinaryExpression", }, "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 6, + "line": 3, }, "start": Object { "column": 2, - "line": 4, + "line": 3, }, }, "range": Array [ - 48, - 61, + 33, + 37, ], "type": "ExpressionStatement", }, @@ -66415,16 +74406,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, - 63, + 16, + 39, ], "type": "BlockStatement", }, @@ -66451,7 +74442,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -66461,7 +74452,7 @@ Object { "params": Array [], "range": Array [ 0, - 63, + 39, ], "type": "FunctionDeclaration", }, @@ -66469,7 +74460,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 5, }, "start": Object { "column": 0, @@ -66478,7 +74469,7 @@ Object { }, "range": Array [ 0, - 64, + 40, ], "sourceType": "script", "tokens": Array [ @@ -66521,17 +74512,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], "type": "Punctuator", "value": "(", @@ -66539,17 +74530,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 15, ], "type": "Punctuator", "value": ")", @@ -66557,17 +74548,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 17, ], "type": "Punctuator", "value": "{", @@ -66575,7 +74566,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 2, }, "start": Object { @@ -66584,34 +74575,16 @@ Object { }, }, "range": Array [ - 19, - 31, + 20, + 30, ], "type": "String", - "value": "\\"use strict\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": ";", + "value": "\\"use smth\\"", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 3, }, "start": Object { @@ -66620,62 +74593,44 @@ Object { }, }, "range": Array [ - 35, - 38, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 39, - 40, + 33, + 34, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 4, "line": 3, }, "start": Object { - "column": 8, + "column": 3, "line": 3, }, }, "range": Array [ - 41, - 42, + 34, + 35, ], "type": "Punctuator", - "value": "=", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 5, "line": 3, }, "start": Object { - "column": 10, + "column": 4, "line": 3, }, }, "range": Array [ - 43, - 44, + 35, + 36, ], "type": "Numeric", "value": "1", @@ -66683,53 +74638,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 6, "line": 3, }, "start": Object { - "column": 11, + "column": 5, "line": 3, }, }, "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 48, - 60, - ], - "type": "String", - "value": "\\"use strict\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "range": Array [ - 60, - 61, + 36, + 37, ], "type": "Punctuator", "value": ";", @@ -66738,16 +74657,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 4, }, "start": Object { "column": 0, - "line": 5, + "line": 4, }, }, "range": Array [ - 62, - 63, + 38, + 39, ], "type": "Punctuator", "value": "}", @@ -66757,589 +74676,403 @@ Object { } `; -exports[`javascript fixtures/directives/directive-in-class.src 1`] = ` +exports[`javascript fixtures/directives/non-directive-string.src 1`] = ` Object { "body": Array [ Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "ExpressionStatement", - }, - Object { - "body": Object { + "alternate": null, + "consequent": Object { "body": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "name": "constructor", - "range": Array [ - 31, - 42, - ], - "type": "Identifier", - }, - "kind": "constructor", - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 31, - 75, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 56, - 68, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 56, - 69, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 19, - "line": 4, - }, - }, - "range": Array [ - 46, - 75, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "expression": Object { "loc": Object { "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { "column": 16, - "line": 4, - }, - }, - "params": Array [], - "range": Array [ - 43, - 75, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 8, + "line": 2, }, "start": Object { - "column": 8, - "line": 8, + "column": 4, + "line": 2, }, }, - "name": "foo", "range": Array [ - 85, - 88, + 16, + 28, ], - "type": "Identifier", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "kind": "get", "loc": Object { "end": Object { - "column": 5, - "line": 10, + "column": 16, + "line": 2, }, "start": Object { "column": 4, - "line": 8, + "line": 2, }, }, "range": Array [ - 81, - 121, + 16, + 28, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 9, - }, - }, - "range": Array [ - 102, - 114, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 30, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 8, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "IfStatement", + }, + Object { + "cases": Array [ + Object { + "consequent": Array [ + Object { + "body": Array [ + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 21, - "line": 9, + "column": 20, + "line": 7, }, "start": Object { "column": 8, - "line": 9, + "line": 7, }, }, "range": Array [ - 102, - 115, + 74, + 86, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 10, + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "start": Object { - "column": 15, - "line": 8, + "loc": Object { + "end": Object { + "column": 20, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, }, + "range": Array [ + 74, + 86, + ], + "type": "ExpressionStatement", }, - "range": Array [ - 92, - 121, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + ], "loc": Object { "end": Object { "column": 5, - "line": 10, - }, - "start": Object { - "column": 12, "line": 8, }, - }, - "params": Array [], - "range": Array [ - 89, - 121, - ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 12, - }, "start": Object { - "column": 8, - "line": 12, + "column": 16, + "line": 6, }, }, - "name": "foo", "range": Array [ - 131, - 134, + 64, + 92, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "set", + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 52, + 92, + ], + "test": Object { "loc": Object { "end": Object { - "column": 5, - "line": 14, + "column": 14, + "line": 6, }, "start": Object { - "column": 4, - "line": 12, + "column": 9, + "line": 6, }, }, "range": Array [ - 127, - 172, + 57, + 62, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 13, - }, - "start": Object { - "column": 8, - "line": 13, - }, - }, - "range": Array [ - 153, - 165, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, + "raw": "false", + "type": "Literal", + "value": false, + }, + "type": "SwitchCase", + }, + Object { + "consequent": Array [ + Object { + "body": Array [ + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 21, - "line": 13, + "column": 20, + "line": 10, }, "start": Object { "column": 8, - "line": 13, + "line": 10, }, }, "range": Array [ - 153, - 166, + 116, + 128, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 14, - }, - "start": Object { - "column": 20, - "line": 12, + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - }, - "range": Array [ - 143, - 172, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 14, - }, - "start": Object { - "column": 12, - "line": 12, - }, - }, - "params": Array [ - Object { "loc": Object { "end": Object { - "column": 18, - "line": 12, + "column": 20, + "line": 10, }, "start": Object { - "column": 13, - "line": 12, + "column": 8, + "line": 10, }, }, - "name": "value", "range": Array [ - 136, - 141, + 116, + 128, ], - "type": "Identifier", + "type": "ExpressionStatement", }, ], + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 13, + "line": 9, + }, + }, "range": Array [ - 135, - 172, + 106, + 134, ], - "type": "FunctionExpression", + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 9, }, }, + "range": Array [ + 97, + 134, + ], + "test": null, + "type": "SwitchCase", + }, + ], + "discriminant": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 40, + 44, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 32, + 136, + ], + "type": "SwitchStatement", + }, + Object { + "body": Object { + "body": Array [ Object { - "computed": false, - "key": Object { + "expression": Object { "loc": Object { "end": Object { - "column": 10, - "line": 16, + "column": 16, + "line": 15, }, "start": Object { "column": 4, - "line": 16, + "line": 15, }, }, - "name": "method", "range": Array [ - 178, - 184, + 157, + 169, ], - "type": "Identifier", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "kind": "method", "loc": Object { "end": Object { - "column": 5, - "line": 18, + "column": 16, + "line": 15, }, "start": Object { "column": 4, - "line": 16, - }, - }, - "range": Array [ - 178, - 217, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 17, - }, - "start": Object { - "column": 8, - "line": 17, - }, - }, - "range": Array [ - 198, - 210, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 17, - }, - "start": Object { - "column": 8, - "line": 17, - }, - }, - "range": Array [ - 198, - 211, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 18, - }, - "start": Object { - "column": 14, - "line": 16, - }, - }, - "range": Array [ - 188, - 217, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 18, - }, - "start": Object { - "column": 11, - "line": 16, - }, - }, - "params": Array [], - "range": Array [ - 185, - 217, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 19, - }, - "start": Object { - "column": 10, - "line": 3, + "line": 15, + }, + }, + "range": Array [ + 157, + 169, + ], + "type": "ExpressionStatement", }, - }, - "range": Array [ - 25, - 219, ], - "type": "ClassBody", - }, - "id": Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 1, + "line": 16, }, "start": Object { - "column": 6, - "line": 3, + "column": 13, + "line": 14, }, }, - "name": "Foo", "range": Array [ - 21, - 24, + 151, + 171, ], - "type": "Identifier", + "type": "BlockStatement", }, "loc": Object { "end": Object { "column": 1, - "line": 19, + "line": 16, }, "start": Object { "column": 0, - "line": 3, + "line": 14, }, }, "range": Array [ - 15, - 219, + 138, + 171, ], - "superClass": null, - "type": "ClassDeclaration", + "test": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 14, + }, + "start": Object { + "column": 7, + "line": 14, + }, + }, + "range": Array [ + 145, + 149, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "WhileStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 20, + "line": 17, }, "start": Object { "column": 0, @@ -67348,14 +75081,14 @@ Object { }, "range": Array [ 0, - 220, + 172, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 2, "line": 1, }, "start": Object { @@ -67365,115 +75098,25 @@ Object { }, "range": Array [ 0, - 12, - ], - "type": "String", - "value": "\\"use strict\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 20, + 2, ], "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "{", + "value": "if", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { "column": 4, - "line": 4, - }, - }, - "range": Array [ - 31, - 42, - ], - "type": "Identifier", - "value": "constructor", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 3, + "line": 1, }, }, "range": Array [ - 43, - 44, + 3, + 4, ], "type": "Punctuator", "value": "(", @@ -67481,161 +75124,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "start": Object { - "column": 19, - "line": 4, - }, - }, - "range": Array [ - 46, - 47, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 5, - }, - "start": Object { "column": 8, - "line": 5, - }, - }, - "range": Array [ - 56, - 68, - ], - "type": "String", - "value": "\\"use strict\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 5, - }, - "start": Object { - "column": 20, - "line": 5, - }, - }, - "range": Array [ - 68, - 69, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 74, - 75, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, + "line": 1, }, "start": Object { "column": 4, - "line": 8, + "line": 1, }, }, "range": Array [ - 81, - 84, + 4, + 8, ], - "type": "Identifier", - "value": "get", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 8, + "column": 9, + "line": 1, }, "start": Object { "column": 8, - "line": 8, - }, - }, - "range": Array [ - 85, - 88, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 8, - }, - "start": Object { - "column": 12, - "line": 8, - }, - }, - "range": Array [ - 89, - 90, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 13, - "line": 8, + "line": 1, }, }, "range": Array [ - 90, - 91, + 8, + 9, ], "type": "Punctuator", "value": ")", @@ -67643,17 +75160,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, - "line": 8, + "column": 11, + "line": 1, }, "start": Object { - "column": 15, - "line": 8, + "column": 10, + "line": 1, }, }, "range": Array [ - 92, - 93, + 10, + 11, ], "type": "Punctuator", "value": "{", @@ -67661,17 +75178,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 9, + "column": 16, + "line": 2, }, "start": Object { - "column": 8, - "line": 9, + "column": 4, + "line": 2, }, }, "range": Array [ - 102, - 114, + 16, + 28, ], "type": "String", "value": "\\"use strict\\"", @@ -67679,35 +75196,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 9, - }, - "start": Object { - "column": 20, - "line": 9, - }, - }, - "range": Array [ - 114, - 115, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 10, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 10, + "column": 0, + "line": 3, }, }, "range": Array [ - 120, - 121, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -67715,53 +75214,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 12, + "column": 6, + "line": 5, }, "start": Object { - "column": 4, - "line": 12, + "column": 0, + "line": 5, }, }, "range": Array [ - 127, - 130, + 32, + 38, ], - "type": "Identifier", - "value": "set", + "type": "Keyword", + "value": "switch", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 12, - }, - "start": Object { "column": 8, - "line": 12, - }, - }, - "range": Array [ - 131, - 134, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 12, + "line": 5, }, "start": Object { - "column": 12, - "line": 12, + "column": 7, + "line": 5, }, }, "range": Array [ - 135, - 136, + 39, + 40, ], "type": "Punctuator", "value": "(", @@ -67769,233 +75250,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 12, - }, - "start": Object { - "column": 13, - "line": 12, - }, - }, - "range": Array [ - 136, - 141, - ], - "type": "Identifier", - "value": "value", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 12, - }, - "start": Object { - "column": 18, - "line": 12, - }, - }, - "range": Array [ - 141, - 142, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 12, - }, - "start": Object { - "column": 20, - "line": 12, - }, - }, - "range": Array [ - 143, - 144, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 13, + "column": 12, + "line": 5, }, "start": Object { "column": 8, - "line": 13, - }, - }, - "range": Array [ - 153, - 165, - ], - "type": "String", - "value": "\\"use strict\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 13, - }, - "start": Object { - "column": 20, - "line": 13, + "line": 5, }, }, "range": Array [ - 165, - 166, + 40, + 44, ], - "type": "Punctuator", - "value": ";", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 14, + "column": 13, + "line": 5, }, "start": Object { - "column": 4, - "line": 14, + "column": 12, + "line": 5, }, }, "range": Array [ - 171, - 172, + 44, + 45, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 16, + "column": 15, + "line": 5, }, "start": Object { - "column": 4, - "line": 16, + "column": 14, + "line": 5, }, }, "range": Array [ - 178, - 184, + 46, + 47, ], - "type": "Identifier", - "value": "method", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 16, + "column": 8, + "line": 6, }, "start": Object { - "column": 11, - "line": 16, + "column": 4, + "line": 6, }, }, "range": Array [ - 185, - 186, + 52, + 56, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "case", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 16, + "column": 14, + "line": 6, }, "start": Object { - "column": 12, - "line": 16, + "column": 9, + "line": 6, }, }, "range": Array [ - 186, - 187, + 57, + 62, ], - "type": "Punctuator", - "value": ")", + "type": "Boolean", + "value": "false", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 16, + "line": 6, }, "start": Object { "column": 14, - "line": 16, + "line": 6, }, }, "range": Array [ - 188, - 189, + 62, + 63, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 17, + "column": 17, + "line": 6, }, "start": Object { - "column": 8, - "line": 17, + "column": 16, + "line": 6, }, }, "range": Array [ - 198, - 210, + 64, + 65, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 17, + "column": 20, + "line": 7, }, "start": Object { - "column": 20, - "line": 17, + "column": 8, + "line": 7, }, }, "range": Array [ - 210, - 211, + 74, + 86, ], - "type": "Punctuator", - "value": ";", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 18, + "line": 8, }, "start": Object { "column": 4, - "line": 18, + "line": 8, }, }, "range": Array [ - 216, - 217, + 91, + 92, ], "type": "Punctuator", "value": "}", @@ -68003,408 +75412,233 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 19, + "column": 11, + "line": 9, }, "start": Object { - "column": 0, - "line": 19, + "column": 4, + "line": 9, }, }, "range": Array [ - 218, - 219, + 97, + 104, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "default", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/directives/function-non-strict.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "directive": "use smth", - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 20, - 30, - ], - "raw": "\\"use smth\\"", - "type": "Literal", - "value": "use smth", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 20, - 30, - ], - "type": "ExpressionStatement", - }, - Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 33, - 34, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "operator": "+", - "range": Array [ - 33, - 36, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 35, - 36, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 33, - 37, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 39, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 12, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 9, }, }, - "params": Array [], "range": Array [ - 0, - 39, + 104, + 105, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ":", }, - }, - "range": Array [ - 0, - 40, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 14, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 13, + "line": 9, }, }, "range": Array [ - 0, - 8, + 106, + 107, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 20, + "line": 10, }, "start": Object { - "column": 9, - "line": 1, + "column": 8, + "line": 10, }, }, "range": Array [ - 9, - 12, + 116, + 128, ], - "type": "Identifier", - "value": "foo", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 5, + "line": 11, }, "start": Object { - "column": 13, - "line": 1, + "column": 4, + "line": 11, }, }, "range": Array [ - 13, - 14, + 133, + 134, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 12, }, "start": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 12, }, }, "range": Array [ - 14, - 15, + 135, + 136, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 5, + "line": 14, }, "start": Object { - "column": 16, - "line": 1, + "column": 0, + "line": 14, }, }, "range": Array [ - 16, - 17, + 138, + 143, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "while", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 7, + "line": 14, }, "start": Object { - "column": 2, - "line": 2, + "column": 6, + "line": 14, }, }, "range": Array [ - 20, - 30, + 144, + 145, ], - "type": "String", - "value": "\\"use smth\\"", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 11, + "line": 14, }, "start": Object { - "column": 2, - "line": 3, + "column": 7, + "line": 14, }, }, "range": Array [ - 33, - 34, + 145, + 149, ], - "type": "Numeric", - "value": "1", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 3, + "column": 12, + "line": 14, }, "start": Object { - "column": 3, - "line": 3, + "column": 11, + "line": 14, }, }, "range": Array [ - 34, - 35, + 149, + 150, ], "type": "Punctuator", - "value": "+", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 14, + "line": 14, }, "start": Object { - "column": 4, - "line": 3, + "column": 13, + "line": 14, }, }, "range": Array [ - 35, - 36, + 151, + 152, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 16, + "line": 15, }, "start": Object { - "column": 5, - "line": 3, + "column": 4, + "line": 15, }, }, "range": Array [ - 36, - 37, + 157, + 169, ], - "type": "Punctuator", - "value": ";", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 16, }, "start": Object { "column": 0, - "line": 4, + "line": 16, }, }, "range": Array [ - 38, - 39, + 170, + 171, ], "type": "Punctuator", "value": "}", @@ -68414,70 +75648,34 @@ Object { } `; -exports[`javascript fixtures/directives/non-directive-string.src 1`] = ` +exports[`javascript fixtures/directives/program.src 1`] = ` Object { "body": Array [ Object { - "alternate": null, - "consequent": Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 16, - 28, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 16, - 28, - ], - "type": "ExpressionStatement", - }, - ], + "directive": "use strict", + "expression": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 10, + "column": 0, "line": 1, }, }, "range": Array [ - 10, - 30, + 0, + 12, ], - "type": "BlockStatement", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 13, + "line": 1, }, "start": Object { "column": 0, @@ -68486,331 +75684,125 @@ Object { }, "range": Array [ 0, - 30, + 13, ], - "test": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 8, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, - "type": "IfStatement", + "type": "ExpressionStatement", }, Object { - "cases": Array [ + "declarations": Array [ Object { - "consequent": Array [ - Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 74, - 86, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 74, - 86, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 16, - "line": 6, - }, + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, }, - "range": Array [ - 64, - 92, - ], - "type": "BlockStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 6, }, + "name": "a", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", }, - "range": Array [ - 52, - 92, - ], - "test": Object { + "init": Object { "loc": Object { "end": Object { - "column": 14, - "line": 6, + "column": 9, + "line": 2, }, "start": Object { - "column": 9, - "line": 6, + "column": 8, + "line": 2, }, }, "range": Array [ - 57, - 62, + 22, + 23, ], - "raw": "false", + "raw": "1", "type": "Literal", - "value": false, + "value": 1, }, - "type": "SwitchCase", - }, - Object { - "consequent": Array [ - Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 10, - }, - "start": Object { - "column": 8, - "line": 10, - }, - }, - "range": Array [ - 116, - 128, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 10, - }, - "start": Object { - "column": 8, - "line": 10, - }, - }, - "range": Array [ - 116, - 128, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 11, - }, - "start": Object { - "column": 13, - "line": 9, - }, - }, - "range": Array [ - 106, - 134, - ], - "type": "BlockStatement", - }, - ], "loc": Object { "end": Object { - "column": 5, - "line": 11, + "column": 9, + "line": 2, }, "start": Object { "column": 4, - "line": 9, + "line": 2, }, }, "range": Array [ - 97, - 134, + 18, + 23, ], - "test": null, - "type": "SwitchCase", + "type": "VariableDeclarator", }, ], - "discriminant": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "range": Array [ - 40, - 44, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 12, + "column": 10, + "line": 2, }, "start": Object { "column": 0, - "line": 5, + "line": 2, }, }, "range": Array [ - 32, - 136, + 14, + 24, ], - "type": "SwitchStatement", + "type": "VariableDeclaration", }, Object { - "body": Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 15, - }, - "start": Object { - "column": 4, - "line": 15, - }, - }, - "range": Array [ - 157, - 169, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 15, - }, - "start": Object { - "column": 4, - "line": 15, - }, - }, - "range": Array [ - 157, - 169, - ], - "type": "ExpressionStatement", - }, - ], + "expression": Object { "loc": Object { "end": Object { - "column": 1, - "line": 16, + "column": 12, + "line": 3, }, "start": Object { - "column": 13, - "line": 14, + "column": 0, + "line": 3, }, }, "range": Array [ - 151, - 171, + 25, + 37, ], - "type": "BlockStatement", + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, "loc": Object { "end": Object { - "column": 1, - "line": 16, + "column": 13, + "line": 3, }, "start": Object { "column": 0, - "line": 14, + "line": 3, }, }, "range": Array [ - 138, - 171, + 25, + 38, ], - "test": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 14, - }, - "start": Object { - "column": 7, - "line": 14, - }, - }, - "range": Array [ - 145, - 149, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, - "type": "WhileStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 17, + "line": 4, }, "start": Object { "column": 0, @@ -68819,14 +75811,14 @@ Object { }, "range": Array [ 0, - 172, + 39, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, + "column": 12, "line": 1, }, "start": Object { @@ -68836,711 +75828,941 @@ Object { }, "range": Array [ 0, - 2, + 12, ], - "type": "Keyword", - "value": "if", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 13, "line": 1, }, "start": Object { - "column": 3, + "column": 12, "line": 1, }, }, "range": Array [ - 3, - 4, + 12, + 13, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 4, - 8, + 14, + 17, ], - "type": "Boolean", - "value": "true", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 8, - 9, + 18, + 19, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 10, - 11, + 20, + 21, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 9, "line": 2, }, "start": Object { - "column": 4, + "column": 8, "line": 2, }, }, "range": Array [ - 16, - 28, + 22, + 23, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 10, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 9, + "line": 2, }, }, "range": Array [ - 29, - 30, + 23, + 24, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 5, + "column": 12, + "line": 3, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 32, - 38, + 25, + 37, ], - "type": "Keyword", - "value": "switch", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 13, + "line": 3, }, "start": Object { - "column": 7, - "line": 5, + "column": 12, + "line": 3, }, }, "range": Array [ - 39, - 40, + 37, + 38, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/directives/program-order.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 5, + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", }, - "range": Array [ - 40, - 44, - ], - "type": "Boolean", - "value": "true", - }, - Object { "loc": Object { "end": Object { "column": 13, - "line": 5, + "line": 1, }, "start": Object { - "column": 12, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 44, - 45, + 0, + 13, ], - "type": "Punctuator", - "value": ")", + "type": "ExpressionStatement", }, Object { + "directive": "use loose", + "expression": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "raw": "\\"use loose\\"", + "type": "Literal", + "value": "use loose", + }, "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 12, + "line": 2, }, "start": Object { - "column": 14, - "line": 5, + "column": 0, + "line": 2, }, }, "range": Array [ - 46, - 47, + 14, + 26, ], - "type": "Punctuator", - "value": "{", + "type": "ExpressionStatement", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 6, + "line": 3, }, "start": Object { - "column": 4, - "line": 6, + "column": 0, + "line": 3, }, }, "range": Array [ - 52, - 56, + 27, + 33, ], - "type": "Keyword", - "value": "case", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 14, - "line": 6, + "column": 12, + "line": 1, }, "start": Object { - "column": 9, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 57, - 62, + 0, + 12, ], - "type": "Boolean", - "value": "false", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 6, + "column": 13, + "line": 1, }, "start": Object { - "column": 14, - "line": 6, + "column": 12, + "line": 1, }, }, "range": Array [ - 62, - 63, + 12, + 13, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 11, + "line": 2, }, "start": Object { - "column": 16, - "line": 6, + "column": 0, + "line": 2, }, }, "range": Array [ - 64, - 65, + 14, + 25, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"use loose\\"", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 7, + "column": 12, + "line": 2, }, "start": Object { - "column": 8, - "line": 7, + "column": 11, + "line": 2, }, }, "range": Array [ - 74, - 86, + 25, + 26, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 8, + "column": 3, + "line": 3, }, "start": Object { - "column": 4, - "line": 8, + "column": 0, + "line": 3, }, }, "range": Array [ - 91, - 92, + 27, + 30, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 9, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 9, + "line": 3, }, }, "range": Array [ - 97, - 104, + 31, + 32, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 9, + "column": 6, + "line": 3, }, "start": Object { - "column": 11, - "line": 9, + "column": 5, + "line": 3, }, }, "range": Array [ - 104, - 105, + 32, + 33, ], "type": "Punctuator", - "value": ":", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/directives/raw.src 1`] = ` +Object { + "body": Array [ Object { + "directive": "use\\\\x20strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "raw": "\\"use\\\\x20strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 14, - "line": 9, + "column": 16, + "line": 1, }, "start": Object { - "column": 13, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 106, - 107, + 0, + 16, ], - "type": "Punctuator", - "value": "{", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 20, - "line": 10, + "column": 15, + "line": 1, }, "start": Object { - "column": 8, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 116, - 128, + 0, + 15, ], "type": "String", - "value": "\\"use strict\\"", + "value": "\\"use\\\\x20strict\\"", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 11, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 11, + "column": 15, + "line": 1, }, }, "range": Array [ - 133, - 134, + 15, + 16, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` +Object { + "body": Array [ Object { + "async": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 1, - "line": 12, + "line": 3, }, "start": Object { "column": 0, - "line": 12, + "line": 1, }, }, + "params": Array [], "range": Array [ - 135, - 136, + 0, + 26, ], - "type": "Punctuator", - "value": "}", + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 5, - "line": 14, + "line": 1, }, "start": Object { "column": 0, - "line": 14, + "line": 1, }, }, "range": Array [ - 138, - 143, + 0, + 5, ], - "type": "Keyword", - "value": "while", + "type": "Identifier", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 14, + "column": 14, + "line": 1, }, "start": Object { "column": 6, - "line": 14, + "line": 1, }, }, "range": Array [ - 144, - 145, + 6, + 14, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 14, + "column": 15, + "line": 1, }, "start": Object { - "column": 7, - "line": 14, + "column": 14, + "line": 1, }, }, "range": Array [ - 145, - 149, + 14, + 15, ], - "type": "Boolean", - "value": "true", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 14, + "column": 19, + "line": 1, }, "start": Object { - "column": 11, - "line": 14, + "column": 16, + "line": 1, }, }, "range": Array [ - 149, - 150, + 16, + 19, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 14, + "column": 20, + "line": 1, }, "start": Object { - "column": 13, - "line": 14, + "column": 19, + "line": 1, }, }, "range": Array [ - 151, - 152, + 19, + 20, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 15, + "column": 21, + "line": 1, }, "start": Object { - "column": 4, - "line": 15, + "column": 20, + "line": 1, }, }, "range": Array [ - 157, - 169, + 20, + 21, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 16, + "column": 23, + "line": 1, }, "start": Object { - "column": 0, - "line": 16, + "column": 22, + "line": 1, }, }, "range": Array [ - 170, - 171, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/directives/program.src 1`] = ` -Object { - "body": Array [ Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, "loc": Object { - "end": Object { - "column": 13, - "line": 1, + "end": Object { + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 1, + "line": 3, }, }, "range": Array [ - 0, - 13, + 25, + 26, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` +Object { + "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "await": true, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 59, + 67, + ], + "type": "BlockStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "item", + "range": Array [ + 44, + 48, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 44, + 48, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 38, + 48, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { "column": 5, - "line": 2, + "line": 4, }, "start": Object { "column": 4, "line": 2, }, }, - "name": "a", "range": Array [ - 18, - 19, + 27, + 67, ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, + "right": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, }, + "name": "items", + "range": Array [ + 52, + 57, + ], + "type": "Identifier", }, - "range": Array [ - 22, - 23, - ], - "raw": "1", - "type": "Literal", - "value": 1, + "type": "ForOfStatement", }, - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 21, + "line": 1, }, - "range": Array [ - 18, - 23, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, }, + "range": Array [ + 21, + 69, + ], + "type": "BlockStatement", }, - "range": Array [ - 14, - 24, - ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 15, + "line": 1, }, }, + "name": "foo", "range": Array [ - 25, - 37, + 15, + 18, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 1, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, + "params": Array [], "range": Array [ - 25, - 38, + 0, + 69, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -69549,14 +76771,14 @@ Object { }, "range": Array [ 0, - 39, + 70, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 5, "line": 1, }, "start": Object { @@ -69566,146 +76788,146 @@ Object { }, "range": Array [ 0, - 12, + 5, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 6, "line": 1, }, }, "range": Array [ - 12, - 13, + 6, + 14, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 14, - 17, + 15, + 18, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ 18, 19, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ + 19, 20, - 21, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ + 21, 22, - 23, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 2, }, "start": Object { - "column": 9, + "column": 4, "line": 2, }, }, "range": Array [ - 23, - 24, + 27, + 30, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 13, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 8, + "line": 2, }, }, "range": Array [ - 25, - 37, + 31, + 36, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "await", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 15, + "line": 2, }, "start": Object { - "column": 12, - "line": 3, + "column": 14, + "line": 2, }, }, "range": Array [ @@ -69713,303 +76935,276 @@ Object { 38, ], "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/directives/program-order.src 1`] = ` -Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "ExpressionStatement", + "value": "(", }, Object { - "directive": "use loose", - "expression": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 14, - 25, - ], - "raw": "\\"use loose\\"", - "type": "Literal", - "value": "use loose", - }, "loc": Object { "end": Object { - "column": 12, + "column": 20, "line": 2, }, "start": Object { - "column": 0, + "column": 15, "line": 2, }, }, "range": Array [ - 14, - 26, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 27, - 33, + 38, + 43, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Keyword", + "value": "const", }, - }, - "range": Array [ - 0, - 34, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 0, - 12, + 44, + 48, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "item", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 12, - 13, + 49, + 51, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 34, "line": 2, }, "start": Object { - "column": 0, + "column": 29, "line": 2, }, }, "range": Array [ - 14, - 25, + 52, + 57, ], - "type": "String", - "value": "\\"use loose\\"", + "type": "Identifier", + "value": "items", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 35, "line": 2, }, "start": Object { - "column": 11, + "column": 34, "line": 2, }, }, "range": Array [ - 25, - 26, + 57, + 58, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 37, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 36, + "line": 2, }, }, "range": Array [ - 27, - 30, + 59, + 60, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { "column": 4, - "line": 3, + "line": 4, }, }, "range": Array [ - 31, - 32, + 66, + 67, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 1, + "line": 5, }, "start": Object { - "column": 5, - "line": 3, + "column": 0, + "line": 5, }, }, "range": Array [ - 32, - 33, + 68, + 69, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/directives/raw.src 1`] = ` +exports[`javascript fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` Object { "body": Array [ Object { - "directive": "use\\\\x20strict", "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "main", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Import", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "CallExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "then", + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 18, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 15, + "column": 24, "line": 1, }, "start": Object { @@ -70019,15 +77214,13 @@ Object { }, "range": Array [ 0, - 15, + 24, ], - "raw": "\\"use\\\\x20strict\\"", - "type": "Literal", - "value": "use strict", + "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { @@ -70037,7 +77230,7 @@ Object { }, "range": Array [ 0, - 16, + 25, ], "type": "ExpressionStatement", }, @@ -70054,14 +77247,14 @@ Object { }, "range": Array [ 0, - 17, + 26, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 15, + "column": 6, "line": 1, }, "start": Object { @@ -70071,128 +77264,64 @@ Object { }, "range": Array [ 0, - 15, + 6, ], - "type": "String", - "value": "\\"use\\\\x20strict\\"", + "type": "Keyword", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 7, "line": 1, }, "start": Object { - "column": 15, + "column": 6, "line": 1, }, }, "range": Array [ - 15, - 16, + 6, + 7, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalAsyncIteration/async-generators.src 1`] = ` -Object { - "body": Array [ Object { - "async": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, - "params": Array [], "range": Array [ - 0, - 26, + 7, + 12, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "String", + "value": "'foo'", }, - }, - "range": Array [ - 0, - 27, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, - 5, + 12, + 13, ], - "type": "Identifier", - "value": "async", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -70201,21 +77330,21 @@ Object { "line": 1, }, "start": Object { - "column": 6, + "column": 13, "line": 1, }, }, "range": Array [ - 6, + 13, 14, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { @@ -70225,65 +77354,29 @@ Object { }, "range": Array [ 14, - 15, - ], - "type": "Punctuator", - "value": "*", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 19, + 18, ], "type": "Identifier", - "value": "foo", + "value": "then", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { - "column": 19, + "column": 18, "line": 1, }, }, "range": Array [ + 18, 19, - 20, ], "type": "Punctuator", "value": "(", }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ")", - }, Object { "loc": Object { "end": Object { @@ -70291,171 +77384,78 @@ Object { "line": 1, }, "start": Object { - "column": 22, + "column": 19, "line": 1, }, }, "range": Array [ - 22, + 19, 23, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "main", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalAsyncIteration/async-iterator.src 1`] = ` -Object { - "body": Array [ - Object { - "async": true, - "body": Object { - "body": Array [ - Object { - "await": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 36, - "line": 2, - }, - }, - "range": Array [ - 59, - 67, - ], - "type": "BlockStatement", - }, - "left": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "name": "item", - "range": Array [ - 44, - 48, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 44, - 48, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 38, - 48, - ], - "type": "VariableDeclaration", - }, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 27, - 67, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 2, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "name": "items", - "range": Array [ - 52, - 57, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", - }, - ], + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 24, + "line": 1, }, "start": Object { - "column": 21, + "column": 22, "line": 1, }, }, "range": Array [ - 21, - 69, + 22, + 24, ], "type": "BlockStatement", }, @@ -70464,35 +77464,147 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 18, + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, - "name": "foo", + "name": "c", "range": Array [ - 15, - 18, + 9, + 10, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 24, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [], + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 12, + 13, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 11, + 20, + ], + "type": "ObjectPattern", + }, + ], "range": Array [ 0, - 69, + 24, ], "type": "FunctionDeclaration", }, @@ -70500,7 +77612,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -70509,14 +77621,14 @@ Object { }, "range": Array [ 0, - 70, + 25, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -70526,25 +77638,7 @@ Object { }, "range": Array [ 0, - 5, - ], - "type": "Identifier", - "value": "async", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 14, + 8, ], "type": "Keyword", "value": "function", @@ -70552,35 +77646,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 10, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 18, + 9, + 10, ], "type": "Identifier", - "value": "foo", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 11, "line": 1, }, "start": Object { - "column": 18, + "column": 10, "line": 1, }, }, "range": Array [ - 18, - 19, + 10, + 11, ], "type": "Punctuator", "value": "(", @@ -70588,179 +77682,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 21, + "column": 11, "line": 1, }, }, "range": Array [ - 21, - 22, + 11, + 12, ], "type": "Punctuator", "value": "{", }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 27, - 30, - ], - "type": "Keyword", - "value": "for", - }, Object { "loc": Object { "end": Object { "column": 13, - "line": 2, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 31, - 36, + 12, + 13, ], "type": "Identifier", - "value": "await", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 37, - 38, + 13, + 14, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { "column": 15, - "line": 2, - }, - }, - "range": Array [ - 38, - 43, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, + "line": 1, }, }, "range": Array [ - 44, - 48, + 15, + 18, ], - "type": "Identifier", - "value": "item", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 26, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 49, - 51, + 18, + 19, ], "type": "Identifier", - "value": "of", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 29, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 52, - 57, + 19, + 20, ], - "type": "Identifier", - "value": "items", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 34, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 57, - 58, + 20, + 21, ], "type": "Punctuator", "value": ")", @@ -70768,17 +77808,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 37, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 36, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 59, - 60, + 22, + 23, ], "type": "Punctuator", "value": "{", @@ -70786,35 +77826,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 66, - 67, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, + "column": 24, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 23, + "line": 1, }, }, "range": Array [ - 68, - 69, + 23, + 24, ], "type": "Punctuator", "value": "}", @@ -70824,141 +77846,253 @@ Object { } `; -exports[`javascript fixtures/experimentalDynamicImport/dynamic-import.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` Object { "body": Array [ Object { "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, + "left": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", }, - "start": Object { - "column": 19, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 3, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, }, + "range": Array [ + 5, + 9, + ], + "type": "RestElement", }, - "name": "main", - "range": Array [ - 19, - 23, - ], - "type": "Identifier", + ], + "range": Array [ + 1, + 10, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, }, + }, + "operator": "=", + "range": Array [ + 1, + 22, ], - "callee": Object { - "computed": false, + "right": Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 13, "line": 1, }, }, - "object": Object { - "arguments": Array [ - Object { + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { - "column": 7, + "column": 14, "line": 1, }, }, + "name": "a", "range": Array [ - 7, - 12, + 14, + 15, ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", + "type": "Identifier", }, - ], - "callee": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 6, + "column": 15, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, + "method": false, "range": Array [ - 0, - 6, + 14, + 15, ], - "type": "Import", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", }, }, - "range": Array [ - 0, - 13, - ], - "type": "CallExpression", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", }, - "start": Object { - "column": 14, - "line": 1, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, }, + "range": Array [ + 17, + 21, + ], + "type": "SpreadElement", }, - "name": "then", - "range": Array [ - 14, - 18, - ], - "type": "Identifier", - }, + ], "range": Array [ - 0, - 18, + 13, + 22, ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "ObjectExpression", }, - "range": Array [ - 0, - 24, - ], - "type": "CallExpression", + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 25, + "column": 23, "line": 1, }, "start": Object { @@ -70968,7 +78102,7 @@ Object { }, "range": Array [ 0, - 25, + 23, ], "type": "ExpressionStatement", }, @@ -70985,14 +78119,14 @@ Object { }, "range": Array [ 0, - 26, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 1, "line": 1, }, "start": Object { @@ -71002,64 +78136,136 @@ Object { }, "range": Array [ 0, - 6, + 1, ], - "type": "Keyword", - "value": "import", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 2, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, "range": Array [ - 6, - 7, + 1, + 2, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 3, "line": 1, }, "start": Object { - "column": 7, + "column": 2, "line": 1, }, }, "range": Array [ - 7, - 12, + 2, + 3, ], - "type": "String", - "value": "'foo'", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, "line": 1, }, "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { "column": 12, "line": 1, }, + "start": Object { + "column": 11, + "line": 1, + }, }, "range": Array [ + 11, 12, - 13, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { @@ -71077,12 +78283,12 @@ Object { 14, ], "type": "Punctuator", - "value": ".", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { @@ -71092,89 +78298,107 @@ Object { }, "range": Array [ 14, - 18, + 15, ], "type": "Identifier", - "value": "then", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 16, "line": 1, }, "start": Object { - "column": 18, + "column": 15, "line": 1, }, }, "range": Array [ - 18, - 19, + 15, + 16, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { - "column": 19, + "column": 17, "line": 1, }, }, "range": Array [ - 19, - 23, + 17, + 20, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, ], "type": "Identifier", - "value": "main", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 22, "line": 1, }, "start": Object { - "column": 23, + "column": 21, "line": 1, }, }, "range": Array [ - 23, - 24, + 21, + 22, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 23, "line": 1, }, "start": Object { - "column": 24, + "column": 22, "line": 1, }, }, "range": Array [ - 24, - 25, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": ")", }, ], "type": "Program", } `; -exports[`javascript fixtures/experimentalObjectRestSpread/arg-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` Object { "body": Array [ Object { @@ -71183,17 +78407,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 24, + "column": 26, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, "range": Array [ - 22, - 24, + 23, + 26, ], "type": "BlockStatement", }, @@ -71202,7 +78426,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -71210,16 +78434,16 @@ Object { "line": 1, }, }, - "name": "c", + "name": "foo", "range": Array [ 9, - 10, + 12, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 24, + "column": 26, "line": 1, }, "start": Object { @@ -71231,118 +78455,61 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 12, - 13, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - }, Object { "argument": Object { "loc": Object { "end": Object { - "column": 19, + "column": 20, "line": 1, }, "start": Object { - "column": 18, + "column": 17, "line": 1, }, }, - "name": "b", + "name": "bar", "range": Array [ - 18, - 19, + 17, + 20, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 19, + "column": 20, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ - 15, - 19, + 14, + 20, ], "type": "RestElement", }, ], "range": Array [ - 11, - 20, + 13, + 21, ], "type": "ObjectPattern", }, ], "range": Array [ 0, - 24, + 26, ], "type": "FunctionDeclaration", }, @@ -71353,69 +78520,33 @@ Object { "line": 2, }, "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 25, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "c", + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 10, + "column": 0, "line": 1, }, }, "range": Array [ - 10, - 11, + 0, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -71424,16 +78555,16 @@ Object { "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, + 9, 12, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -71450,8 +78581,8 @@ Object { 12, 13, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -71469,22 +78600,22 @@ Object { 14, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ - 15, - 18, + 14, + 17, ], "type": "Punctuator", "value": "...", @@ -71492,35 +78623,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 20, "line": 1, }, "start": Object { - "column": 18, + "column": 17, "line": 1, }, }, "range": Array [ - 18, - 19, + 17, + 20, ], "type": "Identifier", - "value": "b", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { - "column": 19, + "column": 20, "line": 1, }, }, "range": Array [ - 19, 20, + 21, ], "type": "Punctuator", "value": "}", @@ -71528,17 +78659,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 22, "line": 1, }, "start": Object { - "column": 20, + "column": 21, "line": 1, }, }, "range": Array [ - 20, 21, + 22, ], "type": "Punctuator", "value": ")", @@ -71546,17 +78677,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 1, }, "start": Object { - "column": 22, + "column": 23, "line": 1, }, }, "range": Array [ - 22, 23, + 24, ], "type": "Punctuator", "value": "{", @@ -71564,17 +78695,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 26, "line": 1, }, "start": Object { - "column": 23, + "column": 25, "line": 1, }, }, "range": Array [ - 23, - 24, + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -71584,253 +78715,221 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; + +exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, - "name": "a", + "method": false, "range": Array [ - 2, - 3, + 6, + 7, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", }, }, - "method": false, - "range": Array [ - 2, - 3, - ], - "shorthand": true, - "type": "Property", - "value": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 3, + "column": 10, "line": 1, }, "start": Object { - "column": 2, + "column": 9, "line": 1, }, }, - "name": "a", + "method": false, "range": Array [ - 2, - 3, + 9, + 10, ], - "type": "Identifier", + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, }, - }, - Object { - "argument": Object { + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 12, "line": 1, }, }, - "name": "b", "range": Array [ - 8, - 9, + 12, + 16, ], - "type": "Identifier", + "type": "RestElement", }, - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, + ], + "range": Array [ + 4, + 19, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, }, - "range": Array [ - 5, - 9, - ], - "type": "RestElement", }, - ], - "range": Array [ - 1, - 10, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, + "name": "foo", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", }, - }, - "operator": "=", - "range": Array [ - 1, - 22, - ], - "right": Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 13, + "column": 4, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 14, - 15, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 21, - ], - "type": "SpreadElement", - }, - ], "range": Array [ - 13, - 22, + 4, + 25, ], - "type": "ObjectExpression", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 23, + "column": 26, "line": 1, }, "start": Object { @@ -71840,9 +78939,9 @@ Object { }, "range": Array [ 0, - 23, + 26, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { @@ -71857,14 +78956,14 @@ Object { }, "range": Array [ 0, - 24, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -71874,25 +78973,25 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 5, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, "range": Array [ - 1, - 2, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -71900,35 +78999,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, "range": Array [ - 2, - 3, + 6, + 7, ], "type": "Identifier", - "value": "a", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 8, "line": 1, }, "start": Object { - "column": 3, + "column": 7, "line": 1, }, }, "range": Array [ - 3, - 4, + 7, + 8, ], "type": "Punctuator", "value": ",", @@ -71936,338 +79035,700 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 8, + 9, + 10, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 15, "line": 1, }, }, "range": Array [ - 9, - 10, + 15, + 16, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 17, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 17, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 19, "line": 1, }, "start": Object { - "column": 13, + "column": 18, "line": 1, }, }, "range": Array [ - 13, - 14, + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 21, "line": 1, }, "start": Object { - "column": 14, + "column": 20, "line": 1, }, }, "range": Array [ - 14, - 15, + 20, + 21, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 22, "line": 1, }, }, "range": Array [ - 15, - 16, + 22, + 25, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 26, "line": 1, }, "start": Object { - "column": 17, + "column": 25, "line": 1, }, }, "range": Array [ - 17, - 20, + 25, + 26, ], "type": "Punctuator", - "value": "...", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 9, + 10, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 16, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 4, + 18, + ], + "type": "ObjectPattern", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 23, + 27, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 29, + 33, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 35, + 39, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 41, + 42, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 41, + 45, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "raw": "4", + "type": "Literal", + "value": 4, + }, + }, + ], + "range": Array [ + 21, + 47, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 47, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 21, + "column": 48, "line": 1, }, "start": Object { - "column": 20, + "column": 0, "line": 1, }, }, "range": Array [ - 20, - 21, + 0, + 48, ], - "type": "Identifier", - "value": "b", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 3, "line": 1, }, "start": Object { - "column": 21, + "column": 0, "line": 1, }, }, "range": Array [ - 21, - 22, + 0, + 3, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 5, "line": 1, }, "start": Object { - "column": 22, + "column": 4, "line": 1, }, }, "range": Array [ - 22, - 23, + 4, + 5, ], "type": "Punctuator", - "value": ")", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 26, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 6, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "properties": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 20, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 13, - 21, - ], - "type": "ObjectPattern", - }, - ], "range": Array [ - 0, - 26, + 6, + 7, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "x", }, - }, - "range": Array [ - 0, - 27, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { @@ -72275,21 +79736,21 @@ Object { "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, + 7, 8, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { @@ -72299,69 +79760,69 @@ Object { }, "range": Array [ 9, - 12, + 10, ], "type": "Identifier", - "value": "foo", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 1, }, "start": Object { - "column": 12, + "column": 10, "line": 1, }, }, "range": Array [ - 12, - 13, + 10, + 11, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ - 13, - 14, + 12, + 15, ], "type": "Punctuator", - "value": "{", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, - 17, + 15, + 16, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { @@ -72371,28 +79832,28 @@ Object { }, "range": Array [ 17, - 20, + 18, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { - "column": 20, + "column": 19, "line": 1, }, }, "range": Array [ + 19, 20, - 21, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { @@ -72410,7 +79871,7 @@ Object { 22, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { @@ -72427,345 +79888,131 @@ Object { 23, 24, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 25, "line": 1, }, "start": Object { - "column": 25, + "column": 24, "line": 1, }, }, "range": Array [ + 24, 25, - 26, ], "type": "Punctuator", - "value": "}", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest.src 1`] = `"',' expected."`; - -exports[`javascript fixtures/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 6, - 7, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 9, - 10, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 16, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 4, - 19, - ], - "type": "ObjectPattern", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 25, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 26, + "column": 27, "line": 1, }, "start": Object { - "column": 0, + "column": 26, "line": 1, }, }, "range": Array [ - 0, 26, + 27, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "type": "Numeric", + "value": "1", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 27, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 30, "line": 1, }, "start": Object { - "column": 0, + "column": 29, "line": 1, }, }, "range": Array [ - 0, - 3, + 29, + 30, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 31, "line": 1, }, "start": Object { - "column": 4, + "column": 30, "line": 1, }, }, "range": Array [ - 4, - 5, + 30, + 31, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 33, "line": 1, }, "start": Object { - "column": 6, + "column": 32, "line": 1, }, }, "range": Array [ - 6, - 7, + 32, + 33, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 34, "line": 1, }, "start": Object { - "column": 7, + "column": 33, "line": 1, }, }, "range": Array [ - 7, - 8, + 33, + 34, ], "type": "Punctuator", "value": ",", @@ -72773,161 +80020,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 36, "line": 1, }, "start": Object { - "column": 9, + "column": 35, "line": 1, }, }, "range": Array [ - 9, - 10, + 35, + 36, ], "type": "Identifier", - "value": "y", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 37, "line": 1, }, "start": Object { - "column": 10, + "column": 36, "line": 1, }, }, "range": Array [ - 10, - 11, + 36, + 37, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 39, "line": 1, }, "start": Object { - "column": 12, + "column": 38, "line": 1, }, }, "range": Array [ - 12, - 15, + 38, + 39, ], - "type": "Punctuator", - "value": "...", + "type": "Numeric", + "value": "3", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 40, "line": 1, }, "start": Object { - "column": 15, + "column": 39, "line": 1, }, }, "range": Array [ - 15, - 16, + 39, + 40, ], - "type": "Identifier", - "value": "z", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 42, "line": 1, }, "start": Object { - "column": 16, + "column": 41, "line": 1, }, }, "range": Array [ - 16, - 17, + 41, + 42, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 43, "line": 1, }, "start": Object { - "column": 18, + "column": 42, "line": 1, }, }, "range": Array [ - 18, - 19, + 42, + 43, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 45, "line": 1, }, "start": Object { - "column": 20, + "column": 44, "line": 1, }, }, "range": Array [ - 20, - 21, + 44, + 45, ], - "type": "Punctuator", - "value": "=", + "type": "Numeric", + "value": "4", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 47, "line": 1, }, "start": Object { - "column": 22, + "column": 46, "line": 1, }, }, "range": Array [ - 22, - 25, + 46, + 47, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 48, "line": 1, }, "start": Object { - "column": 25, + "column": 47, "line": 1, }, }, "range": Array [ - 25, - 26, + 47, + 48, ], "type": "Punctuator", "value": ";", @@ -72937,7 +80184,7 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/object-rest.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` Object { "body": Array [ Object { @@ -72946,7 +80193,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 18, + "column": 7, "line": 1, }, "start": Object { @@ -72954,172 +80201,150 @@ Object { "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 6, - 7, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 9, - 10, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, + "start": Object { + "column": 4, + "line": 2, }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 16, - ], - "type": "RestElement", + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, }, + }, + "name": "set", + "range": Array [ + 22, + 25, ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", "range": Array [ - 4, - 18, + 32, + 33, ], - "type": "ObjectPattern", + "type": "Identifier", }, "init": Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, "start": Object { - "column": 21, - "line": 1, + "column": 8, + "line": 5, }, }, "properties": Array [ @@ -73128,115 +80353,56 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 23, - 27, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, + "column": 7, + "line": 6, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 6, }, }, - "name": "y", + "name": "foo", "range": Array [ - 29, - 30, + 42, + 45, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 6, }, }, "method": false, "range": Array [ - 29, - 33, + 42, + 50, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 32, - "line": 1, + "column": 9, + "line": 6, }, }, + "name": "foo", "range": Array [ - 32, - 33, + 47, + 50, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "Identifier", }, }, Object { @@ -73244,137 +80410,149 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 7, + "line": 7, }, "start": Object { - "column": 35, - "line": 1, + "column": 4, + "line": 7, }, }, - "name": "a", + "name": "get", "range": Array [ - 35, - 36, + 56, + 59, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 35, - "line": 1, + "column": 4, + "line": 7, }, }, "method": false, "range": Array [ - 35, - 39, + 56, + 64, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 38, - "line": 1, + "column": 9, + "line": 7, }, }, + "name": "get", "range": Array [ - 38, - 39, + 61, + 64, ], - "raw": "3", - "type": "Literal", - "value": 3, + "type": "Identifier", }, }, Object { - "computed": false, - "key": Object { + "argument": Object { + "computed": false, "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 41, - "line": 1, + "column": 7, + "line": 8, }, }, - "name": "b", + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 73, + 76, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "name": "foo", + "range": Array [ + 77, + 80, + ], + "type": "Identifier", + }, "range": Array [ - 41, - 42, + 73, + 80, ], - "type": "Identifier", + "type": "MemberExpression", }, - "kind": "init", "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 41, - "line": 1, + "column": 4, + "line": 8, }, }, - "method": false, "range": Array [ - 41, - 45, + 70, + 80, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 44, - "line": 1, - }, - }, - "range": Array [ - 44, - 45, - ], - "raw": "4", - "type": "Literal", - "value": 4, - }, + "type": "SpreadElement", }, ], "range": Array [ - 21, - 47, + 36, + 82, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "range": Array [ - 4, - 47, + 32, + 82, ], "type": "VariableDeclarator", }, @@ -73382,17 +80560,17 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 2, + "line": 9, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 48, + 28, + 83, ], "type": "VariableDeclaration", }, @@ -73400,7 +80578,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 10, }, "start": Object { "column": 0, @@ -73409,7 +80587,7 @@ Object { }, "range": Array [ 0, - 49, + 84, ], "sourceType": "script", "tokens": Array [ @@ -73434,7 +80612,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -73444,28 +80622,10 @@ Object { }, "range": Array [ 4, - 5, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, 7, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { @@ -73488,35 +80648,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 10, + 13, + 16, ], "type": "Identifier", - "value": "y", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 10, - 11, + 16, + 17, ], "type": "Punctuator", "value": ",", @@ -73524,377 +80684,341 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 15, - ], - "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 15, - 16, + 22, + 25, ], "type": "Identifier", - "value": "z", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 8, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 3, }, }, "range": Array [ - 17, - 18, + 25, + 26, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 19, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 19, - 20, + 28, + 31, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 5, + "line": 5, }, "start": Object { - "column": 21, - "line": 1, + "column": 4, + "line": 5, }, }, "range": Array [ - 21, - 22, + 32, + 33, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 23, - "line": 1, + "column": 6, + "line": 5, }, }, "range": Array [ - 23, - 24, + 34, + 35, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 24, - 25, + 36, + 37, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 7, + "line": 6, }, "start": Object { - "column": 26, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 26, - 27, + 42, + 45, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 8, + "line": 6, }, "start": Object { - "column": 27, - "line": 1, + "column": 7, + "line": 6, }, }, "range": Array [ - 27, - 28, + 45, + 46, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 29, - "line": 1, + "column": 9, + "line": 6, }, }, "range": Array [ - 29, - 30, + 47, + 50, ], "type": "Identifier", - "value": "y", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 13, + "line": 6, }, "start": Object { - "column": 30, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 30, - 31, + 50, + 51, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 7, + "line": 7, }, "start": Object { - "column": 32, - "line": 1, + "column": 4, + "line": 7, }, }, "range": Array [ - 32, - 33, + 56, + 59, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 8, + "line": 7, }, "start": Object { - "column": 33, - "line": 1, + "column": 7, + "line": 7, }, }, "range": Array [ - 33, - 34, + 59, + 60, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 35, - "line": 1, + "column": 9, + "line": 7, }, }, "range": Array [ - 35, - 36, + 61, + 64, ], "type": "Identifier", - "value": "a", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 13, + "line": 7, }, "start": Object { - "column": 36, - "line": 1, + "column": 12, + "line": 7, }, }, "range": Array [ - 36, - 37, + 64, + 65, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Numeric", - "value": "3", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 7, + "line": 8, }, "start": Object { - "column": 39, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 39, - 40, + 70, + 73, ], "type": "Punctuator", - "value": ",", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 10, + "line": 8, }, "start": Object { - "column": 41, - "line": 1, + "column": 7, + "line": 8, }, }, "range": Array [ - 41, - 42, + 73, + 76, ], "type": "Identifier", - "value": "b", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 11, + "line": 8, }, "start": Object { - "column": 42, - "line": 1, + "column": 10, + "line": 8, }, }, "range": Array [ - 42, - 43, + 76, + 77, ], "type": "Punctuator", - "value": ":", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 14, + "line": 8, }, "start": Object { - "column": 44, - "line": 1, + "column": 11, + "line": 8, }, }, "range": Array [ - 44, - 45, + 77, + 80, ], - "type": "Numeric", - "value": "4", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, "start": Object { - "column": 46, - "line": 1, + "column": 0, + "line": 9, }, }, "range": Array [ - 46, - 47, + 81, + 82, ], "type": "Punctuator", "value": "}", @@ -73902,17 +81026,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 2, + "line": 9, }, "start": Object { - "column": 47, - "line": 1, + "column": 1, + "line": 9, }, }, "range": Array [ - 47, - 48, + 82, + 83, ], "type": "Punctuator", "value": ";", @@ -73922,401 +81046,298 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/property-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", + "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + "start": Object { + "column": 1, + "line": 1, }, - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "name": "initialize", + "range": Array [ + 7, + 17, + ], + "type": "Identifier", }, - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 22, - 25, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 8, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { + "kind": "init", "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 4, }, "start": Object { "column": 4, - "line": 5, + "line": 2, }, }, - "name": "x", + "method": true, "range": Array [ - 32, - 33, + 7, + 104, ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "init", + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 5, + "line": 4, }, "start": Object { - "column": 4, - "line": 6, + "column": 48, + "line": 2, }, }, - "method": false, "range": Array [ - 42, - 50, + 51, + 104, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, + "type": "BlockStatement", }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 56, - 59, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, }, - "method": false, - "range": Array [ - 56, - 64, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", + "start": Object { + "column": 14, + "line": 2, }, }, - Object { - "argument": Object { - "computed": false, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 46, + "line": 2, }, "start": Object { - "column": 7, - "line": 8, + "column": 15, + "line": 2, }, }, - "object": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 8, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", }, - "start": Object { - "column": 7, - "line": 8, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 19, + 26, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 19, + 26, + ], + "type": "Identifier", }, }, - "name": "set", - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 8, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 28, + 36, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 28, + 36, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 28, + 36, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "name": "options", + "range": Array [ + 41, + 48, + ], + "type": "Identifier", }, - "start": Object { - "column": 11, - "line": 8, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, }, + "range": Array [ + 38, + 48, + ], + "type": "RestElement", }, - "name": "foo", - "range": Array [ - 77, - 80, - ], - "type": "Identifier", - }, + ], "range": Array [ - 73, - 80, + 18, + 49, ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, + "type": "ObjectPattern", }, - "range": Array [ - 70, - 80, - ], - "type": "SpreadElement", - }, - ], - "range": Array [ - 36, - 82, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 5, + ], + "range": Array [ + 17, + 104, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 32, - 82, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 106, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 83, + 0, + 108, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 6, }, "start": Object { "column": 0, @@ -74325,14 +81346,14 @@ Object { }, "range": Array [ 0, - 84, + 109, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -74342,51 +81363,33 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, + 1, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 2, "line": 1, }, "start": Object { - "column": 7, + "column": 1, "line": 1, }, }, "range": Array [ - 7, - 8, + 1, + 2, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 14, "line": 2, }, "start": Object { @@ -74395,386 +81398,278 @@ Object { }, }, "range": Array [ - 13, - 16, + 7, + 17, ], "type": "Identifier", - "value": "get", + "value": "initialize", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 2, }, "start": Object { - "column": 7, + "column": 14, "line": 2, }, }, "range": Array [ - 16, 17, + 18, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - "value": "set", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 16, + "line": 2, }, "start": Object { - "column": 7, - "line": 3, + "column": 15, + "line": 2, }, }, "range": Array [ - 25, - 26, + 18, + 19, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 28, - 31, - ], - "type": "Keyword", - "value": "var", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 23, + "line": 2, }, "start": Object { - "column": 4, - "line": 5, + "column": 16, + "line": 2, }, }, "range": Array [ - 32, - 33, + 19, + 26, ], "type": "Identifier", - "value": "x", + "value": "someVar", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 24, + "line": 2, }, "start": Object { - "column": 6, - "line": 5, + "column": 23, + "line": 2, }, }, "range": Array [ - 34, - 35, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 33, + "line": 2, }, "start": Object { - "column": 8, - "line": 5, + "column": 25, + "line": 2, }, }, "range": Array [ + 28, 36, - 37, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 42, - 45, ], "type": "Identifier", - "value": "foo", + "value": "otherVar", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 34, + "line": 2, }, "start": Object { - "column": 7, - "line": 6, + "column": 33, + "line": 2, }, }, "range": Array [ - 45, - 46, + 36, + 37, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - "value": "foo", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 38, + "line": 2, }, "start": Object { - "column": 12, - "line": 6, + "column": 35, + "line": 2, }, }, "range": Array [ - 50, - 51, + 38, + 41, ], "type": "Punctuator", - "value": ",", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 45, + "line": 2, }, "start": Object { - "column": 4, - "line": 7, + "column": 38, + "line": 2, }, }, "range": Array [ - 56, - 59, + 41, + 48, ], "type": "Identifier", - "value": "get", + "value": "options", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 46, + "line": 2, }, "start": Object { - "column": 7, - "line": 7, + "column": 45, + "line": 2, }, }, "range": Array [ - 59, - 60, + 48, + 49, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 47, + "line": 2, }, "start": Object { - "column": 9, - "line": 7, + "column": 46, + "line": 2, }, }, "range": Array [ - 61, - 64, + 49, + 50, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 49, + "line": 2, }, "start": Object { - "column": 12, - "line": 7, + "column": 48, + "line": 2, }, }, "range": Array [ - 64, - 65, + 51, + 52, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 5, + "line": 4, }, "start": Object { "column": 4, - "line": 8, + "line": 4, }, }, "range": Array [ - 70, - 73, + 103, + 104, ], "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 7, - "line": 8, - }, - }, - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - "value": "set", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 8, + "column": 1, + "line": 5, }, "start": Object { - "column": 10, - "line": 8, + "column": 0, + "line": 5, }, }, "range": Array [ - 76, - 77, + 105, + 106, ], "type": "Punctuator", - "value": ".", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 8, + "column": 2, + "line": 5, }, "start": Object { - "column": 11, - "line": 8, - }, - }, - "range": Array [ - 77, - 80, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { "column": 1, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, + "line": 5, }, }, "range": Array [ - 81, - 82, + 106, + 107, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 3, + "line": 5, }, "start": Object { - "column": 1, - "line": 9, + "column": 2, + "line": 5, }, }, "range": Array [ - 82, - 83, + 107, + 108, ], "type": "Punctuator", "value": ";", @@ -74784,280 +81679,318 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-method-args.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "initialize", - "range": Array [ - 7, - 17, - ], - "type": "Identifier", - }, - "kind": "init", + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 1, }, "start": Object { "column": 4, - "line": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, }, }, - "method": true, - "range": Array [ - 7, - 104, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "initialize", + "range": Array [ + 14, + 24, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { "column": 5, "line": 4, }, "start": Object { - "column": 48, + "column": 4, "line": 2, }, }, + "method": true, "range": Array [ - 51, - 104, + 14, + 111, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "params": Array [ - Object { + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 48, + "line": 2, + }, + }, + "range": Array [ + 58, + 111, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 46, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 15, + "column": 14, "line": 2, }, }, - "properties": Array [ + "params": Array [ Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "someVar", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - "kind": "init", "loc": Object { "end": Object { - "column": 23, + "column": 46, "line": 2, }, "start": Object { - "column": 16, + "column": 15, "line": 2, }, }, - "method": false, - "range": Array [ - 19, - 26, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 26, + 33, + ], + "type": "Identifier", }, - }, - "name": "someVar", - "range": Array [ - 19, - 26, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, }, - "start": Object { - "column": 25, - "line": 2, + "method": false, + "range": Array [ + 26, + 33, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "someVar", + "range": Array [ + 26, + 33, + ], + "type": "Identifier", }, }, - "name": "otherVar", - "range": Array [ - 28, - 36, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 28, - 36, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 35, + 43, + ], + "type": "Identifier", }, - "start": Object { - "column": 25, - "line": 2, + "kind": "init", + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 35, + 43, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "otherVar", + "range": Array [ + 35, + 43, + ], + "type": "Identifier", }, }, - "name": "otherVar", - "range": Array [ - 28, - 36, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 2, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 2, + }, + }, + "name": "options", + "range": Array [ + 48, + 55, + ], + "type": "Identifier", }, - "start": Object { - "column": 38, - "line": 2, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, }, + "range": Array [ + 45, + 55, + ], + "type": "RestElement", }, - "name": "options", - "range": Array [ - 41, - 48, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 35, - "line": 2, - }, - }, + ], "range": Array [ - 38, - 48, + 25, + 56, ], - "type": "RestElement", + "type": "ObjectPattern", }, ], "range": Array [ - 18, - 49, + 24, + 111, ], - "type": "ObjectPattern", + "type": "FunctionExpression", }, - ], - "range": Array [ - 17, - 104, - ], - "type": "FunctionExpression", + }, + ], + "range": Array [ + 8, + 113, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, }, }, - ], - "range": Array [ - 1, - 106, - ], - "type": "ObjectExpression", - }, + "range": Array [ + 4, + 113, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 3, + "column": 2, "line": 5, }, "start": Object { @@ -75067,15 +82000,15 @@ Object { }, "range": Array [ 0, - 108, + 114, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 2, + "line": 5, }, "start": Object { "column": 0, @@ -75084,14 +82017,14 @@ Object { }, "range": Array [ 0, - 109, + 114, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -75101,25 +82034,61 @@ Object { }, "range": Array [ 0, - 1, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 1, }, "start": Object { - "column": 1, + "column": 8, "line": 1, }, }, "range": Array [ - 1, - 2, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -75136,8 +82105,8 @@ Object { }, }, "range": Array [ - 7, - 17, + 14, + 24, ], "type": "Identifier", "value": "initialize", @@ -75154,8 +82123,8 @@ Object { }, }, "range": Array [ - 17, - 18, + 24, + 25, ], "type": "Punctuator", "value": "(", @@ -75172,8 +82141,8 @@ Object { }, }, "range": Array [ - 18, - 19, + 25, + 26, ], "type": "Punctuator", "value": "{", @@ -75190,8 +82159,8 @@ Object { }, }, "range": Array [ - 19, 26, + 33, ], "type": "Identifier", "value": "someVar", @@ -75208,8 +82177,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 33, + 34, ], "type": "Punctuator", "value": ",", @@ -75226,8 +82195,8 @@ Object { }, }, "range": Array [ - 28, - 36, + 35, + 43, ], "type": "Identifier", "value": "otherVar", @@ -75244,8 +82213,8 @@ Object { }, }, "range": Array [ - 36, - 37, + 43, + 44, ], "type": "Punctuator", "value": ",", @@ -75262,8 +82231,8 @@ Object { }, }, "range": Array [ - 38, - 41, + 45, + 48, ], "type": "Punctuator", "value": "...", @@ -75280,8 +82249,8 @@ Object { }, }, "range": Array [ - 41, 48, + 55, ], "type": "Identifier", "value": "options", @@ -75298,8 +82267,8 @@ Object { }, }, "range": Array [ - 48, - 49, + 55, + 56, ], "type": "Punctuator", "value": "}", @@ -75316,8 +82285,8 @@ Object { }, }, "range": Array [ - 49, - 50, + 56, + 57, ], "type": "Punctuator", "value": ")", @@ -75334,8 +82303,8 @@ Object { }, }, "range": Array [ - 51, - 52, + 58, + 59, ], "type": "Punctuator", "value": "{", @@ -75352,8 +82321,8 @@ Object { }, }, "range": Array [ - 103, - 104, + 110, + 111, ], "type": "Punctuator", "value": "}", @@ -75370,8 +82339,8 @@ Object { }, }, "range": Array [ - 105, - 106, + 112, + 113, ], "type": "Punctuator", "value": "}", @@ -75388,38 +82357,148 @@ Object { }, }, "range": Array [ - 106, - 107, + 113, + 114, ], "type": "Punctuator", - "value": ")", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 7, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 8, + "line": 3, }, "start": Object { - "column": 2, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 107, - 108, + 0, + 26, ], - "type": "Punctuator", - "value": ";", + "type": "VariableDeclaration", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-methods.src 1`] = ` -Object { - "body": Array [ Object { "declarations": Array [ Object { @@ -75427,17 +82506,17 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 5, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "name": "x", "range": Array [ - 4, - 5, + 32, + 33, ], "type": "Identifier", }, @@ -75445,11 +82524,11 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 8, - "line": 1, + "line": 5, }, }, "properties": Array [ @@ -75458,269 +82537,170 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 7, + "line": 6, }, "start": Object { "column": 4, - "line": 2, + "line": 6, }, }, - "name": "initialize", + "name": "foo", "range": Array [ - 14, - 24, + 42, + 45, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 6, }, "start": Object { "column": 4, - "line": 2, + "line": 6, }, }, - "method": true, + "method": false, "range": Array [ - 14, - 111, + 42, + 45, ], - "shorthand": false, + "shorthand": true, "type": "Property", "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 48, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, }, - "range": Array [ - 58, - 111, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": null, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 7, }, "start": Object { - "column": 14, - "line": 2, + "column": 4, + "line": 7, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "someVar", - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 26, - 33, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "someVar", - "range": Array [ - 26, - 33, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "name": "otherVar", - "range": Array [ - 35, - 43, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "method": false, - "range": Array [ - 35, - 43, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "name": "otherVar", - "range": Array [ - 35, - 43, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 38, - "line": 2, - }, - }, - "name": "options", - "range": Array [ - 48, - 55, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 45, - "line": 2, - }, - "start": Object { - "column": 35, - "line": 2, - }, - }, - "range": Array [ - 45, - 55, - ], - "type": "RestElement", - }, - ], - "range": Array [ - 25, - 56, - ], - "type": "ObjectPattern", + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 51, + 54, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "name": "set", "range": Array [ - 24, - 111, + 63, + 66, ], - "type": "FunctionExpression", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, }, + "range": Array [ + 60, + 66, + ], + "type": "SpreadElement", }, ], "range": Array [ - 8, - 113, + 36, + 68, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "range": Array [ - 4, - 113, + 32, + 68, ], "type": "VariableDeclarator", }, @@ -75729,24 +82709,24 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 114, + 28, + 69, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 0, + "line": 10, }, "start": Object { "column": 0, @@ -75755,7 +82735,7 @@ Object { }, "range": Array [ 0, - 114, + 70, ], "sourceType": "script", "tokens": Array [ @@ -75780,7 +82760,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -75790,92 +82770,92 @@ Object { }, "range": Array [ 4, - 5, + 7, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 8, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 8, - 9, + 13, + 16, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 2, }, "start": Object { - "column": 4, + "column": 7, "line": 2, }, }, "range": Array [ - 14, - 24, + 16, + 17, ], - "type": "Identifier", - "value": "initialize", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 14, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 24, + 22, 25, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ @@ -75883,202 +82863,202 @@ Object { 26, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 3, + "line": 5, }, "start": Object { - "column": 16, - "line": 2, + "column": 0, + "line": 5, }, }, "range": Array [ - 26, - 33, + 28, + 31, ], - "type": "Identifier", - "value": "someVar", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 5, + "line": 5, }, "start": Object { - "column": 23, - "line": 2, + "column": 4, + "line": 5, }, }, "range": Array [ + 32, 33, - 34, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 7, + "line": 5, }, "start": Object { - "column": 25, - "line": 2, + "column": 6, + "line": 5, }, }, "range": Array [ + 34, 35, - 43, ], - "type": "Identifier", - "value": "otherVar", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 9, + "line": 5, }, "start": Object { - "column": 33, - "line": 2, + "column": 8, + "line": 5, }, }, "range": Array [ - 43, - 44, + 36, + 37, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 2, + "column": 7, + "line": 6, }, "start": Object { - "column": 35, - "line": 2, + "column": 4, + "line": 6, }, }, "range": Array [ + 42, 45, - 48, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 2, + "column": 8, + "line": 6, }, "start": Object { - "column": 38, - "line": 2, + "column": 7, + "line": 6, }, }, "range": Array [ - 48, - 55, + 45, + 46, ], - "type": "Identifier", - "value": "options", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 2, + "column": 7, + "line": 7, }, "start": Object { - "column": 45, - "line": 2, + "column": 4, + "line": 7, }, }, "range": Array [ - 55, - 56, + 51, + 54, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 2, + "column": 8, + "line": 7, }, "start": Object { - "column": 46, - "line": 2, + "column": 7, + "line": 7, }, }, "range": Array [ - 56, - 57, + 54, + 55, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 2, + "column": 7, + "line": 8, }, "start": Object { - "column": 48, - "line": 2, + "column": 4, + "line": 8, }, }, "range": Array [ - 58, - 59, + 60, + 63, ], "type": "Punctuator", - "value": "{", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 10, + "line": 8, }, "start": Object { - "column": 4, - "line": 4, + "column": 7, + "line": 8, }, }, "range": Array [ - 110, - 111, + 63, + 66, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 5, + "line": 9, }, }, "range": Array [ - 112, - 113, + 67, + 68, ], "type": "Punctuator", "value": "}", @@ -76087,16 +83067,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 9, }, "start": Object { "column": 1, - "line": 5, + "line": 9, }, }, "range": Array [ - 113, - 114, + 68, + 69, ], "type": "Punctuator", "value": ";", @@ -76106,7 +83086,7 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/shorthand-properties.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` Object { "body": Array [ Object { @@ -76293,7 +83273,7 @@ Object { "kind": "init", "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 6, }, "start": Object { @@ -76304,25 +83284,25 @@ Object { "method": false, "range": Array [ 42, - 45, + 50, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 6, }, "start": Object { - "column": 4, + "column": 9, "line": 6, }, }, "name": "foo", "range": Array [ - 42, - 45, + 47, + 50, ], "type": "Identifier", }, @@ -76342,15 +83322,15 @@ Object { }, "name": "get", "range": Array [ - 51, - 54, + 56, + 59, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 7, }, "start": Object { @@ -76360,26 +83340,26 @@ Object { }, "method": false, "range": Array [ - 51, - 54, + 56, + 64, ], - "shorthand": true, + "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 7, }, "start": Object { - "column": 4, + "column": 9, "line": 7, }, }, "name": "get", "range": Array [ - 51, - 54, + 61, + 64, ], "type": "Identifier", }, @@ -76398,8 +83378,8 @@ Object { }, "name": "set", "range": Array [ - 63, - 66, + 73, + 76, ], "type": "Identifier", }, @@ -76414,15 +83394,15 @@ Object { }, }, "range": Array [ - 60, - 66, + 70, + 76, ], "type": "SpreadElement", }, ], "range": Array [ 36, - 68, + 78, ], "type": "ObjectExpression", }, @@ -76438,7 +83418,7 @@ Object { }, "range": Array [ 32, - 68, + 78, ], "type": "VariableDeclarator", }, @@ -76456,7 +83436,7 @@ Object { }, "range": Array [ 28, - 69, + 79, ], "type": "VariableDeclaration", }, @@ -76473,7 +83453,7 @@ Object { }, "range": Array [ 0, - 70, + 80, ], "sourceType": "script", "tokens": Array [ @@ -76709,6 +83689,42 @@ Object { 46, ], "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", "value": ",", }, Object { @@ -76723,8 +83739,8 @@ Object { }, }, "range": Array [ - 51, - 54, + 56, + 59, ], "type": "Identifier", "value": "get", @@ -76741,8 +83757,44 @@ Object { }, }, "range": Array [ - 54, - 55, + 59, + 60, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 61, + 64, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 64, + 65, ], "type": "Punctuator", "value": ",", @@ -76759,8 +83811,8 @@ Object { }, }, "range": Array [ - 60, - 63, + 70, + 73, ], "type": "Punctuator", "value": "...", @@ -76777,8 +83829,8 @@ Object { }, }, "range": Array [ - 63, - 66, + 73, + 76, ], "type": "Identifier", "value": "set", @@ -76795,8 +83847,8 @@ Object { }, }, "range": Array [ - 67, - 68, + 77, + 78, ], "type": "Punctuator", "value": "}", @@ -76813,8 +83865,8 @@ Object { }, }, "range": Array [ - 68, - 69, + 78, + 79, ], "type": "Punctuator", "value": ";", @@ -76824,7 +83876,415 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/single-spread.src 1`] = ` +exports[`javascript fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 4, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 6, + 7, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 13, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 1, + 16, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ")", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` Object { "body": Array [ Object { @@ -77046,29 +84506,27 @@ Object { }, }, Object { - "computed": false, - "key": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 7, }, "start": Object { - "column": 4, + "column": 7, "line": 7, }, }, "name": "get", "range": Array [ - 56, 59, + 62, ], "type": "Identifier", }, - "kind": "init", "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 7, }, "start": Object { @@ -77076,31 +84534,11 @@ Object { "line": 7, }, }, - "method": false, "range": Array [ 56, - 64, + 62, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 61, - 64, - ], - "type": "Identifier", - }, + "type": "SpreadElement", }, Object { "argument": Object { @@ -77116,8 +84554,8 @@ Object { }, "name": "set", "range": Array [ - 73, - 76, + 71, + 74, ], "type": "Identifier", }, @@ -77132,15 +84570,15 @@ Object { }, }, "range": Array [ - 70, - 76, + 68, + 74, ], "type": "SpreadElement", }, ], "range": Array [ 36, - 78, + 76, ], "type": "ObjectExpression", }, @@ -77156,7 +84594,7 @@ Object { }, "range": Array [ 32, - 78, + 76, ], "type": "VariableDeclarator", }, @@ -77174,7 +84612,7 @@ Object { }, "range": Array [ 28, - 79, + 77, ], "type": "VariableDeclaration", }, @@ -77191,7 +84629,7 @@ Object { }, "range": Array [ 0, - 80, + 78, ], "sourceType": "script", "tokens": Array [ @@ -77480,13 +84918,13 @@ Object { 56, 59, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 7, }, "start": Object { @@ -77496,25 +84934,7 @@ Object { }, "range": Array [ 59, - 60, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 7, - }, - "start": Object { - "column": 9, - "line": 7, - }, - }, - "range": Array [ - 61, - 64, + 62, ], "type": "Identifier", "value": "get", @@ -77522,17 +84942,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 7, }, "start": Object { - "column": 12, + "column": 10, "line": 7, }, }, "range": Array [ - 64, - 65, + 62, + 63, ], "type": "Punctuator", "value": ",", @@ -77549,8 +84969,8 @@ Object { }, }, "range": Array [ - 70, - 73, + 68, + 71, ], "type": "Punctuator", "value": "...", @@ -77567,8 +84987,8 @@ Object { }, }, "range": Array [ - 73, - 76, + 71, + 74, ], "type": "Identifier", "value": "set", @@ -77585,8 +85005,8 @@ Object { }, }, "range": Array [ - 77, - 78, + 75, + 76, ], "type": "Punctuator", "value": "}", @@ -77603,8 +85023,8 @@ Object { }, }, "range": Array [ - 78, - 79, + 76, + 77, ], "type": "Punctuator", "value": ";", @@ -77614,181 +85034,68 @@ Object { } `; -exports[`javascript fixtures/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = ` +exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "block": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 16, + "column": 6, "line": 1, }, "start": Object { - "column": 1, + "column": 4, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, + "range": Array [ + 4, + 6, + ], + "type": "BlockStatement", + }, + "finalizer": null, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, }, - "method": false, - "range": Array [ - 3, - 4, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", + "start": Object { + "column": 13, + "line": 1, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 6, - 7, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + "range": Array [ + 13, + 15, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "c", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 13, - ], - "type": "SpreadElement", + "start": Object { + "column": 7, + "line": 1, }, - ], + }, + "param": null, "range": Array [ - 1, - 16, + 7, + 15, ], - "type": "ObjectExpression", + "type": "CatchClause", }, "loc": Object { "end": Object { - "column": 17, + "column": 15, "line": 1, }, "start": Object { @@ -77798,9 +85105,9 @@ Object { }, "range": Array [ 0, - 17, + 15, ], - "type": "ExpressionStatement", + "type": "TryStatement", }, ], "loc": Object { @@ -77815,14 +85122,14 @@ Object { }, "range": Array [ 0, - 18, + 16, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -77832,46 +85139,232 @@ Object { }, "range": Array [ 0, - 1, + 3, + ], + "type": "Keyword", + "value": "try", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "type": "Keyword", + "value": "catch", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` +Object { + "body": Array [ + Object { + "block": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 6, + ], + "type": "BlockStatement", + }, + "finalizer": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "handler": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "param": null, + "range": Array [ + 7, + 15, + ], + "type": "CatchClause", + }, + "loc": Object { + "end": Object { + "column": 26, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, "range": Array [ - 1, - 2, + 0, + 26, ], - "type": "Punctuator", - "value": "{", + "type": "TryStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 3, "line": 1, }, "start": Object { - "column": 3, + "column": 0, "line": 1, }, }, "range": Array [ + 0, 3, - 4, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "try", }, Object { "loc": Object { @@ -77889,30 +85382,30 @@ Object { 5, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 6, + "column": 5, "line": 1, }, }, "range": Array [ + 5, 6, - 7, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 12, "line": 1, }, "start": Object { @@ -77922,107 +85415,107 @@ Object { }, "range": Array [ 7, - 8, + 12, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "catch", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 13, "line": 1, }, }, "range": Array [ - 9, - 12, + 13, + 14, ], "type": "Punctuator", - "value": "...", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, - 13, + 14, + 15, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 16, "line": 1, }, }, "range": Array [ - 13, - 14, + 16, + 23, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "finally", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 24, "line": 1, }, }, "range": Array [ - 15, - 16, + 24, + 25, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 26, "line": 1, }, "start": Object { - "column": 16, + "column": 25, "line": 1, }, }, "range": Array [ - 16, - 17, + 25, + 26, ], "type": "Punctuator", - "value": ")", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/experimentalObjectRestSpread/two-spread.src 1`] = ` +exports[`javascript fixtures/exponentiationOperators/exponential-operators.src 1`] = ` Object { "body": Array [ Object { @@ -78031,7 +85524,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -78039,17 +85532,72 @@ Object { "line": 1, }, }, - "name": "foo", + "name": "x", "range": Array [ 4, - 7, + 5, ], "type": "Identifier", }, - "init": null, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "operator": "**", + "range": Array [ + 8, + 14, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + "type": "BinaryExpression", + }, "loc": Object { "end": Object { - "column": 7, + "column": 14, "line": 1, }, "start": Object { @@ -78059,88 +85607,122 @@ Object { }, "range": Array [ 4, - 7, + 14, ], "type": "VariableDeclarator", }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "get", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "init": null, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "left": Object { "loc": Object { "end": Object { - "column": 7, + "column": 1, "line": 2, }, "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, + "name": "x", "range": Array [ - 13, 16, + 17, ], - "type": "VariableDeclarator", + "type": "Identifier", }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 7, + "line": 2, }, - "init": null, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "**=", + "range": Array [ + 16, + 23, + ], + "right": Object { "loc": Object { "end": Object { "column": 7, - "line": 3, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 6, + "line": 2, }, }, "range": Array [ 22, - 25, + 23, ], - "type": "VariableDeclarator", + "raw": "4", + "type": "Literal", + "value": 4, }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { "column": 8, - "line": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 16, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, }, "start": Object { "column": 0, @@ -78149,216 +85731,241 @@ Object { }, "range": Array [ 0, - 26, + 3, ], - "type": "VariableDeclaration", + "type": "Keyword", + "value": "var", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "method": false, - "range": Array [ - 42, - 50, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 6, - }, - "start": Object { - "column": 9, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 7, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 59, - 62, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "range": Array [ - 56, - 62, - ], - "type": "SpreadElement", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 7, - "line": 8, - }, - }, - "name": "set", - "range": Array [ - 71, - 74, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "range": Array [ - 68, - 74, - ], - "type": "SpreadElement", - }, - ], - "range": Array [ - 36, - 76, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 32, - 76, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, }, + }, + "range": Array [ + 6, + 7, ], - "kind": "var", + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Punctuator", + "value": "**", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + Object { "loc": Object { "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { "column": 2, - "line": 9, + "line": 2, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Punctuator", + "value": "**=", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Numeric", + "value": "4", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/for/for-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "EmptyStatement", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 9, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 77, + 0, + 9, ], - "type": "VariableDeclaration", + "test": null, + "type": "ForStatement", + "update": null, }, ], "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 2, }, "start": Object { "column": 0, @@ -78367,7 +85974,7 @@ Object { }, "range": Array [ 0, - 78, + 10, ], "sourceType": "script", "tokens": Array [ @@ -78387,12 +85994,12 @@ Object { 3, ], "type": "Keyword", - "value": "var", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -78402,456 +86009,920 @@ Object { }, "range": Array [ 4, - 7, + 5, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { - "column": 7, + "column": 5, "line": 1, }, }, "range": Array [ - 7, - 8, + 5, + 6, ], "type": "Punctuator", - "value": ",", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 2, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 13, - 16, + 6, + 7, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 2, + "line": 1, }, "start": Object { "column": 7, - "line": 2, + "line": 1, }, }, "range": Array [ - 16, - 17, + 7, + 8, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 9, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 8, + "line": 1, }, }, "range": Array [ - 22, - 25, + 8, + 9, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/for/for-loop.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 30, + ], + "type": "BlockStatement", + }, + "init": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 8, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 30, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 25, - 26, + 0, + 30, ], - "type": "Punctuator", - "value": ";", + "test": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "operator": "<", + "range": Array [ + 15, + 21, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "type": "BinaryExpression", + }, + "type": "ForStatement", + "update": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "operator": "++", + "prefix": false, + "range": Array [ + 23, + 26, + ], + "type": "UpdateExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 4, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 3, + "line": 1, }, }, "range": Array [ - 28, - 31, + 3, + 4, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 7, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 33, + 4, + 7, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 6, - "line": 5, + "column": 8, + "line": 1, }, }, "range": Array [ - 34, - 35, + 8, + 9, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 11, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 36, - 37, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 6, + "column": 13, + "line": 1, }, "start": Object { - "column": 4, - "line": 6, + "column": 12, + "line": 1, }, }, "range": Array [ - 42, - 45, + 12, + 13, ], - "type": "Identifier", - "value": "foo", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 14, + "line": 1, }, "start": Object { - "column": 7, - "line": 6, + "column": 13, + "line": 1, }, }, "range": Array [ - 45, - 46, + 13, + 14, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 16, + "line": 1, }, "start": Object { - "column": 9, - "line": 6, + "column": 15, + "line": 1, }, }, "range": Array [ - 47, - 50, + 15, + 16, ], "type": "Identifier", - "value": "foo", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 18, + "line": 1, }, "start": Object { - "column": 12, - "line": 6, + "column": 17, + "line": 1, }, }, "range": Array [ - 50, - 51, + 17, + 18, ], "type": "Punctuator", - "value": ",", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 21, + "line": 1, }, "start": Object { - "column": 4, - "line": 7, + "column": 19, + "line": 1, }, }, "range": Array [ - 56, - 59, + 19, + 21, ], - "type": "Punctuator", - "value": "...", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 22, + "line": 1, }, "start": Object { - "column": 7, - "line": 7, + "column": 21, + "line": 1, }, }, "range": Array [ - 59, - 62, + 21, + 22, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 24, + "line": 1, }, "start": Object { - "column": 10, - "line": 7, + "column": 23, + "line": 1, }, }, "range": Array [ - 62, - 63, + 23, + 24, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 26, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 24, + "line": 1, }, }, "range": Array [ - 68, - 71, + 24, + 26, ], "type": "Punctuator", - "value": "...", + "value": "++", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 8, + "column": 27, + "line": 1, }, "start": Object { - "column": 7, - "line": 8, + "column": 26, + "line": 1, }, }, "range": Array [ - 71, - 74, + 26, + 27, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 29, + "line": 1, }, "start": Object { - "column": 0, - "line": 9, + "column": 28, + "line": 1, }, }, "range": Array [ - 75, - 76, + 28, + 29, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 30, + "line": 1, }, "start": Object { - "column": 1, - "line": 9, + "column": 29, + "line": 1, }, }, "range": Array [ - 76, - 77, + 29, + 30, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = ` +exports[`javascript fixtures/for/for-with-coma.src 1`] = ` Object { "body": Array [ Object { - "block": Object { + "body": Object { "body": Array [], "loc": Object { "end": Object { - "column": 6, + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "BlockStatement", + }, + "init": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "VariableDeclarator", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 22, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, - 6, + 5, + 22, ], - "type": "BlockStatement", + "type": "VariableDeclaration", }, - "finalizer": null, - "handler": Object { - "body": Object { - "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "test": Object { + "left": Object { "loc": Object { "end": Object { - "column": 15, + "column": 25, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, + "name": "i", "range": Array [ - 13, - 15, + 24, + 25, ], - "type": "BlockStatement", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 15, + "column": 29, "line": 1, }, "start": Object { - "column": 7, + "column": 24, "line": 1, }, }, - "param": null, + "operator": "<", "range": Array [ - 7, - 15, + 24, + 29, ], - "type": "CatchClause", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, + "right": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", }, - "start": Object { - "column": 0, - "line": 1, + "type": "BinaryExpression", + }, + "type": "ForStatement", + "update": Object { + "expressions": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "operator": "++", + "prefix": false, + "range": Array [ + 31, + 34, + ], + "type": "UpdateExpression", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "name": "j", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "operator": "--", + "prefix": false, + "range": Array [ + 36, + 39, + ], + "type": "UpdateExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, }, + "range": Array [ + 31, + 39, + ], + "type": "SequenceExpression", }, - "range": Array [ - 0, - 15, - ], - "type": "TryStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -78860,7 +86931,7 @@ Object { }, "range": Array [ 0, - 16, + 46, ], "sourceType": "script", "tokens": Array [ @@ -78880,7 +86951,7 @@ Object { 3, ], "type": "Keyword", - "value": "try", + "value": "for", }, Object { "loc": Object { @@ -78898,12 +86969,12 @@ Object { 5, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -78913,10 +86984,28 @@ Object { }, "range": Array [ 5, - 6, + 8, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "i", }, Object { "loc": Object { @@ -78925,16 +87014,16 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 11, "line": 1, }, }, "range": Array [ - 7, + 11, 12, ], - "type": "Keyword", - "value": "catch", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { @@ -78951,8 +87040,8 @@ Object { 13, 14, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { @@ -78970,280 +87059,292 @@ Object { 15, ], "type": "Punctuator", - "value": "}", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = ` -Object { - "body": Array [ Object { - "block": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - "range": Array [ - 4, - 6, - ], - "type": "BlockStatement", - }, - "finalizer": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, + "start": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 24, - 26, - ], - "type": "BlockStatement", }, - "handler": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 15, - ], - "type": "BlockStatement", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "start": Object { + "column": 18, + "line": 1, }, - "param": null, - "range": Array [ - 7, - 15, - ], - "type": "CatchClause", }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "=", + }, + Object { "loc": Object { "end": Object { - "column": 26, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 26, + 20, + 22, ], - "type": "TryStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "type": "Numeric", + "value": "10", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 27, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 25, "line": 1, }, "start": Object { - "column": 0, + "column": 24, "line": 1, }, }, "range": Array [ - 0, - 3, + 24, + 25, ], - "type": "Keyword", - "value": "try", + "type": "Identifier", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 27, "line": 1, }, "start": Object { - "column": 4, + "column": 26, "line": 1, }, }, "range": Array [ - 4, - 5, + 26, + 27, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 29, "line": 1, }, "start": Object { - "column": 5, + "column": 28, "line": 1, }, }, "range": Array [ - 5, - 6, + 28, + 29, + ], + "type": "Identifier", + "value": "j", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 32, "line": 1, }, "start": Object { - "column": 7, + "column": 31, "line": 1, }, }, "range": Array [ - 7, - 12, + 31, + 32, ], - "type": "Keyword", - "value": "catch", + "type": "Identifier", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 34, "line": 1, }, "start": Object { - "column": 13, + "column": 32, "line": 1, }, }, "range": Array [ - 13, - 14, + 32, + 34, ], "type": "Punctuator", - "value": "{", + "value": "++", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 35, "line": 1, }, "start": Object { - "column": 14, + "column": 34, "line": 1, }, }, "range": Array [ - 14, - 15, + 34, + 35, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 37, "line": 1, }, "start": Object { - "column": 16, + "column": 36, "line": 1, }, }, "range": Array [ - 16, - 23, + 36, + 37, ], - "type": "Keyword", - "value": "finally", + "type": "Identifier", + "value": "j", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 39, "line": 1, }, "start": Object { - "column": 24, + "column": 37, "line": 1, }, }, "range": Array [ - 24, - 25, + 37, + 39, ], "type": "Punctuator", - "value": "{", + "value": "--", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 40, "line": 1, }, "start": Object { - "column": 25, + "column": 39, "line": 1, }, }, "range": Array [ - 25, - 26, + 39, + 40, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, ], "type": "Punctuator", "value": "}", @@ -79253,108 +87354,106 @@ Object { } `; -exports[`javascript fixtures/exponentiationOperators/exponential-operators.src 1`] = ` +exports[`javascript fixtures/for/for-with-const.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - "init": Object { - "left": Object { + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "BlockStatement", + }, + "init": Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 12, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, + "name": "i", "range": Array [ - 8, - 9, + 11, + 12, ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "type": "Identifier", }, - "operator": "**", - "range": Array [ - 8, - 14, - ], - "right": Object { + "init": Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 14, + 15, + 16, ], - "raw": "3", + "raw": "0", "type": "Literal", - "value": 3, - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + "value": 0, }, - "start": Object { - "column": 4, - "line": 1, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "range": Array [ + 11, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 4, - 14, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 5, + 16, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -79363,87 +87462,70 @@ Object { }, "range": Array [ 0, - 15, + 29, ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { + "test": Object { "left": Object { "loc": Object { - "end": Object { - "column": 1, - "line": 2, + "end": Object { + "column": 19, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 18, + "line": 1, }, }, - "name": "x", + "name": "i", "range": Array [ - 16, - 17, + 18, + 19, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 18, + "line": 1, }, }, - "operator": "**=", + "operator": "<", "range": Array [ - 16, + 18, 23, ], "right": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 22, + "line": 1, }, }, + "name": "j", "range": Array [ 22, 23, ], - "raw": "4", - "type": "Literal", - "value": 4, - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, + "type": "Identifier", }, + "type": "BinaryExpression", }, - "range": Array [ - 16, - 24, - ], - "type": "ExpressionStatement", + "type": "ForStatement", + "update": null, }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -79452,7 +87534,7 @@ Object { }, "range": Array [ 0, - 25, + 30, ], "sourceType": "script", "tokens": Array [ @@ -79472,7 +87554,7 @@ Object { 3, ], "type": "Keyword", - "value": "var", + "value": "for", }, Object { "loc": Object { @@ -79489,44 +87571,26 @@ Object { 4, 5, ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 5, "line": 1, }, }, "range": Array [ - 8, - 9, + 5, + 10, ], - "type": "Numeric", - "value": "2", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { @@ -79535,16 +87599,16 @@ Object { "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, "range": Array [ - 10, + 11, 12, ], - "type": "Punctuator", - "value": "**", + "type": "Identifier", + "value": "i", }, Object { "loc": Object { @@ -79561,211 +87625,113 @@ Object { 13, 14, ], - "type": "Numeric", - "value": "3", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 1, }, "start": Object { - "column": 14, + "column": 15, "line": 1, }, }, "range": Array [ - 14, 15, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ 16, - 17, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 18, - 21, - ], - "type": "Punctuator", - "value": "**=", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 6, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, ], "type": "Numeric", - "value": "4", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 23, - 24, + 16, + 17, ], "type": "Punctuator", "value": ";", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/for/for-empty.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], - "type": "EmptyStatement", - }, - "init": null, "loc": Object { "end": Object { - "column": 9, + "column": 19, "line": 1, }, "start": Object { - "column": 0, + "column": 18, "line": 1, }, }, "range": Array [ - 0, - 9, + 18, + 19, ], - "test": null, - "type": "ForStatement", - "update": null, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "i", }, - }, - "range": Array [ - 0, - 10, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 21, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 3, + 20, + 21, ], - "type": "Keyword", - "value": "for", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 23, "line": 1, }, "start": Object { - "column": 4, + "column": 22, "line": 1, }, }, "range": Array [ - 4, - 5, + 22, + 23, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "j", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 24, "line": 1, }, "start": Object { - "column": 5, + "column": 23, "line": 1, }, }, "range": Array [ - 5, - 6, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -79773,161 +87739,141 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 25, "line": 1, }, "start": Object { - "column": 6, + "column": 24, "line": 1, }, }, "range": Array [ - 6, - 7, + 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 7, - 8, + 26, + 27, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 8, - 9, + 28, + 29, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/for/for-loop.src 1`] = ` +exports[`javascript fixtures/for/for-with-function.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 30, + "column": 42, "line": 1, }, "start": Object { - "column": 28, + "column": 41, "line": 1, }, }, "range": Array [ - 28, - 30, + 41, + 42, ], - "type": "BlockStatement", + "type": "EmptyStatement", }, "init": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "i", - "range": Array [ - 8, - 9, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "raw": "0", - "type": "Literal", - "value": 0, + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "start": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 8, - 13, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 13, + "column": 10, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, + "operator": "=", "range": Array [ - 4, - 13, + 5, + 10, ], - "type": "VariableDeclaration", + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 30, + "column": 42, "line": 1, }, "start": Object { @@ -79937,100 +87883,171 @@ Object { }, "range": Array [ 0, - 30, + 42, ], "test": Object { "left": Object { "loc": Object { "end": Object { - "column": 16, + "column": 13, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, - "name": "i", + "name": "x", "range": Array [ - 15, - 16, + 12, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 21, + "column": 33, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, - "operator": "<", + "operator": "=", "range": Array [ - 15, - 21, + 12, + 33, ], "right": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "toExponential", + "range": Array [ + 18, + 31, + ], + "type": "Identifier", + }, + "range": Array [ + 16, + 31, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 21, + "column": 33, "line": 1, }, "start": Object { - "column": 19, + "column": 16, "line": 1, }, }, "range": Array [ - 19, - 21, + 16, + 33, ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "CallExpression", }, - "type": "BinaryExpression", + "type": "AssignmentExpression", }, "type": "ForStatement", "update": Object { - "argument": Object { + "left": Object { "loc": Object { "end": Object { - "column": 24, + "column": 36, "line": 1, }, "start": Object { - "column": 23, + "column": 35, "line": 1, }, }, - "name": "i", + "name": "x", "range": Array [ - 23, - 24, + 35, + 36, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 26, + "column": 40, "line": 1, }, "start": Object { - "column": 23, + "column": 35, "line": 1, }, }, - "operator": "++", - "prefix": false, + "operator": "=", "range": Array [ - 23, - 26, + 35, + 40, ], - "type": "UpdateExpression", + "right": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "AssignmentExpression", }, }, ], @@ -80046,7 +88063,7 @@ Object { }, "range": Array [ 0, - 31, + 43, ], "sourceType": "script", "tokens": Array [ @@ -80071,17 +88088,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { - "column": 3, + "column": 4, "line": 1, }, }, "range": Array [ - 3, 4, + 5, ], "type": "Punctuator", "value": "(", @@ -80089,38 +88106,56 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 4, + "column": 5, "line": 1, }, }, "range": Array [ - 4, - 7, + 5, + 6, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "range": Array [ + 7, 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ 9, + 10, ], - "type": "Identifier", - "value": "i", + "type": "Numeric", + "value": "5", }, Object { "loc": Object { @@ -80138,7 +88173,7 @@ Object { 11, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { @@ -80155,44 +88190,44 @@ Object { 12, 13, ], - "type": "Numeric", - "value": "0", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 17, ], "type": "Identifier", - "value": "i", + "value": "x", }, Object { "loc": Object { @@ -80210,40 +88245,76 @@ Object { 18, ], "type": "Punctuator", - "value": "<", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 31, "line": 1, }, "start": Object { - "column": 19, + "column": 18, "line": 1, }, }, "range": Array [ - 19, - 21, + 18, + 31, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "toExponential", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 32, "line": 1, }, "start": Object { - "column": 21, + "column": 31, "line": 1, }, }, "range": Array [ - 21, - 22, + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, ], "type": "Punctuator", "value": ";", @@ -80251,99 +88322,99 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 36, "line": 1, }, "start": Object { - "column": 23, + "column": 35, "line": 1, }, }, "range": Array [ - 23, - 24, + 35, + 36, ], "type": "Identifier", - "value": "i", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 38, "line": 1, }, "start": Object { - "column": 24, + "column": 37, "line": 1, }, }, "range": Array [ - 24, - 26, + 37, + 38, ], "type": "Punctuator", - "value": "++", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 40, "line": 1, }, "start": Object { - "column": 26, + "column": 39, "line": 1, }, }, "range": Array [ - 26, - 27, + 39, + 40, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "5", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 41, "line": 1, }, "start": Object { - "column": 28, + "column": 40, "line": 1, }, }, "range": Array [ - 28, - 29, + 40, + 41, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 42, "line": 1, }, "start": Object { - "column": 29, + "column": 41, "line": 1, }, }, "range": Array [ - 29, - 30, + 41, + 42, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/for/for-with-coma.src 1`] = ` +exports[`javascript fixtures/for/for-with-let.src 1`] = ` Object { "body": Array [ Object { @@ -80360,8 +88431,8 @@ Object { }, }, "range": Array [ - 41, - 44, + 26, + 29, ], "type": "BlockStatement", }, @@ -80371,35 +88442,35 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, "name": "i", "range": Array [ - 9, - 10, + 11, + 12, ], "type": "Identifier", }, "init": Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 14, + 15, + 16, ], "raw": "0", "type": "Literal", @@ -80407,79 +88478,25 @@ Object { }, "loc": Object { "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 14, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "j", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 22, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "loc": Object { - "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 16, - 22, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { @@ -80489,7 +88506,7 @@ Object { }, "range": Array [ 5, - 22, + 16, ], "type": "VariableDeclaration", }, @@ -80505,162 +88522,70 @@ Object { }, "range": Array [ 0, - 44, + 29, ], "test": Object { "left": Object { "loc": Object { "end": Object { - "column": 25, + "column": 19, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "name": "i", "range": Array [ - 24, - 25, + 18, + 19, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 29, + "column": 23, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "operator": "<", "range": Array [ - 24, - 29, + 18, + 23, ], "right": Object { "loc": Object { "end": Object { - "column": 29, + "column": 23, "line": 1, }, "start": Object { - "column": 28, + "column": 22, "line": 1, }, }, "name": "j", "range": Array [ - 28, - 29, + 22, + 23, ], "type": "Identifier", }, "type": "BinaryExpression", }, "type": "ForStatement", - "update": Object { - "expressions": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "name": "i", - "range": Array [ - 31, - 32, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "operator": "++", - "prefix": false, - "range": Array [ - 31, - 34, - ], - "type": "UpdateExpression", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "name": "j", - "range": Array [ - 36, - 37, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "operator": "--", - "prefix": false, - "range": Array [ - 36, - 39, - ], - "type": "UpdateExpression", - }, - ], - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 39, - ], - "type": "SequenceExpression", - }, + "update": null, }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -80669,7 +88594,7 @@ Object { }, "range": Array [ 0, - 46, + 30, ], "sourceType": "script", "tokens": Array [ @@ -80712,7 +88637,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -80722,25 +88647,97 @@ Object { }, "range": Array [ 5, - 8, + 10, ], "type": "Keyword", - "value": "var", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 18, "line": 1, }, }, "range": Array [ - 9, - 10, + 18, + 19, ], "type": "Identifier", "value": "i", @@ -80748,313 +88745,512 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 21, "line": 1, }, "start": Object { - "column": 11, + "column": 20, "line": 1, }, }, "range": Array [ - 11, - 12, + 20, + 21, ], "type": "Punctuator", - "value": "=", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 22, "line": 1, }, }, "range": Array [ - 13, - 14, + 22, + 23, ], - "type": "Numeric", - "value": "0", + "type": "Identifier", + "value": "j", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 24, "line": 1, }, "start": Object { - "column": 14, + "column": 23, "line": 1, }, }, "range": Array [ - 14, - 15, + 23, + 24, ], "type": "Punctuator", - "value": ",", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 24, "line": 1, }, }, "range": Array [ - 16, - 17, + 24, + 25, ], - "type": "Identifier", - "value": "j", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 18, - 19, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 20, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 20, - 22, + 28, + 29, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-array.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 23, + "column": 16, "line": 1, }, "start": Object { - "column": 22, + "column": 0, "line": 1, }, }, "range": Array [ - 22, - 23, + 0, + 16, ], - "type": "Punctuator", - "value": ";", + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "ArrayPattern", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, + "column": 3, "line": 1, }, "start": Object { - "column": 24, + "column": 0, "line": 1, }, }, "range": Array [ - 24, - 25, + 0, + 3, ], - "type": "Identifier", - "value": "i", + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 5, "line": 1, }, "start": Object { - "column": 26, + "column": 4, "line": 1, }, }, "range": Array [ - 26, - 27, + 4, + 5, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 6, "line": 1, }, "start": Object { - "column": 28, + "column": 5, "line": 1, }, }, "range": Array [ - 28, - 29, + 5, + 6, ], "type": "Identifier", - "value": "j", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 9, "line": 1, }, "start": Object { - "column": 29, + "column": 7, "line": 1, }, }, "range": Array [ - 29, - 30, + 7, + 9, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 11, "line": 1, }, "start": Object { - "column": 31, + "column": 10, "line": 1, }, }, "range": Array [ - 31, - 32, + 10, + 11, ], - "type": "Identifier", - "value": "i", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 12, "line": 1, }, "start": Object { - "column": 32, + "column": 11, "line": 1, }, }, "range": Array [ - 32, - 34, + 11, + 12, ], "type": "Punctuator", - "value": "++", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 13, "line": 1, }, "start": Object { - "column": 34, + "column": 12, "line": 1, }, }, "range": Array [ - 34, - 35, + 12, + 13, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 37, + "column": 15, "line": 1, }, "start": Object { - "column": 36, + "column": 14, "line": 1, }, }, "range": Array [ - 36, - 37, + 14, + 15, ], - "type": "Identifier", - "value": "j", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 39, + "column": 16, "line": 1, }, "start": Object { - "column": 37, + "column": 15, "line": 1, }, }, "range": Array [ - 37, - 39, + 15, + 16, ], "type": "Punctuator", - "value": "--", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-bare-nonstrict.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "effects", + "range": Array [ + 4, + 11, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 40, + "column": 16, "line": 1, }, "start": Object { - "column": 39, + "column": 0, "line": 1, }, }, "range": Array [ - 39, - 40, + 0, + 16, ], - "type": "Punctuator", - "value": ")", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "iterations", + "range": Array [ + 21, + 31, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 35, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, + "column": 19, "line": 2, }, "start": Object { @@ -81063,16 +89259,54 @@ Object { }, }, "range": Array [ - 41, - 42, + 17, + 36, ], - "type": "Punctuator", - "value": "{", + "type": "VariableDeclaration", }, Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "stored", + "range": Array [ + 41, + 47, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 41, + 47, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, + "column": 11, "line": 3, }, "start": Object { @@ -81081,189 +89315,521 @@ Object { }, }, "range": Array [ - 43, - 44, + 37, + 48, ], - "type": "Punctuator", - "value": "}", + "type": "VariableDeclaration", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/for/for-with-const.src 1`] = ` -Object { - "body": Array [ Object { "body": Object { - "body": Array [], + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "iterations", + "range": Array [ + 119, + 129, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "operator": "++", + "prefix": true, + "range": Array [ + 117, + 129, + ], + "type": "UpdateExpression", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 117, + 130, + ], + "type": "ExpressionStatement", + }, + ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 6, }, "start": Object { - "column": 0, - "line": 2, + "column": 64, + "line": 4, }, }, "range": Array [ - 26, - 29, + 113, + 132, ], "type": "BlockStatement", }, - "init": Object { + "left": Object { "declarations": Array [ Object { "id": Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 10, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 9, + "line": 4, }, }, - "name": "i", + "name": "a", "range": Array [ - 11, - 12, + 58, + 59, ], "type": "Identifier", }, "init": Object { + "expressions": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "effects", + "range": Array [ + 65, + 72, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "operator": "++", + "prefix": true, + "range": Array [ + 63, + 72, + ], + "type": "UpdateExpression", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 75, + 76, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "operator": "-", + "prefix": true, + "range": Array [ + 74, + 76, + ], + "type": "UnaryExpression", + }, + ], "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 27, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 15, - 16, + 63, + 76, ], - "raw": "0", - "type": "Literal", - "value": 0, + "type": "SequenceExpression", }, "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 28, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 9, + "line": 4, }, }, "range": Array [ - 11, - 16, + 58, + 77, ], "type": "VariableDeclarator", }, ], - "kind": "const", + "kind": "var", "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 28, + "line": 4, }, "start": Object { "column": 5, - "line": 1, + "line": 4, }, }, "range": Array [ - 5, - 16, + 54, + 77, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 6, }, "start": Object { "column": 0, - "line": 1, + "line": 4, }, }, "range": Array [ - 0, - 29, + 49, + 132, ], - "test": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, + "right": Object { + "expressions": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "name": "stored", + "range": Array [ + 81, + 87, + ], + "type": "Identifier", }, - "start": Object { - "column": 18, - "line": 1, + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 32, + "line": 4, + }, + }, + "operator": "=", + "range": Array [ + 81, + 91, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 4, + }, + "start": Object { + "column": 41, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 90, + 91, + ], + "type": "Identifier", }, + "type": "AssignmentExpression", }, - "name": "i", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 4, + }, + "start": Object { + "column": 44, + "line": 4, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 4, + }, + "start": Object { + "column": 45, + "line": 4, + }, + }, + "name": "a", + "range": Array [ + 94, + 95, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 49, + "line": 4, + }, + "start": Object { + "column": 45, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 94, + 98, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 4, + }, + "start": Object { + "column": 48, + "line": 4, + }, + }, + "range": Array [ + 97, + 98, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 4, + }, + "start": Object { + "column": 51, + "line": 4, + }, + }, + "name": "b", + "range": Array [ + 100, + 101, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 55, + "line": 4, + }, + "start": Object { + "column": 51, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 100, + 104, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 4, + }, + "start": Object { + "column": 54, + "line": 4, + }, + }, + "range": Array [ + 103, + 104, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 4, + }, + "start": Object { + "column": 57, + "line": 4, + }, + }, + "name": "c", + "range": Array [ + 106, + 107, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 61, + "line": 4, + }, + "start": Object { + "column": 57, + "line": 4, + }, + }, + "method": false, + "range": Array [ + 106, + 110, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 4, + }, + "start": Object { + "column": 60, + "line": 4, + }, + }, + "range": Array [ + 109, + 110, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + ], + "range": Array [ + 93, + 111, + ], + "type": "ObjectExpression", + }, + ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 62, + "line": 4, }, "start": Object { - "column": 18, - "line": 1, + "column": 32, + "line": 4, }, }, - "operator": "<", "range": Array [ - 18, - 23, + 81, + 111, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "j", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "type": "BinaryExpression", + "type": "SequenceExpression", }, - "type": "ForStatement", - "update": null, + "type": "ForInStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 7, }, "start": Object { "column": 0, @@ -81272,7 +89838,7 @@ Object { }, "range": Array [ 0, - 30, + 133, ], "sourceType": "script", "tokens": Array [ @@ -81292,12 +89858,12 @@ Object { 3, ], "type": "Keyword", - "value": "for", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 11, "line": 1, }, "start": Object { @@ -81307,61 +89873,25 @@ Object { }, "range": Array [ 4, - 5, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 10, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ 11, - 12, ], "type": "Identifier", - "value": "i", + "value": "effects", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 14, ], "type": "Punctuator", "value": "=", @@ -81369,17 +89899,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 16, ], "type": "Numeric", "value": "0", @@ -81387,17 +89917,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, "range": Array [ + 15, 16, - 17, ], "type": "Punctuator", "value": ";", @@ -81405,420 +89935,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 18, - 19, + 17, + 20, ], - "type": "Identifier", - "value": "i", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 20, 21, + 31, ], - "type": "Punctuator", - "value": "<", + "type": "Identifier", + "value": "iterations", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 22, - 23, + 32, + 33, ], - "type": "Identifier", - "value": "j", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 23, - 24, + 34, + 35, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 24, - 25, + 35, + 36, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 3, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 3, }, }, "range": Array [ - 26, - 27, + 37, + 40, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 10, "line": 3, }, "start": Object { - "column": 0, + "column": 4, "line": 3, }, }, "range": Array [ - 28, - 29, + 41, + 47, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "stored", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/for/for-with-function.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 42, - ], - "type": "EmptyStatement", - }, - "init": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 5, - 10, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, - "type": "AssignmentExpression", - }, "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 0, - 42, + 47, + 48, ], - "test": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 12, - 13, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 12, - 33, - ], - "right": Object { - "arguments": Array [], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "toExponential", - "range": Array [ - 18, - 31, - ], - "type": "Identifier", - }, - "range": Array [ - 16, - 31, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 33, - ], - "type": "CallExpression", - }, - "type": "AssignmentExpression", - }, - "type": "ForStatement", - "update": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 35, - 40, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 40, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, - "type": "AssignmentExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 43, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { "column": 3, - "line": 1, + "line": 4, }, "start": Object { "column": 0, - "line": 1, + "line": 4, }, }, "range": Array [ - 0, - 3, + 49, + 52, ], "type": "Keyword", "value": "for", @@ -81827,16 +90098,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 4, }, "start": Object { "column": 4, - "line": 1, + "line": 4, }, }, "range": Array [ - 4, - 5, + 53, + 54, ], "type": "Punctuator", "value": "(", @@ -81844,35 +90115,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 8, + "line": 4, }, "start": Object { "column": 5, - "line": 1, + "line": 4, }, }, "range": Array [ - 5, - 6, + 54, + 57, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 58, + 59, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 7, - "line": 1, + "column": 11, + "line": 4, }, }, "range": Array [ - 7, - 8, + 60, + 61, ], "type": "Punctuator", "value": "=", @@ -81880,710 +90169,557 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 14, + "line": 4, }, "start": Object { - "column": 9, - "line": 1, + "column": 13, + "line": 4, }, }, "range": Array [ - 9, - 10, + 62, + 63, ], - "type": "Numeric", - "value": "5", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 16, + "line": 4, }, "start": Object { - "column": 10, - "line": 1, + "column": 14, + "line": 4, }, }, "range": Array [ - 10, - 11, + 63, + 65, ], "type": "Punctuator", - "value": ";", + "value": "++", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 23, + "line": 4, }, "start": Object { - "column": 12, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 12, - 13, + 65, + 72, ], "type": "Identifier", - "value": "x", + "value": "effects", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, }, "start": Object { - "column": 14, - "line": 1, + "column": 25, + "line": 4, }, }, "range": Array [ - 14, - 15, + 74, + 75, ], "type": "Punctuator", - "value": "=", + "value": "-", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 27, + "line": 4, }, "start": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 4, }, }, "range": Array [ - 16, - 17, + 75, + 76, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 28, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 27, + "line": 4, }, }, "range": Array [ - 17, - 18, + 76, + 77, ], "type": "Punctuator", - "value": ".", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 31, - "line": 1, + "line": 4, }, "start": Object { - "column": 18, - "line": 1, + "column": 29, + "line": 4, }, }, "range": Array [ - 18, - 31, + 78, + 80, ], - "type": "Identifier", - "value": "toExponential", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 38, + "line": 4, }, "start": Object { - "column": 31, - "line": 1, + "column": 32, + "line": 4, }, }, "range": Array [ - 31, - 32, + 81, + 87, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "stored", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 40, + "line": 4, }, "start": Object { - "column": 32, - "line": 1, + "column": 39, + "line": 4, }, }, "range": Array [ - 32, - 33, + 88, + 89, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 42, + "line": 4, }, "start": Object { - "column": 33, - "line": 1, + "column": 41, + "line": 4, }, }, "range": Array [ - 33, - 34, + 90, + 91, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 43, + "line": 4, }, "start": Object { - "column": 35, - "line": 1, + "column": 42, + "line": 4, }, }, "range": Array [ - 35, - 36, + 91, + 92, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 45, + "line": 4, }, "start": Object { - "column": 37, - "line": 1, + "column": 44, + "line": 4, }, }, "range": Array [ - 37, - 38, + 93, + 94, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 46, + "line": 4, }, "start": Object { - "column": 39, - "line": 1, + "column": 45, + "line": 4, }, }, "range": Array [ - 39, - 40, + 94, + 95, ], - "type": "Numeric", - "value": "5", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 47, + "line": 4, }, "start": Object { - "column": 40, - "line": 1, + "column": 46, + "line": 4, }, }, "range": Array [ - 40, - 41, + 95, + 96, ], "type": "Punctuator", - "value": ")", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 49, + "line": 4, }, "start": Object { - "column": 41, - "line": 1, + "column": 48, + "line": 4, }, }, "range": Array [ - 41, - 42, + 97, + 98, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "0", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/for/for-with-let.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "BlockStatement", - }, - "init": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "i", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 16, - ], - "type": "VariableDeclaration", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 50, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 49, + "line": 4, }, }, "range": Array [ - 0, - 29, + 98, + 99, ], - "test": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "i", - "range": Array [ - 18, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "operator": "<", - "range": Array [ - 18, - 23, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "name": "j", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "type": "BinaryExpression", - }, - "type": "ForStatement", - "update": null, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 30, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 52, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 51, + "line": 4, }, }, "range": Array [ - 0, - 3, + 100, + 101, ], - "type": "Keyword", - "value": "for", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 53, + "line": 4, }, "start": Object { - "column": 4, - "line": 1, + "column": 52, + "line": 4, }, }, "range": Array [ - 4, - 5, + 101, + 102, ], "type": "Punctuator", - "value": "(", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 55, + "line": 4, }, "start": Object { - "column": 5, - "line": 1, + "column": 54, + "line": 4, }, }, "range": Array [ - 5, - 10, + 103, + 104, ], - "type": "Keyword", - "value": "const", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 56, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 55, + "line": 4, }, }, "range": Array [ - 11, - 12, + 104, + 105, ], - "type": "Identifier", - "value": "i", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 58, + "line": 4, }, "start": Object { - "column": 13, - "line": 1, + "column": 57, + "line": 4, }, }, "range": Array [ - 13, - 14, + 106, + 107, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 59, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 58, + "line": 4, }, }, "range": Array [ - 15, - 16, + 107, + 108, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 61, + "line": 4, }, "start": Object { - "column": 16, - "line": 1, + "column": 60, + "line": 4, }, }, "range": Array [ - 16, - 17, + 109, + 110, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 62, + "line": 4, }, "start": Object { - "column": 18, - "line": 1, + "column": 61, + "line": 4, }, }, "range": Array [ - 18, - 19, + 110, + 111, ], - "type": "Identifier", - "value": "i", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 63, + "line": 4, }, "start": Object { - "column": 20, - "line": 1, + "column": 62, + "line": 4, }, }, "range": Array [ - 20, - 21, + 111, + 112, ], "type": "Punctuator", - "value": "<", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 65, + "line": 4, }, "start": Object { - "column": 22, - "line": 1, + "column": 64, + "line": 4, }, }, "range": Array [ - 22, - 23, + 113, + 114, ], - "type": "Identifier", - "value": "j", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 4, + "line": 5, }, "start": Object { - "column": 23, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 23, - 24, + 117, + 119, ], "type": "Punctuator", - "value": ";", + "value": "++", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 14, + "line": 5, }, "start": Object { - "column": 24, - "line": 1, + "column": 4, + "line": 5, }, }, "range": Array [ - 24, - 25, + 119, + 129, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "iterations", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 2, + "column": 15, + "line": 5, }, "start": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 5, }, }, "range": Array [ - 26, - 27, + 129, + 130, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 6, }, "start": Object { "column": 0, - "line": 3, + "line": 6, }, }, "range": Array [ - 28, - 29, + 131, + 132, ], "type": "Punctuator", "value": "}", @@ -82593,7 +90729,7 @@ Object { } `; -exports[`javascript fixtures/forIn/for-in-array.src 1`] = ` +exports[`javascript fixtures/forIn/for-in-destruction.src 1`] = ` Object { "body": Array [ Object { @@ -82601,24 +90737,100 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 16, + "column": 33, "line": 1, }, "start": Object { - "column": 14, + "column": 31, "line": 1, }, }, "range": Array [ - 14, - 16, + 31, + 33, ], "type": "BlockStatement", }, "left": Object { + "declarations": Array [ + Object { + "id": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "ArrayPattern", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 22, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 6, + "column": 22, "line": 1, }, "start": Object { @@ -82626,16 +90838,15 @@ Object { "line": 1, }, }, - "name": "i", "range": Array [ 5, - 6, + 22, ], - "type": "Identifier", + "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 16, + "column": 33, "line": 1, }, "start": Object { @@ -82645,25 +90856,25 @@ Object { }, "range": Array [ 0, - 16, + 33, ], "right": Object { - "elements": Array [], "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 1, }, "start": Object { - "column": 10, + "column": 26, "line": 1, }, }, + "name": "obj", "range": Array [ - 10, - 12, + 26, + 29, ], - "type": "ArrayPattern", + "type": "Identifier", }, "type": "ForInStatement", }, @@ -82680,7 +90891,7 @@ Object { }, "range": Array [ 0, - 17, + 34, ], "sourceType": "script", "tokens": Array [ @@ -82723,7 +90934,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -82733,33 +90944,33 @@ Object { }, "range": Array [ 5, - 6, + 8, ], - "type": "Identifier", - "value": "i", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, 9, + 10, ], - "type": "Keyword", - "value": "in", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { @@ -82769,366 +90980,179 @@ Object { }, "range": Array [ 10, - 11, + 14, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 14, "line": 1, }, }, "range": Array [ - 11, - 12, + 14, + 15, ], "type": "Punctuator", - "value": "]", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 21, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 13, + 16, + 21, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 22, "line": 1, }, "start": Object { - "column": 14, + "column": 21, "line": 1, }, }, "range": Array [ - 14, - 15, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 23, "line": 1, }, }, "range": Array [ - 15, - 16, + 23, + 25, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "in", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/forIn/for-in-bare-nonstrict.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "effects", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 15, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 16, + "column": 29, "line": 1, }, "start": Object { - "column": 0, + "column": 26, "line": 1, }, }, "range": Array [ - 0, - 16, + 26, + 29, ], - "type": "VariableDeclaration", + "type": "Identifier", + "value": "obj", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "iterations", - "range": Array [ - 21, - 31, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 34, - 35, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 35, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 17, - 36, + 29, + 30, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": ")", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "stored", - "range": Array [ - 41, - 47, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 41, - 47, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 31, + "line": 1, }, }, "range": Array [ - 37, - 48, + 31, + 32, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "{", }, Object { - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "name": "iterations", - "range": Array [ - 119, - 129, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "operator": "++", - "prefix": true, - "range": Array [ - 117, - 129, - ], - "type": "UpdateExpression", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "range": Array [ - 117, - 130, - ], - "type": "ExpressionStatement", - }, - ], + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-destruction-object.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 33, + "line": 1, }, "start": Object { - "column": 64, - "line": 4, + "column": 31, + "line": 1, }, }, "range": Array [ - 113, - 132, + 31, + 33, ], "type": "BlockStatement", }, @@ -83138,128 +91162,150 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 22, + "line": 1, }, "start": Object { "column": 9, - "line": 4, + "line": 1, }, }, - "name": "a", - "range": Array [ - 58, - 59, - ], - "type": "Identifier", - }, - "init": Object { - "expressions": Array [ + "properties": Array [ Object { - "argument": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 23, - "line": 4, + "column": 14, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 10, + "line": 1, }, }, - "name": "effects", + "name": "name", "range": Array [ - 65, - 72, + 10, + 14, ], "type": "Identifier", }, + "kind": "init", "loc": Object { "end": Object { - "column": 23, - "line": 4, + "column": 14, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 10, + "line": 1, }, }, - "operator": "++", - "prefix": true, + "method": false, "range": Array [ - 63, - 72, + 10, + 14, ], - "type": "UpdateExpression", + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, }, Object { - "argument": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 21, + "line": 1, }, "start": Object { - "column": 26, - "line": 4, + "column": 16, + "line": 1, }, }, + "name": "value", "range": Array [ - 75, - 76, + 16, + 21, ], - "raw": "1", - "type": "Literal", - "value": 1, + "type": "Identifier", }, + "kind": "init", "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 21, + "line": 1, }, "start": Object { - "column": 25, - "line": 4, + "column": 16, + "line": 1, }, }, - "operator": "-", - "prefix": true, + "method": false, "range": Array [ - 74, - 76, + 16, + 21, ], - "type": "UnaryExpression", + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, }, ], - "loc": Object { - "end": Object { - "column": 27, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, "range": Array [ - 63, - 76, + 9, + 22, ], - "type": "SequenceExpression", + "type": "ObjectPattern", }, + "init": null, "loc": Object { "end": Object { - "column": 28, - "line": 4, + "column": 22, + "line": 1, }, "start": Object { "column": 9, - "line": 4, + "line": 1, }, }, "range": Array [ - 58, - 77, + 9, + 22, ], "type": "VariableDeclarator", }, @@ -83267,299 +91313,51 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 28, - "line": 4, + "column": 22, + "line": 1, }, "start": Object { "column": 5, - "line": 4, + "line": 1, }, }, "range": Array [ - 54, - 77, + 5, + 22, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 33, + "line": 1, }, "start": Object { "column": 0, - "line": 4, + "line": 1, }, }, "range": Array [ - 49, - 132, + 0, + 33, ], "right": Object { - "expressions": Array [ - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 32, - "line": 4, - }, - }, - "name": "stored", - "range": Array [ - 81, - 87, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 4, - }, - "start": Object { - "column": 32, - "line": 4, - }, - }, - "operator": "=", - "range": Array [ - 81, - 91, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 4, - }, - "start": Object { - "column": 41, - "line": 4, - }, - }, - "name": "a", - "range": Array [ - 90, - 91, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", - }, - Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 4, - }, - "start": Object { - "column": 44, - "line": 4, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 4, - }, - "start": Object { - "column": 45, - "line": 4, - }, - }, - "name": "a", - "range": Array [ - 94, - 95, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 49, - "line": 4, - }, - "start": Object { - "column": 45, - "line": 4, - }, - }, - "method": false, - "range": Array [ - 94, - 98, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 4, - }, - "start": Object { - "column": 48, - "line": 4, - }, - }, - "range": Array [ - 97, - 98, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 4, - }, - "start": Object { - "column": 51, - "line": 4, - }, - }, - "name": "b", - "range": Array [ - 100, - 101, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 55, - "line": 4, - }, - "start": Object { - "column": 51, - "line": 4, - }, - }, - "method": false, - "range": Array [ - 100, - 104, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 4, - }, - "start": Object { - "column": 54, - "line": 4, - }, - }, - "range": Array [ - 103, - 104, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 4, - }, - "start": Object { - "column": 57, - "line": 4, - }, - }, - "name": "c", - "range": Array [ - 106, - 107, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 61, - "line": 4, - }, - "start": Object { - "column": 57, - "line": 4, - }, - }, - "method": false, - "range": Array [ - 106, - 110, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 61, - "line": 4, - }, - "start": Object { - "column": 60, - "line": 4, - }, - }, - "range": Array [ - 109, - 110, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - }, - ], - "range": Array [ - 93, - 111, - ], - "type": "ObjectExpression", - }, - ], "loc": Object { "end": Object { - "column": 62, - "line": 4, + "column": 29, + "line": 1, }, "start": Object { - "column": 32, - "line": 4, + "column": 26, + "line": 1, }, }, + "name": "obj", "range": Array [ - 81, - 111, + 26, + 29, ], - "type": "SequenceExpression", + "type": "Identifier", }, "type": "ForInStatement", }, @@ -83567,7 +91365,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 7, + "line": 2, }, "start": Object { "column": 0, @@ -83576,7 +91374,7 @@ Object { }, "range": Array [ 0, - 133, + 34, ], "sourceType": "script", "tokens": Array [ @@ -83596,12 +91394,12 @@ Object { 3, ], "type": "Keyword", - "value": "var", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 5, "line": 1, }, "start": Object { @@ -83611,313 +91409,339 @@ Object { }, "range": Array [ 4, - 11, - ], - "type": "Identifier", - "value": "effects", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, + 5, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 8, "line": 1, }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, "range": Array [ - 15, - 16, + 5, + 8, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 17, - 20, + 9, + 10, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 2, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 21, - 31, + 10, + 14, ], "type": "Identifier", - "value": "iterations", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 32, - 33, + 14, + 15, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 34, - 35, + 16, + 21, ], - "type": "Numeric", - "value": "0", + "type": "Identifier", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 18, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 35, - 36, + 21, + 22, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 23, + "line": 1, }, }, "range": Array [ - 37, - 40, + 23, + 25, ], "type": "Keyword", - "value": "var", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 3, + "column": 29, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 26, + "line": 1, }, }, "range": Array [ - 41, - 47, + 26, + 29, ], "type": "Identifier", - "value": "stored", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 30, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 29, + "line": 1, }, }, "range": Array [ - 47, - 48, + 29, + 30, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 32, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 31, + "line": 1, }, }, "range": Array [ - 49, - 52, + 31, + 32, ], - "type": "Keyword", - "value": "for", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 33, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 32, + "line": 1, }, }, "range": Array [ - 53, - 54, + 32, + 33, ], "type": "Punctuator", - "value": "(", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-object.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/forIn/for-in-object-with-body.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 4, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, - "start": Object { - "column": 5, - "line": 4, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, }, + "name": "i", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", }, - "range": Array [ - 54, - 57, - ], - "type": "Keyword", - "value": "var", - }, - Object { "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 16, + "line": 1, }, "start": Object { - "column": 9, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 58, - 59, + 0, + 16, ], - "type": "Identifier", - "value": "a", + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 10, + 12, + ], + "type": "ObjectExpression", + }, + "type": "ForInStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 3, + "line": 1, }, "start": Object { - "column": 11, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 60, - 61, + 0, + 3, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 5, + "line": 1, }, "start": Object { - "column": 13, - "line": 4, + "column": 4, + "line": 1, }, }, "range": Array [ - 62, - 63, + 4, + 5, ], "type": "Punctuator", "value": "(", @@ -83925,449 +91749,493 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 5, + "line": 1, }, }, "range": Array [ - 63, - 65, + 5, + 6, ], - "type": "Punctuator", - "value": "++", + "type": "Identifier", + "value": "i", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 4, + "column": 9, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 7, + "line": 1, }, }, "range": Array [ - 65, - 72, + 7, + 9, ], - "type": "Identifier", - "value": "effects", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 11, + "line": 1, }, "start": Object { - "column": 23, - "line": 4, + "column": 10, + "line": 1, }, }, "range": Array [ - 72, - 73, + 10, + 11, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 12, + "line": 1, }, "start": Object { - "column": 25, - "line": 4, + "column": 11, + "line": 1, }, }, "range": Array [ - 74, - 75, + 11, + 12, ], "type": "Punctuator", - "value": "-", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 4, + "column": 13, + "line": 1, }, "start": Object { - "column": 26, - "line": 4, + "column": 12, + "line": 1, }, }, "range": Array [ - 75, - 76, + 12, + 13, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 4, + "column": 15, + "line": 1, }, "start": Object { - "column": 27, - "line": 4, + "column": 14, + "line": 1, }, }, "range": Array [ - 76, - 77, + 14, + 15, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 4, + "column": 16, + "line": 1, }, "start": Object { - "column": 29, - "line": 4, + "column": 15, + "line": 1, }, }, "range": Array [ - 78, - 80, + 15, + 16, ], - "type": "Keyword", - "value": "in", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/forIn/for-in-with-assigment.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 4, + "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 25, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 35, + ], + "type": "CallExpression", }, - "start": Object { - "column": 32, - "line": 4, + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 36, + ], + "type": "ExpressionStatement", + }, + "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 15, + ], + "raw": "42", + "type": "Literal", + "value": 42, + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 15, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, }, + "range": Array [ + 5, + 15, + ], + "type": "VariableDeclaration", }, - "range": Array [ - 81, - 87, - ], - "type": "Identifier", - "value": "stored", - }, - Object { "loc": Object { "end": Object { - "column": 40, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 39, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 88, - 89, + 0, + 36, ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 4, - }, - "start": Object { - "column": 41, - "line": 4, + "right": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, }, + "name": "list", + "range": Array [ + 19, + 23, + ], + "type": "Identifier", }, - "range": Array [ - 90, - 91, - ], - "type": "Identifier", - "value": "a", + "type": "ForInStatement", }, - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 4, - }, - "start": Object { - "column": 42, - "line": 4, - }, - }, - "range": Array [ - 91, - 92, - ], - "type": "Punctuator", - "value": ",", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, }, - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 4, - }, - "start": Object { - "column": 44, - "line": 4, - }, - }, - "range": Array [ - 93, - 94, - ], - "type": "Punctuator", - "value": "{", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 46, - "line": 4, + "column": 3, + "line": 1, }, "start": Object { - "column": 45, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 94, - 95, + 0, + 3, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 4, + "column": 5, + "line": 1, }, "start": Object { - "column": 46, - "line": 4, + "column": 4, + "line": 1, }, }, "range": Array [ - 95, - 96, + 4, + 5, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 49, - "line": 4, - }, - "start": Object { - "column": 48, - "line": 4, - }, - }, - "range": Array [ - 97, - 98, - ], - "type": "Numeric", - "value": "0", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 50, - "line": 4, + "column": 8, + "line": 1, }, "start": Object { - "column": 49, - "line": 4, + "column": 5, + "line": 1, }, }, "range": Array [ - 98, - 99, + 5, + 8, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 52, - "line": 4, + "column": 10, + "line": 1, }, "start": Object { - "column": 51, - "line": 4, + "column": 9, + "line": 1, }, }, "range": Array [ - 100, - 101, + 9, + 10, ], "type": "Identifier", - "value": "b", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 53, - "line": 4, + "column": 12, + "line": 1, }, "start": Object { - "column": 52, - "line": 4, + "column": 11, + "line": 1, }, }, "range": Array [ - 101, - 102, + 11, + 12, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 55, - "line": 4, + "column": 15, + "line": 1, }, "start": Object { - "column": 54, - "line": 4, + "column": 13, + "line": 1, }, }, "range": Array [ - 103, - 104, + 13, + 15, ], "type": "Numeric", - "value": "1", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 4, + "column": 18, + "line": 1, }, "start": Object { - "column": 55, - "line": 4, + "column": 16, + "line": 1, }, }, "range": Array [ - 104, - 105, + 16, + 18, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 58, - "line": 4, + "column": 23, + "line": 1, }, "start": Object { - "column": 57, - "line": 4, + "column": 19, + "line": 1, }, }, "range": Array [ - 106, - 107, + 19, + 23, ], "type": "Identifier", - "value": "c", - }, - Object { - "loc": Object { - "end": Object { - "column": 59, - "line": 4, - }, - "start": Object { - "column": 58, - "line": 4, - }, - }, - "range": Array [ - 107, - 108, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 61, - "line": 4, - }, - "start": Object { - "column": 60, - "line": 4, - }, - }, - "range": Array [ - 109, - 110, - ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 4, - }, - "start": Object { - "column": 61, - "line": 4, - }, - }, - "range": Array [ - 110, - 111, - ], - "type": "Punctuator", - "value": "}", + "value": "list", }, Object { "loc": Object { "end": Object { - "column": 63, - "line": 4, + "column": 24, + "line": 1, }, "start": Object { - "column": 62, - "line": 4, + "column": 23, + "line": 1, }, }, "range": Array [ - 111, - 112, + 23, + 24, ], "type": "Punctuator", "value": ")", @@ -84375,200 +92243,141 @@ Object { Object { "loc": Object { "end": Object { - "column": 65, - "line": 4, + "column": 32, + "line": 1, }, "start": Object { - "column": 64, - "line": 4, + "column": 25, + "line": 1, }, }, "range": Array [ - 113, - 114, + 25, + 32, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "process", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 33, + "line": 1, }, "start": Object { - "column": 2, - "line": 5, + "column": 32, + "line": 1, }, }, "range": Array [ - 117, - 119, + 32, + 33, ], "type": "Punctuator", - "value": "++", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 5, + "column": 34, + "line": 1, }, "start": Object { - "column": 4, - "line": 5, + "column": 33, + "line": 1, }, }, "range": Array [ - 119, - 129, + 33, + 34, ], "type": "Identifier", - "value": "iterations", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 35, + "line": 1, }, "start": Object { - "column": 14, - "line": 5, + "column": 34, + "line": 1, }, }, "range": Array [ - 129, - 130, + 34, + 35, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 36, + "line": 1, }, "start": Object { - "column": 0, - "line": 6, + "column": 35, + "line": 1, }, }, "range": Array [ - 131, - 132, + 35, + 36, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-destruction.src 1`] = ` +exports[`javascript fixtures/forIn/for-in-with-bare-assigment.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 33, + "column": 19, "line": 1, }, "start": Object { - "column": 31, + "column": 18, "line": 1, }, }, "range": Array [ - 31, - 33, + 18, + 19, ], - "type": "BlockStatement", + "type": "EmptyStatement", }, "left": Object { - "declarations": Array [ - Object { - "id": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 22, - ], - "type": "ArrayPattern", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, }, - "range": Array [ - 9, - 22, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "name": "x", + "range": Array [ + 5, + 6, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 22, + "column": 10, "line": 1, }, "start": Object { @@ -84576,15 +92385,35 @@ Object { "line": 1, }, }, + "operator": "=", "range": Array [ 5, - 22, + 10, ], - "type": "VariableDeclaration", + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "raw": "0", + "type": "Literal", + "value": 0, + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 33, + "column": 19, "line": 1, }, "start": Object { @@ -84594,23 +92423,23 @@ Object { }, "range": Array [ 0, - 33, + 19, ], "right": Object { "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 26, + "column": 14, "line": 1, }, }, - "name": "obj", + "name": "arr", "range": Array [ - 26, - 29, + 14, + 17, ], "type": "Identifier", }, @@ -84629,7 +92458,7 @@ Object { }, "range": Array [ 0, - 34, + 20, ], "sourceType": "script", "tokens": Array [ @@ -84672,7 +92501,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -84682,115 +92511,61 @@ Object { }, "range": Array [ 5, - 8, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 14, + 6, ], "type": "Identifier", - "value": "name", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 8, "line": 1, }, "start": Object { - "column": 14, + "column": 7, "line": 1, }, }, "range": Array [ - 14, - 15, + 7, + 8, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - "value": "value", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 10, "line": 1, }, "start": Object { - "column": 21, + "column": 9, "line": 1, }, }, "range": Array [ - 21, - 22, + 9, + 10, ], - "type": "Punctuator", - "value": "]", + "type": "Numeric", + "value": "0", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 13, "line": 1, }, "start": Object { - "column": 23, + "column": 11, "line": 1, }, }, "range": Array [ - 23, - 25, + 11, + 13, ], "type": "Keyword", "value": "in", @@ -84798,35 +92573,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 26, + "column": 14, "line": 1, }, }, "range": Array [ - 26, - 29, + 14, + 17, ], "type": "Identifier", - "value": "obj", + "value": "arr", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { - "column": 29, + "column": 17, "line": 1, }, }, "range": Array [ - 29, - 30, + 17, + 18, ], "type": "Punctuator", "value": ")", @@ -84834,65 +92609,101 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, + "column": 19, "line": 1, }, "start": Object { - "column": 32, + "column": 18, "line": 1, }, }, "range": Array [ - 32, - 33, + 18, + 19, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-destruction-object.src 1`] = ` +exports[`javascript fixtures/forIn/for-in-with-const.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 22, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 32, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { "column": 33, "line": 1, }, "start": Object { - "column": 31, + "column": 22, "line": 1, }, }, "range": Array [ - 31, + 22, 33, ], - "type": "BlockStatement", + "type": "ExpressionStatement", }, "left": Object { "declarations": Array [ @@ -84900,158 +92711,43 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 10, - 14, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 16, - 21, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - }, - ], + "name": "x", "range": Array [ - 9, - 22, + 11, + 12, ], - "type": "ObjectPattern", + "type": "Identifier", }, "init": null, "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, "range": Array [ - 9, - 22, + 11, + 12, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { @@ -85061,7 +92757,7 @@ Object { }, "range": Array [ 5, - 22, + 12, ], "type": "VariableDeclaration", }, @@ -85082,18 +92778,18 @@ Object { "right": Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { - "column": 26, + "column": 16, "line": 1, }, }, - "name": "obj", + "name": "list", "range": Array [ - 26, - 29, + 16, + 20, ], "type": "Identifier", }, @@ -85155,7 +92851,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -85165,46 +92861,28 @@ Object { }, "range": Array [ 5, - 8, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, 10, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, "range": Array [ - 10, - 14, + 11, + 12, ], "type": "Identifier", - "value": "name", + "value": "x", }, Object { "loc": Object { @@ -85213,21 +92891,21 @@ Object { "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ - 14, + 13, 15, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 20, "line": 1, }, "start": Object { @@ -85237,82 +92915,82 @@ Object { }, "range": Array [ 16, - 21, + 20, ], "type": "Identifier", - "value": "value", + "value": "list", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { - "column": 21, + "column": 20, "line": 1, }, }, "range": Array [ + 20, 21, - 22, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 29, "line": 1, }, "start": Object { - "column": 23, + "column": 22, "line": 1, }, }, "range": Array [ - 23, - 25, + 22, + 29, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "process", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 30, "line": 1, }, "start": Object { - "column": 26, + "column": 29, "line": 1, }, }, "range": Array [ - 26, 29, + 30, ], - "type": "Identifier", - "value": "obj", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 31, "line": 1, }, "start": Object { - "column": 29, + "column": 30, "line": 1, }, }, "range": Array [ - 29, 30, + 31, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -85330,7 +93008,7 @@ Object { 32, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { @@ -85348,41 +93026,130 @@ Object { 33, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-object.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/forIn/for-in-object-with-body.src 1`] = ` +exports[`javascript fixtures/forIn/for-in-with-milti-asigment.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { - "column": 14, + "column": 24, "line": 1, }, }, "range": Array [ - 14, - 16, + 24, + 25, ], - "type": "BlockStatement", + "type": "EmptyStatement", }, "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 13, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 13, + 18, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 18, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 6, + "column": 18, "line": 1, }, "start": Object { @@ -85390,16 +93157,15 @@ Object { "line": 1, }, }, - "name": "i", "range": Array [ 5, - 6, + 18, ], - "type": "Identifier", + "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { @@ -85409,25 +93175,25 @@ Object { }, "range": Array [ 0, - 16, + 25, ], "right": Object { "loc": Object { "end": Object { - "column": 12, + "column": 23, "line": 1, }, "start": Object { - "column": 10, + "column": 22, "line": 1, }, }, - "properties": Array [], + "name": "q", "range": Array [ - 10, - 12, + 22, + 23, ], - "type": "ObjectExpression", + "type": "Identifier", }, "type": "ForInStatement", }, @@ -85444,7 +93210,7 @@ Object { }, "range": Array [ 0, - 17, + 26, ], "sourceType": "script", "tokens": Array [ @@ -85487,7 +93253,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -85497,278 +93263,315 @@ Object { }, "range": Array [ 5, - 6, + 8, ], - "type": "Identifier", - "value": "i", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, 9, + 10, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 12, "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, "range": Array [ - 10, 11, + 12, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "range": Array [ - 11, - 12, + 13, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 15, "line": 1, }, }, "range": Array [ - 12, - 13, + 15, + 16, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 14, + "column": 17, "line": 1, }, }, "range": Array [ - 14, - 15, + 17, + 18, + ], + "type": "Identifier", + "value": "z", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 21, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "q", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 24, "line": 1, }, }, "range": Array [ - 15, - 16, + 24, + 25, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-with-assigment.src 1`] = ` +exports[`javascript fixtures/forIn/for-in-with-rest.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "expression": Object { - "arguments": Array [ - Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 41, + ], + "type": "BlockStatement", + }, + "left": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 34, + "column": 8, "line": 1, }, "start": Object { - "column": 33, + "column": 7, "line": 1, }, }, "name": "x", "range": Array [ - 33, - 34, + 7, + 8, ], "type": "Identifier", }, - ], - "callee": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 32, + "column": 12, "line": 1, }, "start": Object { - "column": 25, + "column": 7, "line": 1, }, }, - "name": "process", + "method": false, "range": Array [ - 25, - 32, + 7, + 12, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 35, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 36, - ], - "type": "ExpressionStatement", - }, - "left": Object { - "declarations": Array [ - Object { - "id": Object { + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, - "name": "x", + "name": "xx", "range": Array [ - 9, 10, + 12, ], "type": "Identifier", }, - "init": Object { + }, + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 15, + "column": 25, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, + "name": "rrestOff", "range": Array [ - 13, - 15, + 17, + 25, ], - "raw": "42", - "type": "Literal", - "value": 42, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 15, + "column": 25, "line": 1, }, "start": Object { - "column": 9, + "column": 14, "line": 1, }, }, "range": Array [ - 9, - 15, + 14, + 25, ], - "type": "VariableDeclarator", + "type": "SpreadElement", }, ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, "range": Array [ 5, - 15, + 27, ], - "type": "VariableDeclaration", + "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { "column": 0, @@ -85777,23 +93580,23 @@ Object { }, "range": Array [ 0, - 36, + 41, ], "right": Object { "loc": Object { "end": Object { - "column": 23, + "column": 36, "line": 1, }, "start": Object { - "column": 19, + "column": 31, "line": 1, }, }, - "name": "list", + "name": "array", "range": Array [ - 19, - 23, + 31, + 36, ], "type": "Identifier", }, @@ -85803,7 +93606,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -85812,7 +93615,7 @@ Object { }, "range": Array [ 0, - 37, + 42, ], "sourceType": "script", "tokens": Array [ @@ -85855,7 +93658,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -85865,25 +93668,25 @@ Object { }, "range": Array [ 5, - 8, + 6, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 10, + 7, + 8, ], "type": "Identifier", "value": "x", @@ -85891,228 +93694,322 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 9, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ - 11, - 12, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 12, "line": 1, }, "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 12, + ], + "type": "Identifier", + "value": "xx", + }, + Object { + "loc": Object { + "end": Object { "column": 13, "line": 1, }, + "start": Object { + "column": 12, + "line": 1, + }, }, "range": Array [ + 12, 13, - 15, ], - "type": "Numeric", - "value": "42", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 17, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, "range": Array [ - 16, - 18, + 14, + 17, ], - "type": "Keyword", - "value": "in", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 25, "line": 1, }, "start": Object { - "column": 19, + "column": 17, "line": 1, }, }, "range": Array [ - 19, - 23, + 17, + 25, ], "type": "Identifier", - "value": "list", + "value": "rrestOff", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 27, "line": 1, }, "start": Object { - "column": 23, + "column": 26, "line": 1, }, }, "range": Array [ - 23, - 24, + 26, + 27, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 1, }, "start": Object { - "column": 25, + "column": 28, "line": 1, }, }, "range": Array [ - 25, - 32, + 28, + 30, ], - "type": "Identifier", - "value": "process", + "type": "Keyword", + "value": "in", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 36, "line": 1, }, "start": Object { - "column": 32, + "column": 31, "line": 1, }, }, "range": Array [ - 32, - 33, + 31, + 36, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "array", }, Object { "loc": Object { "end": Object { - "column": 34, + "column": 37, "line": 1, }, "start": Object { - "column": 33, + "column": 36, "line": 1, }, }, "range": Array [ - 33, - 34, + 36, + 37, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 39, "line": 1, }, "start": Object { - "column": 34, + "column": 38, "line": 1, }, }, "range": Array [ - 34, - 35, + 38, + 39, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 35, - 36, + 40, + 41, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-with-bare-assigment.src 1`] = ` +exports[`javascript fixtures/forIn/for-in-with-var.src 1`] = ` Object { "body": Array [ Object { "body": Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 20, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 30, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 20, "line": 1, }, }, "range": Array [ - 18, - 19, + 20, + 31, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, "left": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, - "start": Object { - "column": 5, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "range": Array [ + 9, + 10, + ], + "type": "VariableDeclarator", }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { "column": 10, @@ -86123,35 +94020,15 @@ Object { "line": 1, }, }, - "operator": "=", "range": Array [ 5, 10, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "raw": "0", - "type": "Literal", - "value": 0, - }, - "type": "AssignmentExpression", + "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 1, }, "start": Object { @@ -86161,12 +94038,12 @@ Object { }, "range": Array [ 0, - 19, + 31, ], "right": Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { @@ -86174,10 +94051,10 @@ Object { "line": 1, }, }, - "name": "arr", + "name": "list", "range": Array [ 14, - 17, + 18, ], "type": "Identifier", }, @@ -86196,7 +94073,7 @@ Object { }, "range": Array [ 0, - 20, + 32, ], "sourceType": "script", "tokens": Array [ @@ -86239,7 +94116,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -86249,7 +94126,25 @@ Object { }, "range": Array [ 5, - 6, + 8, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, ], "type": "Identifier", "value": "x", @@ -86257,89 +94152,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 11, "line": 1, }, }, "range": Array [ - 7, - 8, + 11, + 13, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "Identifier", + "value": "list", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 27, "line": 1, }, "start": Object { - "column": 9, + "column": 20, "line": 1, }, }, "range": Array [ - 9, - 10, + 20, + 27, ], - "type": "Numeric", - "value": "0", + "type": "Identifier", + "value": "process", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 28, "line": 1, }, "start": Object { - "column": 11, + "column": 27, "line": 1, }, }, "range": Array [ - 11, - 13, + 27, + 28, ], - "type": "Keyword", - "value": "in", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 29, "line": 1, }, "start": Object { - "column": 14, + "column": 28, "line": 1, }, }, "range": Array [ - 14, - 17, + 28, + 29, ], "type": "Identifier", - "value": "arr", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 30, "line": 1, }, "start": Object { - "column": 17, + "column": 29, "line": 1, }, }, "range": Array [ - 17, - 18, + 29, + 30, ], "type": "Punctuator", "value": ")", @@ -86347,17 +94278,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 30, "line": 1, }, }, "range": Array [ - 18, - 19, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -86367,79 +94298,61 @@ Object { } `; -exports[`javascript fixtures/forIn/for-in-with-const.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-array.src 1`] = ` Object { "body": Array [ Object { + "await": false, "body": Object { "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 30, - 31, - ], - "type": "Identifier", - }, - ], + "arguments": Array [], "callee": Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "process", + "name": "doSomething", "range": Array [ 22, - 29, + 33, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ 22, - 32, + 35, ], "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ 22, - 33, + 36, ], "type": "ExpressionStatement", }, @@ -86449,43 +94362,43 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "name": "x", "range": Array [ - 11, - 12, + 9, + 10, ], "type": "Identifier", }, "init": null, "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 12, + 9, + 10, ], "type": "VariableDeclarator", }, ], - "kind": "const", + "kind": "let", "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { @@ -86495,14 +94408,14 @@ Object { }, "range": Array [ 5, - 12, + 10, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 0, @@ -86511,33 +94424,33 @@ Object { }, "range": Array [ 0, - 33, + 36, ], "right": Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 20, + "column": 16, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, - "name": "list", "range": Array [ + 14, 16, - 20, ], - "type": "Identifier", + "type": "ArrayPattern", }, - "type": "ForInStatement", + "type": "ForOfStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -86546,7 +94459,7 @@ Object { }, "range": Array [ 0, - 34, + 37, ], "sourceType": "script", "tokens": Array [ @@ -86589,7 +94502,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -86599,25 +94512,25 @@ Object { }, "range": Array [ 5, - 10, + 8, ], "type": "Keyword", - "value": "const", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 12, + 9, + 10, ], "type": "Identifier", "value": "x", @@ -86625,125 +94538,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 13, - 15, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 15, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, "range": Array [ - 16, - 20, + 14, + 15, ], - "type": "Identifier", - "value": "list", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 16, "line": 1, }, "start": Object { - "column": 20, + "column": 15, "line": 1, }, }, "range": Array [ - 20, - 21, + 15, + 16, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 29, + 16, + 17, ], - "type": "Identifier", - "value": "process", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 29, - 30, + 22, + 33, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "doSomething", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 30, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 30, - 31, + 33, + 34, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 31, - 32, + 34, + 35, ], "type": "Punctuator", "value": ")", @@ -86751,17 +94664,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 32, - 33, + 35, + 36, ], "type": "Punctuator", "value": ";", @@ -86771,105 +94684,91 @@ Object { } `; -exports[`javascript fixtures/forIn/for-in-with-milti-asigment.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-destruction.src 1`] = ` Object { "body": Array [ Object { + "await": false, "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { - "column": 24, + "column": 31, "line": 1, }, }, "range": Array [ - 24, - 25, + 31, + 33, ], - "type": "EmptyStatement", + "type": "BlockStatement", }, "left": Object { "declarations": Array [ Object { "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "init": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, - "start": Object { - "column": 13, - "line": 1, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", }, - "name": "y", - "range": Array [ - 13, - 14, - ], - "type": "Identifier", - }, + ], "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 13, + "column": 9, "line": 1, }, }, - "operator": "=", "range": Array [ - 13, - 18, + 9, + 22, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "z", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", + "type": "ArrayPattern", }, + "init": null, "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { @@ -86879,7 +94778,7 @@ Object { }, "range": Array [ 9, - 18, + 22, ], "type": "VariableDeclarator", }, @@ -86887,7 +94786,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { @@ -86897,13 +94796,13 @@ Object { }, "range": Array [ 5, - 18, + 22, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { @@ -86913,27 +94812,27 @@ Object { }, "range": Array [ 0, - 25, + 33, ], "right": Object { "loc": Object { "end": Object { - "column": 23, + "column": 29, "line": 1, }, "start": Object { - "column": 22, + "column": 26, "line": 1, }, }, - "name": "q", + "name": "obj", "range": Array [ - 22, - 23, + 26, + 29, ], "type": "Identifier", }, - "type": "ForInStatement", + "type": "ForOfStatement", }, ], "loc": Object { @@ -86948,7 +94847,7 @@ Object { }, "range": Array [ 0, - 26, + 34, ], "sourceType": "script", "tokens": Array [ @@ -87021,233 +94920,198 @@ Object { 9, 10, ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], "type": "Identifier", - "value": "x", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 14, "line": 1, }, }, "range": Array [ - 11, - 12, + 14, + 15, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 21, "line": 1, }, "start": Object { - "column": 13, + "column": 16, "line": 1, }, }, "range": Array [ - 13, - 14, + 16, + 21, ], "type": "Identifier", - "value": "y", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 15, + "column": 21, "line": 1, }, }, "range": Array [ - 15, - 16, + 21, + 22, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 25, "line": 1, }, "start": Object { - "column": 17, + "column": 23, "line": 1, }, }, "range": Array [ - 17, - 18, + 23, + 25, ], "type": "Identifier", - "value": "z", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 29, "line": 1, }, "start": Object { - "column": 19, + "column": 26, "line": 1, }, }, "range": Array [ - 19, - 21, + 26, + 29, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 30, "line": 1, }, "start": Object { - "column": 22, + "column": 29, "line": 1, }, }, "range": Array [ - 22, - 23, + 29, + 30, ], - "type": "Identifier", - "value": "q", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 32, "line": 1, }, "start": Object { - "column": 23, + "column": 31, "line": 1, }, }, "range": Array [ - 23, - 24, + 31, + 32, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 33, "line": 1, }, "start": Object { - "column": 24, + "column": 32, "line": 1, }, }, "range": Array [ - 24, - 25, + 32, + 33, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/forIn/for-in-with-var.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-destruction-object.src 1`] = ` Object { "body": Array [ Object { + "await": false, "body": Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "process", - "range": Array [ - 20, - 27, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 30, - ], - "type": "CallExpression", - }, + "body": Array [], "loc": Object { "end": Object { - "column": 31, + "column": 33, "line": 1, }, "start": Object { - "column": 20, + "column": 31, "line": 1, }, }, "range": Array [ - 20, 31, + 33, ], - "type": "ExpressionStatement", + "type": "BlockStatement", }, "left": Object { "declarations": Array [ @@ -87255,7 +95119,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 1, }, "start": Object { @@ -87263,17 +95127,132 @@ Object { "line": 1, }, }, - "name": "x", + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 14, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "name", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 21, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "value", + "range": Array [ + 16, + 21, + ], + "type": "Identifier", + }, + }, + ], "range": Array [ 9, - 10, + 22, ], - "type": "Identifier", + "type": "ObjectPattern", }, "init": null, "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 1, }, "start": Object { @@ -87283,7 +95262,7 @@ Object { }, "range": Array [ 9, - 10, + 22, ], "type": "VariableDeclarator", }, @@ -87291,7 +95270,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 1, }, "start": Object { @@ -87301,13 +95280,13 @@ Object { }, "range": Array [ 5, - 10, + 22, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 31, + "column": 33, "line": 1, }, "start": Object { @@ -87317,27 +95296,27 @@ Object { }, "range": Array [ 0, - 31, + 33, ], "right": Object { "loc": Object { "end": Object { - "column": 18, + "column": 29, "line": 1, }, "start": Object { - "column": 14, + "column": 26, "line": 1, }, }, - "name": "list", + "name": "obj", "range": Array [ - 14, - 18, + 26, + 29, ], "type": "Identifier", }, - "type": "ForInStatement", + "type": "ForOfStatement", }, ], "loc": Object { @@ -87352,7 +95331,7 @@ Object { }, "range": Array [ 0, - 32, + 34, ], "sourceType": "script", "tokens": Array [ @@ -87425,31 +95404,31 @@ Object { 9, 10, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 10, "line": 1, }, }, "range": Array [ - 11, - 13, + 10, + 14, ], - "type": "Keyword", - "value": "in", + "type": "Identifier", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { @@ -87459,125 +95438,143 @@ Object { }, "range": Array [ 14, - 18, + 15, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, ], "type": "Identifier", - "value": "list", + "value": "value", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 22, "line": 1, }, "start": Object { - "column": 18, + "column": 21, "line": 1, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 25, "line": 1, }, "start": Object { - "column": 20, + "column": 23, "line": 1, }, }, "range": Array [ - 20, - 27, + 23, + 25, ], "type": "Identifier", - "value": "process", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 29, "line": 1, }, "start": Object { - "column": 27, + "column": 26, "line": 1, }, }, "range": Array [ - 27, - 28, + 26, + 29, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 30, "line": 1, }, "start": Object { - "column": 28, + "column": 29, "line": 1, }, }, "range": Array [ - 28, 29, + 30, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 32, "line": 1, }, "start": Object { - "column": 29, + "column": 31, "line": 1, }, }, "range": Array [ - 29, - 30, + 31, + 32, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 33, "line": 1, }, "start": Object { - "column": 30, + "column": 32, "line": 1, }, }, "range": Array [ - 30, - 31, + 32, + 33, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/forOf/for-of-array.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-object.src 1`] = ` Object { "body": Array [ Object { @@ -87706,7 +95703,6 @@ Object { 36, ], "right": Object { - "elements": Array [], "loc": Object { "end": Object { "column": 16, @@ -87717,11 +95713,12 @@ Object { "line": 1, }, }, + "properties": Array [], "range": Array [ 14, 16, ], - "type": "ArrayPattern", + "type": "ObjectExpression", }, "type": "ForOfStatement", }, @@ -87848,7 +95845,7 @@ Object { 15, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { @@ -87866,7 +95863,7 @@ Object { 16, ], "type": "Punctuator", - "value": "]", + "value": "}", }, Object { "loc": Object { @@ -87963,91 +95960,220 @@ Object { } `; -exports[`javascript fixtures/forOf/for-of-destruction.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-function-initializer.src 1`] = ` Object { "body": Array [ Object { "await": false, "body": Object { - "body": Array [], + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 61, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 61, + 62, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 60, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "name": "process", + "range": Array [ + 53, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 53, + "line": 1, + }, + }, + "range": Array [ + 53, + 63, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 33, + "column": 64, "line": 1, }, "start": Object { - "column": 31, + "column": 53, "line": 1, }, }, "range": Array [ - 31, - 33, + 53, + 64, ], - "type": "BlockStatement", + "type": "ExpressionStatement", }, "left": Object { "declarations": Array [ Object { "id": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 10, + "line": 1, }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "i", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "raw": "10", + "type": "Literal", + "value": 10, + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "operator": "in", + "range": Array [ + 33, + 41, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 41, + ], + "type": "ArrayExpression", + }, + "type": "BinaryExpression", }, - "start": Object { - "column": 16, - "line": 1, + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, }, + "range": Array [ + 26, + 41, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, }, - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", }, - ], + "range": Array [ + 24, + 43, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 22, + "column": 43, "line": 1, }, "start": Object { - "column": 9, + "column": 13, "line": 1, }, }, + "params": Array [], "range": Array [ - 9, - 22, + 13, + 43, ], - "type": "ArrayPattern", + "type": "FunctionExpression", }, - "init": null, "loc": Object { "end": Object { - "column": 22, + "column": 43, "line": 1, }, "start": Object { @@ -88057,7 +96183,7 @@ Object { }, "range": Array [ 9, - 22, + 43, ], "type": "VariableDeclarator", }, @@ -88065,7 +96191,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 22, + "column": 43, "line": 1, }, "start": Object { @@ -88075,13 +96201,13 @@ Object { }, "range": Array [ 5, - 22, + 43, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 33, + "column": 64, "line": 1, }, "start": Object { @@ -88091,23 +96217,23 @@ Object { }, "range": Array [ 0, - 33, + 64, ], "right": Object { "loc": Object { "end": Object { - "column": 29, + "column": 51, "line": 1, }, "start": Object { - "column": 26, + "column": 47, "line": 1, }, }, - "name": "obj", + "name": "list", "range": Array [ - 26, - 29, + 47, + 51, ], "type": "Identifier", }, @@ -88126,7 +96252,7 @@ Object { }, "range": Array [ 0, - 34, + 65, ], "sourceType": "script", "tokens": Array [ @@ -88199,177 +96325,357 @@ Object { 9, 10, ], + "type": "Identifier", + "value": "i", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 21, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 38, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], "type": "Punctuator", "value": "[", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 41, "line": 1, }, "start": Object { - "column": 10, + "column": 40, "line": 1, }, }, "range": Array [ - 10, - 14, + 40, + 41, ], - "type": "Identifier", - "value": "name", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 43, "line": 1, }, "start": Object { - "column": 14, + "column": 42, "line": 1, }, }, "range": Array [ - 14, - 15, + 42, + 43, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 46, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "of", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 51, "line": 1, }, "start": Object { - "column": 16, + "column": 47, "line": 1, }, }, "range": Array [ - 16, - 21, + 47, + 51, ], "type": "Identifier", - "value": "value", + "value": "list", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 52, "line": 1, }, "start": Object { - "column": 21, + "column": 51, "line": 1, }, }, "range": Array [ - 21, - 22, + 51, + 52, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 60, "line": 1, }, "start": Object { - "column": 23, + "column": 53, "line": 1, }, }, "range": Array [ - 23, - 25, + 53, + 60, ], "type": "Identifier", - "value": "of", + "value": "process", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 61, "line": 1, }, "start": Object { - "column": 26, + "column": 60, "line": 1, }, }, "range": Array [ - 26, - 29, + 60, + 61, ], - "type": "Identifier", - "value": "obj", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 62, "line": 1, }, "start": Object { - "column": 29, + "column": 61, "line": 1, }, }, "range": Array [ - 29, - 30, + 61, + 62, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 63, "line": 1, }, "start": Object { - "column": 31, + "column": 62, "line": 1, }, }, "range": Array [ - 31, - 32, + 62, + 63, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 64, "line": 1, }, "start": Object { - "column": 32, + "column": 63, "line": 1, }, }, "range": Array [ - 32, - 33, + 63, + 64, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/forOf/for-of-destruction-object.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-rest.src 1`] = ` Object { "body": Array [ Object { @@ -88378,195 +96684,135 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 31, + "column": 38, "line": 1, }, }, "range": Array [ - 31, - 33, + 38, + 41, ], "type": "BlockStatement", }, "left": Object { - "declarations": Array [ + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "properties": Array [ Object { - "id": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 22, + "column": 8, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 10, - 14, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "name", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 7, + 12, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 16, - 21, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "value", - "range": Array [ - 16, - 21, - ], - "type": "Identifier", - }, + "start": Object { + "column": 10, + "line": 1, }, + }, + "name": "xx", + "range": Array [ + 10, + 12, ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "rrestOff", "range": Array [ - 9, - 22, + 17, + 25, ], - "type": "ObjectPattern", + "type": "Identifier", }, - "init": null, "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 9, + "column": 14, "line": 1, }, }, "range": Array [ - 9, - 22, + 14, + 25, ], - "type": "VariableDeclarator", + "type": "SpreadElement", }, ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, "range": Array [ 5, - 22, + 27, ], - "type": "VariableDeclaration", + "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { "column": 0, @@ -88575,23 +96821,23 @@ Object { }, "range": Array [ 0, - 33, + 41, ], "right": Object { "loc": Object { "end": Object { - "column": 29, + "column": 36, "line": 1, }, "start": Object { - "column": 26, + "column": 31, "line": 1, }, }, - "name": "obj", + "name": "array", "range": Array [ - 26, - 29, + 31, + 36, ], "type": "Identifier", }, @@ -88601,7 +96847,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -88610,7 +96856,7 @@ Object { }, "range": Array [ 0, - 34, + 42, ], "sourceType": "script", "tokens": Array [ @@ -88653,7 +96899,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -88663,33 +96909,51 @@ Object { }, "range": Array [ 5, - 8, + 6, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { "column": 9, "line": 1, }, + "start": Object { + "column": 8, + "line": 1, + }, }, "range": Array [ + 8, 9, - 10, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { @@ -88699,15 +96963,33 @@ Object { }, "range": Array [ 10, - 14, + 12, ], "type": "Identifier", - "value": "name", + "value": "xx", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, "line": 1, }, "start": Object { @@ -88717,43 +96999,43 @@ Object { }, "range": Array [ 14, - 15, + 17, ], "type": "Punctuator", - "value": ",", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, - 21, + 17, + 25, ], "type": "Identifier", - "value": "value", + "value": "rrestOff", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { - "column": 21, + "column": 26, "line": 1, }, }, "range": Array [ - 21, - 22, + 26, + 27, ], "type": "Punctuator", "value": "}", @@ -88761,17 +97043,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { - "column": 23, + "column": 28, "line": 1, }, }, "range": Array [ - 23, - 25, + 28, + 30, ], "type": "Identifier", "value": "of", @@ -88779,35 +97061,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 36, "line": 1, }, "start": Object { - "column": 26, + "column": 31, "line": 1, }, }, "range": Array [ - 26, - 29, + 31, + 36, ], "type": "Identifier", - "value": "obj", + "value": "array", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 37, "line": 1, }, "start": Object { - "column": 29, + "column": 36, "line": 1, }, }, "range": Array [ - 29, - 30, + 36, + 37, ], "type": "Punctuator", "value": ")", @@ -88815,17 +97097,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 39, "line": 1, }, "start": Object { - "column": 31, + "column": 38, "line": 1, }, }, "range": Array [ - 31, - 32, + 38, + 39, ], "type": "Punctuator", "value": "{", @@ -88833,17 +97115,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 1, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 32, - 33, + 40, + 41, ], "type": "Punctuator", "value": "}", @@ -88853,18 +97135,53 @@ Object { } `; -exports[`javascript fixtures/forOf/for-of-object.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` Object { "body": Array [ Object { "await": false, "body": Object { - "expression": Object { - "arguments": Array [], - "callee": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "doSomething", + "range": Array [ + 25, + 36, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 2, }, "start": Object { @@ -88872,44 +97189,28 @@ Object { "line": 2, }, }, - "name": "doSomething", "range": Array [ - 22, - 33, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, + 25, + 39, + ], + "type": "ExpressionStatement", }, - "range": Array [ - 22, - 35, - ], - "type": "CallExpression", - }, + ], "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 22, - 36, + 19, + 41, ], - "type": "ExpressionStatement", + "type": "BlockStatement", }, "left": Object { "declarations": Array [ @@ -88950,7 +97251,7 @@ Object { "type": "VariableDeclarator", }, ], - "kind": "let", + "kind": "var", "loc": Object { "end": Object { "column": 10, @@ -88969,8 +97270,8 @@ Object { }, "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -88979,12 +97280,12 @@ Object { }, "range": Array [ 0, - 36, + 41, ], "right": Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -88992,12 +97293,12 @@ Object { "line": 1, }, }, - "properties": Array [], + "name": "foo", "range": Array [ 14, - 16, + 17, ], - "type": "ObjectExpression", + "type": "Identifier", }, "type": "ForOfStatement", }, @@ -89005,7 +97306,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -89014,7 +97315,7 @@ Object { }, "range": Array [ 0, - 37, + 42, ], "sourceType": "script", "tokens": Array [ @@ -89070,7 +97371,7 @@ Object { 8, ], "type": "Keyword", - "value": "let", + "value": "var", }, Object { "loc": Object { @@ -89111,7 +97412,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { @@ -89121,46 +97422,46 @@ Object { }, "range": Array [ 14, - 15, + 17, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 16, + 17, + 18, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 19, "line": 1, }, }, "range": Array [ - 16, - 17, + 19, + 20, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { @@ -89174,8 +97475,8 @@ Object { }, }, "range": Array [ - 22, - 33, + 25, + 36, ], "type": "Identifier", "value": "doSomething", @@ -89192,8 +97493,8 @@ Object { }, }, "range": Array [ - 33, - 34, + 36, + 37, ], "type": "Punctuator", "value": "(", @@ -89210,8 +97511,8 @@ Object { }, }, "range": Array [ - 34, - 35, + 37, + 38, ], "type": "Punctuator", "value": ")", @@ -89228,91 +97529,90 @@ Object { }, }, "range": Array [ - 35, - 36, + 38, + 39, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`javascript fixtures/forOf/for-of-with-function-initializer.src 1`] = ` +exports[`javascript fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` Object { "body": Array [ Object { "await": false, "body": Object { "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 61, - 62, - ], - "type": "Identifier", - }, - ], + "arguments": Array [], "callee": Object { "loc": Object { "end": Object { - "column": 60, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 53, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "process", + "name": "doSomething", "range": Array [ - 53, - 60, + 23, + 34, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 63, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 53, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 53, - 63, + 23, + 36, ], "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 53, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 53, - 64, + 23, + 37, ], "type": "ExpressionStatement", }, @@ -89330,129 +97630,17 @@ Object { "line": 1, }, }, - "name": "i", + "name": "x", "range": Array [ 9, 10, ], "type": "Identifier", }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 35, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "operator": "in", - "range": Array [ - 33, - 41, - ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 41, - ], - "type": "ArrayExpression", - }, - "type": "BinaryExpression", - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 41, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 43, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 13, - 43, - ], - "type": "FunctionExpression", - }, + "init": null, "loc": Object { "end": Object { - "column": 43, + "column": 10, "line": 1, }, "start": Object { @@ -89462,7 +97650,7 @@ Object { }, "range": Array [ 9, - 43, + 10, ], "type": "VariableDeclarator", }, @@ -89470,7 +97658,7 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 43, + "column": 10, "line": 1, }, "start": Object { @@ -89480,14 +97668,14 @@ Object { }, "range": Array [ 5, - 43, + 10, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { "column": 0, @@ -89496,23 +97684,23 @@ Object { }, "range": Array [ 0, - 64, + 37, ], "right": Object { "loc": Object { "end": Object { - "column": 51, + "column": 17, "line": 1, }, "start": Object { - "column": 47, + "column": 14, "line": 1, }, }, - "name": "list", + "name": "foo", "range": Array [ - 47, - 51, + 14, + 17, ], "type": "Identifier", }, @@ -89522,7 +97710,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -89531,294 +97719,96 @@ Object { }, "range": Array [ 0, - 65, + 38, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "for", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 8, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "i", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 21, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 35, - ], - "type": "Numeric", - "value": "10", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, + "column": 3, "line": 1, }, "start": Object { - "column": 36, + "column": 0, "line": 1, }, }, "range": Array [ - 36, - 38, + 0, + 3, ], "type": "Keyword", - "value": "in", + "value": "for", }, Object { "loc": Object { "end": Object { - "column": 40, + "column": 5, "line": 1, }, "start": Object { - "column": 39, + "column": 4, "line": 1, }, }, "range": Array [ - 39, - 40, + 4, + 5, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 8, "line": 1, }, "start": Object { - "column": 40, + "column": 5, "line": 1, }, }, "range": Array [ - 40, - 41, + 5, + 8, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 43, + "column": 10, "line": 1, }, "start": Object { - "column": 42, + "column": 9, "line": 1, }, }, "range": Array [ - 42, - 43, + 9, + 10, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 46, + "column": 13, "line": 1, }, "start": Object { - "column": 44, + "column": 11, "line": 1, }, }, "range": Array [ - 44, - 46, + 11, + 13, ], "type": "Identifier", "value": "of", @@ -89826,35 +97816,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 51, + "column": 17, "line": 1, }, "start": Object { - "column": 47, + "column": 14, "line": 1, }, }, "range": Array [ - 47, - 51, + 14, + 17, ], "type": "Identifier", - "value": "list", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 52, + "column": 18, "line": 1, }, "start": Object { - "column": 51, + "column": 17, "line": 1, }, }, "range": Array [ - 51, - 52, + 17, + 18, ], "type": "Punctuator", "value": ")", @@ -89862,35 +97852,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 60, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 53, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 53, - 60, + 23, + 34, ], "type": "Identifier", - "value": "process", + "value": "doSomething", }, Object { "loc": Object { "end": Object { - "column": 61, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 60, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 60, - 61, + 34, + 35, ], "type": "Punctuator", "value": "(", @@ -89898,35 +97888,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 62, - "line": 1, - }, - "start": Object { - "column": 61, - "line": 1, - }, - }, - "range": Array [ - 61, - 62, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 63, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 62, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 62, - 63, + 35, + 36, ], "type": "Punctuator", "value": ")", @@ -89934,17 +97906,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 64, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 63, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 63, - 64, + 36, + 37, ], "type": "Punctuator", "value": ";", @@ -89954,53 +97926,18 @@ Object { } `; -exports[`javascript fixtures/forOf/for-of-with-var-and-braces.src 1`] = ` +exports[`javascript fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` Object { "body": Array [ Object { "await": false, "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "doSomething", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 38, - ], - "type": "CallExpression", - }, + "expression": Object { + "arguments": Array [], + "callee": Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 2, }, "start": Object { @@ -90008,28 +97945,44 @@ Object { "line": 2, }, }, + "name": "doSomething", "range": Array [ 25, - 39, + 36, ], - "type": "ExpressionStatement", + "type": "Identifier", }, - ], + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 25, + 38, + ], + "type": "CallExpression", + }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 41, + 25, + 39, ], - "type": "BlockStatement", + "type": "ExpressionStatement", }, "left": Object { "declarations": Array [ @@ -90037,43 +97990,43 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, "name": "x", "range": Array [ - 9, - 10, + 11, + 12, ], "type": "Identifier", }, "init": null, "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, "range": Array [ - 9, - 10, + 11, + 12, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -90083,14 +98036,14 @@ Object { }, "range": Array [ 5, - 10, + 12, ], "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 2, }, "start": Object { "column": 0, @@ -90099,23 +98052,23 @@ Object { }, "range": Array [ 0, - 41, + 39, ], "right": Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "name": "foo", "range": Array [ - 14, - 17, + 16, + 19, ], "type": "Identifier", }, @@ -90125,7 +98078,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 3, }, "start": Object { "column": 0, @@ -90134,7 +98087,7 @@ Object { }, "range": Array [ 0, - 42, + 40, ], "sourceType": "script", "tokens": Array [ @@ -90177,7 +98130,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -90187,25 +98140,25 @@ Object { }, "range": Array [ 5, - 8, + 10, ], "type": "Keyword", - "value": "var", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 11, "line": 1, }, }, "range": Array [ - 9, - 10, + 11, + 12, ], "type": "Identifier", "value": "x", @@ -90213,17 +98166,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 13, "line": 1, }, }, "range": Array [ - 11, 13, + 15, ], "type": "Identifier", "value": "of", @@ -90231,39 +98184,21 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, - 17, + 16, + 19, ], "type": "Identifier", "value": "foo", }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ")", - }, Object { "loc": Object { "end": Object { @@ -90280,7 +98215,7 @@ Object { 20, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { @@ -90354,30 +98289,12 @@ Object { "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } `; -exports[`javascript fixtures/forOf/for-of-with-var-and-no-braces.src 1`] = ` +exports[`javascript fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` Object { "body": Array [ Object { @@ -90474,7 +98391,7 @@ Object { "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "let", "loc": Object { "end": Object { "column": 10, @@ -90594,7 +98511,7 @@ Object { 8, ], "type": "Keyword", - "value": "var", + "value": "let", }, Object { "loc": Object { @@ -90745,159 +98662,125 @@ Object { } `; -exports[`javascript fixtures/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = ` +exports[`javascript fixtures/generators/anonymous-generator.src 1`] = ` Object { "body": Array [ Object { - "await": false, - "body": Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "delegate": false, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 23, + ], + "type": "YieldExpression", }, - }, - "name": "doSomething", - "range": Array [ - 25, - 36, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 38, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 25, - 39, - ], - "type": "ExpressionStatement", - }, - "left": Object { - "declarations": Array [ - Object { - "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 23, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, - "name": "x", "range": Array [ - 11, - 12, + 16, + 23, ], - "type": "Identifier", + "type": "ExpressionStatement", }, - "init": null, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, - "range": Array [ - 11, - 12, - ], - "type": "VariableDeclarator", }, - ], - "kind": "const", + "range": Array [ + 14, + 25, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 12, + "column": 25, "line": 1, }, "start": Object { - "column": 5, + "column": 1, "line": 1, }, }, + "params": Array [], "range": Array [ - 5, - 12, + 1, + 25, ], - "type": "VariableDeclaration", + "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "range": Array [ - 0, - 39, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", + "range": Array [ + 0, + 27, + ], + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 3, + "column": 27, + "line": 1, }, "start": Object { "column": 0, @@ -90906,14 +98789,14 @@ Object { }, "range": Array [ 0, - 40, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -90923,28 +98806,28 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "for", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 1, "line": 1, }, }, "range": Array [ - 4, - 5, + 1, + 9, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -90953,16 +98836,16 @@ Object { "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, + 9, 10, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { @@ -90979,113 +98862,113 @@ Object { 11, 12, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 15, ], - "type": "Identifier", - "value": "of", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 15, "line": 1, }, "start": Object { - "column": 16, + "column": 14, "line": 1, }, }, "range": Array [ - 16, - 19, + 14, + 15, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 21, "line": 1, }, "start": Object { - "column": 19, + "column": 16, "line": 1, }, }, "range": Array [ - 19, - 20, + 16, + 21, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "yield", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 25, - 36, + 22, + 23, ], "type": "Identifier", - "value": "doSomething", + "value": "v", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ - 36, - 37, + 24, + 25, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ - 37, - 38, + 25, + 26, ], "type": "Punctuator", "value": ")", @@ -91093,17 +98976,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ - 38, - 39, + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -91113,275 +98996,151 @@ Object { } `; -exports[`javascript fixtures/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = ` +exports[`javascript fixtures/generators/async-generator-function.src 1`] = ` Object { "body": Array [ Object { - "await": false, + "async": true, "body": Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "doSomething", - "range": Array [ - 23, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 23, - 36, - ], - "type": "CallExpression", - }, + "body": Array [], "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 4, }, "start": Object { - "column": 4, + "column": 22, "line": 2, }, }, "range": Array [ 23, - 37, + 27, ], - "type": "ExpressionStatement", + "type": "BlockStatement", }, - "left": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", + "expression": false, + "generator": true, + "id": Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 16, + "line": 2, }, }, + "name": "foo", "range": Array [ - 5, - 10, + 17, + 20, ], - "type": "VariableDeclaration", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 4, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, + "params": Array [], "range": Array [ - 0, - 37, + 1, + 27, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "type": "ForOfStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 38, + 1, + 28, ], "sourceType": "script", "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "for", - }, Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 4, - 5, + 1, + 6, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 5, - 8, + 7, + 15, ], "type": "Keyword", - "value": "let", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "x", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 11, - 13, + 16, + 17, ], - "type": "Identifier", - "value": "of", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 14, 17, + 20, ], "type": "Identifier", "value": "foo", @@ -91389,200 +99148,313 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, + "column": 20, "line": 2, }, "start": Object { - "column": 4, + "column": 19, "line": 2, }, }, "range": Array [ - 23, - 34, + 20, + 21, ], - "type": "Identifier", - "value": "doSomething", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 21, "line": 2, }, "start": Object { - "column": 15, + "column": 20, "line": 2, }, }, "range": Array [ - 34, - 35, + 21, + 22, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 2, }, "start": Object { - "column": 16, + "column": 22, "line": 2, }, }, "range": Array [ - 35, - 36, + 23, + 24, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 1, + "line": 4, }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 4, }, }, "range": Array [ - 36, - 37, + 26, + 27, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/generators/anonymous-generator.src 1`] = ` +exports[`javascript fixtures/generators/async-generator-method.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "f", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 63, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": true, + "body": Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "name": "x", + "range": Array [ + 42, + 43, + ], + "type": "Identifier", + }, + "init": Object { + "argument": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "name": "g", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 3, + }, + }, + "range": Array [ + 53, + 56, + ], + "type": "CallExpression", + }, + "delegate": true, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 46, + 56, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 42, + 56, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 29, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, }, + "range": Array [ + 36, + 57, + ], + "type": "VariableDeclaration", }, - "name": "v", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "delegate": false, + ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { "column": 16, - "line": 1, + "line": 2, }, }, "range": Array [ - 16, - 23, + 26, + 63, ], - "type": "YieldExpression", + "type": "BlockStatement", }, + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 16, - "line": 1, + "column": 13, + "line": 2, }, }, + "params": Array [], "range": Array [ - 16, 23, + 63, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "type": "FunctionExpression", }, }, - "range": Array [ - 14, - 25, - ], - "type": "BlockStatement", + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - "expression": false, - "generator": true, - "id": null, + "range": Array [ + 8, + 65, + ], + "type": "ClassBody", + }, + "id": Object { "loc": Object { "end": Object { - "column": 25, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, - "params": Array [], + "name": "C", "range": Array [ - 1, - 25, + 6, + 7, ], - "type": "FunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, @@ -91591,15 +99463,16 @@ Object { }, "range": Array [ 0, - 27, + 65, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -91608,14 +99481,14 @@ Object { }, "range": Array [ 0, - 27, + 66, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -91625,146 +99498,128 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 9, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 10, + 6, + 7, ], - "type": "Punctuator", - "value": "*", + "type": "Identifier", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 9, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ - 11, - 12, + 8, + 9, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 12, - 13, + 14, + 19, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "async", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 14, - 15, + 20, + 21, ], "type": "Punctuator", - "value": "{", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 16, - 21, + 22, + 23, ], - "type": "Keyword", - "value": "yield", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 22, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 22, 23, + 24, ], - "type": "Identifier", - "value": "v", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ @@ -91772,176 +99627,112 @@ Object { 25, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 25, 26, + 27, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 26, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 26, - 27, + 36, + 41, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "const", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/generators/async-generator-function.src 1`] = ` -Object { - "body": Array [ Object { - "async": true, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "range": Array [ - 23, - 27, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 15, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 3, }, }, - "params": Array [], "range": Array [ - 1, - 27, + 42, + 43, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 2, + "type": "Identifier", + "value": "x", }, - }, - "range": Array [ - 1, - 28, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 17, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 16, + "line": 3, }, }, "range": Array [ - 1, - 6, + 44, + 45, ], - "type": "Identifier", - "value": "async", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 23, + "line": 3, }, "start": Object { - "column": 6, - "line": 2, + "column": 18, + "line": 3, }, }, "range": Array [ - 7, - 15, + 46, + 51, ], "type": "Keyword", - "value": "function", + "value": "yield", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 24, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 23, + "line": 3, }, }, "range": Array [ - 16, - 17, + 51, + 52, ], "type": "Punctuator", "value": "*", @@ -91949,35 +99740,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 26, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 25, + "line": 3, }, }, "range": Array [ - 17, - 20, + 53, + 54, ], "type": "Identifier", - "value": "foo", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 27, + "line": 3, }, "start": Object { - "column": 19, - "line": 2, + "column": 26, + "line": 3, }, }, "range": Array [ - 20, - 21, + 54, + 55, ], "type": "Punctuator", "value": "(", @@ -91985,17 +99776,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 28, + "line": 3, }, "start": Object { - "column": 20, - "line": 2, + "column": 27, + "line": 3, }, }, "range": Array [ - 21, - 22, + 55, + 56, ], "type": "Punctuator", "value": ")", @@ -92003,35 +99794,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 29, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, }, "start": Object { - "column": 22, - "line": 2, + "column": 4, + "line": 4, }, }, "range": Array [ - 23, - 24, + 62, + 63, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, - "line": 4, + "line": 5, }, }, "range": Array [ - 26, - 27, + 64, + 65, ], "type": "Punctuator", "value": "}", @@ -92041,239 +99850,127 @@ Object { } `; -exports[`javascript fixtures/generators/async-generator-method.src 1`] = ` +exports[`javascript fixtures/generators/double-yield.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "name": "f", - "range": Array [ - 22, - 23, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 63, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": true, - "body": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "name": "x", - "range": Array [ - 42, - 43, - ], - "type": "Identifier", - }, - "init": Object { - "argument": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 3, - }, - "start": Object { - "column": 25, - "line": 3, - }, - }, - "name": "g", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 25, - "line": 3, - }, - }, - "range": Array [ - 53, - 56, - ], - "type": "CallExpression", - }, - "delegate": true, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 46, - 56, - ], - "type": "YieldExpression", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 42, - 56, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 30, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 28, + "line": 1, }, }, "range": Array [ - 36, - 57, + 28, + 30, ], - "type": "VariableDeclaration", + "raw": "10", + "type": "Literal", + "value": 10, }, - ], + "delegate": false, + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 30, + ], + "type": "YieldExpression", + }, + "delegate": false, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 30, + "line": 1, }, "start": Object { "column": 16, - "line": 2, + "line": 1, }, }, "range": Array [ - 26, - 63, + 16, + 30, ], - "type": "BlockStatement", + "type": "YieldExpression", }, - "expression": false, - "generator": true, - "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 30, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 16, + "line": 1, }, }, - "params": Array [], "range": Array [ - 23, - 63, + 16, + 30, ], - "type": "FunctionExpression", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "range": Array [ + 14, + 32, + ], + "type": "BlockStatement", }, - "range": Array [ - 8, - 65, - ], - "type": "ClassBody", - }, - "id": Object { + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 7, + "column": 32, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, - "name": "C", + "params": Array [], "range": Array [ - 6, - 7, + 1, + 32, ], - "type": "Identifier", + "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 34, + "line": 1, }, "start": Object { "column": 0, @@ -92282,16 +99979,15 @@ Object { }, "range": Array [ 0, - 65, + 34, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 34, + "line": 1, }, "start": Object { "column": 0, @@ -92300,14 +99996,14 @@ Object { }, "range": Array [ 0, - 66, + 34, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -92317,241 +100013,340 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 1, "line": 1, }, }, "range": Array [ - 6, - 7, + 1, + 9, ], - "type": "Identifier", - "value": "C", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, }, "range": Array [ 14, - 19, + 15, ], - "type": "Identifier", - "value": "async", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 20, + 16, 21, ], - "type": "Punctuator", - "value": "*", + "type": "Keyword", + "value": "yield", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ 22, - 23, + 27, ], - "type": "Identifier", - "value": "f", + "type": "Keyword", + "value": "yield", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 23, - 24, + 28, + 30, ], - "type": "Punctuator", - "value": "(", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 31, + "line": 1, }, }, "range": Array [ - 24, - 25, + 31, + 32, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 33, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 32, + "line": 1, }, }, "range": Array [ - 26, - 27, + 32, + 33, ], "type": "Punctuator", - "value": "{", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 34, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 33, + "line": 1, }, }, "range": Array [ - 36, - 41, + 33, + 34, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/generators/empty-generator-declaration.src 1`] = ` +Object { + "body": Array [ Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "t", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 16, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 0, + "line": 1, }, }, + "params": Array [], "range": Array [ - 42, - 43, + 0, + 16, ], - "type": "Identifier", - "value": "x", + "type": "FunctionDeclaration", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 3, + "line": 1, }, "start": Object { "column": 16, - "line": 3, + "line": 1, }, }, "range": Array [ - 44, - 45, + 16, + 17, ], - "type": "Punctuator", - "value": "=", + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 23, - "line": 3, + "column": 8, + "line": 1, }, "start": Object { - "column": 18, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 46, - 51, + 0, + 8, ], "type": "Keyword", - "value": "yield", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 3, + "column": 9, + "line": 1, }, "start": Object { - "column": 23, - "line": 3, + "column": 8, + "line": 1, }, }, "range": Array [ - 51, - 52, + 8, + 9, ], "type": "Punctuator", "value": "*", @@ -92559,35 +100354,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 3, + "column": 11, + "line": 1, }, "start": Object { - "column": 25, - "line": 3, + "column": 10, + "line": 1, }, }, "range": Array [ - 53, - 54, + 10, + 11, ], "type": "Identifier", - "value": "g", + "value": "t", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 26, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 54, - 55, + 11, + 12, ], "type": "Punctuator", "value": "(", @@ -92595,17 +100390,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, - "line": 3, + "column": 13, + "line": 1, }, "start": Object { - "column": 27, - "line": 3, + "column": 12, + "line": 1, }, }, "range": Array [ - 55, - 56, + 12, + 13, ], "type": "Punctuator", "value": ")", @@ -92613,35 +100408,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 28, - "line": 3, + "column": 14, + "line": 1, }, }, "range": Array [ - 56, - 57, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 4, + "column": 15, + "line": 1, }, }, "range": Array [ - 62, - 63, + 15, + 16, ], "type": "Punctuator", "value": "}", @@ -92649,146 +100444,126 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 17, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 16, + "line": 1, }, }, "range": Array [ - 64, - 65, + 16, + 17, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/generators/double-yield.src 1`] = ` +exports[`javascript fixtures/generators/generator-declaration.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 30, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - "delegate": false, - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 30, - ], - "type": "YieldExpression", - }, - "delegate": false, + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 30, + "column": 28, "line": 1, }, "start": Object { - "column": 16, + "column": 27, "line": 1, }, }, + "name": "v", "range": Array [ - 16, - 30, + 27, + 28, ], - "type": "YieldExpression", + "type": "Identifier", }, + "delegate": true, "loc": Object { "end": Object { - "column": 30, + "column": 28, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 30, + 20, + 28, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 32, - "line": 1, + "type": "YieldExpression", }, - "start": Object { - "column": 14, - "line": 1, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, }, + "range": Array [ + 20, + 28, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, }, - "range": Array [ - 14, - 32, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": true, - "id": null, + "range": Array [ + 18, + 30, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": true, + "id": Object { "loc": Object { "end": Object { - "column": 32, + "column": 14, "line": 1, }, "start": Object { - "column": 1, + "column": 10, "line": 1, }, }, - "params": Array [], + "name": "test", "range": Array [ - 1, - 32, + 10, + 14, ], - "type": "FunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 34, + "column": 30, "line": 1, }, "start": Object { @@ -92796,16 +100571,34 @@ Object { "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 34, + 30, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 34, + "column": 31, "line": 1, }, "start": Object { @@ -92815,14 +100608,14 @@ Object { }, "range": Array [ 0, - 34, + 31, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 8, "line": 1, }, "start": Object { @@ -92832,10 +100625,10 @@ Object { }, "range": Array [ 0, - 1, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -92844,49 +100637,49 @@ Object { "line": 1, }, "start": Object { - "column": 1, + "column": 8, "line": 1, }, }, "range": Array [ - 1, + 8, 9, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 14, ], - "type": "Punctuator", - "value": "*", + "type": "Identifier", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, - 12, + 15, + 16, ], "type": "Punctuator", "value": "(", @@ -92894,17 +100687,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 13, + 16, + 17, ], "type": "Punctuator", "value": ")", @@ -92912,17 +100705,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 19, "line": 1, }, "start": Object { - "column": 14, + "column": 18, "line": 1, }, }, "range": Array [ - 14, - 15, + 18, + 19, ], "type": "Punctuator", "value": "{", @@ -92930,17 +100723,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 21, + 20, + 25, ], "type": "Keyword", "value": "yield", @@ -92952,49 +100745,49 @@ Object { "line": 1, }, "start": Object { - "column": 22, + "column": 26, "line": 1, }, }, "range": Array [ - 22, + 26, 27, ], - "type": "Keyword", - "value": "yield", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 28, "line": 1, }, "start": Object { - "column": 28, + "column": 27, "line": 1, }, }, "range": Array [ + 27, 28, - 30, ], - "type": "Numeric", - "value": "10", + "type": "Identifier", + "value": "v", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 1, }, "start": Object { - "column": 31, + "column": 29, "line": 1, }, }, "range": Array [ - 31, - 32, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -93002,35 +100795,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, + "column": 31, "line": 1, }, "start": Object { - "column": 33, + "column": 30, "line": 1, }, }, "range": Array [ - 33, - 34, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -93040,52 +100815,107 @@ Object { } `; -exports[`javascript fixtures/generators/empty-generator-declaration.src 1`] = ` +exports[`javascript fixtures/generators/yield-delegation.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "delegate": true, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 24, + ], + "type": "YieldExpression", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 24, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, }, + "range": Array [ + 14, + 26, + ], + "type": "BlockStatement", }, - "range": Array [ - 14, - 16, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 11, + "column": 26, "line": 1, }, "start": Object { - "column": 10, + "column": 1, "line": 1, }, }, - "name": "t", + "params": Array [], "range": Array [ - 10, - 11, + 1, + 26, ], - "type": "Identifier", + "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 16, + "column": 28, "line": 1, }, "start": Object { @@ -93093,34 +100923,16 @@ Object { "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 16, - ], - "type": "FunctionDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, + 28, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 17, + "column": 28, "line": 1, }, "start": Object { @@ -93130,14 +100942,14 @@ Object { }, "range": Array [ 0, - 17, + 28, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -93147,10 +100959,10 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -93159,34 +100971,34 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 1, "line": 1, }, }, "range": Array [ - 8, + 1, 9, ], - "type": "Punctuator", - "value": "*", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 11, ], - "type": "Identifier", - "value": "t", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { @@ -93245,17 +101057,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 21, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 21, + ], + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "*", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "v", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -93263,17 +101129,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 27, "line": 1, }, "start": Object { - "column": 16, + "column": 26, "line": 1, }, }, "range": Array [ - 16, - 17, + 26, + 27, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -93283,106 +101167,90 @@ Object { } `; -exports[`javascript fixtures/generators/generator-declaration.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "argument": Object { + "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "argument": null, + "delegate": false, "loc": Object { "end": Object { - "column": 28, + "column": 21, "line": 1, }, "start": Object { - "column": 27, + "column": 16, "line": 1, }, }, - "name": "v", "range": Array [ - 27, - 28, + 16, + 21, ], - "type": "Identifier", + "type": "YieldExpression", }, - "delegate": true, "loc": Object { "end": Object { - "column": 28, + "column": 22, "line": 1, }, "start": Object { - "column": 20, + "column": 16, "line": 1, }, }, "range": Array [ - 20, - 28, + 16, + 22, ], - "type": "YieldExpression", + "type": "ExpressionStatement", }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, }, - "range": Array [ - 20, - 28, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, }, + "range": Array [ + 14, + 24, + ], + "type": "BlockStatement", }, - "range": Array [ - 18, - 30, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": Object { + "expression": false, + "generator": true, + "id": null, "loc": Object { "end": Object { - "column": 14, + "column": 24, "line": 1, }, "start": Object { - "column": 10, + "column": 1, "line": 1, }, }, - "name": "test", + "params": Array [], "range": Array [ - 10, - 14, + 1, + 24, ], - "type": "Identifier", + "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 1, }, "start": Object { @@ -93390,35 +101258,17 @@ Object { "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 30, - ], - "type": "FunctionDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 31, + 26, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -93427,14 +101277,14 @@ Object { }, "range": Array [ 0, - 31, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -93444,10 +101294,10 @@ Object { }, "range": Array [ 0, - 8, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -93456,49 +101306,49 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 1, "line": 1, }, }, "range": Array [ - 8, + 1, 9, ], - "type": "Punctuator", - "value": "*", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 14, ], - "type": "Identifier", - "value": "test", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 12, "line": 1, }, "start": Object { - "column": 15, + "column": 11, "line": 1, }, }, "range": Array [ - 15, - 16, + 11, + 12, ], "type": "Punctuator", "value": "(", @@ -93506,17 +101356,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { - "column": 16, + "column": 12, "line": 1, }, }, "range": Array [ - 16, - 17, + 12, + 13, ], "type": "Punctuator", "value": ")", @@ -93524,17 +101374,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 15, "line": 1, }, "start": Object { - "column": 18, + "column": 14, "line": 1, }, }, "range": Array [ - 18, - 19, + 14, + 15, ], "type": "Punctuator", "value": "{", @@ -93542,17 +101392,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, + "column": 21, "line": 1, }, "start": Object { - "column": 20, + "column": 16, "line": 1, }, }, "range": Array [ - 20, - 25, + 16, + 21, ], "type": "Keyword", "value": "yield", @@ -93560,71 +101410,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 22, "line": 1, }, "start": Object { - "column": 26, + "column": 21, "line": 1, }, }, "range": Array [ - 26, - 27, + 21, + 22, ], "type": "Punctuator", - "value": "*", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { - "column": 27, + "column": 23, "line": 1, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], - "type": "Identifier", - "value": "v", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 25, "line": 1, }, "start": Object { - "column": 29, + "column": 24, "line": 1, }, }, "range": Array [ - 29, - 30, + 24, + 25, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 26, "line": 1, }, "start": Object { - "column": 30, + "column": 25, "line": 1, }, }, "range": Array [ - 30, - 31, + 25, + 26, ], "type": "Punctuator", "value": ";", @@ -93634,7 +101484,7 @@ Object { } `; -exports[`javascript fixtures/generators/yield-delegation.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value-in-call.src 1`] = ` Object { "body": Array [ Object { @@ -93644,28 +101494,48 @@ Object { "body": Array [ Object { "expression": Object { - "argument": Object { + "arguments": Array [ + Object { + "argument": null, + "delegate": false, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 24, + ], + "type": "YieldExpression", + }, + ], + "callee": Object { "loc": Object { "end": Object { - "column": 24, + "column": 18, "line": 1, }, "start": Object { - "column": 23, + "column": 16, "line": 1, }, }, - "name": "v", + "name": "fn", "range": Array [ - 23, - 24, + 16, + 18, ], "type": "Identifier", }, - "delegate": true, "loc": Object { "end": Object { - "column": 24, + "column": 25, "line": 1, }, "start": Object { @@ -93675,13 +101545,13 @@ Object { }, "range": Array [ 16, - 24, + 25, ], - "type": "YieldExpression", + "type": "CallExpression", }, "loc": Object { "end": Object { - "column": 24, + "column": 26, "line": 1, }, "start": Object { @@ -93691,14 +101561,14 @@ Object { }, "range": Array [ 16, - 24, + 26, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 26, + "column": 28, "line": 1, }, "start": Object { @@ -93708,7 +101578,7 @@ Object { }, "range": Array [ 14, - 26, + 28, ], "type": "BlockStatement", }, @@ -93717,7 +101587,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 26, + "column": 28, "line": 1, }, "start": Object { @@ -93728,13 +101598,13 @@ Object { "params": Array [], "range": Array [ 1, - 26, + 28, ], "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 28, + "column": 30, "line": 1, }, "start": Object { @@ -93744,15 +101614,15 @@ Object { }, "range": Array [ 0, - 28, + 30, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -93761,7 +101631,7 @@ Object { }, "range": Array [ 0, - 28, + 31, ], "sourceType": "script", "tokens": Array [ @@ -93876,7 +101746,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 18, "line": 1, }, "start": Object { @@ -93886,28 +101756,28 @@ Object { }, "range": Array [ 16, - 21, + 18, ], - "type": "Keyword", - "value": "yield", + "type": "Identifier", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 19, "line": 1, }, "start": Object { - "column": 22, + "column": 18, "line": 1, }, }, "range": Array [ - 22, - 23, + 18, + 19, ], "type": "Punctuator", - "value": "*", + "value": "(", }, Object { "loc": Object { @@ -93916,16 +101786,34 @@ Object { "line": 1, }, "start": Object { - "column": 23, + "column": 19, "line": 1, }, }, "range": Array [ - 23, + 19, 24, ], - "type": "Identifier", - "value": "v", + "type": "Keyword", + "value": "yield", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -93943,22 +101831,40 @@ Object { 26, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 28, "line": 1, }, "start": Object { - "column": 26, + "column": 27, "line": 1, }, }, "range": Array [ - 26, 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, ], "type": "Punctuator", "value": ")", @@ -93966,17 +101872,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 30, "line": 1, }, "start": Object { - "column": 27, + "column": 29, "line": 1, }, }, "range": Array [ - 27, - 28, + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -93986,7 +101892,7 @@ Object { } `; -exports[`javascript fixtures/generators/yield-without-value.src 1`] = ` +exports[`javascript fixtures/generators/yield-without-value-no-semi.src 1`] = ` Object { "body": Array [ Object { @@ -94016,7 +101922,7 @@ Object { }, "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { @@ -94026,14 +101932,14 @@ Object { }, "range": Array [ 16, - 22, + 21, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { @@ -94043,7 +101949,7 @@ Object { }, "range": Array [ 14, - 24, + 23, ], "type": "BlockStatement", }, @@ -94052,7 +101958,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 24, + "column": 23, "line": 1, }, "start": Object { @@ -94063,13 +101969,13 @@ Object { "params": Array [], "range": Array [ 1, - 24, + 23, ], "type": "FunctionExpression", }, "loc": Object { "end": Object { - "column": 26, + "column": 25, "line": 1, }, "start": Object { @@ -94079,7 +101985,7 @@ Object { }, "range": Array [ 0, - 26, + 25, ], "type": "ExpressionStatement", }, @@ -94096,7 +102002,7 @@ Object { }, "range": Array [ 0, - 27, + 26, ], "sourceType": "script", "tokens": Array [ @@ -94229,20 +102135,20 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 1, }, "start": Object { - "column": 21, + "column": 22, "line": 1, }, }, "range": Array [ - 21, 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { @@ -94260,7 +102166,7 @@ Object { 24, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { @@ -94278,24 +102184,6 @@ Object { 25, ], "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", "value": ";", }, ], @@ -94303,127 +102191,31 @@ Object { } `; -exports[`javascript fixtures/generators/yield-without-value-in-call.src 1`] = ` +exports[`javascript fixtures/globalReturn/return-identifier.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "argument": null, - "delegate": false, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 24, - ], - "type": "YieldExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "fn", - "range": Array [ - 16, - 18, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 25, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 26, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 28, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": true, - "id": null, + "argument": Object { "loc": Object { "end": Object { - "column": 28, + "column": 11, "line": 1, }, "start": Object { - "column": 1, + "column": 7, "line": 1, }, }, - "params": Array [], + "name": "fooz", "range": Array [ - 1, - 28, + 7, + 11, ], - "type": "FunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 30, + "column": 12, "line": 1, }, "start": Object { @@ -94433,9 +102225,9 @@ Object { }, "range": Array [ 0, - 30, + 12, ], - "type": "ExpressionStatement", + "type": "ReturnStatement", }, ], "loc": Object { @@ -94450,14 +102242,14 @@ Object { }, "range": Array [ 0, - 31, + 13, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 6, "line": 1, }, "start": Object { @@ -94467,241 +102259,476 @@ Object { }, "range": Array [ 0, - 1, + 6, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + "value": "fooz", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/globalReturn/return-no-arg.src 1`] = ` +Object { + "body": Array [ Object { + "argument": null, "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, "range": Array [ - 1, - 9, + 0, + 7, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, ], "type": "Keyword", - "value": "function", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 10, + 6, + 7, ], "type": "Punctuator", - "value": "*", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/globalReturn/return-true.src 1`] = ` +Object { + "body": Array [ Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 11, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, "loc": Object { "end": Object { "column": 12, "line": 1, }, "start": Object { - "column": 11, + "column": 0, "line": 1, }, }, "range": Array [ - 11, + 0, 12, ], - "type": "Punctuator", - "value": "(", + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, + "column": 6, "line": 1, }, "start": Object { - "column": 12, + "column": 0, "line": 1, }, }, "range": Array [ - 12, - 13, + 0, + 6, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 14, + "column": 7, "line": 1, }, }, "range": Array [ - 14, - 15, + 7, + 11, ], - "type": "Punctuator", - "value": "{", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ - 16, - 18, + 11, + 12, ], - "type": "Identifier", - "value": "fn", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/importMeta/simple-import-meta.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "import", + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "meta", + "range": Array [ + 7, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 11, + ], + "type": "MetaProperty", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "url", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 15, + ], + "type": "MemberExpression", + }, "loc": Object { "end": Object { - "column": 19, + "column": 16, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 19, + 0, + 16, ], - "type": "Punctuator", - "value": "(", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 17, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 24, + "column": 6, "line": 1, }, "start": Object { - "column": 19, + "column": 0, "line": 1, }, }, "range": Array [ - 19, - 24, + 0, + 6, ], "type": "Keyword", - "value": "yield", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 7, "line": 1, }, "start": Object { - "column": 24, + "column": 6, "line": 1, }, }, "range": Array [ - 24, - 25, + 6, + 7, ], "type": "Punctuator", - "value": ")", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 11, "line": 1, }, "start": Object { - "column": 25, + "column": 7, "line": 1, }, }, "range": Array [ - 25, - 26, + 7, + 11, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "meta", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 12, "line": 1, }, "start": Object { - "column": 27, + "column": 11, "line": 1, }, }, "range": Array [ - 27, - 28, + 11, + 12, ], "type": "Punctuator", - "value": "}", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 15, "line": 1, }, "start": Object { - "column": 28, + "column": 12, "line": 1, }, }, "range": Array [ - 28, - 29, + 12, + 15, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "url", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 16, "line": 1, }, "start": Object { - "column": 29, + "column": 15, "line": 1, }, }, "range": Array [ - 29, - 30, + 15, + 16, ], "type": "Punctuator", "value": ";", @@ -94711,91 +102738,140 @@ Object { } `; -exports[`javascript fixtures/generators/yield-without-value-no-semi.src 1`] = ` +exports[`javascript fixtures/labels/label-break.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "async": false, + "body": Object { "body": Object { "body": Array [ Object { - "expression": Object { - "argument": null, - "delegate": false, + "label": Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 16, - "line": 1, + "column": 10, + "line": 3, }, }, + "name": "loop1", "range": Array [ - 16, - 21, + 33, + 38, ], - "type": "YieldExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 16, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 16, - 21, + 27, + 39, ], - "type": "ExpressionStatement", + "type": "BreakStatement", + }, + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 44, + 50, + ], + "type": "BreakStatement", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { "column": 14, - "line": 1, + "line": 2, }, }, "range": Array [ - 14, - 23, + 21, + 54, ], "type": "BlockStatement", }, - "expression": false, - "generator": true, - "id": null, "loc": Object { "end": Object { - "column": 23, + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 9, + 54, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 15, + 19, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "WhileStatement", + }, + "label": Object { + "loc": Object { + "end": Object { + "column": 5, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, - "params": Array [], + "name": "loop1", "range": Array [ - 1, - 23, + 0, + 5, ], - "type": "FunctionExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { "column": 0, @@ -94804,15 +102880,15 @@ Object { }, "range": Array [ 0, - 25, + 54, ], - "type": "ExpressionStatement", + "type": "LabeledStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 6, }, "start": Object { "column": 0, @@ -94821,14 +102897,14 @@ Object { }, "range": Array [ 0, - 26, + 55, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -94838,79 +102914,97 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "loop1", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 1, }, "start": Object { - "column": 1, + "column": 5, "line": 1, }, }, "range": Array [ - 1, + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ 9, + 14, ], "type": "Keyword", - "value": "function", + "value": "while", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 9, - 10, + 14, + 15, ], "type": "Punctuator", - "value": "*", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 1, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 11, - 12, + 15, + 19, ], - "type": "Punctuator", - "value": "(", + "type": "Boolean", + "value": "true", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 1, + "line": 2, }, "start": Object { "column": 12, - "line": 1, + "line": 2, }, }, "range": Array [ - 12, - 13, + 19, + 20, ], "type": "Punctuator", "value": ")", @@ -94919,16 +103013,16 @@ Object { "loc": Object { "end": Object { "column": 15, - "line": 1, + "line": 2, }, "start": Object { "column": 14, - "line": 1, + "line": 2, }, }, "range": Array [ - 14, - 15, + 21, + 22, ], "type": "Punctuator", "value": "{", @@ -94936,106 +103030,250 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 16, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 16, - 21, + 27, + 32, ], "type": "Keyword", - "value": "yield", + "value": "break", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 22, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 22, - 23, + 33, + 38, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "loop1", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { - "column": 23, - "line": 1, + "column": 15, + "line": 3, }, }, "range": Array [ - 23, - 24, + 38, + 39, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 4, }, "start": Object { - "column": 24, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 24, - 25, + 44, + 49, + ], + "type": "Keyword", + "value": "break", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 49, + 50, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`javascript fixtures/globalReturn/return-identifier.src 1`] = ` +exports[`javascript fixtures/labels/label-continue.src 1`] = ` Object { "body": Array [ Object { - "argument": Object { + "body": Object { + "body": Object { + "body": Array [ + Object { + "label": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "name": "loop1", + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 27, + 42, + ], + "type": "ContinueStatement", + }, + Object { + "label": null, + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 47, + 56, + ], + "type": "ContinueStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 21, + 60, + ], + "type": "BlockStatement", + }, "loc": Object { "end": Object { - "column": 11, + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 9, + 60, + ], + "test": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 15, + 19, + ], + "raw": "true", + "type": "Literal", + "value": true, + }, + "type": "WhileStatement", + }, + "label": Object { + "loc": Object { + "end": Object { + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 0, "line": 1, }, }, - "name": "fooz", + "name": "loop1", "range": Array [ - 7, - 11, + 0, + 5, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { "column": 0, @@ -95044,15 +103282,15 @@ Object { }, "range": Array [ 0, - 12, + 60, ], - "type": "ReturnStatement", + "type": "LabeledStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 6, }, "start": Object { "column": 0, @@ -95061,312 +103299,302 @@ Object { }, "range": Array [ 0, - 13, + 61, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Identifier", + "value": "loop1", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 6, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 0, - 6, + 9, + 14, ], "type": "Keyword", - "value": "return", + "value": "while", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { "column": 7, - "line": 1, + "line": 2, }, }, "range": Array [ - 7, - 11, + 14, + 15, ], - "type": "Identifier", - "value": "fooz", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 1, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 11, - 12, + 15, + 19, ], - "type": "Punctuator", - "value": ";", + "type": "Boolean", + "value": "true", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/globalReturn/return-no-arg.src 1`] = ` -Object { - "body": Array [ Object { - "argument": null, "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 0, - 7, + 19, + 20, ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ")", }, - }, - "range": Array [ - 0, - 8, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 0, - 6, + 21, + 22, ], - "type": "Keyword", - "value": "return", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 6, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 6, - 7, + 27, + 35, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "continue", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/globalReturn/return-true.src 1`] = ` -Object { - "body": Array [ Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, }, - "range": Array [ - 7, - 11, - ], - "raw": "true", - "type": "Literal", - "value": true, }, + "range": Array [ + 36, + 41, + ], + "type": "Identifier", + "value": "loop1", + }, + Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 19, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 18, + "line": 3, }, }, "range": Array [ - 0, - 12, + 41, + 42, ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 0, - 6, + 47, + 55, ], "type": "Keyword", - "value": "return", + "value": "continue", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 4, }, "start": Object { - "column": 7, - "line": 1, + "column": 12, + "line": 4, }, }, "range": Array [ - 7, - 11, + 55, + 56, ], - "type": "Boolean", - "value": "true", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 11, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 11, - 12, + 59, + 60, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/importMeta/simple-import-meta.src 1`] = ` +exports[`javascript fixtures/modules/error-delete.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "computed": false, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "source": Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, - "object": Object { + "range": Array [ + 14, + 17, + ], + "raw": "\\"x\\"", + "type": "Literal", + "value": "x", + }, + "specifiers": Array [ + Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, - "meta": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "import", - "range": Array [ - 0, - 6, - ], - "type": "Identifier", - }, - "property": Object { + "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 1, }, "start": Object { @@ -95374,56 +103602,73 @@ Object { "line": 1, }, }, - "name": "meta", + "name": "x", "range": Array [ 7, - 11, + 8, ], "type": "Identifier", }, "range": Array [ - 0, - 11, + 7, + 8, ], - "type": "MetaProperty", + "type": "ImportDefaultSpecifier", }, - "property": Object { + ], + "type": "ImportDeclaration", + }, + Object { + "expression": Object { + "argument": Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 7, + "line": 2, }, }, - "name": "url", + "name": "x", "range": Array [ - 12, - 15, + 26, + 27, ], "type": "Identifier", }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "operator": "delete", + "prefix": true, "range": Array [ - 0, - 15, + 19, + 27, ], - "type": "MemberExpression", + "type": "UnaryExpression", }, "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { "column": 0, - "line": 1, + "line": 2, }, }, "range": Array [ - 0, - 16, + 19, + 28, ], "type": "ExpressionStatement", }, @@ -95431,7 +103676,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -95440,7 +103685,7 @@ Object { }, "range": Array [ 0, - 17, + 29, ], "sourceType": "module", "tokens": Array [ @@ -95465,89 +103710,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 8, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 8, ], - "type": "Punctuator", - "value": ".", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 11, + 9, + 13, ], "type": "Identifier", - "value": "meta", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 17, "line": 1, }, "start": Object { - "column": 11, + "column": 14, "line": 1, }, }, "range": Array [ - 11, - 12, + 14, + 17, ], - "type": "Punctuator", - "value": ".", + "type": "String", + "value": "\\"x\\"", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 12, + "column": 17, "line": 1, }, }, "range": Array [ - 12, - 15, + 17, + 18, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "Keyword", + "value": "delete", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, ], "type": "Identifier", - "value": "url", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 15, - 16, + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -95557,157 +103838,107 @@ Object { } `; -exports[`javascript fixtures/labels/label-break.src 1`] = ` +exports[`javascript fixtures/modules/error-function.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { - "body": Object { - "body": Array [ - Object { - "label": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "name": "loop1", - "range": Array [ - 33, - 38, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 27, - 39, - ], - "type": "BreakStatement", - }, - Object { - "label": null, + "body": Array [ + Object { + "declaration": Object { "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 23, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 16, + "line": 2, }, }, + "name": "friends", "range": Array [ - 44, - 50, + 31, + 38, ], - "type": "BreakStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 5, + "type": "Identifier", }, - "start": Object { - "column": 14, - "line": 2, + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 1, + "line": 2, + }, }, + "range": Array [ + 16, + 39, + ], + "type": "ExportDefaultDeclaration", }, - "range": Array [ - 21, - 54, - ], - "type": "BlockStatement", - }, + ], "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 2, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 9, - 54, + 13, + 41, ], - "test": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 15, - 19, - ], - "raw": "true", - "type": "Literal", - "value": true, - }, - "type": "WhileStatement", + "type": "BlockStatement", }, - "label": Object { + "expression": false, + "generator": false, + "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 10, "line": 1, }, "start": Object { - "column": 0, + "column": 9, "line": 1, }, }, - "name": "loop1", + "name": "x", "range": Array [ - 0, - 5, + 9, + 10, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 54, + 41, ], - "type": "LabeledStatement", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 5, }, "start": Object { "column": 0, @@ -95716,14 +103947,14 @@ Object { }, "range": Array [ 0, - 55, + 43, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -95733,61 +103964,43 @@ Object { }, "range": Array [ 0, - 5, + 8, ], - "type": "Identifier", - "value": "loop1", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, - "range": Array [ - 5, - 6, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, "range": Array [ 9, - 14, + 10, ], - "type": "Keyword", - "value": "while", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 14, - 15, + 10, + 11, ], "type": "Punctuator", "value": "(", @@ -95796,101 +104009,101 @@ Object { "loc": Object { "end": Object { "column": 12, - "line": 2, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 15, - 19, + 11, + 12, ], - "type": "Boolean", - "value": "true", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 13, + "line": 1, }, }, "range": Array [ - 19, - 20, + 13, + 14, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 7, "line": 2, }, "start": Object { - "column": 14, + "column": 1, "line": 2, }, }, "range": Array [ - 21, + 16, 22, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 15, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 8, + "line": 2, }, }, "range": Array [ - 27, - 32, + 23, + 30, ], "type": "Keyword", - "value": "break", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 23, + "line": 2, }, "start": Object { - "column": 10, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ - 33, + 31, 38, ], "type": "Identifier", - "value": "loop1", + "value": "friends", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 24, + "line": 2, }, "start": Object { - "column": 15, - "line": 3, + "column": 23, + "line": 2, }, }, "range": Array [ @@ -95903,207 +104116,263 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 4, + "column": 0, + "line": 3, }, }, "range": Array [ - 44, - 49, + 40, + 41, ], - "type": "Keyword", - "value": "break", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/error-strict.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 10, - "line": 4, + "column": 26, + "line": 1, }, "start": Object { - "column": 9, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 49, - 50, + 0, + 26, ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, + "source": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, }, + "range": Array [ + 18, + 25, + ], + "raw": "\\"house\\"", + "type": "Literal", + "value": "house", }, - "range": Array [ - 53, - 54, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "house", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, + "range": Array [ + 7, + 12, + ], + "type": "ImportDefaultSpecifier", + }, ], - "type": "Punctuator", - "value": "}", + "type": "ImportDeclaration", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/labels/label-continue.src 1`] = ` -Object { - "body": Array [ Object { "body": Object { - "body": Object { - "body": Array [ - Object { - "label": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "name": "roof", + "range": Array [ + 56, + 60, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "computed": false, "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 12, + "line": 4, }, "start": Object { - "column": 13, - "line": 3, + "column": 1, + "line": 4, }, }, - "name": "loop1", - "range": Array [ - 36, - 41, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, + "object": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "name": "console", + "range": Array [ + 44, + 51, + ], + "type": "Identifier", }, - "start": Object { - "column": 4, - "line": 3, + "property": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "name": "log", + "range": Array [ + 52, + 55, + ], + "type": "Identifier", }, + "range": Array [ + 44, + 55, + ], + "type": "MemberExpression", }, - "range": Array [ - 27, - 42, - ], - "type": "ContinueStatement", - }, - Object { - "label": null, "loc": Object { "end": Object { - "column": 13, + "column": 18, "line": 4, }, "start": Object { - "column": 4, + "column": 1, "line": 4, }, }, "range": Array [ - 47, - 56, + 44, + 61, ], - "type": "ContinueStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 3, - "line": 5, + "type": "CallExpression", }, - "start": Object { - "column": 14, - "line": 2, + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, }, + "range": Array [ + 44, + 62, + ], + "type": "ExpressionStatement", }, - "range": Array [ - 21, - 60, - ], - "type": "BlockStatement", - }, + ], "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 5, }, "start": Object { - "column": 2, - "line": 2, + "column": 13, + "line": 3, }, }, "range": Array [ - 9, - 60, + 41, + 64, ], - "test": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 15, - 19, - ], - "raw": "true", - "type": "Literal", - "value": true, + "type": "BlockStatement", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, }, - "type": "WhileStatement", }, - "label": Object { + "object": Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 3, }, }, - "name": "loop1", + "name": "house", "range": Array [ - 0, - 5, + 34, + 39, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, "range": Array [ - 0, - 60, + 28, + 64, ], - "type": "LabeledStatement", + "type": "WithStatement", }, ], "loc": Object { @@ -96118,14 +104387,14 @@ Object { }, "range": Array [ 0, - 61, + 65, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { @@ -96135,118 +104404,136 @@ Object { }, "range": Array [ 0, - 5, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, ], "type": "Identifier", - "value": "loop1", + "value": "house", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 1, }, "start": Object { - "column": 5, + "column": 13, "line": 1, }, }, "range": Array [ - 5, - 6, + 13, + 17, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 9, - 14, + 18, + 25, ], - "type": "Keyword", - "value": "while", + "type": "String", + "value": "\\"house\\"", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ - 14, - 15, + 25, + 26, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 4, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 15, - 19, + 28, + 32, ], - "type": "Boolean", - "value": "true", + "type": "Keyword", + "value": "with", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 6, + "line": 3, }, "start": Object { - "column": 12, - "line": 2, + "column": 5, + "line": 3, }, }, "range": Array [ - 19, - 20, + 33, + 34, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 14, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ - 21, - 22, + 34, + 39, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "house", }, Object { "loc": Object { @@ -96255,21 +104542,21 @@ Object { "line": 3, }, "start": Object { - "column": 4, + "column": 11, "line": 3, }, }, "range": Array [ - 27, - 35, + 39, + 40, ], - "type": "Keyword", - "value": "continue", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 14, "line": 3, }, "start": Object { @@ -96278,29 +104565,47 @@ Object { }, }, "range": Array [ - 36, 41, + 42, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 44, + 51, ], "type": "Identifier", - "value": "loop1", + "value": "console", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 9, + "line": 4, }, "start": Object { - "column": 18, - "line": 3, + "column": 8, + "line": 4, }, }, "range": Array [ - 41, - 42, + 51, + 52, ], "type": "Punctuator", - "value": ";", + "value": ".", }, Object { "loc": Object { @@ -96309,16 +104614,16 @@ Object { "line": 4, }, "start": Object { - "column": 4, + "column": 9, "line": 4, }, }, "range": Array [ - 47, + 52, 55, ], - "type": "Keyword", - "value": "continue", + "type": "Identifier", + "value": "log", }, Object { "loc": Object { @@ -96336,166 +104641,128 @@ Object { 56, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 17, + "line": 4, }, "start": Object { - "column": 2, - "line": 5, + "column": 13, + "line": 4, }, }, "range": Array [ - 59, + 56, 60, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "roof", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/error-delete.src 1`] = ` -Object { - "body": Array [ Object { "loc": Object { "end": Object { "column": 18, - "line": 1, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 0, - 18, + 60, + 61, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, }, - "range": Array [ - 14, - 17, - ], - "raw": "\\"x\\"", - "type": "Literal", - "value": "x", - }, - "specifiers": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "range": Array [ - 7, - 8, - ], - "type": "ImportDefaultSpecifier", + "start": Object { + "column": 18, + "line": 4, }, + }, + "range": Array [ + 61, + 62, ], - "type": "ImportDeclaration", + "type": "Punctuator", + "value": ";", }, Object { - "expression": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-default-array.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 1, }, }, - "operator": "delete", - "prefix": true, "range": Array [ - 19, - 27, + 15, + 17, ], - "type": "UnaryExpression", + "type": "ArrayExpression", }, "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { "column": 0, - "line": 2, + "line": 1, }, }, "range": Array [ - 19, - 28, + 0, + 18, ], - "type": "ExpressionStatement", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 2, }, "start": Object { "column": 0, @@ -96504,7 +104771,7 @@ Object { }, "range": Array [ 0, - 29, + 19, ], "sourceType": "module", "tokens": Array [ @@ -96524,12 +104791,12 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 1, }, "start": Object { @@ -96539,28 +104806,28 @@ Object { }, "range": Array [ 7, - 8, + 14, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 15, "line": 1, }, }, "range": Array [ - 9, - 13, + 15, + 16, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { @@ -96569,16 +104836,16 @@ Object { "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, + 16, 17, ], - "type": "String", - "value": "\\"x\\"", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { @@ -96598,166 +104865,261 @@ Object { "type": "Punctuator", "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-default-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 25, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 25, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ - 19, - 25, + 15, + 20, ], "type": "Keyword", - "value": "delete", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 26, - 27, + 21, + 22, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 27, - 28, + 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/error-function.src 1`] = ` +exports[`javascript fixtures/modules/export-default-expression.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "declaration": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "friends", - "range": Array [ - 31, - 38, - ], - "type": "Identifier", + "declaration": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 1, - "line": 2, - }, + "start": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 16, - 39, - ], - "type": "ExportDefaultDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 1, }, + "range": Array [ + 16, + 17, + ], + "raw": "1", + "type": "Literal", + "value": 1, }, - "range": Array [ - 13, - 41, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 21, "line": 1, }, "start": Object { - "column": 9, + "column": 16, "line": 1, }, }, - "name": "x", + "operator": "+", "range": Array [ - 9, - 10, + 16, + 21, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "type": "BinaryExpression", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [], "range": Array [ 0, - 41, + 23, ], - "type": "FunctionDeclaration", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 5, + "line": 2, }, "start": Object { "column": 0, @@ -96766,14 +105128,14 @@ Object { }, "range": Array [ 0, - 43, + 24, ], - "sourceType": "script", + "sourceType": "module", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 6, "line": 1, }, "start": Object { @@ -96783,43 +105145,43 @@ Object { }, "range": Array [ 0, - 8, + 6, ], "type": "Keyword", - "value": "function", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 14, "line": 1, }, "start": Object { - "column": 9, + "column": 7, "line": 1, }, }, "range": Array [ - 9, - 10, + 7, + 14, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 15, "line": 1, }, }, "range": Array [ - 10, - 11, + 15, + 16, ], "type": "Punctuator", "value": "(", @@ -96827,377 +105189,163 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 17, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 17, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 19, "line": 1, }, "start": Object { - "column": 13, + "column": 18, "line": 1, }, }, "range": Array [ - 13, - 14, + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 1, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 16, - 22, + 20, + 21, ], - "type": "Keyword", - "value": "export", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 23, - 30, + 21, + 22, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 31, - 38, - ], - "type": "Identifier", - "value": "friends", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, + "line": 1, }, "start": Object { - "column": 23, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 38, - 39, + 22, + 23, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/error-strict.src 1`] = ` +exports[`javascript fixtures/modules/export-default-function.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 26, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 25, - ], - "raw": "\\"house\\"", - "type": "Literal", - "value": "house", - }, - "specifiers": Array [ - Object { + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 1, }, "start": Object { - "column": 7, + "column": 27, "line": 1, }, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "house", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, "range": Array [ - 7, - 12, + 27, + 29, ], - "type": "ImportDefaultSpecifier", + "type": "BlockStatement", }, - ], - "type": "ImportDeclaration", - }, - Object { - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 4, - }, - "start": Object { - "column": 13, - "line": 4, - }, - }, - "name": "roof", - "range": Array [ - 56, - 60, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "name": "console", - "range": Array [ - 44, - 51, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "name": "log", - "range": Array [ - 52, - 55, - ], - "type": "Identifier", - }, - "range": Array [ - 44, - 55, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 44, - 61, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 44, - 62, - ], - "type": "ExpressionStatement", - }, - ], + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 29, + "line": 1, }, "start": Object { - "column": 13, - "line": 3, + "column": 15, + "line": 1, }, }, + "params": Array [], "range": Array [ - 41, - 64, + 15, + 29, ], - "type": "BlockStatement", + "type": "FunctionDeclaration", }, "loc": Object { "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 3, + "column": 29, + "line": 1, }, - }, - "object": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, + "start": Object { + "column": 0, + "line": 1, }, - "name": "house", - "range": Array [ - 34, - 39, - ], - "type": "Identifier", }, "range": Array [ - 28, - 64, + 0, + 29, ], - "type": "WithStatement", + "type": "ExportDefaultDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -97206,7 +105354,7 @@ Object { }, "range": Array [ 0, - 65, + 30, ], "sourceType": "module", "tokens": Array [ @@ -97226,12 +105374,12 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { @@ -97241,28 +105389,28 @@ Object { }, "range": Array [ 7, - 12, + 14, ], - "type": "Identifier", - "value": "house", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 17, + 15, + 23, ], - "type": "Identifier", - "value": "from", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { @@ -97271,16 +105419,16 @@ Object { "line": 1, }, "start": Object { - "column": 18, + "column": 24, "line": 1, }, }, "range": Array [ - 18, + 24, 25, ], - "type": "String", - "value": "\\"house\\"", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -97298,238 +105446,244 @@ Object { 26, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ + 27, 28, - 32, ], - "type": "Keyword", - "value": "with", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 29, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 28, + "line": 1, }, }, "range": Array [ - 33, - 34, + 28, + 29, ], "type": "Punctuator", - "value": "(", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-default-named-class.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "ClassBody", }, - }, - "range": Array [ - 34, - 39, - ], - "type": "Identifier", - "value": "house", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 3, + "id": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 21, + 25, + ], + "type": "Identifier", }, - "start": Object { - "column": 11, - "line": 3, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, }, + "range": Array [ + 15, + 30, + ], + "superClass": null, + "type": "ClassDeclaration", }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": ")", - }, - Object { "loc": Object { "end": Object { - "column": 14, + "column": 1, "line": 3, }, "start": Object { - "column": 13, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 41, - 42, + 0, + 30, ], - "type": "Punctuator", - "value": "{", + "type": "ExportDefaultDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 44, - 51, - ], - "type": "Identifier", - "value": "console", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 4, - }, - }, - "range": Array [ - 51, - 52, - ], - "type": "Punctuator", - "value": ".", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 31, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { - "column": 9, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 52, - 55, + 0, + 6, ], - "type": "Identifier", - "value": "log", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 14, + "line": 1, }, "start": Object { - "column": 12, - "line": 4, + "column": 7, + "line": 1, }, }, "range": Array [ - 55, - 56, + 7, + 14, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 20, + "line": 1, }, "start": Object { - "column": 13, - "line": 4, + "column": 15, + "line": 1, }, }, "range": Array [ - 56, - 60, + 15, + 20, ], - "type": "Identifier", - "value": "roof", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 25, + "line": 1, }, "start": Object { - "column": 17, - "line": 4, + "column": 21, + "line": 1, }, }, "range": Array [ - 60, - 61, + 21, + 25, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 27, + "line": 1, }, "start": Object { - "column": 18, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 61, - 62, + 26, + 27, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 63, - 64, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -97539,15 +105693,53 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-array.src 1`] = ` +exports[`javascript fixtures/modules/export-default-named-function.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "elements": Array [], + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 17, + "column": 32, "line": 1, }, "start": Object { @@ -97555,15 +105747,16 @@ Object { "line": 1, }, }, + "params": Array [], "range": Array [ 15, - 17, + 32, ], - "type": "ArrayExpression", + "type": "FunctionDeclaration", }, "loc": Object { "end": Object { - "column": 18, + "column": 32, "line": 1, }, "start": Object { @@ -97573,7 +105766,7 @@ Object { }, "range": Array [ 0, - 18, + 32, ], "type": "ExportDefaultDeclaration", }, @@ -97590,7 +105783,7 @@ Object { }, "range": Array [ 0, - 19, + 33, ], "sourceType": "module", "tokens": Array [ @@ -97633,7 +105826,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { @@ -97643,80 +105836,115 @@ Object { }, "range": Array [ 15, - 16, + 23, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, ], "type": "Punctuator", - "value": "[", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 29, "line": 1, }, "start": Object { - "column": 16, + "column": 28, "line": 1, }, }, "range": Array [ - 16, - 17, + 28, + 29, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 31, "line": 1, }, "start": Object { - "column": 17, + "column": 30, "line": 1, }, }, "range": Array [ - 17, - 18, + 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-default-class.src 1`] = ` +exports[`javascript fixtures/modules/export-default-number.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 25, - ], - "type": "ClassBody", - }, - "id": null, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { "column": 15, @@ -97725,15 +105953,16 @@ Object { }, "range": Array [ 15, - 25, + 17, ], - "superClass": null, - "type": "ClassDeclaration", + "raw": "42", + "type": "Literal", + "value": 42, }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { "column": 0, @@ -97742,7 +105971,7 @@ Object { }, "range": Array [ 0, - 25, + 18, ], "type": "ExportDefaultDeclaration", }, @@ -97750,7 +105979,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -97759,7 +105988,7 @@ Object { }, "range": Array [ 0, - 26, + 19, ], "sourceType": "module", "tokens": Array [ @@ -97797,130 +106026,133 @@ Object { 14, ], "type": "Keyword", - "value": "default", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 20, - ], - "type": "Keyword", - "value": "class", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 17, "line": 1, }, "start": Object { - "column": 21, + "column": 15, "line": 1, }, }, "range": Array [ - 21, - 22, + 15, + 17, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "42", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 24, - 25, + 17, + 18, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-default-expression.src 1`] = ` +exports[`javascript fixtures/modules/export-default-object.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, "loc": Object { "end": Object { - "column": 21, + "column": 25, "line": 1, }, "start": Object { - "column": 16, + "column": 15, "line": 1, }, }, - "operator": "+", - "range": Array [ - 16, - 21, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", }, - "start": Object { - "column": 20, - "line": 1, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "raw": "1", + "type": "Literal", + "value": 1, }, }, - "range": Array [ - 20, - 21, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - "type": "BinaryExpression", + ], + "range": Array [ + 15, + 25, + ], + "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 23, + "column": 26, "line": 1, }, "start": Object { @@ -97930,7 +106162,7 @@ Object { }, "range": Array [ 0, - 23, + 26, ], "type": "ExportDefaultDeclaration", }, @@ -97947,7 +106179,7 @@ Object { }, "range": Array [ 0, - 24, + 27, ], "sourceType": "module", "tokens": Array [ @@ -98003,94 +106235,94 @@ Object { 16, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 20, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 21, "line": 1, }, "start": Object { - "column": 18, + "column": 20, "line": 1, }, }, "range": Array [ - 18, - 19, + 20, + 21, ], "type": "Punctuator", - "value": "+", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 20, + "column": 22, "line": 1, }, }, "range": Array [ - 20, - 21, + 22, + 23, ], "type": "Numeric", - "value": "2", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 21, + "column": 24, "line": 1, }, }, "range": Array [ - 21, - 22, + 24, + 25, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 26, "line": 1, }, "start": Object { - "column": 22, + "column": 25, "line": 1, }, }, "range": Array [ - 22, - 23, + 25, + 26, ], "type": "Punctuator", "value": ";", @@ -98100,36 +106332,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-function.src 1`] = ` +exports[`javascript fixtures/modules/export-default-value.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 29, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 29, + "column": 18, "line": 1, }, "start": Object { @@ -98137,16 +106347,16 @@ Object { "line": 1, }, }, - "params": Array [], + "name": "foo", "range": Array [ 15, - 29, + 18, ], - "type": "FunctionDeclaration", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 29, + "column": 19, "line": 1, }, "start": Object { @@ -98156,7 +106366,7 @@ Object { }, "range": Array [ 0, - 29, + 19, ], "type": "ExportDefaultDeclaration", }, @@ -98173,7 +106383,7 @@ Object { }, "range": Array [ 0, - 30, + 20, ], "sourceType": "module", "tokens": Array [ @@ -98216,7 +106426,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { @@ -98226,167 +106436,78 @@ Object { }, "range": Array [ 15, - 23, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, + 18, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 19, "line": 1, }, "start": Object { - "column": 27, + "column": 18, "line": 1, }, }, "range": Array [ - 27, - 28, + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-from-batch.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { - "column": 28, + "column": 0, "line": 1, }, }, "range": Array [ - 28, - 29, + 0, + 20, ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-default-named-class.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 30, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Test", - "range": Array [ - 21, - 25, - ], - "type": "Identifier", - }, + "source": Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ - 15, - 30, + 14, + 19, ], - "superClass": null, - "type": "ClassDeclaration", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", }, - "range": Array [ - 0, - 30, - ], - "type": "ExportDefaultDeclaration", + "type": "ExportAllDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -98395,7 +106516,7 @@ Object { }, "range": Array [ 0, - 31, + 21, ], "sourceType": "module", "tokens": Array [ @@ -98420,7 +106541,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -98430,164 +106551,164 @@ Object { }, "range": Array [ 7, - 14, + 8, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "*", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 13, "line": 1, }, "start": Object { - "column": 15, + "column": 9, "line": 1, }, }, "range": Array [ - 15, - 20, + 9, + 13, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 19, "line": 1, }, "start": Object { - "column": 21, + "column": 14, "line": 1, }, }, "range": Array [ - 21, - 25, + 14, + 19, ], - "type": "Identifier", - "value": "Test", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 20, "line": 1, }, "start": Object { - "column": 26, + "column": 19, "line": 1, }, }, "range": Array [ - 26, - 27, + 19, + 20, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-from-default.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 29, - 30, + 0, + 28, ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-default-named-function.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, + "source": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, }, - "range": Array [ - 30, - 32, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": Object { + "range": Array [ + 22, + 27, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 27, + "column": 15, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, - "name": "foo", + "local": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, "range": Array [ - 24, - 27, + 8, + 15, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 15, - 32, - ], - "type": "FunctionDeclaration", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 32, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -98602,7 +106723,7 @@ Object { }, "range": Array [ 0, - 33, + 29, ], "sourceType": "module", "tokens": Array [ @@ -98627,7 +106748,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -98637,162 +106758,200 @@ Object { }, "range": Array [ 7, - 14, + 8, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 15, - 23, ], "type": "Keyword", - "value": "function", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 16, "line": 1, }, "start": Object { - "column": 24, + "column": 15, "line": 1, }, }, "range": Array [ - 24, - 27, + 15, + 16, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 21, "line": 1, }, "start": Object { - "column": 27, + "column": 17, "line": 1, }, }, "range": Array [ - 27, - 28, + 17, + 21, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 27, "line": 1, }, "start": Object { - "column": 28, + "column": 22, "line": 1, }, }, "range": Array [ - 28, - 29, + 22, + 27, ], - "type": "Punctuator", - "value": ")", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 28, "line": 1, }, "start": Object { - "column": 30, + "column": 27, "line": 1, }, }, "range": Array [ - 30, - 31, + 27, + 28, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-from-named-as-default.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 32, + "column": 35, "line": 1, }, "start": Object { - "column": 31, + "column": 0, "line": 1, }, }, "range": Array [ - 31, - 32, + 0, + 35, ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-default-number.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { + "source": Object { "loc": Object { "end": Object { - "column": 17, + "column": 34, "line": 1, }, "start": Object { - "column": 15, + "column": 29, "line": 1, }, }, "range": Array [ - 15, - 17, + 29, + 34, ], - "raw": "42", + "raw": "\\"foo\\"", "type": "Literal", - "value": 42, + "value": "foo", }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 18, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -98807,7 +106966,7 @@ Object { }, "range": Array [ 0, - 19, + 36, ], "sourceType": "module", "tokens": Array [ @@ -98832,7 +106991,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -98842,15 +107001,51 @@ Object { }, "range": Array [ 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, 14, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 22, "line": 1, }, "start": Object { @@ -98860,25 +107055,79 @@ Object { }, "range": Array [ 15, - 17, + 22, ], - "type": "Numeric", - "value": "42", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 23, "line": 1, }, "start": Object { - "column": 17, + "column": 22, "line": 1, }, }, "range": Array [ - 17, - 18, + 22, + 23, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 34, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", "value": ";", @@ -98888,102 +107137,100 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-object.src 1`] = ` +exports[`javascript fixtures/modules/export-from-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "source": Object { "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { - "column": 15, + "column": 25, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "kind": "init", + "range": Array [ + 25, + 30, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { "loc": Object { "end": Object { - "column": 23, + "column": 18, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, - "method": false, + "name": "bar", "range": Array [ - 17, - 23, + 15, + 18, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 22, - 23, - ], - "raw": "1", - "type": "Literal", - "value": 1, }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", }, - ], - "range": Array [ - 15, - 25, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 8, + 18, + ], + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 26, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -98998,7 +107245,7 @@ Object { }, "range": Array [ 0, - 27, + 32, ], "sourceType": "module", "tokens": Array [ @@ -99014,134 +107261,152 @@ Object { }, }, "range": Array [ - 0, - 6, + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, - 14, + 8, + 11, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, "range": Array [ - 15, - 16, + 12, + 14, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { - "column": 17, + "column": 15, "line": 1, }, }, "range": Array [ - 17, - 20, + 15, + 18, ], "type": "Identifier", - "value": "foo", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 20, + "column": 18, "line": 1, }, }, "range": Array [ - 20, - 21, + 18, + 19, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 24, "line": 1, }, "start": Object { - "column": 22, + "column": 20, "line": 1, }, }, "range": Array [ - 22, - 23, + 20, + 24, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 30, "line": 1, }, "start": Object { - "column": 24, + "column": 25, "line": 1, }, }, "range": Array [ - 24, 25, + 30, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 31, "line": 1, }, "start": Object { - "column": 25, + "column": 30, "line": 1, }, }, "range": Array [ - 25, - 26, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -99151,43 +107416,153 @@ Object { } `; -exports[`javascript fixtures/modules/export-default-value.src 1`] = ` +exports[`javascript fixtures/modules/export-from-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "source": Object { "loc": Object { "end": Object { - "column": 18, + "column": 39, "line": 1, }, "start": Object { - "column": 15, + "column": 34, "line": 1, }, }, - "name": "foo", "range": Array [ - 15, - 18, + 34, + 39, ], - "type": "Identifier", + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "default", + "range": Array [ + 15, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 22, + ], + "type": "ExportSpecifier", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 24, + 27, + ], + "type": "Identifier", + }, + "range": Array [ + 24, + 27, + ], + "type": "ExportSpecifier", }, - }, - "range": Array [ - 0, - 19, ], - "type": "ExportDefaultDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -99202,7 +107577,7 @@ Object { }, "range": Array [ 0, - 20, + 41, ], "sourceType": "module", "tokens": Array [ @@ -99227,7 +107602,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 8, "line": 1, }, "start": Object { @@ -99237,25 +107612,25 @@ Object { }, "range": Array [ 7, - 14, + 8, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, "range": Array [ - 15, - 18, + 8, + 11, ], "type": "Identifier", "value": "foo", @@ -99263,132 +107638,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 14, "line": 1, }, "start": Object { - "column": 18, + "column": 12, "line": 1, }, }, "range": Array [ - 18, - 19, + 12, + 14, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "as", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-from-batch.src 1`] = ` -Object { - "body": Array [ Object { "loc": Object { "end": Object { - "column": 20, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 15, "line": 1, }, }, "range": Array [ - 0, - 20, + 15, + 22, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, }, - "range": Array [ - 14, - 19, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", }, - "type": "ExportAllDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 27, "line": 1, }, "start": Object { - "column": 0, + "column": 24, "line": 1, }, }, "range": Array [ - 0, - 6, + 24, + 27, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 28, "line": 1, }, "start": Object { - "column": 7, + "column": 27, "line": 1, }, }, "range": Array [ - 7, - 8, + 27, + 28, ], "type": "Punctuator", - "value": "*", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 33, "line": 1, }, "start": Object { - "column": 9, + "column": 29, "line": 1, }, }, "range": Array [ - 9, - 13, + 29, + 33, ], "type": "Identifier", "value": "from", @@ -99396,17 +107746,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 39, "line": 1, }, "start": Object { - "column": 14, + "column": 34, "line": 1, }, }, "range": Array [ - 14, - 19, + 34, + 39, ], "type": "String", "value": "\\"foo\\"", @@ -99414,17 +107764,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 40, "line": 1, }, "start": Object { - "column": 19, + "column": 39, "line": 1, }, }, "range": Array [ - 19, - 20, + 39, + 40, ], "type": "Punctuator", "value": ";", @@ -99434,14 +107784,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-default.src 1`] = ` +exports[`javascript fixtures/modules/export-from-specifier.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { @@ -99451,22 +107801,22 @@ Object { }, "range": Array [ 0, - 28, + 24, ], "source": Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 22, + "column": 18, "line": 1, }, }, "range": Array [ - 22, - 27, + 18, + 23, ], "raw": "\\"foo\\"", "type": "Literal", @@ -99477,7 +107827,7 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -99485,16 +107835,16 @@ Object { "line": 1, }, }, - "name": "default", + "name": "foo", "range": Array [ 8, - 15, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -99505,7 +107855,7 @@ Object { "local": Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -99513,16 +107863,16 @@ Object { "line": 1, }, }, - "name": "default", + "name": "foo", "range": Array [ 8, - 15, + 11, ], "type": "Identifier", }, "range": Array [ 8, - 15, + 11, ], "type": "ExportSpecifier", }, @@ -99542,7 +107892,7 @@ Object { }, "range": Array [ 0, - 29, + 25, ], "sourceType": "module", "tokens": Array [ @@ -99585,7 +107935,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -99595,25 +107945,25 @@ Object { }, "range": Array [ 8, - 15, + 11, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 12, "line": 1, }, "start": Object { - "column": 15, + "column": 11, "line": 1, }, }, "range": Array [ - 15, - 16, + 11, + 12, ], "type": "Punctuator", "value": "}", @@ -99621,17 +107971,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 17, "line": 1, }, "start": Object { - "column": 17, + "column": 13, "line": 1, }, }, "range": Array [ + 13, 17, - 21, ], "type": "Identifier", "value": "from", @@ -99639,17 +107989,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 22, + "column": 18, "line": 1, }, }, "range": Array [ - 22, - 27, + 18, + 23, ], "type": "String", "value": "\\"foo\\"", @@ -99657,17 +108007,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 24, "line": 1, }, "start": Object { - "column": 27, + "column": 23, "line": 1, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -99677,14 +108027,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-named-as-default.src 1`] = ` +exports[`javascript fixtures/modules/export-from-specifiers.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { @@ -99694,78 +108044,131 @@ Object { }, "range": Array [ 0, - 35, + 29, ], "source": Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, - "range": Array [ - 29, - 34, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, - "specifiers": Array [ + "range": Array [ + 23, + 28, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, Object { "exported": Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, - "name": "default", + "name": "bar", "range": Array [ - 15, - 22, + 13, + 16, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 1, }, "start": Object { - "column": 8, + "column": 13, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 8, - 11, + 13, + 16, ], "type": "Identifier", }, "range": Array [ - 8, - 22, + 13, + 16, ], "type": "ExportSpecifier", }, @@ -99785,7 +108188,7 @@ Object { }, "range": Array [ 0, - 36, + 30, ], "sourceType": "module", "tokens": Array [ @@ -99846,53 +108249,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 14, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 22, + 13, + 16, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, ], "type": "Punctuator", "value": "}", @@ -99900,17 +108303,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 22, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "range": Array [ - 24, - 28, + 18, + 22, ], "type": "Identifier", "value": "from", @@ -99918,17 +108321,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 34, + 23, + 28, ], "type": "String", "value": "\\"foo\\"", @@ -99936,17 +108339,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { - "column": 34, + "column": 28, "line": 1, }, }, "range": Array [ - 34, - 35, + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -99956,99 +108359,83 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-function.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, + "declaration": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 25, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 0, - "line": 1, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", }, - }, - "range": Array [ - 0, - 31, - ], - "source": Object { "loc": Object { "end": Object { - "column": 30, + "column": 25, "line": 1, }, "start": Object { - "column": 25, + "column": 7, "line": 1, }, }, + "params": Array [], "range": Array [ + 7, 25, - 30, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "type": "FunctionDeclaration", }, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 18, - ], - "type": "ExportSpecifier", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 25, ], + "source": null, + "specifiers": Array [], "type": "ExportNamedDeclaration", }, ], @@ -100064,7 +108451,7 @@ Object { }, "range": Array [ 0, - 32, + 26, ], "sourceType": "module", "tokens": Array [ @@ -100089,7 +108476,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 1, }, "start": Object { @@ -100099,25 +108486,25 @@ Object { }, "range": Array [ 7, - 8, + 15, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 19, "line": 1, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, "range": Array [ - 8, - 11, + 16, + 19, ], "type": "Identifier", "value": "foo", @@ -100125,56 +108512,38 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 14, - ], - "type": "Identifier", - "value": "as", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, + "column": 21, "line": 1, }, "start": Object { - "column": 15, + "column": 20, "line": 1, }, }, "range": Array [ - 15, - 18, + 20, + 21, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 22, "line": 1, }, "start": Object { - "column": 18, + "column": 21, "line": 1, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { @@ -100183,66 +108552,48 @@ Object { "line": 1, }, "start": Object { - "column": 20, + "column": 23, "line": 1, }, }, "range": Array [ - 20, + 23, 24, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { "column": 25, "line": 1, }, - }, - "range": Array [ - 25, - 30, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, "start": Object { - "column": 30, + "column": 24, "line": 1, }, }, "range": Array [ - 30, - 31, + 24, + 25, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-from-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-default.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 40, + "column": 24, "line": 1, }, "start": Object { @@ -100252,27 +108603,9 @@ Object { }, "range": Array [ 0, - 40, + 24, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 39, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, + "source": null, "specifiers": Array [ Object { "exported": Object { @@ -100327,59 +108660,6 @@ Object { ], "type": "ExportSpecifier", }, - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "range": Array [ - 24, - 27, - ], - "type": "ExportSpecifier", - }, ], "type": "ExportNamedDeclaration", }, @@ -100396,7 +108676,7 @@ Object { }, "range": Array [ 0, - 41, + 25, ], "sourceType": "module", "tokens": Array [ @@ -100506,94 +108786,22 @@ Object { 23, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", "value": "}", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 33, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 39, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, + "column": 24, "line": 1, }, "start": Object { - "column": 39, + "column": 23, "line": 1, }, }, "range": Array [ - 39, - 40, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -100603,67 +108811,49 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 24, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, + "declaration": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "range": Array [ - 18, - 23, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", }, + "range": Array [ + 0, + 20, + ], + "source": null, "specifiers": Array [ Object { "exported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 18, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 8, - 11, + 15, + 18, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 11, + "column": 18, "line": 1, }, "start": Object { @@ -100691,7 +108881,7 @@ Object { }, "range": Array [ 8, - 11, + 18, ], "type": "ExportSpecifier", }, @@ -100711,7 +108901,7 @@ Object { }, "range": Array [ 0, - 25, + 21, ], "sourceType": "module", "tokens": Array [ @@ -100772,43 +108962,43 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 18, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 17, + 15, + 18, ], "type": "Identifier", - "value": "from", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 19, "line": 1, }, "start": Object { @@ -100818,25 +109008,25 @@ Object { }, "range": Array [ 18, - 23, + 19, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 20, "line": 1, }, "start": Object { - "column": 23, + "column": 19, "line": 1, }, }, "range": Array [ - 23, - 24, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -100846,7 +109036,7 @@ Object { } `; -exports[`javascript fixtures/modules/export-from-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { @@ -100865,48 +109055,30 @@ Object { 0, 29, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 28, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, + "source": null, "specifiers": Array [ Object { "exported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 22, "line": 1, }, "start": Object { - "column": 8, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "default", "range": Array [ - 8, - 11, + 15, + 22, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 11, + "column": 22, "line": 1, }, "start": Object { @@ -100934,7 +109106,7 @@ Object { }, "range": Array [ 8, - 11, + 22, ], "type": "ExportSpecifier", }, @@ -100942,52 +109114,52 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 16, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, "name": "bar", "range": Array [ - 13, - 16, + 24, + 27, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 27, "line": 1, }, "start": Object { - "column": 13, + "column": 24, "line": 1, }, }, "name": "bar", "range": Array [ - 13, - 16, + 24, + 27, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 24, + 27, ], "type": "ExportSpecifier", }, @@ -101068,74 +109240,74 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 14, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 13, + "column": 15, "line": 1, }, }, "range": Array [ - 13, - 16, + 15, + 22, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 23, "line": 1, }, "start": Object { - "column": 16, + "column": 22, "line": 1, }, }, "range": Array [ - 16, - 17, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 27, "line": 1, }, "start": Object { - "column": 18, + "column": 24, "line": 1, }, }, "range": Array [ - 18, - 22, + 24, + 27, ], "type": "Identifier", - "value": "from", + "value": "bar", }, Object { "loc": Object { @@ -101144,16 +109316,16 @@ Object { "line": 1, }, "start": Object { - "column": 23, + "column": 27, "line": 1, }, }, "range": Array [ - 23, + 27, 28, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { @@ -101178,71 +109350,68 @@ Object { } `; -exports[`javascript fixtures/modules/export-function.src 1`] = ` +exports[`javascript fixtures/modules/export-named-class.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "async": false, "body": Object { "body": Array [], "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 23, + "column": 18, "line": 1, }, }, "range": Array [ - 23, - 25, + 18, + 22, ], - "type": "BlockStatement", + "type": "ClassBody", }, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { - "column": 16, + "column": 13, "line": 1, }, }, - "name": "foo", + "name": "Test", "range": Array [ - 16, - 19, + 13, + 17, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 7, "line": 1, }, }, - "params": Array [], "range": Array [ 7, - 25, + 22, ], - "type": "FunctionDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -101251,7 +109420,7 @@ Object { }, "range": Array [ 0, - 25, + 22, ], "source": null, "specifiers": Array [], @@ -101261,7 +109430,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -101270,7 +109439,7 @@ Object { }, "range": Array [ 0, - 26, + 23, ], "sourceType": "module", "tokens": Array [ @@ -101295,7 +109464,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 12, "line": 1, }, "start": Object { @@ -101305,10 +109474,28 @@ Object { }, "range": Array [ 7, - 15, + 12, ], "type": "Keyword", - "value": "function", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { @@ -101317,102 +109504,354 @@ Object { "line": 1, }, "start": Object { - "column": 16, + "column": 18, "line": 1, }, }, "range": Array [ - 16, + 18, 19, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-named-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 10, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 11, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-named-specifier.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": null, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "source": null, + "specifiers": Array [ + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 8, + 11, + ], + "type": "ExportSpecifier", + }, + ], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 8, "line": 1, }, "start": Object { - "column": 20, + "column": 7, "line": 1, }, }, "range": Array [ - 20, - 21, + 7, + 8, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { - "column": 21, + "column": 8, "line": 1, }, }, "range": Array [ - 21, - 22, + 8, + 11, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 12, "line": 1, }, "start": Object { - "column": 23, + "column": 11, "line": 1, }, }, "range": Array [ - 23, - 24, + 11, + 12, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 13, "line": 1, }, "start": Object { - "column": 24, + "column": 12, "line": 1, }, }, "range": Array [ - 24, - 25, + 12, + 13, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/export-named-as-default.src 1`] = ` +exports[`javascript fixtures/modules/export-named-specifiers.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 24, + "column": 18, "line": 1, }, "start": Object { @@ -101422,7 +109861,7 @@ Object { }, "range": Array [ 0, - 24, + 18, ], "source": null, "specifiers": Array [ @@ -101430,24 +109869,24 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, - "name": "default", + "name": "foo", "range": Array [ - 15, - 22, + 8, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { @@ -101475,7 +109914,60 @@ Object { }, "range": Array [ 8, - 22, + 11, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, ], "type": "ExportSpecifier", }, @@ -101495,7 +109987,7 @@ Object { }, "range": Array [ 0, - 25, + 19, ], "sourceType": "module", "tokens": Array [ @@ -101556,53 +110048,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 14, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 22, + 13, + 16, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, ], "type": "Punctuator", "value": "}", @@ -101610,17 +110102,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 24, + "column": 18, "line": 1, }, "start": Object { - "column": 23, + "column": 17, "line": 1, }, }, "range": Array [ - 23, - 24, + 17, + 18, ], "type": "Punctuator", "value": ";", @@ -101630,14 +110122,14 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/export-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { "declaration": null, "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { @@ -101647,7 +110139,7 @@ Object { }, "range": Array [ 0, - 20, + 19, ], "source": null, "specifiers": Array [ @@ -101655,24 +110147,24 @@ Object { "exported": Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 8, "line": 1, }, }, - "name": "bar", + "name": "foo", "range": Array [ - 15, - 18, + 8, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { @@ -101700,7 +110192,60 @@ Object { }, "range": Array [ 8, - 18, + 11, + ], + "type": "ExportSpecifier", + }, + Object { + "exported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, ], "type": "ExportSpecifier", }, @@ -101720,7 +110265,7 @@ Object { }, "range": Array [ 0, - 21, + 20, ], "sourceType": "module", "tokens": Array [ @@ -101781,35 +110326,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 14, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 16, "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, - 18, + 13, + 16, ], "type": "Identifier", "value": "bar", @@ -101817,17 +110362,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 17, "line": 1, }, "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { "column": 18, "line": 1, }, + "start": Object { + "column": 17, + "line": 1, + }, }, "range": Array [ + 17, 18, - 19, ], "type": "Punctuator", "value": "}", @@ -101835,17 +110398,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 19, "line": 1, }, "start": Object { - "column": 19, + "column": 18, "line": 1, }, }, "range": Array [ + 18, 19, - 20, ], "type": "Punctuator", "value": ";", @@ -101855,14 +110418,69 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/export-var.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 15, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 29, + "column": 15, "line": 1, }, "start": Object { @@ -101872,117 +110490,221 @@ Object { }, "range": Array [ 0, - 29, + 15, ], "source": null, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/export-var-anonymous-function.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", }, - "name": "default", - "range": Array [ - 15, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, + "init": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 8, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, }, + "params": Array [], + "range": Array [ + 17, + 31, + ], + "type": "FunctionExpression", }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 22, - ], - "type": "ExportSpecifier", - }, - Object { - "exported": Object { "loc": Object { "end": Object { - "column": 27, + "column": 31, "line": 1, }, "start": Object { - "column": 24, + "column": 11, "line": 1, }, }, - "name": "bar", "range": Array [ - 24, - 27, + 11, + 31, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 24, - 27, - ], - "type": "Identifier", + "start": Object { + "column": 7, + "line": 1, }, - "range": Array [ - 24, - 27, - ], - "type": "ExportSpecifier", }, + "range": Array [ + 7, + 32, + ], + "type": "VariableDeclaration", + }, + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, ], + "source": null, + "specifiers": Array [], "type": "ExportNamedDeclaration", }, ], @@ -101998,7 +110720,7 @@ Object { }, "range": Array [ 0, - 30, + 33, ], "sourceType": "module", "tokens": Array [ @@ -102023,7 +110745,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -102033,25 +110755,25 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, 11, + 14, ], "type": "Identifier", "value": "foo", @@ -102059,89 +110781,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 15, "line": 1, }, }, "range": Array [ - 12, - 14, + 15, + 16, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 25, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 22, + 17, + 25, ], "type": "Keyword", - "value": "default", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 27, "line": 1, }, "start": Object { - "column": 22, + "column": 26, "line": 1, }, }, "range": Array [ - 22, - 23, + 26, + 27, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 28, "line": 1, }, "start": Object { - "column": 24, + "column": 27, "line": 1, }, }, "range": Array [ - 24, 27, + 28, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 30, "line": 1, }, "start": Object { - "column": 27, + "column": 29, "line": 1, }, }, "range": Array [ - 27, - 28, + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, ], "type": "Punctuator", "value": "}", @@ -102149,17 +110889,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 32, "line": 1, }, "start": Object { - "column": 28, + "column": 31, "line": 1, }, }, "range": Array [ - 28, - 29, + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -102169,51 +110909,72 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-class.src 1`] = ` +exports[`javascript fixtures/modules/export-var-number.src 1`] = ` Object { "body": Array [ Object { "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", }, - }, - "range": Array [ - 18, - 22, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "raw": "1", + "type": "Literal", + "value": 1, }, - "start": Object { - "column": 13, - "line": 1, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "range": Array [ + 11, + 18, + ], + "type": "VariableDeclarator", }, - "name": "Test", - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { "column": 7, @@ -102222,15 +110983,14 @@ Object { }, "range": Array [ 7, - 22, + 19, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { "column": 0, @@ -102239,7 +110999,7 @@ Object { }, "range": Array [ 0, - 22, + 19, ], "source": null, "specifiers": Array [], @@ -102249,7 +111009,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -102258,7 +111018,7 @@ Object { }, "range": Array [ 0, - 23, + 20, ], "sourceType": "module", "tokens": Array [ @@ -102283,7 +111043,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 10, "line": 1, }, "start": Object { @@ -102293,178 +111053,79 @@ Object { }, "range": Array [ 7, - 12, + 10, ], "type": "Keyword", - "value": "class", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 14, "line": 1, }, "start": Object { - "column": 13, + "column": 11, "line": 1, }, }, "range": Array [ - 13, - 17, + 11, + 14, ], "type": "Identifier", - "value": "Test", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-named-empty.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": null, - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 10, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 11, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "export", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 16, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, "range": Array [ - 7, - 8, + 15, + 16, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { - "column": 8, + "column": 17, "line": 1, }, }, "range": Array [ - 8, - 9, + 17, + 18, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 18, "line": 1, }, }, "range": Array [ - 9, - 10, + 18, + 19, ], "type": "Punctuator", "value": ";", @@ -102474,14 +111135,13 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-specifier.src 1`] = ` +exports[`javascript fixtures/modules/import-default.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 13, + "column": 22, "line": 1, }, "start": Object { @@ -102491,65 +111151,65 @@ Object { }, "range": Array [ 0, - 13, + 22, ], - "source": null, + "source": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 21, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, "specifiers": Array [ Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "name": "foo", "range": Array [ - 8, - 11, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 8, - 11, + 7, + 10, ], - "type": "ExportSpecifier", + "type": "ImportDefaultSpecifier", }, ], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -102564,7 +111224,7 @@ Object { }, "range": Array [ 0, - 14, + 23, ], "sourceType": "module", "tokens": Array [ @@ -102584,12 +111244,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -102599,61 +111259,61 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, 11, + 15, ], "type": "Identifier", - "value": "foo", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 21, "line": 1, }, "start": Object { - "column": 11, + "column": 16, "line": 1, }, }, "range": Array [ - 11, - 12, + 16, + 21, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 22, "line": 1, }, "start": Object { - "column": 12, + "column": 21, "line": 1, }, }, "range": Array [ - 12, - 13, + 21, + 22, ], "type": "Punctuator", "value": ";", @@ -102663,14 +111323,13 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-default-and-named-specifiers.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 18, + "column": 29, "line": 1, }, "start": Object { @@ -102680,65 +111339,65 @@ Object { }, "range": Array [ 0, - 18, + 29, ], - "source": null, + "source": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, "specifiers": Array [ Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "name": "foo", "range": Array [ - 8, - 11, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 8, - 11, + 7, + 10, ], - "type": "ExportSpecifier", + "type": "ImportDefaultSpecifier", }, Object { - "exported": Object { + "imported": Object { "loc": Object { "end": Object { "column": 16, @@ -102788,10 +111447,10 @@ Object { 13, 16, ], - "type": "ExportSpecifier", + "type": "ImportSpecifier", }, ], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -102806,7 +111465,7 @@ Object { }, "range": Array [ 0, - 19, + 30, ], "sourceType": "module", "tokens": Array [ @@ -102826,12 +111485,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -102841,10 +111500,10 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -102853,34 +111512,34 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, + 10, 11, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 13, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { @@ -102921,17 +111580,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 18, "line": 1, }, }, "range": Array [ - 17, 18, + 22, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -102941,14 +111636,13 @@ Object { } `; -exports[`javascript fixtures/modules/export-named-specifiers-comma.src 1`] = ` +exports[`javascript fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` Object { "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 19, + "column": 32, "line": 1, }, "start": Object { @@ -102958,118 +111652,100 @@ Object { }, "range": Array [ 0, - 19, + 32, ], - "source": null, + "source": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 31, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, "specifiers": Array [ Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "name": "foo", "range": Array [ - 8, - 11, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 8, - 11, + 7, + 10, ], - "type": "ExportSpecifier", + "type": "ImportDefaultSpecifier", }, Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "name": "bar", "range": Array [ - 13, - 16, + 17, + 20, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 12, + 20, ], - "type": "ExportSpecifier", + "type": "ImportNamespaceSpecifier", }, ], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -103084,7 +111760,7 @@ Object { }, "range": Array [ 0, - 20, + 33, ], "sourceType": "module", "tokens": Array [ @@ -103104,12 +111780,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -103119,10 +111795,10 @@ Object { }, "range": Array [ 7, - 8, + 10, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -103131,34 +111807,34 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, + 10, 11, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 12, "line": 1, }, }, "range": Array [ - 11, 12, + 13, ], "type": "Punctuator", - "value": ",", + "value": "*", }, Object { "loc": Object { @@ -103167,175 +111843,101 @@ Object { "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, + 14, 16, ], "type": "Identifier", - "value": "bar", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, 17, + 20, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 25, "line": 1, }, "start": Object { - "column": 17, + "column": 21, "line": 1, }, }, "range": Array [ - 17, - 18, + 21, + 25, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 31, "line": 1, }, "start": Object { - "column": 18, + "column": 26, "line": 1, }, }, "range": Array [ - 18, - 19, + 26, + 31, ], - "type": "Punctuator", - "value": ";", + "type": "String", + "value": "\\"foo\\"", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-var.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 15, - ], - "type": "VariableDeclaration", - }, "loc": Object { "end": Object { - "column": 15, + "column": 32, "line": 1, }, "start": Object { - "column": 0, + "column": 31, "line": 1, }, }, "range": Array [ - 0, - 15, + 31, + 32, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ";", }, - }, - "range": Array [ - 0, - 16, ], - "sourceType": "module", - "tokens": Array [ + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-default-as.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 35, "line": 1, }, "start": Object { @@ -103345,186 +111947,83 @@ Object { }, "range": Array [ 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 10, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, + 35, ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "source": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, }, + "range": Array [ + 29, + 34, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-var-anonymous-function.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "BlockStatement", + "specifiers": Array [ + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, + "start": Object { + "column": 8, + "line": 1, }, - "params": Array [], - "range": Array [ - 17, - 31, - ], - "type": "FunctionExpression", }, + "name": "default", + "range": Array [ + 8, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "local": Object { "loc": Object { "end": Object { - "column": 31, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 19, "line": 1, }, }, + "name": "foo", "range": Array [ - 11, - 31, + 19, + 22, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "type": "Identifier", }, + "range": Array [ + 8, + 22, + ], + "type": "ImportSpecifier", }, - "range": Array [ - 7, - 32, - ], - "type": "VariableDeclaration", - }, - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 32, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -103539,7 +112038,7 @@ Object { }, "range": Array [ 0, - 33, + 36, ], "sourceType": "module", "tokens": Array [ @@ -103559,12 +112058,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -103574,82 +112073,82 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ - 11, - 14, + 8, + 15, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 16, "line": 1, }, }, "range": Array [ - 15, 16, + 18, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 22, "line": 1, }, "start": Object { - "column": 17, + "column": 19, "line": 1, }, }, "range": Array [ - 17, - 25, + 19, + 22, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 22, "line": 1, }, }, "range": Array [ - 26, - 27, + 22, + 23, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { @@ -103658,21 +112157,21 @@ Object { "line": 1, }, "start": Object { - "column": 27, + "column": 24, "line": 1, }, }, "range": Array [ - 27, + 24, 28, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 34, "line": 1, }, "start": Object { @@ -103682,147 +112181,109 @@ Object { }, "range": Array [ 29, - 30, + 34, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 31, + "column": 35, "line": 1, }, "start": Object { - "column": 30, + "column": 34, "line": 1, }, }, "range": Array [ - 30, - 31, + 34, + 35, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-jquery.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 32, + "column": 22, "line": 1, }, "start": Object { - "column": 31, + "column": 0, "line": 1, }, }, "range": Array [ - 31, - 32, + 0, + 22, ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/export-var-number.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", + "source": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 22, + ], + "raw": "\\"jquery\\"", + "type": "Literal", + "value": "jquery", + }, + "specifiers": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, }, - "init": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], - "raw": "1", - "type": "Literal", - "value": 1, + "start": Object { + "column": 7, + "line": 1, }, + }, + "local": Object { "loc": Object { "end": Object { - "column": 18, + "column": 8, "line": 1, }, "start": Object { - "column": 11, + "column": 7, "line": 1, }, }, + "name": "$", "range": Array [ - 11, - 18, + 7, + 8, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "type": "Identifier", }, + "range": Array [ + 7, + 8, + ], + "type": "ImportDefaultSpecifier", }, - "range": Array [ - 7, - 19, - ], - "type": "VariableDeclaration", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 19, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "ImportDeclaration", }, ], "loc": Object { @@ -103837,7 +112298,7 @@ Object { }, "range": Array [ 0, - 20, + 23, ], "sourceType": "module", "tokens": Array [ @@ -103857,12 +112318,12 @@ Object { 6, ], "type": "Keyword", - "value": "export", + "value": "import", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -103872,79 +112333,159 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "$", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 9, "line": 1, }, }, "range": Array [ - 11, - 14, + 9, + 13, ], "type": "Identifier", - "value": "foo", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ - 15, - 16, + 14, + 22, ], - "type": "Punctuator", - "value": "=", + "type": "String", + "value": "\\"jquery\\"", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-module.src 1`] = ` +Object { + "body": Array [ Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { - "column": 17, + "column": 0, "line": 1, }, }, "range": Array [ - 17, - 18, + 0, + 13, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 12, ], - "type": "Numeric", - "value": "1", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 13, "line": 1, }, "start": Object { - "column": 18, + "column": 12, "line": 1, }, }, "range": Array [ - 18, - 19, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -103954,13 +112495,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default.src 1`] = ` +exports[`javascript fixtures/modules/import-named-as-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 31, "line": 1, }, "start": Object { @@ -103970,22 +112511,22 @@ Object { }, "range": Array [ 0, - 22, + 31, ], "source": Object { "loc": Object { "end": Object { - "column": 21, + "column": 30, "line": 1, }, "start": Object { - "column": 16, + "column": 25, "line": 1, }, }, "range": Array [ - 16, - 21, + 25, + 30, ], "raw": "\\"foo\\"", "type": "Literal", @@ -103993,39 +112534,57 @@ Object { }, "specifiers": Array [ Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "baz", "range": Array [ - 7, - 10, + 15, + 18, ], "type": "Identifier", }, "range": Array [ - 7, - 10, + 8, + 18, ], - "type": "ImportDefaultSpecifier", + "type": "ImportSpecifier", }, ], "type": "ImportDeclaration", @@ -104043,7 +112602,7 @@ Object { }, "range": Array [ 0, - 23, + 32, ], "sourceType": "module", "tokens": Array [ @@ -104068,7 +112627,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -104078,25 +112637,97 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 11, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 11, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, ], "type": "Identifier", "value": "from", @@ -104104,17 +112735,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 21, + "column": 30, "line": 1, }, "start": Object { - "column": 16, + "column": 25, "line": 1, }, }, "range": Array [ - 16, - 21, + 25, + 30, ], "type": "String", "value": "\\"foo\\"", @@ -104122,17 +112753,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 31, "line": 1, }, "start": Object { - "column": 21, + "column": 30, "line": 1, }, }, "range": Array [ - 21, - 22, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -104142,13 +112773,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default-and-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-named-as-specifiers.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 29, + "column": 36, "line": 1, }, "start": Object { @@ -104158,22 +112789,22 @@ Object { }, "range": Array [ 0, - 29, + 36, ], "source": Object { "loc": Object { "end": Object { - "column": 28, + "column": 35, "line": 1, }, "start": Object { - "column": 23, + "column": 30, "line": 1, }, }, "range": Array [ - 23, - 28, + 30, + 35, ], "raw": "\\"foo\\"", "type": "Literal", @@ -104181,90 +112812,108 @@ Object { }, "specifiers": Array [ Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 10, + "column": 18, "line": 1, }, "start": Object { - "column": 7, + "column": 15, "line": 1, }, }, - "name": "foo", + "name": "baz", "range": Array [ - 7, - 10, + 15, + 18, ], "type": "Identifier", }, "range": Array [ - 7, - 10, + 8, + 18, ], - "type": "ImportDefaultSpecifier", + "type": "ImportSpecifier", }, Object { "imported": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, - "name": "bar", + "name": "xyz", "range": Array [ - 13, - 16, + 20, + 23, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, - "name": "bar", + "name": "xyz", "range": Array [ - 13, - 16, + 20, + 23, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 20, + 23, ], "type": "ImportSpecifier", }, @@ -104284,7 +112933,7 @@ Object { }, "range": Array [ 0, - 30, + 37, ], "sourceType": "module", "tokens": Array [ @@ -104309,7 +112958,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -104319,10 +112968,10 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -104331,21 +112980,21 @@ Object { "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, + 8, 11, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { @@ -104355,43 +113004,79 @@ Object { }, "range": Array [ 12, - 13, + 14, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 20, "line": 1, }, }, "range": Array [ - 13, - 16, + 20, + 23, ], "type": "Identifier", - "value": "bar", + "value": "xyz", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 16, + "column": 23, "line": 1, }, }, "range": Array [ - 16, - 17, + 23, + 24, ], "type": "Punctuator", "value": "}", @@ -104399,17 +113084,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 29, "line": 1, }, "start": Object { - "column": 18, + "column": 25, "line": 1, }, }, "range": Array [ - 18, - 22, + 25, + 29, ], "type": "Identifier", "value": "from", @@ -104417,17 +113102,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 35, "line": 1, }, "start": Object { - "column": 23, + "column": 30, "line": 1, }, }, "range": Array [ - 23, - 28, + 30, + 35, ], "type": "String", "value": "\\"foo\\"", @@ -104435,17 +113120,187 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/import-named-empty.src 1`] = ` +Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "source": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "specifiers": Array [], + "type": "ImportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + "value": "from", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "String", + "value": "\\"foo\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, "line": 1, }, "start": Object { - "column": 28, + "column": 20, "line": 1, }, }, "range": Array [ - 28, - 29, + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -104455,13 +113310,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default-and-namespace-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 32, + "column": 24, "line": 1, }, "start": Object { @@ -104471,22 +113326,22 @@ Object { }, "range": Array [ 0, - 32, + 24, ], "source": Object { "loc": Object { "end": Object { - "column": 31, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 18, "line": 1, }, }, "range": Array [ - 26, - 31, + 18, + 23, ], "raw": "\\"foo\\"", "type": "Literal", @@ -104494,74 +113349,57 @@ Object { }, "specifiers": Array [ Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "local": Object { + "imported": Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 7, - 10, + 8, + 11, ], "type": "Identifier", }, - "range": Array [ - 7, - 10, - ], - "type": "ImportDefaultSpecifier", - }, - Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { - "column": 17, + "column": 8, "line": 1, }, }, "name": "bar", "range": Array [ - 17, - 20, + 8, + 11, ], "type": "Identifier", }, "range": Array [ - 12, - 20, + 8, + 11, ], - "type": "ImportNamespaceSpecifier", + "type": "ImportSpecifier", }, ], "type": "ImportDeclaration", @@ -104579,7 +113417,7 @@ Object { }, "range": Array [ 0, - 33, + 25, ], "sourceType": "module", "tokens": Array [ @@ -104604,7 +113442,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 1, }, "start": Object { @@ -104614,10 +113452,10 @@ Object { }, "range": Array [ 7, - 10, + 8, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -104626,85 +113464,49 @@ Object { "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, + 8, 11, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, "range": Array [ + 11, 12, - 13, ], "type": "Punctuator", - "value": "*", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "Identifier", - "value": "as", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { "column": 17, "line": 1, }, - }, - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, "start": Object { - "column": 21, + "column": 13, "line": 1, }, }, "range": Array [ - 21, - 25, + 13, + 17, ], "type": "Identifier", "value": "from", @@ -104712,17 +113514,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 23, "line": 1, }, "start": Object { - "column": 26, + "column": 18, "line": 1, }, }, "range": Array [ - 26, - 31, + 18, + 23, ], "type": "String", "value": "\\"foo\\"", @@ -104730,17 +113532,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 24, "line": 1, }, "start": Object { - "column": 31, + "column": 23, "line": 1, }, }, "range": Array [ - 31, - 32, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -104750,13 +113552,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-default-as.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifiers.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { @@ -104766,22 +113568,22 @@ Object { }, "range": Array [ 0, - 35, + 29, ], "source": Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 34, + 23, + 28, ], "raw": "\\"foo\\"", "type": "Literal", @@ -104792,7 +113594,7 @@ Object { "imported": Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -104800,16 +113602,16 @@ Object { "line": 1, }, }, - "name": "default", + "name": "bar", "range": Array [ 8, - 15, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { @@ -104820,24 +113622,77 @@ Object { "local": Object { "loc": Object { "end": Object { - "column": 22, + "column": 11, "line": 1, }, "start": Object { - "column": 19, + "column": 8, "line": 1, }, }, - "name": "foo", + "name": "bar", "range": Array [ - 19, - 22, + 8, + 11, ], "type": "Identifier", }, "range": Array [ 8, - 22, + 11, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, ], "type": "ImportSpecifier", }, @@ -104857,7 +113712,7 @@ Object { }, "range": Array [ 0, - 36, + 30, ], "sourceType": "module", "tokens": Array [ @@ -104900,7 +113755,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { @@ -104910,61 +113765,61 @@ Object { }, "range": Array [ 8, - 15, + 11, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ - 16, - 18, + 11, + 12, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 16, "line": 1, }, "start": Object { - "column": 19, + "column": 13, "line": 1, }, }, "range": Array [ - 19, - 22, + 13, + 16, ], "type": "Identifier", - "value": "foo", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 17, "line": 1, }, "start": Object { - "column": 22, + "column": 16, "line": 1, }, }, "range": Array [ - 22, - 23, + 16, + 17, ], "type": "Punctuator", "value": "}", @@ -104972,17 +113827,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 22, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, "range": Array [ - 24, - 28, + 18, + 22, ], "type": "Identifier", "value": "from", @@ -104990,17 +113845,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 28, "line": 1, }, "start": Object { - "column": 29, + "column": 23, "line": 1, }, }, "range": Array [ - 29, - 34, + 23, + 28, ], "type": "String", "value": "\\"foo\\"", @@ -105008,17 +113863,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 29, "line": 1, }, "start": Object { - "column": 34, + "column": 28, "line": 1, }, }, "range": Array [ - 34, - 35, + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -105028,13 +113883,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-jquery.src 1`] = ` +exports[`javascript fixtures/modules/import-named-specifiers-comma.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 30, "line": 1, }, "start": Object { @@ -105044,62 +113899,133 @@ Object { }, "range": Array [ 0, - 22, + 30, ], "source": Object { "loc": Object { "end": Object { - "column": 22, + "column": 29, "line": 1, }, "start": Object { - "column": 14, + "column": 24, "line": 1, }, }, "range": Array [ - 14, - 22, + 24, + 29, ], - "raw": "\\"jquery\\"", + "raw": "\\"foo\\"", "type": "Literal", - "value": "jquery", + "value": "foo", }, "specifiers": Array [ Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, - "name": "$", + "name": "bar", "range": Array [ - 7, 8, + 11, ], "type": "Identifier", }, "range": Array [ - 7, 8, + 11, ], - "type": "ImportDefaultSpecifier", + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 13, + 16, + ], + "type": "ImportSpecifier", }, ], "type": "ImportDeclaration", @@ -105117,7 +114043,7 @@ Object { }, "range": Array [ 0, - 23, + 31, ], "sourceType": "module", "tokens": Array [ @@ -105154,139 +114080,131 @@ Object { 7, 8, ], - "type": "Identifier", - "value": "$", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ - 9, - 13, + 8, + 11, ], "type": "Identifier", - "value": "from", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 12, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, "range": Array [ - 14, - 22, + 11, + 12, ], - "type": "String", - "value": "\\"jquery\\"", + "type": "Punctuator", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/import-module.src 1`] = ` -Object { - "body": Array [ Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 13, "line": 1, }, }, "range": Array [ - 0, 13, + 16, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, }, - "range": Array [ - 7, - 12, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", }, - "specifiers": Array [], - "type": "ImportDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 14, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 23, "line": 1, }, "start": Object { - "column": 0, + "column": 19, "line": 1, }, }, "range": Array [ - 0, - 6, + 19, + 23, ], - "type": "Keyword", - "value": "import", + "type": "Identifier", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 1, }, "start": Object { - "column": 7, + "column": 24, "line": 1, }, }, "range": Array [ - 7, - 12, + 24, + 29, ], "type": "String", "value": "\\"foo\\"", @@ -105294,17 +114212,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 30, "line": 1, }, "start": Object { - "column": 12, + "column": 29, "line": 1, }, }, "range": Array [ - 12, - 13, + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -105314,13 +114232,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-named-as-specifier.src 1`] = ` +exports[`javascript fixtures/modules/import-namespace-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 31, + "column": 27, "line": 1, }, "start": Object { @@ -105330,22 +114248,22 @@ Object { }, "range": Array [ 0, - 31, + 27, ], "source": Object { "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 1, }, "start": Object { - "column": 25, + "column": 21, "line": 1, }, }, "range": Array [ - 25, - 30, + 21, + 26, ], "raw": "\\"foo\\"", "type": "Literal", @@ -105353,57 +114271,39 @@ Object { }, "specifiers": Array [ Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 12, "line": 1, }, }, - "name": "baz", + "name": "foo", "range": Array [ + 12, 15, - 18, ], "type": "Identifier", }, "range": Array [ - 8, - 18, + 7, + 15, ], - "type": "ImportSpecifier", + "type": "ImportNamespaceSpecifier", }, ], "type": "ImportDeclaration", @@ -105421,7 +114321,7 @@ Object { }, "range": Array [ 0, - 32, + 28, ], "sourceType": "module", "tokens": Array [ @@ -105459,7 +114359,7 @@ Object { 8, ], "type": "Punctuator", - "value": "{", + "value": "*", }, Object { "loc": Object { @@ -105468,21 +114368,21 @@ Object { "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, + 9, 11, ], "type": "Identifier", - "value": "bar", + "value": "as", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { @@ -105492,61 +114392,25 @@ Object { }, "range": Array [ 12, - 14, - ], - "type": "Identifier", - "value": "as", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ 15, - 18, ], "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "}", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 20, "line": 1, }, "start": Object { - "column": 20, + "column": 16, "line": 1, }, }, "range": Array [ + 16, 20, - 24, ], "type": "Identifier", "value": "from", @@ -105554,17 +114418,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 30, + "column": 26, "line": 1, }, "start": Object { - "column": 25, + "column": 21, "line": 1, }, }, "range": Array [ - 25, - 30, + 21, + 26, ], "type": "String", "value": "\\"foo\\"", @@ -105572,17 +114436,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 27, "line": 1, }, "start": Object { - "column": 30, + "column": 26, "line": 1, }, }, "range": Array [ - 30, - 31, + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -105592,13 +114456,13 @@ Object { } `; -exports[`javascript fixtures/modules/import-named-as-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/import-null-as-nil.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 36, + "column": 33, "line": 1, }, "start": Object { @@ -105608,131 +114472,78 @@ Object { }, "range": Array [ 0, - 36, + 33, ], "source": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 1, }, "start": Object { - "column": 30, + "column": 28, "line": 1, }, }, "range": Array [ - 30, - 35, + 28, + 33, ], - "raw": "\\"foo\\"", + "raw": "\\"bar\\"", "type": "Literal", - "value": "foo", + "value": "bar", }, "specifiers": Array [ Object { "imported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, - "name": "bar", + "name": "null", "range": Array [ - 8, - 11, + 9, + 13, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 18, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { "column": 20, "line": 1, }, - }, - "name": "xyz", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, "start": Object { - "column": 20, + "column": 17, "line": 1, }, }, - "name": "xyz", + "name": "nil", "range": Array [ + 17, 20, - 23, ], "type": "Identifier", }, "range": Array [ + 9, 20, - 23, ], "type": "ImportSpecifier", }, @@ -105752,7 +114563,7 @@ Object { }, "range": Array [ 0, - 37, + 34, ], "sourceType": "module", "tokens": Array [ @@ -105795,35 +114606,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, - 11, + 9, + 13, ], - "type": "Identifier", - "value": "bar", + "type": "Null", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 12, + "column": 14, "line": 1, }, }, "range": Array [ - 12, 14, + 16, ], "type": "Identifier", "value": "as", @@ -105831,156 +114642,279 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 20, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 18, + 17, + 20, ], "type": "Identifier", - "value": "baz", + "value": "nil", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 22, "line": 1, }, "start": Object { - "column": 18, + "column": 21, "line": 1, }, }, "range": Array [ - 18, - 19, + 21, + 22, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 27, "line": 1, }, "start": Object { - "column": 20, + "column": 23, "line": 1, }, }, "range": Array [ - 20, 23, + 27, ], "type": "Identifier", - "value": "xyz", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 33, "line": 1, }, "start": Object { - "column": 23, + "column": 28, "line": 1, }, }, "range": Array [ - 23, - 24, + 28, + 33, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "\\"bar\\"", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/invalid-await.src 1`] = ` +Object { + "body": Array [ Object { + "declaration": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "await", + "range": Array [ + 11, + 16, + ], + "type": "Identifier", + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "VariableDeclaration", + }, "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 25, + "column": 0, "line": 1, }, }, "range": Array [ - 25, - 29, + 0, + 17, ], - "type": "Identifier", - "value": "from", + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "module", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 35, + "column": 6, "line": 1, }, "start": Object { - "column": 30, + "column": 0, "line": 1, }, }, "range": Array [ - 30, - 35, + 0, + 6, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Keyword", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 36, + "column": 10, "line": 1, }, "start": Object { - "column": 35, + "column": 7, "line": 1, }, }, "range": Array [ - 35, - 36, + 7, + 10, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "var", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/import-named-empty.src 1`] = ` -Object { - "body": Array [ Object { "loc": Object { "end": Object { - "column": 21, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 21, + 11, + 16, ], - "source": Object { + "type": "Keyword", + "value": "await", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/modules/invalid-class.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "ClassBody", + }, + "id": null, "loc": Object { "end": Object { - "column": 20, + "column": 23, "line": 1, }, "start": Object { @@ -105990,14 +114924,26 @@ Object { }, "range": Array [ 15, - 20, + 23, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "superClass": null, + "type": "ClassDeclaration", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, - "specifiers": Array [], - "type": "ImportDeclaration", + "range": Array [ + 0, + 23, + ], + "type": "ExportDefaultDeclaration", }, ], "loc": Object { @@ -106012,7 +114958,7 @@ Object { }, "range": Array [ 0, - 22, + 24, ], "sourceType": "module", "tokens": Array [ @@ -106032,12 +114978,12 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 1, }, "start": Object { @@ -106047,95 +114993,88 @@ Object { }, "range": Array [ 7, - 8, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 20, "line": 1, }, "start": Object { - "column": 10, + "column": 15, "line": 1, }, }, "range": Array [ - 10, - 14, + 15, + 20, ], - "type": "Identifier", - "value": "from", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 22, "line": 1, }, "start": Object { - "column": 15, + "column": 21, "line": 1, }, }, "range": Array [ - 15, - 20, + 21, + 22, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 23, "line": 1, }, "start": Object { - "column": 20, + "column": 22, "line": 1, }, }, "range": Array [ - 20, - 21, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/import-named-specifier.src 1`] = ` +exports[`javascript fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; + +exports[`javascript fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/modules/invalid-export-named-default.src 1`] = ` Object { "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 24, + "column": 16, "line": 1, }, "start": Object { @@ -106145,33 +115084,15 @@ Object { }, "range": Array [ 0, - 24, + 16, ], - "source": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 23, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, + "source": null, "specifiers": Array [ Object { - "imported": Object { + "exported": Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -106179,16 +115100,16 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "default", "range": Array [ 8, - 11, + 15, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -106199,7 +115120,7 @@ Object { "local": Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -106207,21 +115128,21 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "default", "range": Array [ 8, - 11, + 15, ], "type": "Identifier", }, "range": Array [ 8, - 11, + 15, ], - "type": "ImportSpecifier", + "type": "ExportSpecifier", }, ], - "type": "ImportDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -106236,7 +115157,7 @@ Object { }, "range": Array [ 0, - 25, + 17, ], "sourceType": "module", "tokens": Array [ @@ -106256,7 +115177,7 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { @@ -106279,7 +115200,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { @@ -106289,95 +115210,53 @@ Object { }, "range": Array [ 8, - 11, + 15, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "default", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, - 12, + 15, + 16, ], "type": "Punctuator", "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 17, - ], - "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 23, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": ";", - }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/import-named-specifiers.src 1`] = ` +exports[`javascript fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; + +exports[`javascript fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` Object { "body": Array [ Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { @@ -106387,133 +115266,61 @@ Object { }, "range": Array [ 0, - 29, + 20, ], "source": Object { "loc": Object { "end": Object { - "column": 28, + "column": 19, "line": 1, }, "start": Object { - "column": 23, + "column": 16, "line": 1, }, }, + "name": "bar", "range": Array [ - 23, - 28, + 16, + 19, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "type": "Identifier", }, "specifiers": Array [ Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 11, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 13, + "column": 7, "line": 1, }, }, "local": Object { "loc": Object { "end": Object { - "column": 16, + "column": 10, "line": 1, }, "start": Object { - "column": 13, + "column": 7, "line": 1, }, }, - "name": "baz", + "name": "foo", "range": Array [ - 13, - 16, + 7, + 10, ], "type": "Identifier", }, "range": Array [ - 13, - 16, + 7, + 10, ], - "type": "ImportSpecifier", + "type": "ImportDefaultSpecifier", }, ], "type": "ImportDeclaration", @@ -106531,7 +115338,7 @@ Object { }, "range": Array [ 0, - 30, + 21, ], "sourceType": "module", "tokens": Array [ @@ -106556,7 +115363,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { @@ -106566,33 +115373,15 @@ Object { }, "range": Array [ 7, - 8, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 11, + 10, ], "type": "Identifier", - "value": "bar", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 1, }, "start": Object { @@ -106602,33 +115391,15 @@ Object { }, "range": Array [ 11, - 12, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 16, + 15, ], "type": "Identifier", - "value": "baz", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 19, "line": 1, }, "start": Object { @@ -106638,61 +115409,25 @@ Object { }, "range": Array [ 16, - 17, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 22, + 19, ], "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 28, - ], - "type": "String", - "value": "\\"foo\\"", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 20, "line": 1, }, "start": Object { - "column": 28, + "column": 19, "line": 1, }, }, "range": Array [ - 28, - 29, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -106702,13 +115437,16 @@ Object { } `; -exports[`javascript fixtures/modules/import-named-specifiers-comma.src 1`] = ` +exports[`javascript fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-module-specifier.src 1`] = ` Object { "body": Array [ Object { + "declaration": null, "loc": Object { "end": Object { - "column": 30, + "column": 21, "line": 1, }, "start": Object { @@ -106718,30 +115456,29 @@ Object { }, "range": Array [ 0, - 30, + 21, ], "source": Object { "loc": Object { "end": Object { - "column": 29, + "column": 21, "line": 1, }, "start": Object { - "column": 24, + "column": 18, "line": 1, }, }, + "name": "bar", "range": Array [ - 24, - 29, + 18, + 21, ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", + "type": "Identifier", }, "specifiers": Array [ Object { - "imported": Object { + "exported": Object { "loc": Object { "end": Object { "column": 11, @@ -106752,7 +115489,7 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "foo", "range": Array [ 8, 11, @@ -106780,74 +115517,21 @@ Object { "line": 1, }, }, - "name": "bar", + "name": "foo", "range": Array [ 8, 11, ], "type": "Identifier", }, - "range": Array [ - 8, - 11, - ], - "type": "ImportSpecifier", - }, - Object { - "imported": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 13, - 16, - ], - "type": "Identifier", - }, - "range": Array [ - 13, - 16, + "range": Array [ + 8, + 11, ], - "type": "ImportSpecifier", + "type": "ExportSpecifier", }, ], - "type": "ImportDeclaration", + "type": "ExportNamedDeclaration", }, ], "loc": Object { @@ -106862,7 +115546,7 @@ Object { }, "range": Array [ 0, - 31, + 22, ], "sourceType": "module", "tokens": Array [ @@ -106882,7 +115566,7 @@ Object { 6, ], "type": "Keyword", - "value": "import", + "value": "export", }, Object { "loc": Object { @@ -106918,7 +115602,7 @@ Object { 11, ], "type": "Identifier", - "value": "bar", + "value": "foo", }, Object { "loc": Object { @@ -106936,12 +115620,12 @@ Object { 12, ], "type": "Punctuator", - "value": ",", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { @@ -106951,181 +115635,158 @@ Object { }, "range": Array [ 13, - 16, + 17, ], "type": "Identifier", - "value": "baz", + "value": "from", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { "column": 18, "line": 1, }, - "start": Object { - "column": 17, - "line": 1, - }, }, "range": Array [ - 17, 18, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 23, + 21, ], "type": "Identifier", - "value": "from", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 29, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": ";", + "value": "bar", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/import-namespace-specifier.src 1`] = ` +exports[`javascript fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; + +exports[`javascript fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; + +exports[`javascript fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; + +exports[`javascript fixtures/newTarget/invalid-new-target.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 27, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 26, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, - "specifiers": Array [ + "declarations": Array [ Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "local": Object { + "init": Object { "loc": Object { "end": Object { - "column": 15, + "column": 18, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, - "name": "foo", + "meta": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "name": "new", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": "target", + "range": Array [ + 12, + 18, + ], + "type": "Identifier", + }, "range": Array [ - 12, - 15, + 8, + 18, ], - "type": "Identifier", + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, "range": Array [ - 7, - 15, + 4, + 18, ], - "type": "ImportNamespaceSpecifier", + "type": "VariableDeclarator", }, ], - "type": "ImportDeclaration", + "kind": "var", + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "VariableDeclaration", }, ], "loc": Object { @@ -107140,14 +115801,14 @@ Object { }, "range": Array [ 0, - 28, + 20, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -107157,115 +115818,115 @@ Object { }, "range": Array [ 0, - 6, + 3, ], "type": "Keyword", - "value": "import", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, "range": Array [ - 7, - 8, + 4, + 5, ], - "type": "Punctuator", - "value": "*", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 11, + 6, + 7, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 11, "line": 1, }, "start": Object { - "column": 12, + "column": 8, "line": 1, }, }, "range": Array [ - 12, - 15, + 8, + 11, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ - 16, - 20, + 11, + 12, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 18, "line": 1, }, "start": Object { - "column": 21, + "column": 12, "line": 1, }, }, "range": Array [ - 21, - 26, + 12, + 18, ], - "type": "String", - "value": "\\"foo\\"", + "type": "Identifier", + "value": "target", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 19, "line": 1, }, "start": Object { - "column": 26, + "column": 18, "line": 1, }, }, "range": Array [ - 26, - 27, + 18, + 19, ], "type": "Punctuator", "value": ";", @@ -107275,99 +115936,174 @@ Object { } `; -exports[`javascript fixtures/modules/import-null-as-nil.src 1`] = ` +exports[`javascript fixtures/newTarget/invalid-unknown-property.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 33, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 33, - ], - "raw": "\\"bar\\"", - "type": "Literal", - "value": "bar", - }, - "specifiers": Array [ + "declarations": Array [ Object { - "imported": Object { + "id": Object { "loc": Object { "end": Object { - "column": 13, + "column": 5, "line": 1, }, "start": Object { - "column": 9, + "column": 4, "line": 1, }, }, - "name": "null", + "name": "f", "range": Array [ - 9, - 13, + 4, + 5, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "new", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "unknown_property", + "range": Array [ + 25, + 41, + ], + "type": "Identifier", + }, + "range": Array [ + 21, + 41, + ], + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 42, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 44, + ], + "type": "BlockStatement", }, - }, - "local": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 20, + "column": 44, "line": 1, }, "start": Object { - "column": 17, + "column": 8, "line": 1, }, }, - "name": "nil", + "params": Array [], "range": Array [ - 17, - 20, + 8, + 44, ], - "type": "Identifier", + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, "range": Array [ - 9, - 20, + 4, + 44, ], - "type": "ImportSpecifier", + "type": "VariableDeclarator", }, ], - "type": "ImportDeclaration", + "kind": "var", + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 44, + ], + "type": "VariableDeclaration", }, ], "loc": Object { @@ -107382,14 +116118,14 @@ Object { }, "range": Array [ 0, - 34, + 45, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -107399,69 +116135,87 @@ Object { }, "range": Array [ 0, - 6, + 3, ], "type": "Keyword", - "value": "import", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { "column": 7, "line": 1, }, + "start": Object { + "column": 6, + "line": 1, + }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ - 9, - 13, + 8, + 16, ], - "type": "Null", - "value": "null", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 17, "line": 1, }, "start": Object { - "column": 14, + "column": 16, "line": 1, }, }, "range": Array [ - 14, 16, + 17, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 18, "line": 1, }, "start": Object { @@ -107471,15 +116225,33 @@ Object { }, "range": Array [ 17, + 18, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, 20, ], - "type": "Identifier", - "value": "nil", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 24, "line": 1, }, "start": Object { @@ -107489,135 +116261,262 @@ Object { }, "range": Array [ 21, - 22, + 24, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, ], "type": "Punctuator", - "value": "}", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 41, "line": 1, }, "start": Object { - "column": 23, + "column": 25, "line": 1, }, }, "range": Array [ - 23, - 27, + 25, + 41, ], "type": "Identifier", - "value": "from", + "value": "unknown_property", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 42, "line": 1, }, "start": Object { - "column": 28, + "column": 41, "line": 1, }, }, "range": Array [ - 28, - 33, + 41, + 42, ], - "type": "String", - "value": "\\"bar\\"", + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-await.src 1`] = ` +exports[`javascript fixtures/newTarget/simple-new-target.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "declarations": Array [ + "async": false, + "body": Object { + "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", }, - "start": Object { - "column": 11, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "meta": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "name": "new", + "range": Array [ + 27, + 30, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "target", + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + }, + "range": Array [ + 27, + 37, + ], + "type": "MetaProperty", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, }, + "range": Array [ + 23, + 37, + ], + "type": "VariableDeclarator", }, - "name": "await", - "range": Array [ - 11, - 16, - ], - "type": "Identifier", - }, - "init": null, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 11, - 16, + 19, + 38, ], - "type": "VariableDeclarator", + "type": "VariableDeclaration", }, ], - "kind": "var", "loc": Object { "end": Object { - "column": 17, + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 40, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, + "name": "f", "range": Array [ - 7, - 17, + 9, + 10, ], - "type": "VariableDeclaration", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, "line": 1, }, }, + "params": Array [], "range": Array [ 0, - 17, + 40, ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", + "type": "FunctionDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -107626,14 +116525,14 @@ Object { }, "range": Array [ 0, - 18, + 41, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { @@ -107643,10 +116542,10 @@ Object { }, "range": Array [ 0, - 6, + 8, ], "type": "Keyword", - "value": "export", + "value": "function", }, Object { "loc": Object { @@ -107655,21 +116554,39 @@ Object { "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, + 9, 10, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, "line": 1, }, "start": Object { @@ -107678,79 +116595,313 @@ Object { }, }, "range": Array [ - 11, - 16, + 11, + 12, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 19, + 22, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 27, + 30, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ".", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Identifier", + "value": "target", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, ], - "type": "Keyword", - "value": "await", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 16, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 16, - 17, + 39, + 40, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-class.src 1`] = ` +exports[`javascript fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "body": Object { - "body": Array [], + "expression": Object { + "left": Object { + "computed": false, "loc": Object { "end": Object { - "column": 23, + "column": 8, "line": 1, }, "start": Object { - "column": 21, + "column": 0, "line": 1, }, }, + "object": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 3, + 5, + ], + "type": "ObjectExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "fn", + "range": Array [ + 0, + 2, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "CallExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, "range": Array [ - 21, - 23, + 0, + 8, ], - "type": "ClassBody", + "type": "MemberExpression", }, - "id": null, "loc": Object { "end": Object { - "column": 23, + "column": 14, "line": 1, }, "start": Object { - "column": 15, + "column": 0, "line": 1, }, }, + "operator": "=", "range": Array [ - 15, - 23, + 0, + 14, ], - "superClass": null, - "type": "ClassDeclaration", + "right": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "obj", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { @@ -107760,9 +116911,9 @@ Object { }, "range": Array [ 0, - 23, + 15, ], - "type": "ExportDefaultDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { @@ -107777,14 +116928,14 @@ Object { }, "range": Array [ 0, - 24, + 16, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 2, "line": 1, }, "start": Object { @@ -107794,361 +116945,355 @@ Object { }, "range": Array [ 0, - 6, + 2, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "fn", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 3, "line": 1, }, "start": Object { - "column": 7, + "column": 2, "line": 1, }, }, "range": Array [ - 7, - 14, + 2, + 3, ], - "type": "Keyword", - "value": "default", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 4, "line": 1, }, "start": Object { - "column": 15, + "column": 3, "line": 1, }, }, "range": Array [ - 15, - 20, + 3, + 4, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 5, "line": 1, }, "start": Object { - "column": 21, + "column": 4, "line": 1, }, }, "range": Array [ - 21, - 22, + 4, + 5, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 6, "line": 1, }, "start": Object { - "column": 22, + "column": 5, "line": 1, }, }, "range": Array [ - 22, - 23, + 5, + 6, ], "type": "Punctuator", - "value": "}", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/invalid-export-batch-missing-from-clause.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-export-batch-token.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-export-default.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/modules/invalid-export-default-equal.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/modules/invalid-export-default-token.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/modules/invalid-export-named-default.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 16, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 6, "line": 1, }, }, "range": Array [ - 0, - 16, - ], - "source": null, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "default", - "range": Array [ - 8, - 15, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "default", - "range": Array [ - 8, - 15, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 15, - ], - "type": "ExportSpecifier", - }, + 6, + 7, ], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ".", }, - }, - "range": Array [ - 0, - 17, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 1, }, "start": Object { - "column": 0, + "column": 7, "line": 1, }, }, "range": Array [ - 0, - 6, + 7, + 8, ], - "type": "Keyword", - "value": "export", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 8, + 9, + 10, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 11, "line": 1, }, }, "range": Array [ - 8, - 15, + 11, + 14, ], - "type": "Keyword", - "value": "default", + "type": "Identifier", + "value": "obj", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 16, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-export-named-extra-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-export-named-middle-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-default.src 1`] = `"Expression expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-after-named-after-default.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-missing-module-specifier.src 1`] = `"'=' expected."`; - -exports[`javascript fixtures/modules/invalid-import-default-module-specifier.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` Object { "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 20, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "start": Object { - "column": 16, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "operator": "+", + "range": Array [ + 15, + 20, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "raw": "5", + "type": "Literal", + "value": 5, + }, + "type": "BinaryExpression", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 14, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 8, + 28, + ], + "type": "ObjectExpression", }, - }, - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "specifiers": Array [ - Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, - "local": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 7, - 10, - ], - "type": "Identifier", - }, "range": Array [ - 7, - 10, + 4, + 28, ], - "type": "ImportDefaultSpecifier", + "type": "VariableDeclarator", }, ], - "type": "ImportDeclaration", + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -108157,14 +117302,14 @@ Object { }, "range": Array [ 0, - 21, + 30, ], - "sourceType": "module", + "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 3, "line": 1, }, "start": Object { @@ -108174,423 +117319,371 @@ Object { }, "range": Array [ 0, - 6, + 3, ], "type": "Keyword", - "value": "import", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 5, "line": 1, }, "start": Object { - "column": 7, + "column": 4, "line": 1, }, }, "range": Array [ - 7, - 10, + 4, + 5, ], "type": "Identifier", - "value": "foo", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 7, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, "range": Array [ - 11, - 15, + 6, + 7, ], - "type": "Identifier", - "value": "from", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 9, "line": 1, }, "start": Object { - "column": 16, + "column": 8, "line": 1, }, }, "range": Array [ - 16, - 19, + 8, + 9, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 19, - 20, + 14, + 15, ], "type": "Punctuator", - "value": ";", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/modules/invalid-import-missing-module-specifier.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-module-specifier.src 1`] = ` -Object { - "body": Array [ Object { - "declaration": null, "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 0, - 21, - ], - "source": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 18, - 21, - ], - "type": "Identifier", - }, - "specifiers": Array [ - Object { - "exported": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "local": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 11, - ], - "type": "ExportSpecifier", - }, + 15, + 16, ], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Numeric", + "value": "5", }, - }, - "range": Array [ - 0, - 22, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 0, - 6, + 17, + 18, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 7, - 8, + 19, + 20, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "5", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 1, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 8, - 11, + 20, + 21, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 1, + "line": 2, }, "start": Object { "column": 11, - "line": 1, + "line": 2, }, }, "range": Array [ - 11, - 12, + 21, + 22, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { "column": 13, - "line": 1, + "line": 2, }, }, "range": Array [ - 13, - 17, + 23, + 26, ], "type": "Identifier", - "value": "from", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 18, - 21, + 27, + 28, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/modules/invalid-import-named-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-after-namespace.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-as-missing-from.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-extra-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-named-middle-comma.src 1`] = `"Identifier expected."`; - -exports[`javascript fixtures/modules/invalid-import-namespace-after-named.src 1`] = `"'from' expected."`; - -exports[`javascript fixtures/modules/invalid-import-namespace-missing-as.src 1`] = `"'as' expected."`; - -exports[`javascript fixtures/newTarget/invalid-new-target.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "expression": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 18, + "column": 9, "line": 1, }, "start": Object { - "column": 8, + "column": 2, "line": 1, }, }, - "meta": Object { + "method": false, + "range": Array [ + 2, + 9, + ], + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, - "name": "new", "range": Array [ - 8, - 11, + 7, + 9, ], - "type": "Identifier", + "raw": "10", + "type": "Literal", + "value": 10, }, - "property": Object { + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 12, + "column": 11, "line": 1, }, }, - "name": "target", + "name": "y", "range": Array [ + 11, 12, - 18, ], "type": "Identifier", }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "method": false, "range": Array [ - 8, - 18, + 11, + 16, ], - "type": "MetaProperty", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "raw": "20", + "type": "Literal", + "value": 20, }, }, - "range": Array [ - 4, - 18, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 17, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { "column": 19, @@ -108605,13 +117698,13 @@ Object { 0, 19, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { "column": 0, @@ -108620,14 +117713,14 @@ Object { }, "range": Array [ 0, - 20, + 19, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -108637,25 +117730,61 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, "line": 1, }, "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { "column": 4, "line": 1, }, + "start": Object { + "column": 3, + "line": 1, + }, }, "range": Array [ + 3, 4, - 5, ], "type": "Identifier", "value": "x", @@ -108663,38 +117792,74 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { "column": 6, "line": 1, }, + "start": Object { + "column": 5, + "line": 1, + }, }, "range": Array [ + 5, 6, - 7, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 8, + "column": 7, "line": 1, }, }, "range": Array [ - 8, - 11, + 7, + 9, ], - "type": "Keyword", - "value": "new", + "type": "Numeric", + "value": "10", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { @@ -108711,13 +117876,13 @@ Object { 11, 12, ], - "type": "Punctuator", - "value": ".", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 13, "line": 1, }, "start": Object { @@ -108727,10 +117892,64 @@ Object { }, "range": Array [ 12, + 13, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Numeric", + "value": "20", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, 18, ], - "type": "Identifier", - "value": "target", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -108755,162 +117974,209 @@ Object { } `; -exports[`javascript fixtures/newTarget/invalid-unknown-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, + "kind": "get", "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 2, "line": 1, }, }, - "name": "f", + "method": false, "range": Array [ - 4, - 5, + 2, + 14, ], - "type": "Identifier", - }, - "init": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "meta": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "new", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "unknown_property", - "range": Array [ - 25, - 41, - ], - "type": "Identifier", - }, - "range": Array [ - 21, - 41, - ], - "type": "MetaProperty", + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, + "start": Object { + "column": 12, + "line": 1, }, - "range": Array [ - 21, - 42, - ], - "type": "ExpressionStatement", }, + "range": Array [ + 12, + 14, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 9, + 14, ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { "loc": Object { "end": Object { - "column": 44, + "column": 22, "line": 1, }, "start": Object { - "column": 19, + "column": 21, "line": 1, }, }, + "name": "x", "range": Array [ - 19, - 44, + 21, + 22, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, + "kind": "set", "loc": Object { "end": Object { - "column": 44, + "column": 29, "line": 1, }, "start": Object { - "column": 8, + "column": 16, "line": 1, }, }, - "params": Array [], + "method": false, "range": Array [ - 8, - 44, + 16, + 29, ], - "type": "FunctionExpression", - }, - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 29, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "v", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 23, + 29, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 4, - 44, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 30, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 44, + "column": 32, "line": 1, }, "start": Object { @@ -108920,15 +118186,15 @@ Object { }, "range": Array [ 0, - 44, + 32, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 32, + "line": 1, }, "start": Object { "column": 0, @@ -108937,552 +118203,325 @@ Object { }, "range": Array [ 0, - 45, + 32, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, + "column": 1, "line": 1, }, "start": Object { - "column": 8, + "column": 0, "line": 1, }, }, "range": Array [ - 8, - 16, + 0, + 1, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 2, "line": 1, }, "start": Object { - "column": 16, + "column": 1, "line": 1, }, }, "range": Array [ - 16, - 17, + 1, + 2, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 5, "line": 1, }, "start": Object { - "column": 17, + "column": 2, "line": 1, }, }, "range": Array [ - 17, - 18, + 2, + 5, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 7, "line": 1, }, "start": Object { - "column": 19, + "column": 6, "line": 1, }, }, "range": Array [ - 19, - 20, + 6, + 7, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 8, "line": 1, }, "start": Object { - "column": 21, + "column": 7, "line": 1, }, }, "range": Array [ - 21, - 24, + 7, + 8, ], - "type": "Keyword", - "value": "new", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 9, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, "range": Array [ - 24, - 25, + 8, + 9, ], "type": "Punctuator", - "value": ".", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 41, + "column": 10, "line": 1, }, "start": Object { - "column": 25, + "column": 9, "line": 1, }, }, "range": Array [ - 25, - 41, + 9, + 10, ], - "type": "Identifier", - "value": "unknown_property", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 42, + "column": 11, "line": 1, }, "start": Object { - "column": 41, + "column": 10, "line": 1, }, }, "range": Array [ - 41, - 42, + 10, + 11, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 13, "line": 1, }, "start": Object { - "column": 43, + "column": 12, "line": 1, }, }, "range": Array [ - 43, - 44, + 12, + 13, ], "type": "Punctuator", - "value": "}", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/newTarget/simple-new-target.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "name": "x", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "meta": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "name": "new", - "range": Array [ - 27, - 30, - ], - "type": "Identifier", - }, - "property": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "name": "target", - "range": Array [ - 31, - 37, - ], - "type": "Identifier", - }, - "range": Array [ - 27, - 37, - ], - "type": "MetaProperty", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 23, - 37, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 19, - 38, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 40, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 14, + "line": 1, }, "start": Object { - "column": 0, + "column": 13, "line": 1, }, }, - "params": Array [], "range": Array [ - 0, - 40, + 13, + 14, ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 41, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, "range": Array [ - 0, - 8, + 14, + 15, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 19, "line": 1, }, "start": Object { - "column": 9, + "column": 16, "line": 1, }, }, "range": Array [ - 9, - 10, + 16, + 19, ], "type": "Identifier", - "value": "f", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 21, "line": 1, }, "start": Object { - "column": 10, + "column": 20, "line": 1, }, }, "range": Array [ - 10, - 11, + 20, + 21, ], "type": "Punctuator", - "value": "(", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 22, "line": 1, }, "start": Object { - "column": 11, + "column": 21, "line": 1, }, }, "range": Array [ - 11, - 12, + 21, + 22, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 23, "line": 1, }, "start": Object { - "column": 13, + "column": 22, "line": 1, }, }, "range": Array [ - 13, - 14, + 22, + 23, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 19, - 22, + 23, + 24, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ - 23, 24, + 25, ], "type": "Identifier", - "value": "x", + "value": "v", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 25, + "line": 1, }, }, "range": Array [ @@ -109490,238 +118529,226 @@ Object { 26, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 27, + "line": 1, }, }, "range": Array [ 27, - 30, - ], - "type": "Keyword", - "value": "new", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, + 28, ], "type": "Punctuator", - "value": ".", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 31, - 37, + 28, + 29, ], - "type": "Identifier", - "value": "target", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 30, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 37, - 38, + 29, + 30, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 31, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 30, + "line": 1, }, }, "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteral/object-literal-in-lhs.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "left": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "object": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 3, - 5, - ], - "type": "ObjectExpression", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "fn", - "range": Array [ - 0, - 2, - ], - "type": "Identifier", - }, + 30, + 31, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 6, + "column": 5, "line": 1, }, "start": Object { - "column": 0, + "column": 4, "line": 1, }, }, + "name": "x", "range": Array [ - 0, - 6, + 4, + 5, ], - "type": "CallExpression", + "type": "Identifier", }, - "property": Object { + "init": Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, - "name": "x", + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 15, + 20, + ], + "raw": "\\"hey\\"", + "type": "Literal", + "value": "hey", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": false, + "range": Array [ + 14, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 23, + 26, + ], + "type": "Identifier", + }, + }, + ], "range": Array [ - 7, 8, + 28, ], - "type": "Identifier", - }, - "range": Array [ - 0, - 8, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "ObjectExpression", }, - }, - "operator": "=", - "range": Array [ - 0, - 14, - ], - "right": Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, + "column": 4, "line": 1, }, }, - "name": "obj", "range": Array [ - 11, - 14, + 4, + 28, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { "column": 0, @@ -109730,15 +118757,15 @@ Object { }, "range": Array [ 0, - 15, + 29, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -109747,14 +118774,14 @@ Object { }, "range": Array [ 0, - 16, + 30, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, + "column": 3, "line": 1, }, "start": Object { @@ -109764,43 +118791,61 @@ Object { }, "range": Array [ 0, - 2, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Identifier", - "value": "fn", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, "range": Array [ - 2, - 3, + 6, + 7, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 9, "line": 1, }, "start": Object { - "column": 3, + "column": 8, "line": 1, }, }, "range": Array [ - 3, - 4, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -109809,124 +118854,124 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 2, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, "range": Array [ - 4, - 5, + 14, + 15, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { "column": 5, - "line": 1, + "line": 2, }, }, "range": Array [ - 5, - 6, + 15, + 20, ], - "type": "Punctuator", - "value": ")", + "type": "String", + "value": "\\"hey\\"", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 6, - 7, + 20, + 21, ], "type": "Punctuator", - "value": ".", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 7, - 8, + 21, + 22, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 9, - 10, + 23, + 26, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 11, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 11, - 14, + 27, + 28, ], - "type": "Identifier", - "value": "obj", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 2, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 1, + "line": 3, }, }, "range": Array [ - 14, - 15, + 28, + 29, ], "type": "Punctuator", "value": ";", @@ -109936,7 +118981,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-addition-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` Object { "body": Array [ Object { @@ -109975,28 +119020,9 @@ Object { Object { "computed": true, "key": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 15, - 16, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, "loc": Object { "end": Object { - "column": 10, + "column": 8, "line": 2, }, "start": Object { @@ -110004,36 +119030,17 @@ Object { "line": 2, }, }, - "operator": "+", + "name": "bar", "range": Array [ 15, - 20, + 18, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 20, - ], - "raw": "5", - "type": "Literal", - "value": 5, - }, - "type": "BinaryExpression", + "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { @@ -110044,25 +119051,25 @@ Object { "method": false, "range": Array [ 14, - 26, + 24, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 13, + "column": 11, "line": 2, }, }, "name": "foo", "range": Array [ - 23, - 26, + 21, + 24, ], "type": "Identifier", }, @@ -110070,7 +119077,7 @@ Object { ], "range": Array [ 8, - 28, + 26, ], "type": "ObjectExpression", }, @@ -110086,7 +119093,7 @@ Object { }, "range": Array [ 4, - 28, + 26, ], "type": "VariableDeclarator", }, @@ -110104,7 +119111,7 @@ Object { }, "range": Array [ 0, - 29, + 27, ], "type": "VariableDeclaration", }, @@ -110121,7 +119128,7 @@ Object { }, "range": Array [ 0, - 30, + 28, ], "sourceType": "script", "tokens": Array [ @@ -110218,7 +119225,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 2, }, "start": Object { @@ -110228,28 +119235,28 @@ Object { }, "range": Array [ 15, - 16, + 18, ], - "type": "Numeric", - "value": "5", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 2, }, "start": Object { - "column": 7, + "column": 8, "line": 2, }, }, "range": Array [ - 17, 18, + 19, ], "type": "Punctuator", - "value": "+", + "value": "]", }, Object { "loc": Object { @@ -110266,31 +119273,13 @@ Object { 19, 20, ], - "type": "Numeric", - "value": "5", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, - ], "type": "Punctuator", - "value": "]", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 2, }, "start": Object { @@ -110300,25 +119289,7 @@ Object { }, "range": Array [ 21, - 22, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 26, + 24, ], "type": "Identifier", "value": "foo", @@ -110335,8 +119306,8 @@ Object { }, }, "range": Array [ - 27, - 28, + 25, + 26, ], "type": "Punctuator", "value": "}", @@ -110353,8 +119324,8 @@ Object { }, }, "range": Array [ - 28, - 29, + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -110364,14 +119335,18 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-and-identifier.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; + +exports[`javascript fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; + +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "loc": Object { "end": Object { - "column": 17, + "column": 10, "line": 1, }, "start": Object { @@ -110438,74 +119413,16 @@ Object { "value": 10, }, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "y", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 11, - 16, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "raw": "20", - "type": "Literal", - "value": 20, - }, - }, ], "range": Array [ 1, - 17, + 10, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 19, + "column": 12, "line": 1, }, "start": Object { @@ -110515,15 +119432,15 @@ Object { }, "range": Array [ 0, - 19, + 12, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -110532,7 +119449,7 @@ Object { }, "range": Array [ 0, - 19, + 13, ], "sourceType": "script", "tokens": Array [ @@ -110678,94 +119595,22 @@ Object { 10, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 16, - ], - "type": "Numeric", - "value": "20", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 11, "line": 1, }, "start": Object { - "column": 17, + "column": 10, "line": 1, }, }, "range": Array [ - 17, - 18, + 10, + 11, ], "type": "Punctuator", "value": ")", @@ -110773,17 +119618,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 12, "line": 1, }, "start": Object { - "column": 18, + "column": 11, "line": 1, }, }, "range": Array [ - 18, - 19, + 11, + 12, ], "type": "Punctuator", "value": ";", @@ -110793,14 +119638,14 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` Object { "body": Array [ Object { "expression": Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { @@ -110812,190 +119657,109 @@ Object { Object { "computed": true, "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "kind": "get", - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 14, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "left": Object { "loc": Object { "end": Object { - "column": 14, + "column": 6, "line": 1, }, "start": Object { - "column": 12, + "column": 3, "line": 1, }, }, "range": Array [ - 12, - 14, + 3, + 6, ], - "type": "BlockStatement", + "raw": "\\"x\\"", + "type": "Literal", + "value": "x", }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 14, + "column": 12, "line": 1, }, "start": Object { - "column": 9, + "column": 3, "line": 1, }, }, - "params": Array [], + "operator": "+", "range": Array [ - 9, - 14, + 3, + 12, ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, + "right": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, }, + "range": Array [ + 9, + 12, + ], + "raw": "\\"y\\"", + "type": "Literal", + "value": "y", }, - "name": "x", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", + "type": "BinaryExpression", }, - "kind": "set", + "kind": "init", "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 16, + "column": 2, "line": 1, }, }, "method": false, "range": Array [ - 16, - 29, + 2, + 17, ], "shorthand": false, "type": "Property", "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 29, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 23, + "column": 15, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "name": "v", - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - }, - ], "range": Array [ - 23, - 29, + 15, + 17, ], - "type": "FunctionExpression", + "raw": "10", + "type": "Literal", + "value": 10, }, }, ], "range": Array [ 1, - 30, + 18, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { - "column": 32, + "column": 20, "line": 1, }, "start": Object { @@ -111005,15 +119769,15 @@ Object { }, "range": Array [ 0, - 32, + 20, ], "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -111022,7 +119786,7 @@ Object { }, "range": Array [ 0, - 32, + 21, ], "sourceType": "script", "tokens": Array [ @@ -111065,7 +119829,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -111075,28 +119839,28 @@ Object { }, "range": Array [ 2, - 5, + 3, ], - "type": "Identifier", - "value": "get", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, "range": Array [ + 3, 6, - 7, ], - "type": "Punctuator", - "value": "[", + "type": "String", + "value": "\\"x\\"", }, Object { "loc": Object { @@ -111113,31 +119877,13 @@ Object { 7, 8, ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 9, - ], "type": "Punctuator", - "value": "]", + "value": "+", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 12, "line": 1, }, "start": Object { @@ -111147,28 +119893,10 @@ Object { }, "range": Array [ 9, - 10, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, + 12, ], - "type": "Punctuator", - "value": ")", + "type": "String", + "value": "\\"y\\"", }, Object { "loc": Object { @@ -111186,7 +119914,7 @@ Object { 13, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { @@ -111204,202 +119932,40 @@ Object { 14, ], "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - "value": "set", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Identifier", - "value": "v", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 17, "line": 1, }, "start": Object { - "column": 28, + "column": 15, "line": 1, }, }, "range": Array [ - 28, - 29, + 15, + 17, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "10", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 18, "line": 1, }, "start": Object { - "column": 29, + "column": 17, "line": 1, }, }, "range": Array [ - 29, - 30, + 17, + 18, ], "type": "Punctuator", "value": "}", @@ -111407,17 +119973,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 19, "line": 1, }, "start": Object { - "column": 30, + "column": 18, "line": 1, }, }, "range": Array [ - 30, - 31, + 18, + 19, ], "type": "Punctuator", "value": ")", @@ -111425,17 +119991,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 20, "line": 1, }, "start": Object { - "column": 31, + "column": 19, "line": 1, }, }, "range": Array [ - 31, - 32, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -111445,129 +120011,112 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-string-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 3, + 4, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 5, + "column": 20, "line": 1, }, "start": Object { - "column": 4, + "column": 2, "line": 1, }, }, - "name": "x", + "method": false, "range": Array [ - 4, - 5, + 2, + 20, ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 15, - 20, - ], - "raw": "\\"hey\\"", - "type": "Literal", - "value": "hey", - }, - "kind": "init", + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 18, + "line": 1, }, }, - "method": false, "range": Array [ - 14, - 26, + 18, + 20, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 23, - 26, - ], - "type": "Identifier", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, }, }, - ], - "range": Array [ - 8, - 28, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 1, + "params": Array [], + "range": Array [ + 7, + 20, + ], + "type": "FunctionExpression", }, }, - "range": Array [ - 4, - 28, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + ], + "range": Array [ + 1, + 21, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 23, + "line": 1, }, "start": Object { "column": 0, @@ -111576,15 +120125,15 @@ Object { }, "range": Array [ 0, - 29, + 23, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -111593,14 +120142,14 @@ Object { }, "range": Array [ 0, - 30, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -111610,25 +120159,61 @@ Object { }, "range": Array [ 0, - 3, + 1, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, "line": 1, }, "start": Object { + "column": 2, + "line": 1, + }, + }, + "range": Array [ + 2, + 3, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { "column": 4, "line": 1, }, + "start": Object { + "column": 3, + "line": 1, + }, }, "range": Array [ + 3, 4, - 5, ], "type": "Identifier", "value": "x", @@ -111636,143 +120221,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 7, + 4, + 5, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 1, }, "start": Object { - "column": 8, + "column": 5, "line": 1, }, }, "range": Array [ - 8, - 9, + 5, + 6, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 7, + "line": 1, }, }, "range": Array [ - 14, + 7, 15, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 15, + "line": 1, }, }, "range": Array [ 15, - 20, + 16, ], - "type": "String", - "value": "\\"hey\\"", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 10, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 20, - 21, + 16, + 17, ], "type": "Punctuator", - "value": "]", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 21, - 22, + 18, + 19, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 23, - 26, + 19, + 20, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 21, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 20, + "line": 1, }, }, "range": Array [ - 27, - 28, + 20, + 21, ], "type": "Punctuator", "value": "}", @@ -111780,17 +120365,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 1, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 28, - 29, + 21, + 22, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, ], "type": "Punctuator", "value": ";", @@ -111800,9 +120403,119 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/computed-variable-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` Object { "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "proto", + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 30, + ], + "type": "VariableDeclaration", + }, Object { "declarations": Array [ Object { @@ -111810,17 +120523,17 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 5, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "name": "x", "range": Array [ - 4, - 5, + 36, + 37, ], "type": "Identifier", }, @@ -111828,91 +120541,148 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 8, }, "start": Object { "column": 8, - "line": 1, + "line": 5, }, }, "properties": Array [ Object { - "computed": true, + "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 10, + "line": 6, }, "start": Object { - "column": 5, - "line": 2, + "column": 1, + "line": 6, }, }, - "name": "bar", + "name": "__proto__", "range": Array [ - 15, - 18, + 43, + 52, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 17, + "line": 6, }, "start": Object { - "column": 4, - "line": 2, + "column": 1, + "line": 6, }, }, "method": false, "range": Array [ - 14, - 24, + 43, + 59, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 17, + "line": 6, }, "start": Object { - "column": 11, - "line": 2, + "column": 12, + "line": 6, }, }, - "name": "foo", + "name": "proto", "range": Array [ - 21, - 24, + 54, + 59, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "name": "__proto__", + "range": Array [ + 62, + 71, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "method": false, + "range": Array [ + 62, + 78, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "name": "proto", + "range": Array [ + 73, + 78, ], "type": "Identifier", }, }, ], "range": Array [ - 8, - 26, + 40, + 80, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 8, }, "start": Object { "column": 4, - "line": 1, + "line": 5, }, }, "range": Array [ - 4, - 26, + 36, + 80, ], "type": "VariableDeclarator", }, @@ -111921,24 +120691,24 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 3, + "line": 8, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 27, + 32, + 81, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 4, + "column": 2, + "line": 8, }, "start": Object { "column": 0, @@ -111947,14 +120717,14 @@ Object { }, "range": Array [ 0, - 28, + 81, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 12, "line": 1, }, "start": Object { @@ -111964,490 +120734,367 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, + 12, ], - "type": "Identifier", - "value": "x", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 12, "line": 1, }, }, "range": Array [ - 6, - 7, + 12, + 13, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 8, - 9, + 15, + 18, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { "column": 4, - "line": 2, + "line": 3, }, }, "range": Array [ - 14, - 15, + 19, + 24, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 11, + "line": 3, }, "start": Object { - "column": 5, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 15, - 18, + 25, + 26, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 13, + "line": 3, }, "start": Object { - "column": 8, - "line": 2, + "column": 12, + "line": 3, }, }, "range": Array [ - 18, - 19, + 27, + 28, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 14, + "line": 3, }, "start": Object { - "column": 9, - "line": 2, + "column": 13, + "line": 3, }, }, "range": Array [ - 19, - 20, + 28, + 29, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 15, + "line": 3, }, "start": Object { - "column": 11, - "line": 2, + "column": 14, + "line": 3, }, }, "range": Array [ - 21, - 24, + 29, + 30, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 25, - 26, + 32, + 35, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 5, + "line": 5, }, "start": Object { - "column": 1, - "line": 3, + "column": 4, + "line": 5, }, }, "range": Array [ - 26, - 27, + 36, + 37, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "x", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = `"':' expected."`; - -exports[`javascript fixtures/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = `"':' expected."`; - -exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 9, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 9, - ], - "raw": "10", - "type": "Literal", - "value": 10, - }, - }, - ], - "range": Array [ - 1, - 10, - ], - "type": "ObjectExpression", - }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 6, + "line": 5, }, }, "range": Array [ - 0, - 12, + 38, + 39, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "=", }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 0, - 1, + 40, + 41, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 10, + "line": 6, }, "start": Object { "column": 1, - "line": 1, + "line": 6, }, }, "range": Array [ - 1, - 2, + 43, + 52, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "__proto__", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 11, + "line": 6, }, "start": Object { - "column": 2, - "line": 1, + "column": 10, + "line": 6, }, }, "range": Array [ - 2, - 3, + 52, + 53, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 17, + "line": 6, }, "start": Object { - "column": 3, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 3, - 4, + 54, + 59, ], "type": "Identifier", - "value": "x", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 18, + "line": 6, }, "start": Object { - "column": 4, - "line": 1, + "column": 17, + "line": 6, }, }, "range": Array [ - 4, - 5, + 59, + 60, ], "type": "Punctuator", - "value": "]", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 10, + "line": 7, }, "start": Object { - "column": 5, - "line": 1, + "column": 1, + "line": 7, }, }, "range": Array [ - 5, - 6, + 62, + 71, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "__proto__", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 11, + "line": 7, }, "start": Object { - "column": 7, - "line": 1, + "column": 10, + "line": 7, }, }, "range": Array [ - 7, - 9, + 71, + 72, ], - "type": "Numeric", - "value": "10", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 17, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 12, + "line": 7, }, }, "range": Array [ - 9, - 10, + 73, + 78, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { - "column": 10, - "line": 1, + "column": 0, + "line": 8, }, }, "range": Array [ - 10, - 11, + 79, + 80, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 2, + "line": 8, }, "start": Object { - "column": 11, - "line": 1, + "column": 1, + "line": 8, }, }, "range": Array [ - 11, - 12, + 80, + 81, ], "type": "Punctuator", "value": ";", @@ -112457,146 +121104,314 @@ Object { } `; -exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` Object { "body": Array [ Object { + "directive": "use strict", "expression": Object { "loc": Object { "end": Object { - "column": 18, + "column": 12, "line": 1, }, "start": Object { - "column": 1, + "column": 0, "line": 1, }, }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "left": Object { + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "proto", + "range": Array [ + 19, + 24, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 19, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 15, + 30, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 36, + 37, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 43, + 54, + ], + "raw": "\\"__proto__\\"", + "type": "Literal", + "value": "__proto__", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 19, + "line": 6, }, "start": Object { - "column": 3, - "line": 1, + "column": 1, + "line": 6, }, }, + "method": false, "range": Array [ - 3, - 6, + 43, + 61, ], - "raw": "\\"x\\"", - "type": "Literal", - "value": "x", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 14, + "line": 6, + }, + }, + "name": "proto", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", }, }, - "operator": "+", - "range": Array [ - 3, - 12, - ], - "right": Object { + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 1, + "line": 7, + }, + }, + "range": Array [ + 64, + 75, + ], + "raw": "\\"__proto__\\"", + "type": "Literal", + "value": "__proto__", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 19, + "line": 7, }, "start": Object { - "column": 9, - "line": 1, + "column": 1, + "line": 7, }, }, + "method": false, "range": Array [ - 9, - 12, + 64, + 82, ], - "raw": "\\"y\\"", - "type": "Literal", - "value": "y", - }, - "type": "BinaryExpression", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "name": "proto", + "range": Array [ + 77, + 82, + ], + "type": "Identifier", + }, }, - }, - "method": false, + ], "range": Array [ - 2, - 17, + 40, + 84, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 17, - ], - "raw": "10", - "type": "Literal", - "value": 10, + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 5, }, }, - ], - "range": Array [ - 1, - 18, - ], - "type": "ObjectExpression", - }, + "range": Array [ + 36, + 84, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 2, + "line": 8, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 20, + 32, + 85, ], - "type": "ExpressionStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 2, + "line": 8, }, "start": Object { "column": 0, @@ -112605,14 +121420,14 @@ Object { }, "range": Array [ 0, - 21, + 85, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 12, "line": 1, }, "start": Object { @@ -112622,597 +121437,367 @@ Object { }, "range": Array [ 0, - 1, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "range": Array [ - 2, - 3, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 6, - ], - "type": "String", - "value": "\\"x\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "+", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 12, - ], - "type": "String", - "value": "\\"y\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ 12, - 13, ], - "type": "Punctuator", - "value": "]", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 13, + "column": 12, "line": 1, }, }, "range": Array [ + 12, 13, - 14, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 15, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ 15, - 17, + 18, ], - "type": "Numeric", - "value": "10", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 17, - 18, + 19, + 24, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 18, - 19, + 25, + 26, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 3, }, }, "range": Array [ - 19, - 20, + 27, + 28, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 3, - 4, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 2, - 20, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 20, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "params": Array [], - "range": Array [ - 7, - 20, - ], - "type": "FunctionExpression", - }, - }, - ], - "range": Array [ - 1, - 21, - ], - "type": "ObjectExpression", - }, "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 14, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 13, + "line": 3, }, }, "range": Array [ - 0, - 23, + 28, + 29, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 24, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 0, - 1, + 29, + 30, ], "type": "Punctuator", - "value": "(", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 1, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 1, - 2, + 32, + 35, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 5, + "line": 5, }, "start": Object { - "column": 2, - "line": 1, + "column": 4, + "line": 5, }, }, "range": Array [ - 2, - 3, + 36, + 37, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { - "column": 3, - "line": 1, + "column": 6, + "line": 5, }, }, "range": Array [ - 3, - 4, + 38, + 39, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 4, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 4, - 5, + 40, + 41, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 5, - "line": 1, + "column": 1, + "line": 6, }, }, "range": Array [ - 5, - 6, + 43, + 54, ], - "type": "Punctuator", - "value": ":", + "type": "String", + "value": "\\"__proto__\\"", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 13, + "line": 6, }, "start": Object { - "column": 7, - "line": 1, + "column": 12, + "line": 6, }, }, "range": Array [ - 7, - 15, + 54, + 55, ], - "type": "Keyword", - "value": "function", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 19, + "line": 6, }, "start": Object { - "column": 15, - "line": 1, + "column": 14, + "line": 6, }, }, "range": Array [ - 15, - 16, + 56, + 61, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 20, + "line": 6, }, "start": Object { - "column": 16, - "line": 1, + "column": 19, + "line": 6, }, }, "range": Array [ - 16, - 17, + 61, + 62, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 7, }, "start": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 7, }, }, "range": Array [ - 18, - 19, + 64, + 75, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"__proto__\\"", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 13, + "line": 7, }, "start": Object { - "column": 19, - "line": 1, + "column": 12, + "line": 7, }, }, "range": Array [ - 19, - 20, + 75, + 76, ], "type": "Punctuator", - "value": "}", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 19, + "line": 7, }, "start": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 7, }, }, "range": Array [ - 20, - 21, + 77, + 82, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "proto", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 8, }, "start": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 8, }, }, "range": Array [ - 21, - 22, + 83, + 84, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 2, + "line": 8, }, "start": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 8, }, }, "range": Array [ - 22, - 23, + 84, + 85, ], "type": "Punctuator", "value": ";", @@ -113222,7 +121807,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` Object { "body": Array [ Object { @@ -113268,7 +121853,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -113276,83 +121861,10 @@ Object { "line": 3, }, }, - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "properties": Array [], - "range": Array [ - 27, - 29, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 29, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 30, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, "name": "x", "range": Array [ - 36, - 37, + 19, + 20, ], "type": "Identifier", }, @@ -113360,11 +121872,11 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 8, - "line": 5, + "line": 3, }, }, "properties": Array [ @@ -113373,56 +121885,57 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, - "line": 6, + "column": 2, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, - "name": "__proto__", - "range": Array [ - 43, - 52, + "name": "y", + "range": Array [ + 26, + 27, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 11, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "method": false, "range": Array [ - 43, - 59, + 26, + 36, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 11, + "line": 4, }, "start": Object { - "column": 12, - "line": 6, + "column": 4, + "line": 4, }, }, - "name": "proto", "range": Array [ - 54, - 59, + 29, + 36, ], - "type": "Identifier", + "raw": "'first'", + "type": "Literal", + "value": "first", }, }, Object { @@ -113430,78 +121943,79 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 2, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, - "name": "__proto__", + "name": "y", "range": Array [ - 62, - 71, + 39, + 40, ], "type": "Identifier", }, "kind": "init", "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 12, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, "method": false, "range": Array [ - 62, - 78, + 39, + 50, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 12, + "line": 5, }, "start": Object { - "column": 12, - "line": 7, + "column": 4, + "line": 5, }, }, - "name": "proto", "range": Array [ - 73, - 78, + 42, + 50, ], - "type": "Identifier", + "raw": "'second'", + "type": "Literal", + "value": "second", }, }, ], "range": Array [ - 40, - 80, + 23, + 52, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 36, - 80, + 19, + 52, ], "type": "VariableDeclarator", }, @@ -113510,16 +122024,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 32, - 81, + 15, + 53, ], "type": "VariableDeclaration", }, @@ -113527,7 +122041,7 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, @@ -113536,7 +122050,7 @@ Object { }, "range": Array [ 0, - 81, + 53, ], "sourceType": "script", "tokens": Array [ @@ -113597,7 +122111,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -113607,25 +122121,25 @@ Object { }, "range": Array [ 19, - 24, + 20, ], "type": "Identifier", - "value": "proto", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 3, }, "start": Object { - "column": 10, + "column": 6, "line": 3, }, }, "range": Array [ - 25, - 26, + 21, + 22, ], "type": "Punctuator", "value": "=", @@ -113633,17 +122147,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 9, "line": 3, }, "start": Object { - "column": 12, + "column": 8, "line": 3, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": "{", @@ -113651,101 +122165,101 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 2, + "line": 4, }, "start": Object { - "column": 13, - "line": 3, + "column": 1, + "line": 4, }, }, "range": Array [ - 28, - 29, + 26, + 27, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 3, + "line": 4, }, "start": Object { - "column": 14, - "line": 3, + "column": 2, + "line": 4, }, }, "range": Array [ - 29, - 30, + 27, + 28, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 11, + "line": 4, }, "start": Object { - "column": 0, - "line": 5, + "column": 4, + "line": 4, }, }, "range": Array [ - 32, - 35, + 29, + 36, ], - "type": "Keyword", - "value": "var", + "type": "String", + "value": "'first'", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 12, + "line": 4, }, "start": Object { - "column": 4, - "line": 5, + "column": 11, + "line": 4, }, }, "range": Array [ 36, 37, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 2, "line": 5, }, "start": Object { - "column": 6, + "column": 1, "line": 5, }, }, "range": Array [ - 38, 39, + 40, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 3, "line": 5, }, "start": Object { - "column": 8, + "column": 2, "line": 5, }, }, @@ -113754,148 +122268,40 @@ Object { 41, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 6, - }, - "start": Object { - "column": 1, - "line": 6, - }, - }, - "range": Array [ - 43, - 52, - ], - "type": "Identifier", - "value": "__proto__", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 6, - }, - "start": Object { - "column": 10, - "line": 6, - }, - }, - "range": Array [ - 52, - 53, - ], - "type": "Punctuator", "value": ":", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, - }, - "start": Object { "column": 12, - "line": 6, - }, - }, - "range": Array [ - 54, - 59, - ], - "type": "Identifier", - "value": "proto", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 6, - }, - "start": Object { - "column": 17, - "line": 6, - }, - }, - "range": Array [ - 59, - 60, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "start": Object { - "column": 1, - "line": 7, - }, - }, - "range": Array [ - 62, - 71, - ], - "type": "Identifier", - "value": "__proto__", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 71, - 72, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 7, + "line": 5, }, "start": Object { - "column": 12, - "line": 7, + "column": 4, + "line": 5, }, }, "range": Array [ - 73, - 78, + 42, + 50, ], - "type": "Identifier", - "value": "proto", + "type": "String", + "value": "'second'", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 0, - "line": 8, + "line": 6, }, }, "range": Array [ - 79, - 80, + 51, + 52, ], "type": "Punctuator", "value": "}", @@ -113904,16 +122310,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 1, - "line": 8, + "line": 6, }, }, "range": Array [ - 80, - 81, + 52, + 53, ], "type": "Punctuator", "value": ";", @@ -113923,7 +122329,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` Object { "body": Array [ Object { @@ -113969,7 +122375,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -113977,83 +122383,10 @@ Object { "line": 3, }, }, - "name": "proto", - "range": Array [ - 19, - 24, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "properties": Array [], - "range": Array [ - 27, - 29, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 29, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 30, - ], - "type": "VariableDeclaration", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, "name": "x", "range": Array [ - 36, - 37, + 19, + 20, ], "type": "Identifier", }, @@ -114061,11 +122394,11 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 8, - "line": 5, + "line": 3, }, }, "properties": Array [ @@ -114074,57 +122407,58 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 4, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "range": Array [ - 43, - 54, + 26, + 29, ], - "raw": "\\"__proto__\\"", + "raw": "\\"y\\"", "type": "Literal", - "value": "__proto__", + "value": "y", }, "kind": "init", "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 13, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "method": false, "range": Array [ - 43, - 61, + 26, + 38, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 13, + "line": 4, }, "start": Object { - "column": 14, - "line": 6, + "column": 6, + "line": 4, }, }, - "name": "proto", "range": Array [ - 56, - 61, + 31, + 38, ], - "type": "Identifier", + "raw": "\\"first\\"", + "type": "Literal", + "value": "first", }, }, Object { @@ -114132,79 +122466,80 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 4, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, "range": Array [ - 64, - 75, + 41, + 44, ], - "raw": "\\"__proto__\\"", + "raw": "\\"y\\"", "type": "Literal", - "value": "__proto__", + "value": "y", }, "kind": "init", "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 14, + "line": 5, }, "start": Object { "column": 1, - "line": 7, + "line": 5, }, }, "method": false, "range": Array [ - 64, - 82, + 41, + 54, ], "shorthand": false, "type": "Property", "value": Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 14, + "line": 5, }, "start": Object { - "column": 14, - "line": 7, + "column": 6, + "line": 5, }, }, - "name": "proto", "range": Array [ - 77, - 82, + 46, + 54, ], - "type": "Identifier", + "raw": "\\"second\\"", + "type": "Literal", + "value": "second", }, }, ], "range": Array [ - 40, - 84, + 23, + 56, ], "type": "ObjectExpression", }, "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 6, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 36, - 84, + 19, + 56, ], "type": "VariableDeclarator", }, @@ -114213,16 +122548,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 32, - 85, + 15, + 57, ], "type": "VariableDeclaration", }, @@ -114230,7 +122565,7 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 6, }, "start": Object { "column": 0, @@ -114239,7 +122574,7 @@ Object { }, "range": Array [ 0, - 85, + 57, ], "sourceType": "script", "tokens": Array [ @@ -114300,7 +122635,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 3, }, "start": Object { @@ -114310,25 +122645,25 @@ Object { }, "range": Array [ 19, - 24, + 20, ], "type": "Identifier", - "value": "proto", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 7, "line": 3, }, "start": Object { - "column": 10, + "column": 6, "line": 3, }, }, "range": Array [ - 25, - 26, + 21, + 22, ], "type": "Punctuator", "value": "=", @@ -114336,71 +122671,413 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 9, "line": 3, }, "start": Object { - "column": 12, + "column": 8, "line": 3, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": "{", }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 1, + "line": 4, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "String", + "value": "\\"y\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 31, + 38, + ], + "type": "String", + "value": "\\"first\\"", + }, Object { "loc": Object { "end": Object { "column": 14, - "line": 3, + "line": 4, }, "start": Object { "column": 13, - "line": 3, + "line": 4, }, }, "range": Array [ - 28, - 29, + 38, + 39, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 4, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "String", + "value": "\\"y\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, }, "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { "column": 14, - "line": 3, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, }, }, "range": Array [ - 29, - 30, + 46, + 54, + ], + "type": "String", + "value": "\\"second\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 1, + "line": 6, + }, + }, + "range": Array [ + 56, + 57, ], "type": "Punctuator", "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; + +exports[`javascript fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 14, + 47, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 30, + 41, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 47, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 17, + 47, + ], + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 8, + 49, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 49, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 3, - "line": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 35, + 0, + 3, ], "type": "Keyword", "value": "var", @@ -114409,16 +123086,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 36, - 37, + 4, + 5, ], "type": "Identifier", "value": "x", @@ -114427,16 +123104,16 @@ Object { "loc": Object { "end": Object { "column": 7, - "line": 5, + "line": 1, }, "start": Object { "column": 6, - "line": 5, + "line": 1, }, }, "range": Array [ - 38, - 39, + 6, + 7, ], "type": "Punctuator", "value": "=", @@ -114445,16 +123122,16 @@ Object { "loc": Object { "end": Object { "column": 9, - "line": 5, + "line": 1, }, "start": Object { "column": 8, - "line": 5, + "line": 1, }, }, "range": Array [ - 40, - 41, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -114462,143 +123139,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 7, + "line": 2, }, "start": Object { - "column": 1, - "line": 6, + "column": 4, + "line": 2, }, }, "range": Array [ - 43, - 54, + 14, + 17, ], - "type": "String", - "value": "\\"__proto__\\"", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 8, + "line": 2, }, "start": Object { - "column": 12, - "line": 6, + "column": 7, + "line": 2, }, }, "range": Array [ - 54, - 55, + 17, + 18, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 9, + "line": 2, }, "start": Object { - "column": 14, - "line": 6, + "column": 8, + "line": 2, }, }, "range": Array [ - 56, - 61, + 18, + 19, ], - "type": "Identifier", - "value": "proto", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 6, + "column": 11, + "line": 2, }, "start": Object { - "column": 19, - "line": 6, + "column": 10, + "line": 2, }, }, "range": Array [ - 61, - 62, + 20, + 21, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 7, + "column": 14, + "line": 3, }, "start": Object { - "column": 1, - "line": 7, + "column": 8, + "line": 3, }, }, "range": Array [ - 64, - 75, + 30, + 36, ], - "type": "String", - "value": "\\"__proto__\\"", + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 7, + "column": 19, + "line": 3, }, "start": Object { - "column": 12, - "line": 7, + "column": 18, + "line": 3, }, }, "range": Array [ - 75, - 76, + 40, + 41, ], "type": "Punctuator", - "value": ":", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 5, + "line": 4, }, "start": Object { - "column": 14, - "line": 7, + "column": 4, + "line": 4, }, }, "range": Array [ - 77, - 82, + 46, + 47, ], - "type": "Identifier", - "value": "proto", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 8, + "line": 5, }, "start": Object { "column": 0, - "line": 8, + "line": 5, }, }, "range": Array [ - 83, - 84, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -114607,16 +123302,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 8, + "line": 5, }, "start": Object { "column": 1, - "line": 8, + "line": 5, }, }, "range": Array [ - 84, - 85, + 49, + 50, ], "type": "Punctuator", "value": ";", @@ -114626,241 +123321,182 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` Object { "body": Array [ Object { - "directive": "use strict", "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, "line": 1, }, }, + "operator": "=", "range": Array [ 0, - 12, + 28, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 3, - }, + "start": Object { + "column": 4, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "name": "y", - "range": Array [ - 26, - 27, - ], - "type": "Identifier", - }, - "kind": "init", + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 11, - "line": 4, + "column": 10, + "line": 2, }, "start": Object { - "column": 1, - "line": 4, + "column": 4, + "line": 2, }, }, - "method": false, + "name": "method", "range": Array [ - 26, - 36, + 10, + 16, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 29, - 36, - ], - "raw": "'first'", - "type": "Literal", - "value": "first", + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, }, }, - Object { - "computed": false, - "key": Object { + "method": true, + "range": Array [ + 10, + 26, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 13, + "line": 2, }, }, - "name": "y", "range": Array [ - 39, - 40, + 19, + 26, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "init", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 12, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 10, + "line": 2, }, }, - "method": false, + "params": Array [], "range": Array [ - 39, - 50, + 16, + 26, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 42, - 50, - ], - "raw": "'second'", - "type": "Literal", - "value": "second", - }, + "type": "FunctionExpression", }, - ], - "range": Array [ - 23, - 52, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 3, }, - }, + ], "range": Array [ - 19, - 52, + 4, + 28, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 15, - 53, + 0, + 29, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 6, + "column": 3, + "line": 4, }, "start": Object { "column": 0, @@ -114869,14 +123505,14 @@ Object { }, "range": Array [ 0, - 53, + 30, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 1, "line": 1, }, "start": Object { @@ -114886,97 +123522,43 @@ Object { }, "range": Array [ 0, - 12, + 1, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 1, }, "start": Object { - "column": 12, + "column": 2, "line": 1, }, }, "range": Array [ - 12, - 13, + 2, + 3, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "Keyword", - "value": "var", + "value": "=", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 1, }, "start": Object { "column": 4, - "line": 3, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, + "line": 1, }, }, "range": Array [ - 23, - 24, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -114984,143 +123566,107 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 10, + "line": 2, }, "start": Object { - "column": 1, - "line": 4, + "column": 4, + "line": 2, }, }, "range": Array [ - 26, - 27, + 10, + 16, ], "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": ":", + "value": "method", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 4, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 10, + "line": 2, }, }, "range": Array [ - 29, - 36, + 16, + 17, ], - "type": "String", - "value": "'first'", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 4, + "line": 2, }, "start": Object { "column": 11, - "line": 4, + "line": 2, }, }, "range": Array [ - 36, - 37, + 17, + 18, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Identifier", - "value": "y", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 14, + "line": 2, }, "start": Object { - "column": 2, - "line": 5, + "column": 13, + "line": 2, }, }, "range": Array [ - 40, - 41, + 19, + 20, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 42, - 50, + 25, + 26, ], - "type": "String", - "value": "'second'", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 6, + "line": 4, }, }, "range": Array [ - 51, - 52, + 27, + 28, ], "type": "Punctuator", "value": "}", @@ -115129,16 +123675,34 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "range": Array [ - 52, - 53, + 28, + 29, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 29, + 30, ], "type": "Punctuator", "value": ";", @@ -115148,243 +123712,182 @@ Object { } `; -exports[`javascript fixtures/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` Object { "body": Array [ Object { - "directive": "use strict", "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, "line": 1, }, }, + "operator": "=", "range": Array [ 0, - 12, + 25, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 13, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "name": "x", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 3, - }, + "start": Object { + "column": 4, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 26, - 29, - ], - "raw": "\\"y\\"", - "type": "Literal", - "value": "y", - }, - "kind": "init", + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 7, + "line": 2, }, "start": Object { - "column": 1, - "line": 4, + "column": 4, + "line": 2, }, }, - "method": false, + "name": "get", "range": Array [ - 26, - 38, + 10, + 13, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "range": Array [ - 31, - 38, - ], - "raw": "\\"first\\"", - "type": "Literal", - "value": "first", + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, }, }, - Object { - "computed": false, - "key": Object { + "method": true, + "range": Array [ + 10, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 10, + "line": 2, }, }, "range": Array [ - 41, - 44, + 16, + 23, ], - "raw": "\\"y\\"", - "type": "Literal", - "value": "y", + "type": "BlockStatement", }, - "kind": "init", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 14, - "line": 5, + "column": 5, + "line": 3, }, "start": Object { - "column": 1, - "line": 5, + "column": 7, + "line": 2, }, }, - "method": false, + "params": Array [], "range": Array [ - 41, - 54, + 13, + 23, ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "range": Array [ - 46, - 54, - ], - "raw": "\\"second\\"", - "type": "Literal", - "value": "second", - }, + "type": "FunctionExpression", }, - ], - "range": Array [ - 23, - 56, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 3, }, - }, + ], "range": Array [ - 19, - 56, + 4, + 25, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 15, - 57, + 0, + 26, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 2, - "line": 6, + "column": 3, + "line": 4, }, "start": Object { "column": 0, @@ -115393,14 +123896,14 @@ Object { }, "range": Array [ 0, - 57, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 1, "line": 1, }, "start": Object { @@ -115410,241 +123913,151 @@ Object { }, "range": Array [ 0, - 12, + 1, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 1, }, "start": Object { - "column": 12, + "column": 2, "line": 1, }, }, "range": Array [ - 12, - 13, + 2, + 3, ], "type": "Punctuator", - "value": ";", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 5, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 4, + "line": 1, }, }, "range": Array [ - 15, - 18, + 4, + 5, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 7, + "line": 2, }, "start": Object { "column": 4, - "line": 3, + "line": 2, }, }, "range": Array [ - 19, - 20, + 10, + 13, ], "type": "Identifier", - "value": "x", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 8, + "line": 2, }, "start": Object { - "column": 6, - "line": 3, + "column": 7, + "line": 2, }, }, "range": Array [ - 21, - 22, + 13, + 14, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 3, + "line": 2, }, "start": Object { "column": 8, - "line": 3, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 4, - }, - "start": Object { - "column": 1, - "line": 4, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "String", - "value": "\\"y\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, + "line": 2, }, }, "range": Array [ - 29, - 30, + 14, + 15, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, - }, - }, - "range": Array [ - 31, - 38, - ], - "type": "String", - "value": "\\"first\\"", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 11, + "line": 2, }, "start": Object { - "column": 13, - "line": 4, + "column": 10, + "line": 2, }, }, "range": Array [ - 38, - 39, + 16, + 17, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 4, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "range": Array [ - 41, - 44, - ], - "type": "String", - "value": "\\"y\\"", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 3, }, "start": Object { "column": 4, - "line": 5, + "line": 3, }, }, "range": Array [ - 44, - 45, + 22, + 23, ], "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "range": Array [ - 46, - 54, - ], - "type": "String", - "value": "\\"second\\"", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 4, }, "start": Object { "column": 0, - "line": 6, + "line": 4, }, }, "range": Array [ - 55, - 56, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -115653,16 +124066,34 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 6, + "line": 4, }, "start": Object { "column": 1, - "line": 6, + "line": 4, }, }, "range": Array [ - 56, - 57, + 25, + 26, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -115672,188 +124103,148 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = `"'{' expected."`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/method-property.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "name": "x", + "range": Array [ + 0, + 1, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 0, + 25, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "init", + "start": Object { + "column": 4, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 2, }, "start": Object { "column": 4, "line": 2, }, }, - "method": true, + "name": "set", "range": Array [ - 14, - 47, + 10, + 13, ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 30, - 41, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 20, - 47, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "method": true, + "range": Array [ + 10, + 23, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 3, }, "start": Object { - "column": 7, + "column": 10, "line": 2, }, }, - "params": Array [], "range": Array [ - 17, - 47, + 16, + 23, ], - "type": "FunctionExpression", + "type": "BlockStatement", }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 13, + 23, + ], + "type": "FunctionExpression", }, - ], - "range": Array [ - 8, - 49, - ], - "type": "ObjectExpression", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 1, }, - }, + ], "range": Array [ 4, - 49, + 25, ], - "type": "VariableDeclarator", + "type": "ObjectExpression", }, - ], - "kind": "var", + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 4, }, "start": Object { "column": 0, @@ -115862,15 +124253,32 @@ Object { }, "range": Array [ 0, - 50, + 26, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 3, + "line": 4, }, "start": Object { "column": 0, @@ -115879,14 +124287,14 @@ Object { }, "range": Array [ 0, - 51, + 27, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 1, "line": 1, }, "start": Object { @@ -115896,25 +124304,7 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, + 1, ], "type": "Identifier", "value": "x", @@ -115922,17 +124312,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 3, "line": 1, }, "start": Object { - "column": 6, + "column": 2, "line": 1, }, }, "range": Array [ - 6, - 7, + 2, + 3, ], "type": "Punctuator", "value": "=", @@ -115940,17 +124330,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 5, "line": 1, }, "start": Object { - "column": 8, + "column": 4, "line": 1, }, }, "range": Array [ - 8, - 9, + 4, + 5, ], "type": "Punctuator", "value": "{", @@ -115967,11 +124357,11 @@ Object { }, }, "range": Array [ - 14, - 17, + 10, + 13, ], "type": "Identifier", - "value": "foo", + "value": "set", }, Object { "loc": Object { @@ -115985,8 +124375,8 @@ Object { }, }, "range": Array [ - 17, - 18, + 13, + 14, ], "type": "Punctuator", "value": "(", @@ -116003,8 +124393,8 @@ Object { }, }, "range": Array [ - 18, - 19, + 14, + 15, ], "type": "Punctuator", "value": ")", @@ -116021,8 +124411,8 @@ Object { }, }, "range": Array [ - 20, - 21, + 16, + 17, ], "type": "Punctuator", "value": "{", @@ -116030,71 +124420,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 30, - 36, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 37, - 40, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, + "column": 5, "line": 3, }, "start": Object { - "column": 18, + "column": 4, "line": 3, }, }, "range": Array [ - 40, - 41, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 4, }, "start": Object { - "column": 4, + "column": 0, "line": 4, }, }, "range": Array [ - 46, - 47, + 24, + 25, ], "type": "Punctuator", "value": "}", @@ -116102,35 +124456,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 2, + "line": 4, }, "start": Object { - "column": 0, - "line": 5, + "column": 1, + "line": 4, }, }, "range": Array [ - 48, - 49, + 25, + 26, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 3, + "line": 4, }, "start": Object { - "column": 1, - "line": 5, + "column": 2, + "line": 4, }, }, "range": Array [ - 49, - 50, + 26, + 27, ], "type": "Punctuator", "value": ";", @@ -116140,7 +124494,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` Object { "body": Array [ Object { @@ -116166,7 +124520,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -116176,13 +124530,13 @@ Object { "operator": "=", "range": Array [ 0, - 28, + 33, ], "right": Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 4, @@ -116214,7 +124568,7 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { "column": 4, @@ -116224,7 +124578,7 @@ Object { "method": true, "range": Array [ 10, - 26, + 31, ], "shorthand": false, "type": "Property", @@ -116235,16 +124589,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { - "column": 13, + "column": 17, "line": 2, }, }, "range": Array [ - 19, - 26, + 23, + 31, ], "type": "BlockStatement", }, @@ -116254,17 +124608,36 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { "column": 10, "line": 2, }, }, - "params": Array [], + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "test", + "range": Array [ + 17, + 21, + ], + "type": "Identifier", + }, + ], "range": Array [ 16, - 26, + 31, ], "type": "FunctionExpression", }, @@ -116272,7 +124645,7 @@ Object { ], "range": Array [ 4, - 28, + 33, ], "type": "ObjectExpression", }, @@ -116281,7 +124654,7 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -116290,7 +124663,7 @@ Object { }, "range": Array [ 0, - 29, + 34, ], "type": "ExpressionStatement", }, @@ -116298,16 +124671,16 @@ Object { "loc": Object { "end": Object { "column": 3, - "line": 4, + "line": 5, }, "start": Object { "column": 2, - "line": 4, + "line": 5, }, }, "range": Array [ - 29, - 30, + 34, + 35, ], "type": "EmptyStatement", }, @@ -116315,7 +124688,7 @@ Object { "loc": Object { "end": Object { "column": 3, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -116324,7 +124697,7 @@ Object { }, "range": Array [ 0, - 30, + 35, ], "sourceType": "script", "tokens": Array [ @@ -116421,7 +124794,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 15, "line": 2, }, "start": Object { @@ -116431,7 +124804,25 @@ Object { }, "range": Array [ 17, - 18, + 21, + ], + "type": "Identifier", + "value": "test", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 21, + 22, ], "type": "Punctuator", "value": ")", @@ -116439,17 +124830,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 2, }, "start": Object { - "column": 13, + "column": 17, "line": 2, }, }, "range": Array [ - 19, - 20, + 23, + 24, ], "type": "Punctuator", "value": "{", @@ -116458,16 +124849,16 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { "column": 4, - "line": 3, + "line": 4, }, }, "range": Array [ - 25, - 26, + 30, + 31, ], "type": "Punctuator", "value": "}", @@ -116476,16 +124867,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 5, }, "start": Object { "column": 0, - "line": 4, + "line": 5, }, }, "range": Array [ - 27, - 28, + 32, + 33, ], "type": "Punctuator", "value": "}", @@ -116494,16 +124885,16 @@ Object { "loc": Object { "end": Object { "column": 2, - "line": 4, + "line": 5, }, "start": Object { "column": 1, - "line": 4, + "line": 5, }, }, "range": Array [ - 28, - 29, + 33, + 34, ], "type": "Punctuator", "value": ";", @@ -116512,16 +124903,16 @@ Object { "loc": Object { "end": Object { "column": 3, - "line": 4, + "line": 5, }, "start": Object { "column": 2, - "line": 4, + "line": 5, }, }, "range": Array [ - 29, - 30, + 34, + 35, ], "type": "Punctuator", "value": ";", @@ -116531,7 +124922,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` Object { "body": Array [ Object { @@ -116567,7 +124958,7 @@ Object { "operator": "=", "range": Array [ 0, - 25, + 30, ], "right": Object { "loc": Object { @@ -116586,7 +124977,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 2, }, "start": Object { @@ -116594,12 +124985,13 @@ Object { "line": 2, }, }, - "name": "get", "range": Array [ 10, - 13, + 18, ], - "type": "Identifier", + "raw": "\\"method\\"", + "type": "Literal", + "value": "method", }, "kind": "init", "loc": Object { @@ -116615,7 +125007,7 @@ Object { "method": true, "range": Array [ 10, - 23, + 28, ], "shorthand": false, "type": "Property", @@ -116629,13 +125021,13 @@ Object { "line": 3, }, "start": Object { - "column": 10, + "column": 15, "line": 2, }, }, "range": Array [ - 16, - 23, + 21, + 28, ], "type": "BlockStatement", }, @@ -116648,14 +125040,14 @@ Object { "line": 3, }, "start": Object { - "column": 7, + "column": 12, "line": 2, }, }, "params": Array [], "range": Array [ - 13, - 23, + 18, + 28, ], "type": "FunctionExpression", }, @@ -116663,7 +125055,7 @@ Object { ], "range": Array [ 4, - 25, + 30, ], "type": "ObjectExpression", }, @@ -116681,7 +125073,7 @@ Object { }, "range": Array [ 0, - 26, + 31, ], "type": "ExpressionStatement", }, @@ -116697,8 +125089,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 31, + 32, ], "type": "EmptyStatement", }, @@ -116715,7 +125107,7 @@ Object { }, "range": Array [ 0, - 27, + 32, ], "sourceType": "script", "tokens": Array [ @@ -116776,7 +125168,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 12, "line": 2, }, "start": Object { @@ -116786,25 +125178,25 @@ Object { }, "range": Array [ 10, - 13, + 18, ], - "type": "Identifier", - "value": "get", + "type": "String", + "value": "\\"method\\"", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 2, }, "start": Object { - "column": 7, + "column": 12, "line": 2, }, }, "range": Array [ - 13, - 14, + 18, + 19, ], "type": "Punctuator", "value": "(", @@ -116812,17 +125204,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 2, }, "start": Object { - "column": 8, + "column": 13, "line": 2, }, }, "range": Array [ - 14, - 15, + 19, + 20, ], "type": "Punctuator", "value": ")", @@ -116830,17 +125222,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 16, "line": 2, }, "start": Object { - "column": 10, + "column": 15, "line": 2, }, }, "range": Array [ - 16, - 17, + 21, + 22, ], "type": "Punctuator", "value": "{", @@ -116857,8 +125249,8 @@ Object { }, }, "range": Array [ - 22, - 23, + 27, + 28, ], "type": "Punctuator", "value": "}", @@ -116875,8 +125267,8 @@ Object { }, }, "range": Array [ - 24, - 25, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -116893,8 +125285,8 @@ Object { }, }, "range": Array [ - 25, - 26, + 30, + 31, ], "type": "Punctuator", "value": ";", @@ -116911,8 +125303,8 @@ Object { }, }, "range": Array [ - 26, - 27, + 31, + 32, ], "type": "Punctuator", "value": ";", @@ -116922,148 +125314,187 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "operator": "=", - "range": Array [ - 0, - 25, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "\\"foo\\"", + "type": "Literal", + "value": "foo", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { "column": 4, "line": 2, }, - }, - "name": "set", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "method": true, - "range": Array [ - 10, - 23, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + }, + "method": true, + "range": Array [ + 14, + 49, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 32, + 43, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { "column": 5, - "line": 3, + "line": 4, }, "start": Object { - "column": 10, + "column": 9, "line": 2, }, }, + "params": Array [], "range": Array [ - 16, - 23, + 19, + 49, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 2, - }, + "type": "FunctionExpression", }, - "params": Array [], - "range": Array [ - 13, - 23, - ], - "type": "FunctionExpression", }, + ], + "range": Array [ + 8, + 51, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, }, - ], + "start": Object { + "column": 4, + "line": 1, + }, + }, "range": Array [ 4, - 25, + 51, ], - "type": "ObjectExpression", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { "column": 2, - "line": 4, + "line": 5, }, "start": Object { "column": 0, @@ -117072,32 +125503,15 @@ Object { }, "range": Array [ 0, - 26, - ], - "type": "ExpressionStatement", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 26, - 27, + 52, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 0, + "line": 6, }, "start": Object { "column": 0, @@ -117106,14 +125520,14 @@ Object { }, "range": Array [ 0, - 27, + 53, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -117123,7 +125537,25 @@ Object { }, "range": Array [ 0, - 1, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, ], "type": "Identifier", "value": "x", @@ -117131,17 +125563,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 6, "line": 1, }, }, "range": Array [ - 2, - 3, + 6, + 7, ], "type": "Punctuator", "value": "=", @@ -117149,17 +125581,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 9, "line": 1, }, "start": Object { - "column": 4, + "column": 8, "line": 1, }, }, "range": Array [ - 4, - 5, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -117167,7 +125599,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 2, }, "start": Object { @@ -117176,26 +125608,26 @@ Object { }, }, "range": Array [ - 10, - 13, + 14, + 19, ], - "type": "Identifier", - "value": "set", + "type": "String", + "value": "\\"foo\\"", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 10, "line": 2, }, "start": Object { - "column": 7, + "column": 9, "line": 2, }, }, "range": Array [ - 13, - 14, + 19, + 20, ], "type": "Punctuator", "value": "(", @@ -117203,17 +125635,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 2, }, "start": Object { - "column": 8, + "column": 10, "line": 2, }, }, "range": Array [ - 14, - 15, + 20, + 21, ], "type": "Punctuator", "value": ")", @@ -117221,17 +125653,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, + "column": 13, "line": 2, }, "start": Object { - "column": 10, + "column": 12, "line": 2, }, }, "range": Array [ - 16, - 17, + 22, + 23, ], "type": "Punctuator", "value": "{", @@ -117239,35 +125671,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 14, "line": 3, }, "start": Object { - "column": 4, + "column": 8, "line": 3, }, }, "range": Array [ - 22, - 23, + 32, + 38, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, ], "type": "Punctuator", - "value": "}", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 4, }, "start": Object { - "column": 0, + "column": 4, "line": 4, }, }, "range": Array [ - 24, - 25, + 48, + 49, ], "type": "Punctuator", "value": "}", @@ -117275,35 +125743,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 1, + "line": 5, }, "start": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 5, }, }, "range": Array [ - 25, - 26, + 50, + 51, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 2, + "line": 5, }, "start": Object { - "column": 2, - "line": 4, + "column": 1, + "line": 5, }, }, "range": Array [ - 26, - 27, + 51, + 52, ], "type": "Punctuator", "value": ";", @@ -117313,201 +125781,387 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = ` +exports[`javascript fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": null, "loc": Object { "end": Object { - "column": 1, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 4, "line": 1, }, }, - "name": "x", "range": Array [ - 0, - 1, + 4, + 7, ], - "type": "Identifier", + "type": "VariableDeclarator", }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "get", + "range": Array [ + 13, + 16, + ], + "type": "Identifier", }, - "start": Object { - "column": 0, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, }, + "range": Array [ + 13, + 16, + ], + "type": "VariableDeclarator", }, - "operator": "=", - "range": Array [ - 0, - 33, - ], - "right": Object { + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "set", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "init": null, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 7, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 3, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "range": Array [ + 22, + 25, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 26, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "name": "x", + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "method": false, + "range": Array [ + 42, + 45, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 42, + 45, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 7, + "line": 7, }, "start": Object { "column": 4, - "line": 2, + "line": 7, }, }, - "name": "method", + "method": false, "range": Array [ - 10, - 16, + 51, + 54, ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "name": "get", + "range": Array [ + 51, + 54, + ], + "type": "Identifier", }, }, - "method": true, - "range": Array [ - 10, - 31, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 8, }, "start": Object { - "column": 17, - "line": 2, + "column": 4, + "line": 8, }, }, + "name": "set", "range": Array [ - 23, - 31, + 60, + 63, ], - "type": "BlockStatement", + "type": "Identifier", }, - "expression": false, - "generator": false, - "id": null, + "kind": "init", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 7, + "line": 8, }, "start": Object { - "column": 10, - "line": 2, + "column": 4, + "line": 8, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "name": "test", - "range": Array [ - 17, - 21, - ], - "type": "Identifier", - }, - ], + "method": false, "range": Array [ - 16, - 31, + 60, + 63, ], - "type": "FunctionExpression", + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "name": "set", + "range": Array [ + 60, + 63, + ], + "type": "Identifier", + }, }, + ], + "range": Array [ + 36, + 65, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 9, }, - ], + "start": Object { + "column": 4, + "line": 5, + }, + }, "range": Array [ - 4, - 33, + 32, + 65, ], - "type": "ObjectExpression", + "type": "VariableDeclarator", }, - "type": "AssignmentExpression", - }, + ], + "kind": "var", "loc": Object { "end": Object { "column": 2, - "line": 5, + "line": 9, }, "start": Object { "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 34, - ], - "type": "ExpressionStatement", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 2, "line": 5, }, }, "range": Array [ - 34, - 35, + 28, + 66, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 0, + "line": 10, }, "start": Object { "column": 0, @@ -117516,14 +126170,14 @@ Object { }, "range": Array [ 0, - 35, + 67, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 3, "line": 1, }, "start": Object { @@ -117533,51 +126187,51 @@ Object { }, "range": Array [ 0, - 1, + 3, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 7, "line": 1, }, "start": Object { - "column": 2, + "column": 4, "line": 1, }, }, "range": Array [ - 2, - 3, + 4, + 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { - "column": 4, + "column": 7, "line": 1, }, }, "range": Array [ - 4, - 5, + 7, + 8, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 2, }, "start": Object { @@ -117586,20 +126240,20 @@ Object { }, }, "range": Array [ - 10, + 13, 16, ], "type": "Identifier", - "value": "method", + "value": "get", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 8, "line": 2, }, "start": Object { - "column": 10, + "column": 7, "line": 2, }, }, @@ -117608,316 +126262,293 @@ Object { 17, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 11, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 17, - 21, + 22, + 25, ], "type": "Identifier", - "value": "test", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 15, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ - 21, - 22, + 25, + 26, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 3, + "line": 5, }, "start": Object { - "column": 17, - "line": 2, + "column": 0, + "line": 5, }, }, "range": Array [ - 23, - 24, + 28, + 31, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 4, + "line": 5, }, "start": Object { "column": 4, - "line": 4, + "line": 5, }, }, "range": Array [ - 30, - 31, + 32, + 33, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 7, "line": 5, }, "start": Object { - "column": 0, + "column": 6, "line": 5, }, }, "range": Array [ - 32, - 33, + 34, + 35, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 5, }, "start": Object { - "column": 1, + "column": 8, "line": 5, }, }, "range": Array [ - 33, - 34, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 7, + "line": 6, }, "start": Object { - "column": 2, - "line": 5, + "column": 4, + "line": 6, }, }, "range": Array [ - 34, - 35, + 42, + 45, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 7, + "line": 6, + }, + }, + "range": Array [ + 45, + 46, ], "type": "Punctuator", - "value": ";", + "value": ",", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 0, - 1, - ], - "type": "Identifier", + "loc": Object { + "end": Object { + "column": 7, + "line": 7, }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "start": Object { + "column": 4, + "line": 7, }, - "operator": "=", - "range": Array [ - 0, - 30, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 10, - 18, - ], - "raw": "\\"method\\"", - "type": "Literal", - "value": "method", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "method": true, - "range": Array [ - 10, - 28, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 21, - 28, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 18, - 28, - ], - "type": "FunctionExpression", - }, - }, - ], - "range": Array [ - 4, - 30, - ], - "type": "ObjectExpression", + }, + "range": Array [ + 51, + 54, + ], + "type": "Identifier", + "value": "get", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 7, + "line": 7, }, - "type": "AssignmentExpression", }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": ",", + }, + Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 7, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 8, }, }, "range": Array [ - 0, - 31, + 60, + 63, ], - "type": "ExpressionStatement", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 1, + "line": 9, }, "start": Object { + "column": 0, + "line": 9, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { "column": 2, - "line": 4, + "line": 9, + }, + "start": Object { + "column": 1, + "line": 9, }, }, "range": Array [ - 31, - 32, + 65, + 66, ], - "type": "EmptyStatement", + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; + +exports[`javascript fixtures/octalLiterals/lowercase.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0o717", + "type": "Literal", + "value": 463, + }, + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -117926,14 +126557,14 @@ Object { }, "range": Array [ 0, - 32, + 7, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -117943,187 +126574,292 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Identifier", - "value": "x", + "type": "Numeric", + "value": "0o717", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 6, "line": 1, }, "start": Object { - "column": 2, + "column": 5, "line": 1, }, }, "range": Array [ - 2, - 3, + 5, + 6, ], "type": "Punctuator", - "value": "=", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/octalLiterals/strict-uppercase.src 1`] = ` +Object { + "body": Array [ Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 12, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, "loc": Object { "end": Object { - "column": 5, + "column": 13, "line": 1, }, "start": Object { - "column": 4, + "column": 0, "line": 1, }, }, "range": Array [ - 4, - 5, + 0, + 13, ], - "type": "Punctuator", - "value": "{", + "type": "ExpressionStatement", }, Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 14, + 19, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, "loc": Object { "end": Object { - "column": 12, + "column": 6, "line": 2, }, "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, "range": Array [ - 10, - 18, + 14, + 20, ], - "type": "String", - "value": "\\"method\\"", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 12, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 18, - 19, + 0, + 12, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "\\"use strict\\"", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 13, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 12, + "line": 1, }, }, "range": Array [ - 19, - 20, + 12, + 13, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 5, "line": 2, }, "start": Object { - "column": 15, + "column": 0, "line": 2, }, }, "range": Array [ - 21, - 22, + 14, + 19, ], - "type": "Punctuator", - "value": "{", + "type": "Numeric", + "value": "0O717", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 6, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 5, + "line": 2, }, }, "range": Array [ - 27, - 28, + 19, + 20, ], "type": "Punctuator", - "value": "}", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/octalLiterals/uppercase.src 1`] = ` +Object { + "body": Array [ Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "raw": "0O717", + "type": "Literal", + "value": 463, + }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { "column": 0, - "line": 4, + "line": 1, }, }, "range": Array [ - 29, - 30, + 0, + 6, ], - "type": "Punctuator", - "value": "}", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 7, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 2, - "line": 4, + "column": 5, + "line": 1, }, "start": Object { - "column": 1, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 30, - 31, + 0, + 5, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "0O717", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 6, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 5, + "line": 1, }, }, "range": Array [ - 31, - 32, + 5, + 6, ], "type": "Punctuator", "value": ";", @@ -118133,7 +126869,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandMethods/string-name-method-property.src 1`] = ` +exports[`javascript fixtures/regex/regexp-simple.src 1`] = ` Object { "body": Array [ Object { @@ -118142,7 +126878,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -118150,152 +126886,40 @@ Object { "line": 1, }, }, - "name": "x", + "name": "foo", "range": Array [ 4, - 5, + 7, ], "type": "Identifier", }, "init": Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "raw": "\\"foo\\"", - "type": "Literal", - "value": "foo", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "method": true, - "range": Array [ - 14, - 49, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 32, - 43, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 19, - 49, - ], - "type": "FunctionExpression", - }, - }, - ], "range": Array [ - 8, - 51, + 10, + 16, ], - "type": "ObjectExpression", + "raw": "/foo./", + "regex": Object { + "flags": "", + "pattern": "foo.", + }, + "type": "Literal", + "value": Object {}, }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { "column": 4, @@ -118304,7 +126928,7 @@ Object { }, "range": Array [ 4, - 51, + 16, ], "type": "VariableDeclarator", }, @@ -118312,8 +126936,8 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 17, + "line": 1, }, "start": Object { "column": 0, @@ -118322,7 +126946,7 @@ Object { }, "range": Array [ 0, - 52, + 17, ], "type": "VariableDeclaration", }, @@ -118330,7 +126954,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 6, + "line": 2, }, "start": Object { "column": 0, @@ -118339,7 +126963,7 @@ Object { }, "range": Array [ 0, - 53, + 18, ], "sourceType": "script", "tokens": Array [ @@ -118364,7 +126988,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { @@ -118374,28 +126998,10 @@ Object { }, "range": Array [ 4, - 5, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, 7, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { @@ -118413,184 +127019,44 @@ Object { 9, ], "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "type": "String", - "value": "\\"foo\\"", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 16, + "line": 1, }, "start": Object { "column": 10, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "Keyword", - "value": "return", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 3, - }, - }, - "range": Array [ - 39, - 42, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, + "line": 1, }, }, "range": Array [ - 48, - 49, + 10, + 16, ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, + "regex": Object { + "flags": "", + "pattern": "foo.", }, - "range": Array [ - 50, - 51, - ], - "type": "Punctuator", - "value": "}", + "type": "RegularExpression", + "value": "/foo./", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 17, + "line": 1, }, "start": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 1, }, }, "range": Array [ - 51, - 52, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -118600,7 +127066,7 @@ Object { } `; -exports[`javascript fixtures/objectLiteralShorthandProperties/shorthand-properties.src 1`] = ` +exports[`javascript fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` Object { "body": Array [ Object { @@ -118609,7 +127075,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -118617,99 +127083,49 @@ Object { "line": 1, }, }, - "name": "foo", + "name": "x", "range": Array [ 4, - 7, + 5, ], "type": "Identifier", }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { + "init": Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 40, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, - "name": "get", "range": Array [ - 13, - 16, + 8, + 40, ], - "type": "Identifier", - }, - "init": null, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 13, - 16, - ], - "type": "VariableDeclarator", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, + "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", }, - "name": "set", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", + "type": "Literal", + "value": Object {}, }, - "init": null, "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 40, + "line": 1, }, "start": Object { "column": 4, - "line": 3, + "line": 1, }, }, "range": Array [ - 22, - 25, + 4, + 40, ], "type": "VariableDeclarator", }, @@ -118717,8 +127133,8 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 41, + "line": 1, }, "start": Object { "column": 0, @@ -118727,234 +127143,186 @@ Object { }, "range": Array [ 0, - 26, + 41, ], "type": "VariableDeclaration", }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 42, + ], + "sourceType": "script", + "tokens": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "name": "x", - "range": Array [ - 32, - 33, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "method": false, - "range": Array [ - 42, - 45, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 42, - 45, - ], - "type": "Identifier", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "method": false, - "range": Array [ - 51, - 54, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 4, - "line": 7, - }, - }, - "name": "get", - "range": Array [ - 51, - 54, - ], - "type": "Identifier", - }, + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 40, + ], + "regex": Object { + "flags": "u", + "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", + }, + "type": "RegularExpression", + "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": "set", - "range": Array [ - 60, - 63, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "method": false, - "range": Array [ - 60, - 63, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 8, - }, - "start": Object { - "column": 4, - "line": 8, - }, - }, - "name": "set", - "range": Array [ - 60, - 63, - ], - "type": "Identifier", - }, + "start": Object { + "column": 4, + "line": 1, }, + }, + "name": "x", + "range": Array [ + 4, + 5, ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, "range": Array [ - 36, - 65, + 8, + 21, ], - "type": "ObjectExpression", + "raw": "/\\\\u{110000}/u", + "regex": Object { + "flags": "u", + "pattern": "\\\\u{110000}", + }, + "type": "Literal", + "value": null, }, "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 21, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 65, + 4, + 21, ], "type": "VariableDeclarator", }, @@ -118962,17 +127330,17 @@ Object { "kind": "var", "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 22, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 66, + 0, + 22, ], "type": "VariableDeclaration", }, @@ -118980,7 +127348,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 2, }, "start": Object { "column": 0, @@ -118989,7 +127357,7 @@ Object { }, "range": Array [ 0, - 67, + 23, ], "sourceType": "script", "tokens": Array [ @@ -119014,7 +127382,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -119024,115 +127392,186 @@ Object { }, "range": Array [ 4, - 7, + 5, ], "type": "Identifier", - "value": "foo", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 7, "line": 1, }, "start": Object { - "column": 7, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 7, - 8, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, "range": Array [ - 13, - 16, + 8, + 21, ], - "type": "Identifier", - "value": "get", + "regex": Object { + "flags": "u", + "pattern": "\\\\u{110000}", + }, + "type": "RegularExpression", + "value": "/\\\\u{110000}/u", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 16, - 17, + 21, + 22, ], "type": "Punctuator", - "value": ",", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/regexUFlag/regex-u-simple.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo/u", + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 22, - 25, ], - "type": "Identifier", - "value": "set", - }, - Object { + "kind": "var", "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 17, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 25, - 26, + 0, + 17, ], - "type": "Punctuator", - "value": ";", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 3, - "line": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 28, - 31, + 0, + 3, ], "type": "Keyword", "value": "var", @@ -119140,35 +127579,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 7, + "line": 1, }, "start": Object { "column": 4, - "line": 5, + "line": 1, }, }, "range": Array [ - 32, - 33, + 4, + 7, ], "type": "Identifier", - "value": "x", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 6, - "line": 5, + "column": 8, + "line": 1, }, }, "range": Array [ - 34, - 35, + 8, + 9, ], "type": "Punctuator", "value": "=", @@ -119176,143 +127615,236 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 16, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 36, - 37, + 10, + 16, ], - "type": "Punctuator", - "value": "{", + "regex": Object { + "flags": "u", + "pattern": "foo", + }, + "type": "RegularExpression", + "value": "/foo/u", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 6, + "column": 17, + "line": 1, }, "start": Object { - "column": 4, - "line": 6, + "column": 16, + "line": 1, }, }, "range": Array [ - 42, - 45, + 16, + 17, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/regexYFlag/regexp-y-simple.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 16, + ], + "raw": "/foo/y", + "regex": Object { + "flags": "y", + "pattern": "foo", + }, + "type": "Literal", + "value": Object {}, + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 16, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 17, + "line": 1, }, "start": Object { - "column": 7, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 45, - 46, + 0, + 17, ], - "type": "Punctuator", - "value": ",", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 3, + "line": 1, }, "start": Object { - "column": 4, - "line": 7, + "column": 0, + "line": 1, }, }, "range": Array [ - 51, - 54, + 0, + 3, ], - "type": "Identifier", - "value": "get", + "type": "Keyword", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 7, + "line": 1, }, "start": Object { - "column": 7, - "line": 7, + "column": 4, + "line": 1, }, }, "range": Array [ - 54, - 55, + 4, + 7, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 9, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 8, + "line": 1, }, }, "range": Array [ - 60, - 63, + 8, + 9, ], - "type": "Identifier", - "value": "set", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 9, + "column": 16, + "line": 1, }, "start": Object { - "column": 0, - "line": 9, + "column": 10, + "line": 1, }, }, "range": Array [ - 64, - 65, + 10, + 16, ], - "type": "Punctuator", - "value": "}", + "regex": Object { + "flags": "y", + "pattern": "foo", + }, + "type": "RegularExpression", + "value": "/foo/y", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 9, + "column": 17, + "line": 1, }, "start": Object { - "column": 1, - "line": 9, + "column": 16, + "line": 1, }, }, "range": Array [ - 65, - 66, + 16, + 17, ], "type": "Punctuator", "value": ";", @@ -119322,34 +127854,52 @@ Object { } `; -exports[`javascript fixtures/octalLiterals/invalid.src 1`] = `"';' expected."`; - -exports[`javascript fixtures/octalLiterals/lowercase.src 1`] = ` +exports[`javascript fixtures/restParams/basic-rest.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 5, + "column": 22, "line": 1, }, "start": Object { - "column": 0, + "column": 20, "line": 1, }, }, "range": Array [ - 0, - 5, + 20, + 22, ], - "raw": "0o717", - "type": "Literal", - "value": 463, + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 6, + "column": 22, "line": 1, }, "start": Object { @@ -119357,17 +127907,89 @@ Object { "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 18, + ], + "type": "RestElement", + }, + ], "range": Array [ 0, - 6, + 22, ], - "type": "ExpressionStatement", + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { "column": 0, @@ -119376,14 +127998,14 @@ Object { }, "range": Array [ 0, - 7, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -119393,231 +128015,355 @@ Object { }, "range": Array [ 0, - 5, + 8, ], - "type": "Numeric", - "value": "0o717", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 10, "line": 1, }, "start": Object { - "column": 5, + "column": 9, "line": 1, }, }, "range": Array [ - 5, - 6, + 9, + 10, + ], + "type": "Identifier", + "value": "f", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/octalLiterals/strict-uppercase.src 1`] = ` -Object { - "body": Array [ Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, }, - "range": Array [ - 0, - 12, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", }, + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + "value": "a", + }, + Object { "loc": Object { "end": Object { "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, + 12, 13, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": ",", }, Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 14, - 19, - ], - "raw": "0O717", - "type": "Literal", - "value": 463, - }, "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ 14, - 20, + 17, ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 3, + "type": "Punctuator", + "value": "...", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "b", }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, + "column": 19, "line": 1, }, "start": Object { - "column": 0, + "column": 18, "line": 1, }, }, "range": Array [ - 0, - 12, + 18, + 19, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 21, "line": 1, }, "start": Object { - "column": 12, + "column": 20, "line": 1, }, }, "range": Array [ - 12, - 13, + 20, + 21, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 0, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 14, - 19, + 21, + 22, ], - "type": "Numeric", - "value": "0O717", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/restParams/class-constructor.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 41, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 2, + }, + }, + "range": Array [ + 34, + 41, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 25, + 41, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, + "range": Array [ + 8, + 43, + ], + "type": "ClassBody", }, - "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/octalLiterals/uppercase.src 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { + "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 0, + "column": 6, "line": 1, }, }, + "name": "A", "range": Array [ - 0, - 5, + 6, + 7, ], - "raw": "0O717", - "type": "Literal", - "value": 463, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -119626,15 +128372,16 @@ Object { }, "range": Array [ 0, - 6, + 43, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -119643,7 +128390,7 @@ Object { }, "range": Array [ 0, - 7, + 44, ], "sourceType": "script", "tokens": Array [ @@ -119662,162 +128409,113 @@ Object { 0, 5, ], - "type": "Numeric", - "value": "0O717", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "range": Array [ - 5, 6, + 7, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "A", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/regex/regexp-simple.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, - ], - "raw": "/foo./", - "regex": Object { - "flags": "", - "pattern": "foo.", - }, - "type": "Literal", - "value": Object {}, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 17, + "column": 9, "line": 1, }, "start": Object { - "column": 0, + "column": 8, "line": 1, }, }, "range": Array [ - 0, - 17, + 8, + 9, ], - "type": "VariableDeclaration", + "type": "Punctuator", + "value": "{", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 14, + 25, + ], + "type": "Identifier", + "value": "constructor", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "(", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 0, - 3, + 26, + 29, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 4, - 7, + 29, + 32, ], "type": "Identifier", "value": "foo", @@ -119825,135 +128523,239 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 8, - 9, + 32, + 33, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 10, - 16, + 34, + 35, ], - "regex": Object { - "flags": "", - "pattern": "foo.", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, }, - "type": "RegularExpression", - "value": "/foo./", + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 16, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 16, - 17, + 42, + 43, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/regexUFlag/regex-u-extended-escape.src 1`] = ` +exports[`javascript fixtures/restParams/class-method.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "kind": "method", "loc": Object { "end": Object { "column": 5, - "line": 1, + "line": 3, }, "start": Object { "column": 4, - "line": 1, + "line": 2, }, }, - "name": "x", "range": Array [ - 4, - 5, + 14, + 33, ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 8, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 2, + }, }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 18, + 24, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 17, + 33, + ], + "type": "FunctionExpression", }, - "range": Array [ - 8, - 40, - ], - "raw": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "Literal", - "value": Object {}, }, - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 1, }, - "range": Array [ - 4, - 40, - ], - "type": "VariableDeclarator", }, - ], - "kind": "var", + "range": Array [ + 8, + 35, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { "column": 0, @@ -119962,15 +128764,16 @@ Object { }, "range": Array [ 0, - 41, + 35, ], - "type": "VariableDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 5, }, "start": Object { "column": 0, @@ -119979,14 +128782,14 @@ Object { }, "range": Array [ 0, - 42, + 36, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -119996,375 +128799,297 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "range": Array [ - 6, - 7, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 8, - 40, + 14, + 17, ], - "regex": Object { - "flags": "u", - "pattern": "[\\\\u{0000000000000061}-\\\\u{7A}]", - }, - "type": "RegularExpression", - "value": "/[\\\\u{0000000000000061}-\\\\u{7A}]/u", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 40, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 40, - 41, + 17, + 18, ], "type": "Punctuator", - "value": ";", + "value": "(", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/regexUFlag/regex-u-invalid-extended-escape.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 5, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 21, - ], - "raw": "/\\\\u{110000}/u", - "regex": Object { - "flags": "u", - "pattern": "\\\\u{110000}", - }, - "type": "Literal", - "value": null, - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 21, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 0, - 22, + 18, + 21, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "...", }, - }, - "range": Array [ - 0, - 23, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 0, - 3, + 21, + 24, ], - "type": "Keyword", - "value": "var", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 4, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 4, - 5, + 24, + 25, ], - "type": "Identifier", - "value": "x", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 6, - 7, + 26, + 27, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 8, - 21, + 32, + 33, ], - "regex": Object { - "flags": "u", - "pattern": "\\\\u{110000}", - }, - "type": "RegularExpression", - "value": "/\\\\u{110000}/u", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 21, - 22, + 34, + 35, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`javascript fixtures/regexUFlag/regex-u-simple.src 1`] = ` +exports[`javascript fixtures/restParams/error-no-default.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ + "async": false, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", }, - "init": Object { + "name": "a", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 10, + "column": 17, "line": 1, }, }, + "name": "b", "range": Array [ - 10, - 16, + 17, + 18, ], - "raw": "/foo/u", - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "Literal", - "value": Object {}, + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 4, + "column": 14, "line": 1, }, }, "range": Array [ - 4, - 16, + 14, + 22, ], - "type": "VariableDeclarator", + "type": "RestElement", }, ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, "range": Array [ 0, - 17, + 24, ], - "type": "VariableDeclaration", + "type": "TSDeclareFunction", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { "column": 0, @@ -120373,14 +129098,14 @@ Object { }, "range": Array [ 0, - 18, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 8, "line": 1, }, "start": Object { @@ -120390,51 +129115,33 @@ Object { }, "range": Array [ 0, - 3, + 8, ], "type": "Keyword", - "value": "var", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { "column": 9, "line": 1, }, - "start": Object { - "column": 8, - "line": 1, - }, }, "range": Array [ - 8, 9, + 10, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 11, "line": 1, }, "start": Object { @@ -120444,186 +129151,97 @@ Object { }, "range": Array [ 10, - 16, + 11, ], - "regex": Object { - "flags": "u", - "pattern": "foo", - }, - "type": "RegularExpression", - "value": "/foo/u", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 12, "line": 1, }, "start": Object { - "column": 16, + "column": 11, "line": 1, }, }, "range": Array [ - 16, - 17, + 11, + 12, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "a", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/regexYFlag/regexp-y-simple.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 4, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 16, - ], - "raw": "/foo/y", - "regex": Object { - "flags": "y", - "pattern": "foo", - }, - "type": "Literal", - "value": Object {}, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 16, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, - 17, + 12, + 13, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 18, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 17, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, "range": Array [ - 0, - 3, + 14, + 17, ], - "type": "Keyword", - "value": "var", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 18, "line": 1, }, "start": Object { - "column": 4, + "column": 17, "line": 1, }, }, "range": Array [ - 4, - 7, + 17, + 18, ], "type": "Identifier", - "value": "foo", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 20, "line": 1, }, "start": Object { - "column": 8, + "column": 19, "line": 1, }, }, "range": Array [ - 8, - 9, + 19, + 20, ], "type": "Punctuator", "value": "=", @@ -120631,39 +129249,53 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 22, "line": 1, }, "start": Object { - "column": 10, + "column": 21, "line": 1, }, }, "range": Array [ - 10, - 16, + 21, + 22, ], - "regex": Object { - "flags": "y", - "pattern": "foo", + "type": "Numeric", + "value": "0", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, }, - "type": "RegularExpression", - "value": "/foo/y", + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 17, + "column": 24, "line": 1, }, "start": Object { - "column": 16, + "column": 23, "line": 1, }, }, "range": Array [ - 16, - 17, + 23, + 24, ], "type": "Punctuator", "value": ";", @@ -120673,29 +129305,11 @@ Object { } `; -exports[`javascript fixtures/restParams/basic-rest.src 1`] = ` +exports[`javascript fixtures/restParams/error-not-last.src 1`] = ` Object { "body": Array [ Object { "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 22, - ], - "type": "BlockStatement", - }, "expression": false, "generator": false, "id": Object { @@ -120718,7 +129332,7 @@ Object { }, "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 1, }, "start": Object { @@ -120780,29 +129394,30 @@ Object { ], "type": "RestElement", }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, ], "range": Array [ 0, - 22, - ], - "type": "FunctionDeclaration", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, 23, ], - "type": "EmptyStatement", + "type": "TSDeclareFunction", }, ], "loc": Object { @@ -120963,7 +129578,7 @@ Object { 19, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { @@ -120980,8 +129595,8 @@ Object { 20, 21, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { @@ -120999,7 +129614,7 @@ Object { 22, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { @@ -121024,165 +129639,500 @@ Object { } `; -exports[`javascript fixtures/restParams/class-constructor.src 1`] = ` +exports[`javascript fixtures/restParams/func-expression.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 22, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 8, + 26, + ], + "type": "FunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 26, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Punctuator", + "value": "...", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/restParams/func-expression-multi.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 26, + "line": 1, }, }, - "name": "constructor", "range": Array [ - 14, - 25, + 26, + 28, ], - "type": "Identifier", + "type": "BlockStatement", }, - "kind": "constructor", + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 8, + "line": 1, }, }, - "range": Array [ - 14, - 41, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 17, + "line": 1, }, }, + "name": "a", "range": Array [ - 34, - 41, + 17, + 18, ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 2, - }, + "type": "Identifier", }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 19, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 29, - 32, - ], - "type": "Identifier", - }, + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 23, + "line": 1, }, }, + "name": "b", "range": Array [ - 26, - 32, + 23, + 24, ], - "type": "RestElement", + "type": "Identifier", }, - ], - "range": Array [ - 25, - 41, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 43, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 24, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 8, + 28, + ], + "type": "FunctionExpression", }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 28, + ], + "type": "VariableDeclarator", }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 29, + "line": 1, }, "start": Object { "column": 0, @@ -121191,16 +130141,15 @@ Object { }, "range": Array [ 0, - 43, + 29, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 29, + "line": 1, }, "start": Object { "column": 0, @@ -121209,14 +130158,14 @@ Object { }, "range": Array [ 0, - 44, + 29, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -121226,10 +130175,28 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "class", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "range": Array [ + 4, + 5, + ], + "type": "Identifier", + "value": "x", }, Object { "loc": Object { @@ -121246,13 +130213,13 @@ Object { 6, 7, ], - "type": "Identifier", - "value": "A", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { @@ -121262,61 +130229,79 @@ Object { }, "range": Array [ 8, - 9, + 16, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 18, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 14, - 25, + 17, + 18, ], "type": "Identifier", - "value": "constructor", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 15, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 25, - 26, + 18, + 19, ], "type": "Punctuator", - "value": "(", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 26, - 29, + 20, + 23, ], "type": "Punctuator", "value": "...", @@ -121324,35 +130309,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 24, + "line": 1, }, "start": Object { - "column": 19, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 29, - 32, + 23, + 24, ], "type": "Identifier", - "value": "foo", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 25, + "line": 1, }, "start": Object { - "column": 22, - "line": 2, + "column": 24, + "line": 1, }, }, "range": Array [ - 32, - 33, + 24, + 25, ], "type": "Punctuator", "value": ")", @@ -121360,17 +130345,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 27, + "line": 1, }, "start": Object { - "column": 24, - "line": 2, + "column": 26, + "line": 1, }, }, "range": Array [ - 34, - 35, + 26, + 27, ], "type": "Punctuator", "value": "{", @@ -121378,17 +130363,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 27, + "line": 1, }, }, "range": Array [ - 40, - 41, + 27, + 28, ], "type": "Punctuator", "value": "}", @@ -121396,203 +130381,202 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 29, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 28, + "line": 1, }, }, "range": Array [ - 42, - 43, + 28, + 29, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/restParams/class-method.src 1`] = ` +exports[`javascript fixtures/restParams/invalid-rest-param.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "kind": "method", + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "argument": Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 19, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 14, + "line": 1, }, }, - "range": Array [ - 14, - 33, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 26, - 33, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, - "name": "bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 16, + 17, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 17, + "line": 1, }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 16, + 17, + ], + "shorthand": true, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 16, + "line": 1, }, }, + "name": "a", "range": Array [ - 18, - 24, + 16, + 17, ], - "type": "RestElement", + "type": "Identifier", }, - ], - "range": Array [ - 17, - 33, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 35, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, + }, + ], + "range": Array [ + 14, + 19, + ], + "type": "ObjectPattern", }, - "start": Object { - "column": 6, - "line": 1, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, }, + "range": Array [ + 11, + 19, + ], + "type": "RestElement", }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, + ], + "range": Array [ + 0, + 22, + ], + "type": "FunctionDeclaration", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 23, + "line": 1, }, "start": Object { - "column": 0, + "column": 22, "line": 1, }, }, "range": Array [ - 0, - 35, + 22, + 23, ], - "superClass": null, - "type": "ClassDeclaration", + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 23, + "line": 1, }, "start": Object { "column": 0, @@ -121601,14 +130585,14 @@ Object { }, "range": Array [ 0, - 36, + 23, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 8, "line": 1, }, "start": Object { @@ -121618,133 +130602,133 @@ Object { }, "range": Array [ 0, - 5, + 8, ], "type": "Keyword", - "value": "class", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 1, }, "start": Object { - "column": 6, + "column": 9, "line": 1, }, }, "range": Array [ - 6, - 7, + 9, + 10, ], "type": "Identifier", - "value": "A", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 11, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 9, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 14, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ + 11, 14, - 17, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 15, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 14, + "line": 1, }, }, "range": Array [ - 17, - 18, + 14, + 15, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 17, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 16, + "line": 1, }, }, "range": Array [ - 18, - 21, + 16, + 17, ], - "type": "Punctuator", - "value": "...", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 21, - 24, + 18, + 19, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 19, + "line": 1, }, }, "range": Array [ - 24, - 25, + 19, + 20, ], "type": "Punctuator", "value": ")", @@ -121752,17 +130736,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 26, - 27, + 20, + 21, ], "type": "Punctuator", "value": "{", @@ -121770,17 +130754,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 32, - 33, + 21, + 22, ], "type": "Punctuator", "value": "}", @@ -121788,31 +130772,49 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 23, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 22, + "line": 1, }, }, "range": Array [ - 34, - 35, + 22, + 23, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`javascript fixtures/restParams/error-no-default.src 1`] = ` +exports[`javascript fixtures/restParams/single-rest.src 1`] = ` Object { "body": Array [ Object { "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "BlockStatement", + }, "expression": false, "generator": false, "id": Object { @@ -121835,7 +130837,7 @@ Object { }, "loc": Object { "end": Object { - "column": 24, + "column": 19, "line": 1, }, "start": Object { @@ -121844,70 +130846,69 @@ Object { }, }, "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, Object { "argument": Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 17, + "column": 14, "line": 1, }, }, "name": "b", "range": Array [ - 17, - 18, + 14, + 15, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 22, + "column": 15, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, "range": Array [ - 14, - 22, + 11, + 15, ], "type": "RestElement", }, ], "range": Array [ 0, - 24, + 19, ], - "type": "TSDeclareFunction", + "type": "FunctionDeclaration", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "EmptyStatement", }, ], "loc": Object { "end": Object { - "column": 24, + "column": 20, "line": 1, }, "start": Object { @@ -121917,7 +130918,7 @@ Object { }, "range": Array [ 0, - 24, + 20, ], "sourceType": "script", "tokens": Array [ @@ -121978,7 +130979,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, + "column": 14, "line": 1, }, "start": Object { @@ -121988,43 +130989,7 @@ Object { }, "range": Array [ 11, - 12, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "range": Array [ - 12, - 13, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ 14, - 17, ], "type": "Punctuator", "value": "...", @@ -122032,17 +130997,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 17, + "column": 14, "line": 1, }, }, "range": Array [ - 17, - 18, + 14, + 15, ], "type": "Identifier", "value": "b", @@ -122050,71 +131015,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 16, "line": 1, }, "start": Object { - "column": 19, + "column": 15, "line": 1, }, }, "range": Array [ - 19, - 20, + 15, + 16, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 18, "line": 1, }, "start": Object { - "column": 21, + "column": 17, "line": 1, }, }, "range": Array [ - 21, - 22, + 17, + 18, ], - "type": "Numeric", - "value": "0", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 19, "line": 1, }, "start": Object { - "column": 22, + "column": 18, "line": 1, }, }, "range": Array [ - 22, - 23, + 18, + 19, ], "type": "Punctuator", - "value": ")", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 20, "line": 1, }, "start": Object { - "column": 23, + "column": 19, "line": 1, }, }, "range": Array [ - 23, - 24, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -122124,125 +131089,88 @@ Object { } `; -exports[`javascript fixtures/restParams/error-not-last.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-float.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "f", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", - }, + "declarations": Array [ Object { - "argument": Object { + "id": Object { "loc": Object { "end": Object { - "column": 18, + "column": 7, "line": 1, }, "start": Object { - "column": 17, + "column": 6, "line": 1, }, }, - "name": "b", + "name": "a", "range": Array [ - 17, - 18, + 6, + 7, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "range": Array [ + 10, + 13, + ], + "raw": "1.5", + "type": "Literal", + "value": 1.5, }, - "range": Array [ - 14, - 18, - ], - "type": "RestElement", - }, - Object { "loc": Object { "end": Object { - "column": 21, + "column": 13, "line": 1, }, "start": Object { - "column": 20, + "column": 6, "line": 1, }, }, - "name": "c", "range": Array [ - 20, - 21, + 6, + 13, ], - "type": "Identifier", + "type": "VariableDeclarator", }, ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, "range": Array [ 0, - 23, + 14, ], - "type": "TSDeclareFunction", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -122251,14 +131179,14 @@ Object { }, "range": Array [ 0, - 23, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -122268,187 +131196,305 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 10, + 6, + 7, ], "type": "Identifier", - "value": "f", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 10, "line": 1, }, }, "range": Array [ - 11, - 12, + 10, + 13, ], - "type": "Identifier", - "value": "a", + "type": "Numeric", + "value": "1.5", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 12, + "column": 13, "line": 1, }, }, "range": Array [ - 12, 13, + 14, ], "type": "Punctuator", - "value": ",", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/simple-literals/literal-float-negative.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 14, + ], + "raw": "1.5", + "type": "Literal", + "value": 1.5, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "operator": "-", + "prefix": true, + "range": Array [ + 10, + 14, + ], + "type": "UnaryExpression", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 14, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 15, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 16, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, + "column": 5, "line": 1, }, "start": Object { - "column": 14, + "column": 0, "line": 1, }, }, "range": Array [ - 14, - 17, + 0, + 5, ], - "type": "Punctuator", - "value": "...", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 7, "line": 1, }, "start": Object { - "column": 17, + "column": 6, "line": 1, }, }, "range": Array [ - 17, - 18, + 6, + 7, ], "type": "Identifier", - "value": "b", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 9, "line": 1, }, "start": Object { - "column": 18, + "column": 8, "line": 1, }, }, "range": Array [ - 18, - 19, + 8, + 9, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 11, "line": 1, }, "start": Object { - "column": 20, + "column": 10, "line": 1, }, }, "range": Array [ - 20, - 21, + 10, + 11, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": "-", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 14, "line": 1, }, "start": Object { - "column": 21, + "column": 11, "line": 1, }, }, "range": Array [ - 21, - 22, + 11, + 14, ], - "type": "Punctuator", - "value": ")", + "type": "Numeric", + "value": "1.5", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 15, "line": 1, }, "start": Object { - "column": 22, + "column": 14, "line": 1, }, }, "range": Array [ - 22, - 23, + 14, + 15, ], "type": "Punctuator", "value": ";", @@ -122458,7 +131504,7 @@ Object { } `; -exports[`javascript fixtures/restParams/func-expression.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-null.src 1`] = ` Object { "body": Array [ Object { @@ -122467,118 +131513,61 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", }, "init": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 26, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 26, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 22, - ], - "type": "RestElement", - }, - ], "range": Array [ - 8, - 26, + 10, + 14, ], - "type": "FunctionExpression", + "raw": "null", + "type": "Literal", + "value": null, }, "loc": Object { "end": Object { - "column": 26, + "column": 14, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 26, + 6, + 14, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 27, + "column": 15, "line": 1, }, "start": Object { @@ -122588,15 +131577,15 @@ Object { }, "range": Array [ 0, - 27, + 15, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -122605,14 +131594,14 @@ Object { }, "range": Array [ 0, - 27, + 16, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -122622,43 +131611,43 @@ Object { }, "range": Array [ 0, - 3, + 5, ], "type": "Keyword", - "value": "var", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 8, "line": 1, }, }, "range": Array [ - 6, - 7, + 8, + 9, ], "type": "Punctuator", "value": "=", @@ -122666,143 +131655,224 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, "range": Array [ - 8, - 16, + 10, + 14, ], "type": "Keyword", - "value": "function", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 17, + "column": 14, "line": 1, }, }, "range": Array [ - 17, - 18, + 14, + 15, ], "type": "Punctuator", - "value": "(", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/simple-literals/literal-number.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 11, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 21, + "column": 12, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 21, + 0, + 12, ], - "type": "Punctuator", - "value": "...", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 13, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 5, "line": 1, }, "start": Object { - "column": 21, + "column": 0, "line": 1, }, }, "range": Array [ - 21, - 22, + 0, + 5, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 7, "line": 1, }, "start": Object { - "column": 22, + "column": 6, "line": 1, }, }, "range": Array [ - 22, - 23, + 6, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 9, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, "range": Array [ - 24, - 25, + 8, + 9, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 11, "line": 1, }, "start": Object { - "column": 25, + "column": 10, "line": 1, }, }, "range": Array [ - 25, - 26, + 10, + 11, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 12, "line": 1, }, "start": Object { - "column": 26, + "column": 11, "line": 1, }, }, "range": Array [ - 26, - 27, + 11, + 12, ], "type": "Punctuator", "value": ";", @@ -122812,7 +131882,7 @@ Object { } `; -exports[`javascript fixtures/restParams/func-expression-multi.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-number-negative.src 1`] = ` Object { "body": Array [ Object { @@ -122821,136 +131891,80 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 5, + "column": 7, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, - "name": "x", + "name": "a", "range": Array [ - 4, - 5, + 6, + 7, ], "type": "Identifier", }, "init": Object { - "async": false, - "body": Object { - "body": Array [], + "argument": Object { "loc": Object { "end": Object { - "column": 28, + "column": 12, "line": 1, }, "start": Object { - "column": 26, + "column": 11, "line": 1, }, }, "range": Array [ - 26, - 28, + 11, + 12, ], - "type": "BlockStatement", + "raw": "1", + "type": "Literal", + "value": 1, }, - "expression": false, - "generator": false, - "id": null, "loc": Object { "end": Object { - "column": 28, + "column": 12, "line": 1, }, "start": Object { - "column": 8, + "column": 10, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 17, - 18, - ], - "type": "Identifier", - }, - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 24, - ], - "type": "RestElement", - }, - ], + "operator": "-", + "prefix": true, "range": Array [ - 8, - 28, + 10, + 12, ], - "type": "FunctionExpression", + "type": "UnaryExpression", }, "loc": Object { "end": Object { - "column": 28, + "column": 12, "line": 1, }, "start": Object { - "column": 4, + "column": 6, "line": 1, }, }, "range": Array [ - 4, - 28, + 6, + 12, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "const", "loc": Object { "end": Object { - "column": 29, + "column": 13, "line": 1, }, "start": Object { @@ -122960,15 +131974,15 @@ Object { }, "range": Array [ 0, - 29, + 13, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -122977,14 +131991,14 @@ Object { }, "range": Array [ 0, - 29, + 14, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 1, }, "start": Object { @@ -122994,28 +132008,10 @@ Object { }, "range": Array [ 0, - 3, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, 5, ], - "type": "Identifier", - "value": "x", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { @@ -123032,185 +132028,77 @@ Object { 6, 7, ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 16, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "range": Array [ - 16, - 17, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 18, - ], "type": "Identifier", "value": "a", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 23, - ], - "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, + "column": 9, "line": 1, }, "start": Object { - "column": 24, + "column": 8, "line": 1, }, }, "range": Array [ - 24, - 25, + 8, + 9, ], "type": "Punctuator", - "value": ")", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 11, "line": 1, }, "start": Object { - "column": 26, + "column": 10, "line": 1, }, }, "range": Array [ - 26, - 27, + 10, + 11, ], "type": "Punctuator", - "value": "{", + "value": "-", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 12, "line": 1, }, "start": Object { - "column": 27, + "column": 11, "line": 1, }, }, "range": Array [ - 27, - 28, + 11, + 12, ], - "type": "Punctuator", - "value": "}", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 13, "line": 1, }, "start": Object { - "column": 28, + "column": 12, "line": 1, }, }, "range": Array [ - 28, - 29, + 12, + 13, ], "type": "Punctuator", "value": ";", @@ -123220,182 +132108,88 @@ Object { } `; -exports[`javascript fixtures/restParams/invalid-rest-param.src 1`] = ` +exports[`javascript fixtures/simple-literals/literal-string.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 22, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ + "declarations": Array [ Object { - "argument": Object { + "id": Object { "loc": Object { "end": Object { - "column": 19, + "column": 7, "line": 1, }, "start": Object { - "column": 14, + "column": 6, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 16, - 17, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 16, - 17, - ], - "type": "Identifier", - }, - }, + "name": "a", + "range": Array [ + 6, + 7, ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, "range": Array [ - 14, - 19, + 10, + 13, ], - "type": "ObjectPattern", + "raw": "'a'", + "type": "Literal", + "value": "a", }, "loc": Object { "end": Object { - "column": 19, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 6, "line": 1, }, }, "range": Array [ - 11, - 19, + 6, + 13, ], - "type": "RestElement", + "type": "VariableDeclarator", }, ], - "range": Array [ - 0, - 22, - ], - "type": "FunctionDeclaration", - }, - Object { + "kind": "const", "loc": Object { "end": Object { - "column": 23, + "column": 14, "line": 1, }, "start": Object { - "column": 22, + "column": 0, "line": 1, }, }, "range": Array [ - 22, - 23, + 0, + 14, ], - "type": "EmptyStatement", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 23, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -123404,14 +132198,14 @@ Object { }, "range": Array [ 0, - 23, + 15, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -123421,187 +132215,267 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 10, + 6, + 7, ], "type": "Identifier", - "value": "x", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 13, "line": 1, }, "start": Object { - "column": 11, + "column": 10, "line": 1, }, }, "range": Array [ - 11, - 14, + 10, + 13, ], - "type": "Punctuator", - "value": "...", + "type": "String", + "value": "'a'", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 14, "line": 1, }, "start": Object { - "column": 14, + "column": 13, "line": 1, }, }, "range": Array [ + 13, 14, - 15, ], "type": "Punctuator", - "value": "{", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`javascript fixtures/simple-literals/literal-undefined.src 1`] = ` +Object { + "body": Array [ Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "undefined", + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 19, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", "loc": Object { "end": Object { - "column": 17, + "column": 20, "line": 1, }, "start": Object { - "column": 16, + "column": 0, "line": 1, }, }, "range": Array [ - 16, - 17, + 0, + 20, ], - "type": "Identifier", - "value": "a", + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 21, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 19, + "column": 5, "line": 1, }, "start": Object { - "column": 18, + "column": 0, "line": 1, }, }, "range": Array [ - 18, - 19, + 0, + 5, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 7, "line": 1, }, "start": Object { - "column": 19, + "column": 6, "line": 1, }, }, "range": Array [ - 19, - 20, + 6, + 7, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 9, "line": 1, }, "start": Object { - "column": 20, + "column": 8, "line": 1, }, }, "range": Array [ - 20, - 21, + 8, + 9, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 19, "line": 1, }, "start": Object { - "column": 21, + "column": 10, "line": 1, }, }, "range": Array [ - 21, - 22, + 10, + 19, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "undefined", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 20, "line": 1, }, "start": Object { - "column": 22, + "column": 19, "line": 1, }, }, "range": Array [ - 22, - 23, + 19, + 20, ], "type": "Punctuator", "value": ";", @@ -123611,124 +132485,718 @@ Object { } `; -exports[`javascript fixtures/restParams/single-rest.src 1`] = ` +exports[`javascript fixtures/spread/complex-spread.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 102, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 2, + 3, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 2, + 22, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "ka", + "range": Array [ + 7, + 9, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 7, + 9, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "ka", + "range": Array [ + 7, + 9, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "nested", + "range": Array [ + 14, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 20, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 5, + 22, + ], + "type": "ObjectPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 24, + 32, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "other", + "range": Array [ + 27, + 32, + ], + "type": "Identifier", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "name": "f", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 92, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 34, + 92, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 92, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 39, + 40, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 39, + 64, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "properties": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 48, + "line": 1, + }, + }, + "name": "nested2", + "range": Array [ + 48, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 55, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 43, + 57, + ], + "type": "ObjectExpression", + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "name": "y", + "range": Array [ + 62, + 63, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 59, + "line": 1, + }, + }, + "range": Array [ + 59, + 63, + ], + "type": "SpreadElement", + }, + ], + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 64, + ], + "type": "ArrayPattern", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 67, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "name": "b", + "range": Array [ + 66, + 67, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 66, + 80, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 69, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 71, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 71, + 72, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 71, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 71, + 72, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 72, + "line": 1, + }, + "start": Object { + "column": 71, + "line": 1, + }, + }, + "name": "z", + "range": Array [ + 71, + 72, + ], + "type": "Identifier", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 78, + "line": 1, + }, + "start": Object { + "column": 77, + "line": 1, + }, + }, + "name": "c", + "range": Array [ + 77, + 78, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 78, + "line": 1, + }, + "start": Object { + "column": 74, + "line": 1, + }, + }, + "range": Array [ + 74, + 78, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 69, + 80, + ], + "type": "ObjectExpression", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 90, + "line": 1, + }, + "start": Object { + "column": 85, + "line": 1, + }, + }, + "name": "rest2", + "range": Array [ + 85, + 90, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 90, + "line": 1, + }, + "start": Object { + "column": 82, + "line": 1, + }, + }, + "range": Array [ + 82, + 90, + ], + "type": "SpreadElement", + }, + ], + "range": Array [ + 37, + 92, + ], + "type": "ObjectExpression", + }, + }, + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 101, + "line": 1, + }, + "start": Object { + "column": 97, + "line": 1, + }, + }, + "name": "rest", + "range": Array [ + 97, + 101, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 101, + "line": 1, + }, + "start": Object { + "column": 94, + "line": 1, + }, + }, + "range": Array [ + 94, + 101, + ], + "type": "RestElement", + }, + ], + "range": Array [ + 1, + 102, + ], + "type": "ObjectPattern", }, - "range": Array [ - 17, - 19, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 112, "line": 1, }, "start": Object { - "column": 9, + "column": 1, "line": 1, }, }, - "name": "f", + "operator": "=", "range": Array [ - 9, - 10, + 1, + 112, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "b", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, + "right": Object { "loc": Object { "end": Object { - "column": 15, + "column": 112, "line": 1, }, "start": Object { - "column": 11, + "column": 105, "line": 1, }, }, + "name": "complex", "range": Array [ - 11, - 15, + 105, + 112, ], - "type": "RestElement", + "type": "Identifier", }, - ], - "range": Array [ - 0, - 19, - ], - "type": "FunctionDeclaration", - }, - Object { + "type": "AssignmentExpression", + }, "loc": Object { "end": Object { - "column": 20, + "column": 114, "line": 1, }, "start": Object { - "column": 19, + "column": 0, "line": 1, }, }, "range": Array [ - 19, - 20, + 0, + 114, ], - "type": "EmptyStatement", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -123737,14 +133205,14 @@ Object { }, "range": Array [ 0, - 20, + 115, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 1, }, "start": Object { @@ -123754,43 +133222,7 @@ Object { }, "range": Array [ 0, - 8, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - "value": "f", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, + 1, ], "type": "Punctuator", "value": "(", @@ -123798,71 +133230,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, - ], - "type": "Punctuator", - "value": "...", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, + "column": 2, "line": 1, }, "start": Object { - "column": 17, + "column": 1, "line": 1, }, }, "range": Array [ - 17, - 18, + 1, + 2, ], "type": "Punctuator", "value": "{", @@ -123870,1431 +133248,863 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 19, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, + "column": 3, "line": 1, }, "start": Object { - "column": 19, + "column": 2, "line": 1, }, }, "range": Array [ - 19, - 20, - ], - "type": "Punctuator", - "value": ";", - }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/simple-literals/literal-float.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 13, - ], - "raw": "1.5", - "type": "Literal", - "value": 1.5, - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 13, - ], - "type": "VariableDeclarator", - }, + 2, + 3, ], - "kind": "const", + "type": "Identifier", + "value": "x", + }, + Object { "loc": Object { "end": Object { - "column": 14, + "column": 4, "line": 1, }, "start": Object { - "column": 0, + "column": 3, "line": 1, }, }, "range": Array [ - 0, - 14, + 3, + 4, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ":", }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 1, }, "start": Object { - "column": 0, + "column": 5, "line": 1, }, }, "range": Array [ - 0, 5, + 6, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 1, }, "start": Object { - "column": 6, + "column": 7, "line": 1, }, }, "range": Array [ - 6, 7, + 9, ], "type": "Identifier", - "value": "a", + "value": "ka", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 10, "line": 1, }, "start": Object { - "column": 8, + "column": 9, "line": 1, }, }, "range": Array [ - 8, 9, + 10, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 14, "line": 1, }, "start": Object { - "column": 10, + "column": 11, "line": 1, }, }, "range": Array [ - 10, - 13, + 11, + 14, ], - "type": "Numeric", - "value": "1.5", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 14, "line": 1, }, }, "range": Array [ - 13, 14, + 20, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "nested", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/simple-literals/literal-float-negative.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 14, - ], - "raw": "1.5", - "type": "Literal", - "value": 1.5, - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "operator": "-", - "prefix": true, - "range": Array [ - 10, - 14, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, }, + }, + "range": Array [ + 21, + 22, ], - "kind": "const", + "type": "Punctuator", + "value": "}", + }, + Object { "loc": Object { "end": Object { - "column": 15, + "column": 23, "line": 1, }, "start": Object { - "column": 0, + "column": 22, "line": 1, }, }, "range": Array [ - 0, - 15, + 22, + 23, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, + "type": "Punctuator", + "value": ",", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Identifier", + "value": "y", }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 26, "line": 1, }, "start": Object { - "column": 0, + "column": 25, "line": 1, }, }, "range": Array [ - 0, - 5, + 25, + 26, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 32, "line": 1, }, "start": Object { - "column": 6, + "column": 27, "line": 1, }, }, "range": Array [ - 6, - 7, + 27, + 32, ], "type": "Identifier", - "value": "a", + "value": "other", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 33, "line": 1, }, "start": Object { - "column": 8, + "column": 32, "line": 1, }, }, "range": Array [ - 8, - 9, + 32, + 33, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 35, "line": 1, }, "start": Object { - "column": 10, + "column": 34, "line": 1, }, }, "range": Array [ - 10, - 11, + 34, + 35, ], - "type": "Punctuator", - "value": "-", + "type": "Identifier", + "value": "f", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 36, "line": 1, }, "start": Object { - "column": 11, + "column": 35, "line": 1, }, }, "range": Array [ - 11, - 14, + 35, + 36, ], - "type": "Numeric", - "value": "1.5", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 38, "line": 1, }, "start": Object { - "column": 14, + "column": 37, "line": 1, }, }, "range": Array [ - 14, - 15, + 37, + 38, ], "type": "Punctuator", - "value": ";", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/simple-literals/literal-null.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 14, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 14, - ], - "type": "VariableDeclarator", + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, }, + }, + "range": Array [ + 39, + 40, ], - "kind": "const", + "type": "Identifier", + "value": "a", + }, + Object { "loc": Object { "end": Object { - "column": 15, + "column": 41, "line": 1, }, "start": Object { - "column": 0, + "column": 40, "line": 1, }, }, "range": Array [ - 0, - 15, + 40, + 41, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ":", }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 43, "line": 1, }, "start": Object { - "column": 0, + "column": 42, "line": 1, }, }, "range": Array [ - 0, - 5, + 42, + 43, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 44, "line": 1, }, "start": Object { - "column": 6, + "column": 43, "line": 1, }, }, "range": Array [ - 6, - 7, + 43, + 44, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 48, "line": 1, }, "start": Object { - "column": 8, + "column": 45, "line": 1, }, }, "range": Array [ - 8, - 9, + 45, + 48, ], "type": "Punctuator", - "value": "=", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 55, "line": 1, }, "start": Object { - "column": 10, + "column": 48, "line": 1, }, }, "range": Array [ - 10, - 14, + 48, + 55, ], - "type": "Keyword", - "value": "null", + "type": "Identifier", + "value": "nested2", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 57, "line": 1, }, "start": Object { - "column": 14, + "column": 56, "line": 1, }, }, "range": Array [ - 14, - 15, + 56, + 57, ], "type": "Punctuator", - "value": ";", + "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/simple-literals/literal-number.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 11, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 12, + "column": 58, "line": 1, }, "start": Object { - "column": 0, + "column": 57, "line": 1, }, }, "range": Array [ - 0, - 12, + 57, + 58, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 13, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 62, "line": 1, }, "start": Object { - "column": 0, + "column": 59, "line": 1, }, }, "range": Array [ - 0, - 5, + 59, + 62, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 63, "line": 1, }, "start": Object { - "column": 6, + "column": 62, "line": 1, }, }, "range": Array [ - 6, - 7, + 62, + 63, ], "type": "Identifier", - "value": "a", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 64, "line": 1, }, "start": Object { - "column": 8, + "column": 63, "line": 1, }, }, "range": Array [ - 8, - 9, + 63, + 64, ], "type": "Punctuator", - "value": "=", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 65, "line": 1, }, "start": Object { - "column": 10, + "column": 64, "line": 1, }, }, "range": Array [ - 10, - 11, + 64, + 65, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 67, "line": 1, }, "start": Object { - "column": 11, + "column": 66, "line": 1, }, }, "range": Array [ - 11, - 12, + 66, + 67, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "b", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/simple-literals/literal-number-negative.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 12, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "operator": "-", - "prefix": true, - "range": Array [ - 10, - 12, - ], - "type": "UnaryExpression", - }, - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 12, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 13, + "column": 68, "line": 1, }, "start": Object { - "column": 0, + "column": 67, "line": 1, }, }, "range": Array [ - 0, - 13, + 67, + 68, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ":", }, - }, - "range": Array [ - 0, - 14, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 70, "line": 1, }, "start": Object { - "column": 0, + "column": 69, "line": 1, }, }, "range": Array [ - 0, - 5, + 69, + 70, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 72, "line": 1, }, "start": Object { - "column": 6, + "column": 71, "line": 1, }, }, "range": Array [ - 6, - 7, + 71, + 72, ], "type": "Identifier", - "value": "a", + "value": "z", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 73, "line": 1, }, "start": Object { - "column": 8, + "column": 72, "line": 1, }, }, "range": Array [ - 8, - 9, + 72, + 73, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 77, "line": 1, }, "start": Object { - "column": 10, + "column": 74, "line": 1, }, }, "range": Array [ - 10, - 11, + 74, + 77, ], "type": "Punctuator", - "value": "-", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 78, "line": 1, }, "start": Object { - "column": 11, + "column": 77, "line": 1, }, }, "range": Array [ - 11, - 12, + 77, + 78, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 80, "line": 1, }, "start": Object { - "column": 12, + "column": 79, "line": 1, }, }, "range": Array [ - 12, - 13, + 79, + 80, ], "type": "Punctuator", - "value": ";", + "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/simple-literals/literal-string.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 13, - ], - "raw": "'a'", - "type": "Literal", - "value": "a", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 13, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 14, + "column": 81, "line": 1, }, "start": Object { - "column": 0, + "column": 80, "line": 1, }, }, "range": Array [ - 0, - 14, + 80, + 81, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 15, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 85, "line": 1, }, "start": Object { - "column": 0, + "column": 82, "line": 1, }, }, "range": Array [ - 0, - 5, + 82, + 85, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "...", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 90, "line": 1, }, "start": Object { - "column": 6, + "column": 85, "line": 1, }, }, "range": Array [ - 6, - 7, + 85, + 90, ], "type": "Identifier", - "value": "a", + "value": "rest2", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 92, "line": 1, }, "start": Object { - "column": 8, + "column": 91, "line": 1, }, }, "range": Array [ - 8, - 9, + 91, + 92, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 93, "line": 1, }, "start": Object { - "column": 10, + "column": 92, "line": 1, }, }, "range": Array [ - 10, - 13, + 92, + 93, ], - "type": "String", - "value": "'a'", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 97, "line": 1, }, "start": Object { - "column": 13, + "column": 94, "line": 1, }, }, "range": Array [ - 13, - 14, + 94, + 97, ], "type": "Punctuator", - "value": ";", + "value": "...", }, - ], - "type": "Program", -} -`; - -exports[`javascript fixtures/simple-literals/literal-undefined.src 1`] = ` -Object { - "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "undefined", - "range": Array [ - 10, - 19, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 19, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", "loc": Object { "end": Object { - "column": 20, + "column": 101, "line": 1, }, "start": Object { - "column": 0, + "column": 97, "line": 1, }, }, "range": Array [ - 0, - 20, + 97, + 101, ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "rest", }, - }, - "range": Array [ - 0, - 21, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 102, "line": 1, }, "start": Object { - "column": 0, + "column": 101, "line": 1, }, }, "range": Array [ - 0, - 5, + 101, + 102, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 104, "line": 1, }, "start": Object { - "column": 6, + "column": 103, "line": 1, }, }, "range": Array [ - 6, - 7, + 103, + 104, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 112, "line": 1, }, "start": Object { - "column": 8, + "column": 105, "line": 1, }, }, "range": Array [ - 8, - 9, + 105, + 112, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "complex", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 113, "line": 1, }, "start": Object { - "column": 10, + "column": 112, "line": 1, }, }, "range": Array [ - 10, - 19, + 112, + 113, ], - "type": "Keyword", - "value": "undefined", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 114, "line": 1, }, "start": Object { - "column": 19, + "column": 113, "line": 1, }, }, "range": Array [ - 19, - 20, + 113, + 114, ], "type": "Punctuator", "value": ";", diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 0597717bf9dd..b55b74489e1d 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -246,6 +246,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/and-operator-array-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/delete-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/do-while-statements.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -258,6 +260,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/new-without-parens.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/or-operator-array-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/typeof-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/update-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -291,6 +295,16 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let-in-switchcase.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/call-expression-with-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/call-expression-with-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/mixed-expression.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/new-expression-with-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/new-expression-with-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-accessor-properties.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-computed-static-method.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -396,6 +410,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-var-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/call-expression-destruction-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/call-expression-destruction-object.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -663,6 +681,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-milti-asigment.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-var.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-array.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -682,6 +702,8 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-rest.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1181,6 +1203,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-undefined.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/complex-spread.src.js.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-if.src.js.src 1`] = ` Object { "column": 6, @@ -1884,6 +1908,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-private-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-property-values.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-public-parameter-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index fa037c8ebd7a..c3aff247bea4 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -18913,6 +18913,1140 @@ Object { } `; +exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 20, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "b", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 23, + 30, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "name": "c", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 33, + 40, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 37, + 39, + ], + "type": "ArrayExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "d", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 43, + 50, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 47, + 49, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "name": "e", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 53, + 80, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "arguments": Array [ + Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "properties": Array [], + "range": Array [ + 68, + 70, + ], + "type": "ObjectExpression", + }, + Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 21, + "line": 6, + }, + }, + "range": Array [ + 72, + 74, + ], + "type": "ArrayExpression", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 6, + }, + "start": Object { + "column": 25, + "line": 6, + }, + }, + "range": Array [ + 76, + 77, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 67, + 78, + ], + "type": "ArrayExpression", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "name": "Array", + "range": Array [ + 61, + 66, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "range": Array [ + 57, + 79, + ], + "type": "NewExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 82, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 82, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 83, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 47, + 49, + ], + "type": "String", + "value": "\\"\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "range": Array [ + 57, + 60, + ], + "type": "Keyword", + "value": "new", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "range": Array [ + 61, + 66, + ], + "type": "Identifier", + "value": "Array", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 15, + "line": 6, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 6, + }, + "start": Object { + "column": 18, + "line": 6, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 21, + "line": 6, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 6, + }, + "start": Object { + "column": 22, + "line": 6, + }, + }, + "range": Array [ + 73, + 74, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 6, + }, + "start": Object { + "column": 23, + "line": 6, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 6, + }, + "start": Object { + "column": 25, + "line": 6, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 6, + }, + "start": Object { + "column": 26, + "line": 6, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 6, + }, + "start": Object { + "column": 27, + "line": 6, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 6, + }, + "start": Object { + "column": 28, + "line": 6, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` Object { "body": Array [ From 51394eb319ce8842279e56c2ebe4ff8c60229d8b Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 12 Jan 2019 16:30:49 +0100 Subject: [PATCH 81/84] feat: change logic of distinguishing patterns from statements (#118) BREAKING CHANGE: This changes the AST --- packages/typescript-estree/src/convert.ts | 201 +++++------------- packages/typescript-estree/src/node-utils.ts | 57 ----- .../tests/ast-alignment/fixtures-to-test.ts | 34 +-- .../lib/__snapshots__/javascript.ts.snap | 33 ++- 4 files changed, 69 insertions(+), 256 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index fdb09cd54705..1e420b962f0b 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -35,6 +35,7 @@ interface ConvertConfig { node: ts.Node; parent?: ts.Node | null; inTypeMode?: boolean; + allowPattern?: boolean; ast: ts.SourceFile; additionalOptions: ConvertAdditionalOptions; } @@ -83,7 +84,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { loc: nodeUtils.getLoc(node, ast) }; - function converter(child?: ts.Node, inTypeMode?: boolean): ESTreeNode | null { + function converter( + child?: ts.Node, + inTypeMode?: boolean, + allowPattern?: boolean + ): ESTreeNode | null { if (!child) { return null; } @@ -91,18 +96,28 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { node: child, parent: node, inTypeMode, + allowPattern, ast, additionalOptions }); } + /** + * Converts a TypeScript node into an ESTree node. + * @param {ts.Node} child the child ts.Node + * @returns {ESTreeNode|null} the converted ESTree node + */ + function convertPattern(child?: ts.Node): ESTreeNode | null { + return converter(child, config.inTypeMode, true); + } + /** * Converts a TypeScript node into an ESTree node. * @param {ts.Node} child the child ts.Node * @returns {ESTreeNode|null} the converted ESTree node */ function convertChild(child?: ts.Node): ESTreeNode | null { - return converter(child, config.inTypeMode); + return converter(child, config.inTypeMode, false); } /** @@ -111,7 +126,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * @returns {ESTreeNode|null} the converted ESTree node */ function convertChildType(child?: ts.Node): ESTreeNode | null { - return converter(child, true); + return converter(child, true, false); } /** @@ -632,7 +647,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ForOfStatement: { Object.assign(result, { type: SyntaxKind[node.kind], - left: convertChild(node.initializer), + left: convertPattern(node.initializer), right: convertChild(node.expression), body: convertChild(node.statement) }); @@ -691,7 +706,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.VariableDeclaration: { Object.assign(result, { type: AST_NODE_TYPES.VariableDeclarator, - id: convertChild(node.name), + id: convertPattern(node.name), init: convertChild(node.initializer) }); @@ -746,42 +761,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.ArrayLiteralExpression: { - const arrayAssignNode = nodeUtils.findAncestorOfKind( - node, - SyntaxKind.BinaryExpression - ); - const arrayIsInForOf = - node.parent && node.parent.kind === SyntaxKind.ForOfStatement; - const arrayIsInForIn = - node.parent && node.parent.kind === SyntaxKind.ForInStatement; - let arrayIsInAssignment; - - if (arrayAssignNode) { - if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { - arrayIsInAssignment = false; - } else if (node.parent.kind === SyntaxKind.CallExpression) { - arrayIsInAssignment = false; - } else if ( - nodeUtils.getBinaryExpressionType( - (arrayAssignNode as any).operatorToken - ) === AST_NODE_TYPES.AssignmentExpression - ) { - arrayIsInAssignment = - nodeUtils.findChildOfKind( - (arrayAssignNode as any).left, - SyntaxKind.ArrayLiteralExpression, - ast - ) === node || (arrayAssignNode as any).left === node; - } else { - arrayIsInAssignment = false; - } - } - // TypeScript uses ArrayLiteralExpression in destructuring assignment, too - if (arrayIsInAssignment || arrayIsInForOf || arrayIsInForIn) { + if (config.allowPattern) { Object.assign(result, { type: AST_NODE_TYPES.ArrayPattern, - elements: node.elements.map(convertChild) + elements: node.elements.map(convertPattern) }); } else { Object.assign(result, { @@ -793,43 +777,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } case SyntaxKind.ObjectLiteralExpression: { - const ancestorNode = nodeUtils.findFirstMatchingAncestor( - node, - parentNode => - parentNode.kind === SyntaxKind.BinaryExpression || - parentNode.kind === SyntaxKind.ArrowFunction - ); - const objectAssignNode = - ancestorNode && - ancestorNode.kind === SyntaxKind.BinaryExpression && - (ancestorNode as any).operatorToken.kind === SyntaxKind.FirstAssignment - ? ancestorNode - : null; - - let objectIsInAssignment = false; - - if (objectAssignNode) { - if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) { - objectIsInAssignment = false; - } else if ((objectAssignNode as any).left === node) { - objectIsInAssignment = true; - } else if (node.parent.kind === SyntaxKind.CallExpression) { - objectIsInAssignment = false; - } else { - objectIsInAssignment = - nodeUtils.findChildOfKind( - (objectAssignNode as any).left, - SyntaxKind.ObjectLiteralExpression, - ast - ) === node; - } - } - // TypeScript uses ObjectLiteralExpression in destructuring assignment, too - if (objectIsInAssignment) { + if (config.allowPattern) { Object.assign(result, { type: AST_NODE_TYPES.ObjectPattern, - properties: node.properties.map(convertChild) + properties: node.properties.map(convertPattern) }); } else { Object.assign(result, { @@ -837,7 +789,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { properties: node.properties.map(convertChild) }); } - break; } @@ -845,7 +796,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.Property, key: convertChild(node.name), - value: convertChild(node.initializer), + value: converter( + node.initializer, + config.inTypeMode, + config.allowPattern + ), computed: nodeUtils.isComputedProperty(node.name), method: false, shorthand: false, @@ -860,7 +815,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { key: convertChild(node.name), value: { type: AST_NODE_TYPES.AssignmentPattern, - left: convertChild(node.name), + left: convertPattern(node.name), right: convertChild(node.objectAssignmentInitializer), loc: result.loc, range: result.range @@ -1208,7 +1163,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ArrayBindingPattern: Object.assign(result, { type: AST_NODE_TYPES.ArrayPattern, - elements: node.elements.map(convertChild) + elements: node.elements.map(convertPattern) }); break; @@ -1219,7 +1174,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.ObjectBindingPattern: Object.assign(result, { type: AST_NODE_TYPES.ObjectPattern, - properties: node.elements.map(convertChild) + properties: node.elements.map(convertPattern) }); break; @@ -1387,50 +1342,19 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // Patterns + case SyntaxKind.SpreadAssignment: case SyntaxKind.SpreadElement: { - let type = AST_NODE_TYPES.SpreadElement; - - if ( - node.parent && - node.parent.parent && - node.parent.parent.kind === SyntaxKind.BinaryExpression - ) { - if ((node.parent.parent as ts.BinaryExpression).left === node.parent) { - type = AST_NODE_TYPES.RestElement; - } else if ( - (node.parent.parent as ts.BinaryExpression).right === node.parent - ) { - type = AST_NODE_TYPES.SpreadElement; - } - } - - Object.assign(result, { - type, - argument: convertChild(node.expression) - }); - break; - } - case SyntaxKind.SpreadAssignment: { - let type = AST_NODE_TYPES.SpreadElement; - - if ( - node.parent && - node.parent.parent && - node.parent.parent.kind === SyntaxKind.BinaryExpression - ) { - if ((node.parent.parent as ts.BinaryExpression).right === node.parent) { - type = AST_NODE_TYPES.SpreadElement; - } else if ( - (node.parent.parent as ts.BinaryExpression).left === node.parent - ) { - type = AST_NODE_TYPES.RestElement; - } + if (config.allowPattern) { + Object.assign(result, { + type: AST_NODE_TYPES.RestElement, + argument: convertPattern(node.expression) + }); + } else { + Object.assign(result, { + type: AST_NODE_TYPES.SpreadElement, + argument: convertChild(node.expression) + }); } - - Object.assign(result, { - type, - argument: convertChild(node.expression) - }); break; } @@ -1788,44 +1712,21 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).expressions.push(right); } } else { + const type = nodeUtils.getBinaryExpressionType(node.operatorToken); Object.assign(result, { - type: nodeUtils.getBinaryExpressionType(node.operatorToken), + type, operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), - left: convertChild(node.left), + left: converter( + node.left, + config.inTypeMode, + type === AST_NODE_TYPES.AssignmentExpression + ), right: convertChild(node.right) }); // if the binary expression is in a destructured array, switch it if (result.type === AST_NODE_TYPES.AssignmentExpression) { - const upperArrayNode = nodeUtils.findFirstMatchingAncestor( - node, - parent => - parent.kind === SyntaxKind.ArrayLiteralExpression || - parent.kind === SyntaxKind.ObjectLiteralExpression - ); - const upperArrayAssignNode = - upperArrayNode && - nodeUtils.findAncestorOfKind( - upperArrayNode, - SyntaxKind.BinaryExpression - ); - - let upperArrayIsInAssignment; - - if (upperArrayAssignNode) { - if ((upperArrayAssignNode as any).left === upperArrayNode) { - upperArrayIsInAssignment = true; - } else { - upperArrayIsInAssignment = - nodeUtils.findChildOfKind( - (upperArrayAssignNode as any).left, - SyntaxKind.ArrayLiteralExpression, - ast - ) === upperArrayNode; - } - } - - if (upperArrayIsInAssignment) { + if (config.allowPattern) { delete (result as any).operator; result.type = AST_NODE_TYPES.AssignmentPattern; } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 75b8548ec4f4..b25ad78b8e4d 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -100,33 +100,6 @@ const TOKEN_TO_TEXT: { readonly [P in ts.SyntaxKind]?: string } = { [SyntaxKind.ImportKeyword]: 'import' }; -/** - * Find the first matching child based on the given sourceFile and predicate function. - * @param {ts.Node} node The current ts.Node - * @param {ts.SourceFile} sourceFile The full AST source file - * @param {Function} predicate The predicate function to apply to each checked child - * @returns {ts.Node|undefined} a matching child ts.Node - */ -function findFirstMatchingChild( - node: ts.Node, - sourceFile: ts.SourceFile, - predicate: (node: ts.Node) => boolean -): ts.Node | undefined { - const children = node.getChildren(sourceFile); - for (let i = 0; i < children.length; i++) { - const child = children[i]; - if (child && predicate(child)) { - return child; - } - - const grandChild = findFirstMatchingChild(child, sourceFile, predicate); - if (grandChild) { - return grandChild; - } - } - return undefined; -} - export default { /** * Expose the enum of possible TSNode `kind`s. @@ -148,9 +121,7 @@ export default { getTSNodeAccessibility, findNextToken, findFirstMatchingToken, - findChildOfKind, findFirstMatchingAncestor, - findAncestorOfKind, hasJSXAncestor, unescapeStringLiteralText, isComputedProperty, @@ -460,21 +431,6 @@ function findFirstMatchingToken( return undefined; } -/** - * Finds the first child ts.Node which matches the given kind - * @param {ts.Node} node The parent ts.Node - * @param {number} kind The ts.Node kind to match against - * @param {ts.SourceFile} sourceFile The full AST source file - * @returns {ts.Node|undefined} a matching ts.Node - */ -function findChildOfKind( - node: ts.Node, - kind: number, - sourceFile: ts.SourceFile -): ts.Node | undefined { - return findFirstMatchingChild(node, sourceFile, child => child.kind === kind); -} - /** * Find the first matching ancestor based on the given predicate function. * @param {ts.Node} node The current ts.Node @@ -494,19 +450,6 @@ function findFirstMatchingAncestor( return undefined; } -/** - * Finds the first parent ts.Node which matches the given kind - * @param {ts.Node} node The current ts.Node - * @param {ts.SyntaxKind} kind The ts.Node kind to match against - * @returns {ts.Node|undefined} a matching parent ts.Node - */ -function findAncestorOfKind( - node: ts.Node, - kind: ts.SyntaxKind -): ts.Node | undefined { - return findFirstMatchingAncestor(node, parent => parent.kind === kind); -} - /** * Returns true if a given ts.Node has a JSX token within its hierarchy * @param {ts.Node} node ts.Node to be checked diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index bfdda735377a..d6182fbeca34 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -196,19 +196,6 @@ tester.addFixturePatternConfig('javascript/experimentalOptionalCatchBinding'); tester.addFixturePatternConfig('javascript/for'); tester.addFixturePatternConfig('javascript/forIn', { ignore: [ - /** - * Error: AST difference - * ts-estree: ArrayPattern - * babel: ArrayExpression - */ - 'for-in-array', - 'for-in-with-rest', - /** - * Error: AST difference - * ts-estree: AssignmentExpression - * babel: AssignmentPattern - */ - 'for-in-with-bare-assigment', /** * Babel correctly errors on this file, and we can report on it via: * TS 1189 (ts 3.2) "The variable declaration of a 'for...in' statement cannot have an initializer." @@ -222,17 +209,7 @@ tester.addFixturePatternConfig('javascript/forIn', { ] }); -tester.addFixturePatternConfig('javascript/forOf', { - ignore: [ - /** - * Error: AST difference - * ts-estree: ArrayPattern - * babel: ArrayExpression - */ - 'for-of-array', - 'for-of-with-rest' - ] -}); +tester.addFixturePatternConfig('javascript/forOf'); tester.addFixturePatternConfig('javascript/generators'); tester.addFixturePatternConfig('javascript/globalReturn'); tester.addFixturePatternConfig('javascript/importMeta'); @@ -279,14 +256,7 @@ tester.addFixturePatternConfig('javascript/regex'); tester.addFixturePatternConfig('javascript/regexUFlag'); tester.addFixturePatternConfig('javascript/regexYFlag'); tester.addFixturePatternConfig('javascript/restParams'); -tester.addFixturePatternConfig('javascript/spread', { - ignore: [ - /** - * Error: AST difference - */ - 'complex-spread' - ] -}); +tester.addFixturePatternConfig('javascript/spread'); tester.addFixturePatternConfig('javascript/unicodeCodePointEscapes'); /* ================================================== */ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap index 22aa5f78ee77..f6c0c507868c 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/javascript.ts.snap @@ -51971,7 +51971,7 @@ Object { 1, 23, ], - "type": "ObjectPattern", + "type": "ObjectExpression", }, "loc": Object { "end": Object { @@ -88925,7 +88925,7 @@ Object { 10, 12, ], - "type": "ArrayPattern", + "type": "ArrayExpression", }, "type": "ForInStatement", }, @@ -92385,7 +92385,6 @@ Object { "line": 1, }, }, - "operator": "=", "range": Array [ 5, 10, @@ -92409,7 +92408,7 @@ Object { "type": "Literal", "value": 0, }, - "type": "AssignmentExpression", + "type": "AssignmentPattern", }, "loc": Object { "end": Object { @@ -93559,14 +93558,14 @@ Object { 14, 25, ], - "type": "SpreadElement", + "type": "RestElement", }, ], "range": Array [ 5, 27, ], - "type": "ObjectExpression", + "type": "ObjectPattern", }, "loc": Object { "end": Object { @@ -94442,7 +94441,7 @@ Object { 14, 16, ], - "type": "ArrayPattern", + "type": "ArrayExpression", }, "type": "ForOfStatement", }, @@ -96800,14 +96799,14 @@ Object { 14, 25, ], - "type": "SpreadElement", + "type": "RestElement", }, ], "range": Array [ 5, 27, ], - "type": "ObjectExpression", + "type": "ObjectPattern", }, "loc": Object { "end": Object { @@ -132642,7 +132641,7 @@ Object { 11, 20, ], - "type": "SpreadElement", + "type": "RestElement", }, ], "range": Array [ @@ -132844,14 +132843,14 @@ Object { 45, 55, ], - "type": "SpreadElement", + "type": "RestElement", }, ], "range": Array [ 43, 57, ], - "type": "ObjectExpression", + "type": "ObjectPattern", }, Object { "argument": Object { @@ -132886,7 +132885,7 @@ Object { 59, 63, ], - "type": "SpreadElement", + "type": "RestElement", }, ], "loc": Object { @@ -133046,14 +133045,14 @@ Object { 74, 78, ], - "type": "SpreadElement", + "type": "RestElement", }, ], "range": Array [ 69, 80, ], - "type": "ObjectExpression", + "type": "ObjectPattern", }, }, Object { @@ -133089,14 +133088,14 @@ Object { 82, 90, ], - "type": "SpreadElement", + "type": "RestElement", }, ], "range": Array [ 37, 92, ], - "type": "ObjectExpression", + "type": "ObjectPattern", }, }, Object { From fb011d4dc5adbfc7c9b837ae8779db089c31ca28 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sat, 12 Jan 2019 13:43:32 -0500 Subject: [PATCH 82/84] feat(ast): update TSInterfaceDeclaration and TSClassImplements (#120) BREAKING CHANGE: This changes the AST of TSInterfaceDeclaration nodes, and ClassImplements is now TSClassImplements --- .../typescript-estree/src/ast-node-types.ts | 2 +- packages/typescript-estree/src/convert.ts | 51 +- .../typescript-estree/src/semantic-errors.ts | 3 + .../src/temp-types-based-on-js-source.ts | 2 + .../tests/ast-alignment/fixtures-to-test.ts | 54 +- .../tests/ast-alignment/utils.ts | 30 + .../class-multiple-implements.src.ts | 1 + .../errorRecovery/interface-implements.src.ts | 1 + .../interface-multiple-extends.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 27 + .../lib/__snapshots__/typescript.ts.snap | 1085 ++++++++++++++--- 11 files changed, 1021 insertions(+), 236 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-implements.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts diff --git a/packages/typescript-estree/src/ast-node-types.ts b/packages/typescript-estree/src/ast-node-types.ts index d35277f58167..58dc30f02d07 100644 --- a/packages/typescript-estree/src/ast-node-types.ts +++ b/packages/typescript-estree/src/ast-node-types.ts @@ -21,7 +21,6 @@ export enum AST_NODE_TYPES { ClassBody = 'ClassBody', ClassDeclaration = 'ClassDeclaration', ClassExpression = 'ClassExpression', - ClassImplements = 'ClassImplements', ClassProperty = 'ClassProperty', ConditionalExpression = 'ConditionalExpression', ContinueStatement = 'ContinueStatement', @@ -108,6 +107,7 @@ export enum AST_NODE_TYPES { TSConditionalType = 'TSConditionalType', TSConstructorType = 'TSConstructorType', TSCallSignatureDeclaration = 'TSCallSignatureDeclaration', + TSClassImplements = 'TSClassImplements', TSConstructSignatureDeclaration = 'TSConstructSignatureDeclaration', TSDeclareKeyword = 'TSDeclareKeyword', TSDeclareFunction = 'TSDeclareFunction', diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 1e420b962f0b..bfd00b3404ab 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -274,12 +274,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { nodeType: AST_NODE_TYPES, child: ts.ExpressionWithTypeArguments ): ESTreeNode { - const id = convertChild(child.expression)!; + const expression = convertChild(child.expression)!; const classImplementsNode: ESTreeNode = { type: nodeType, - loc: id.loc, - range: id.range, - id + loc: expression.loc, + range: expression.range, + expression }; if (child.typeArguments && child.typeArguments.length) { classImplementsNode.typeParameters = convertTypeArgumentsToTypeParameters( @@ -1500,9 +1500,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); if (implementsClause) { - (result as any).implements = implementsClause.types.map(el => - // ClassImplements node to match what Flow does. - convertHeritageClause(AST_NODE_TYPES.ClassImplements, el) + result.implements = implementsClause.types.map(el => + convertHeritageClause(AST_NODE_TYPES.TSClassImplements, el) ); } @@ -2405,7 +2404,6 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ); } - const hasImplementsClause = interfaceHeritageClauses.length > 0; const interfaceOpenBrace = nodeUtils.findNextToken( interfaceLastClassToken, ast, @@ -2426,13 +2424,38 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.TSInterfaceDeclaration, body: interfaceBody, - id: convertChild(node.name), - heritage: hasImplementsClause - ? interfaceHeritageClauses[0].types.map(el => - convertHeritageClause(AST_NODE_TYPES.TSInterfaceHeritage, el) - ) - : [] + id: convertChild(node.name) }); + + if (interfaceHeritageClauses.length > 0) { + const interfaceExtends = []; + const interfaceImplements = []; + + for (const heritageClause of interfaceHeritageClauses) { + if (heritageClause.token === SyntaxKind.ExtendsKeyword) { + for (const n of heritageClause.types) { + interfaceExtends.push( + convertHeritageClause(AST_NODE_TYPES.TSInterfaceHeritage, n) + ); + } + } else if (heritageClause.token === SyntaxKind.ImplementsKeyword) { + for (const n of heritageClause.types) { + interfaceImplements.push( + convertHeritageClause(AST_NODE_TYPES.TSInterfaceHeritage, n) + ); + } + } + } + + if (interfaceExtends.length) { + result.extends = interfaceExtends; + } + + if (interfaceImplements.length) { + result.implements = interfaceImplements; + } + } + /** * Semantically, decorators are not allowed on interface declarations, * but the TypeScript compiler will parse them and produce a valid AST, diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index 067a702474c7..3513c4d06627 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -68,7 +68,10 @@ function whitelistSupportedDiagnostics( case 1121: // ts 3.2 "Octal literals are not allowed in strict mode." case 1123: // ts 3.2: "Variable declaration list cannot be empty." case 1141: // ts 3.2 "String literal expected." + case 1172: // ts 3.2 "'extends' clause already seen." case 1173: // ts 3.2 "'extends' clause must precede 'implements' clause." + case 1175: // ts 3.2 "'implements' clause already seen." + case 1176: // ts 3.2 "Interface declaration cannot have 'implements' clause." case 1190: // ts 3.2 "The variable declaration of a 'for...of' statement cannot have an initializer." case 1200: // ts 3.2 "Line terminator not permitted before arrow." case 1206: // ts 3.2 "Decorators are not valid here." diff --git a/packages/typescript-estree/src/temp-types-based-on-js-source.ts b/packages/typescript-estree/src/temp-types-based-on-js-source.ts index cf7124ab04f6..a002b749f5bd 100644 --- a/packages/typescript-estree/src/temp-types-based-on-js-source.ts +++ b/packages/typescript-estree/src/temp-types-based-on-js-source.ts @@ -34,6 +34,8 @@ export interface ESTreeNode { value?: string; expression?: ESTreeNode | null; decorators?: (ESTreeNode | null)[]; + implements?: ESTreeNode[]; + extends?: ESTreeNode[]; const?: boolean; declare?: boolean; global?: boolean; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index d6182fbeca34..30d8bbd6f289 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -314,25 +314,6 @@ tester.addFixturePatternConfig('typescript/basics', { * TODO: remove me in next babel > 7.2.3 */ 'arrow-function-with-type-parameters', - /** - * Babel: ClassDeclaration + abstract: true - * ts-estree: TSAbstractClassDeclaration - */ - 'abstract-class-with-abstract-properties', - /** - * Babel: ClassProperty + abstract: true - * ts-estree: TSAbstractClassProperty - */ - 'abstract-class-with-abstract-readonly-property', - /** - * Babel: TSExpressionWithTypeArguments - * ts-estree: ClassImplements - */ - 'class-with-implements-generic-multiple', - 'class-with-implements-generic', - 'class-with-implements', - 'class-with-extends-and-implements', - 'class-with-mixin', /** * Babel error: parameterName is not included into range of TSTypeAnnotation * TODO: report it to babel @@ -341,26 +322,11 @@ tester.addFixturePatternConfig('typescript/basics', { /** * there is difference in range between babel and ts-estree */ + 'class-with-implements-generic-multiple', + 'class-with-implements-generic', 'export-declare-const-named-enum', - /** - * Other major AST differences (e.g. fundamentally different node types) - */ - 'interface-extends-multiple', - 'interface-extends', - 'interface-type-parameters', 'interface-with-extends-type-parameters', - 'interface-with-generic', - 'interface-with-jsdoc', 'interface-with-optional-properties', - 'interface-without-type-annotation', - 'type-guard-in-interface', - 'typed-this', - /** - * AST difference - * ts-estree: heritage = [] - * babel: heritage = undefined - */ - 'interface-with-method', /** * Babel bug for parsing exported abstract interface * https://github.com/babel/babel/issues/9304 @@ -471,21 +437,7 @@ tester.addFixturePatternConfig('typescript/types', { }); tester.addFixturePatternConfig('typescript/declare', { - fileType: 'ts', - ignore: [ - /** - * AST difference - * ts-estree: heritage = [] - * babel: heritage = undefined - */ - 'interface', - /** - * AST difference - * ts-estree: TSAbstractClassDeclaration - * babel: ClassDeclaration[abstract=true] - */ - 'abstract-class' - ] + fileType: 'ts' }); tester.addFixturePatternConfig('typescript/namespaces-and-modules', { diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 185797249f44..34c3dabbdc00 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -231,6 +231,36 @@ export function preprocessBabylonAST(ast: any): any { type: AST_NODE_TYPES.Identifier }; } + }, + /** + * Babel: ClassDeclaration + abstract: true + * ts-estree: TSAbstractClassDeclaration + */ + ClassDeclaration(node: any) { + if (node.abstract) { + node.type = 'TSAbstractClassDeclaration'; + delete node.abstract; + } + }, + /** + * Babel: ClassProperty + abstract: true + * ts-estree: TSAbstractClassProperty + */ + ClassProperty(node: any, parent: any) { + if (node.abstract) { + node.type = 'TSAbstractClassProperty'; + delete node.abstract; + } + }, + TSExpressionWithTypeArguments(node: any, parent: any) { + if (parent.type === 'TSInterfaceDeclaration') { + node.type = 'TSInterfaceHeritage'; + } else if ( + parent.type === 'ClassExpression' || + parent.type === 'ClassDeclaration' + ) { + node.type = 'TSClassImplements'; + } } } ); diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts new file mode 100644 index 000000000000..4ecd2eee4cae --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts @@ -0,0 +1 @@ +class a implements b implements c {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-implements.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-implements.src.ts new file mode 100644 index 000000000000..d3b8c7228e8c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-implements.src.ts @@ -0,0 +1 @@ +interface d implements e {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts new file mode 100644 index 000000000000..343867f302e1 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts @@ -0,0 +1 @@ +interface foo extends bar extends baz {} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index b55b74489e1d..312d4449b5f0 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -2191,6 +2191,15 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-multiple-implements.src.ts.src 1`] = ` +Object { + "column": 21, + "index": 21, + "lineNumber": 1, + "message": "'implements' clause already seen.", +} +`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts.src 1`] = ` Object { "column": 0, @@ -2238,6 +2247,15 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-implements.src.ts.src 1`] = ` +Object { + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "Interface declaration cannot have 'implements' clause.", +} +`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts.src 1`] = ` Object { "column": 2, @@ -2328,6 +2346,15 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts.src 1`] = ` +Object { + "column": 26, + "index": 26, + "lineNumber": 1, + "message": "'extends' clause already seen.", +} +`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-export.src.ts.src 1`] = ` Object { "column": 2, diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index c3aff247bea4..183fd7e8dc9a 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -2919,7 +2919,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -9740,7 +9739,7 @@ Object { }, "implements": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 77, @@ -9772,7 +9771,7 @@ Object { 66, 77, ], - "type": "ClassImplements", + "type": "TSClassImplements", }, ], "loc": Object { @@ -11926,7 +11925,7 @@ Object { }, "implements": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 24, @@ -11958,7 +11957,7 @@ Object { 21, 24, ], - "type": "ClassImplements", + "type": "TSClassImplements", }, ], "loc": Object { @@ -12150,7 +12149,7 @@ Object { }, "implements": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 56, @@ -12182,7 +12181,7 @@ Object { 45, 56, ], - "type": "ClassImplements", + "type": "TSClassImplements", }, ], "loc": Object { @@ -12427,7 +12426,7 @@ Object { }, "implements": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 24, @@ -12459,7 +12458,7 @@ Object { 21, 24, ], - "type": "ClassImplements", + "type": "TSClassImplements", "typeParameters": Object { "loc": Object { "end": Object { @@ -12759,7 +12758,7 @@ Object { }, "implements": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 24, @@ -12791,7 +12790,7 @@ Object { 21, 24, ], - "type": "ClassImplements", + "type": "TSClassImplements", "typeParameters": Object { "loc": Object { "end": Object { @@ -13488,7 +13487,7 @@ Object { }, "implements": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 38, @@ -13520,7 +13519,7 @@ Object { 123, 124, ], - "type": "ClassImplements", + "type": "TSClassImplements", }, ], "loc": Object { @@ -13703,7 +13702,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -41565,9 +41563,9 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [ + "extends": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 25, @@ -41788,9 +41786,9 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [ + "extends": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 25, @@ -41825,7 +41823,7 @@ Object { "type": "TSInterfaceHeritage", }, Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 29, @@ -42082,7 +42080,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -43574,7 +43571,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -45761,7 +45757,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -46074,9 +46069,9 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [ + "extends": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 28, @@ -46513,7 +46508,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -46829,7 +46823,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -47409,7 +47402,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -48176,7 +48168,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -48760,7 +48751,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -56298,7 +56288,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -62299,7 +62288,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -65746,7 +65734,6 @@ Object { "type": "TSInterfaceBody", }, "declare": true, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -77904,7 +77891,7 @@ Object { }, "implements": Array [ Object { - "id": Object { + "expression": Object { "loc": Object { "end": Object { "column": 32, @@ -77936,7 +77923,7 @@ Object { 29, 32, ], - "type": "ClassImplements", + "type": "TSClassImplements", }, ], "loc": Object { @@ -78327,68 +78314,86 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` +exports[`typescript fixtures/errorRecovery/class-multiple-implements.src 1`] = ` Object { "body": Array [ Object { - "decorators": Array [ + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 36, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "implements": Array [ Object { "expression": Object { "loc": Object { "end": Object { - "column": 4, + "column": 20, "line": 1, }, "start": Object { - "column": 1, + "column": 19, "line": 1, }, }, - "name": "dec", + "name": "b", "range": Array [ - 1, - 4, + 19, + 20, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 4, + "column": 20, "line": 1, }, "start": Object { - "column": 0, + "column": 19, "line": 1, }, }, "range": Array [ - 0, - 4, + 19, + 20, ], - "type": "Decorator", + "type": "TSClassImplements", }, ], - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "E", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 14, + "column": 36, "line": 1, }, "start": Object { @@ -78396,18 +78401,18 @@ Object { "line": 1, }, }, - "members": Array [], "range": Array [ 0, - 14, + 36, ], - "type": "TSEnumDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 0, + "line": 2, }, "start": Object { "column": 0, @@ -78416,14 +78421,14 @@ Object { }, "range": Array [ 0, - 14, + 37, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -78433,79 +78438,115 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "@", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 7, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 4, + 6, + 7, ], "type": "Identifier", - "value": "dec", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 18, "line": 1, }, "start": Object { - "column": 5, + "column": 8, "line": 1, }, }, "range": Array [ - 5, - 9, + 8, + 18, ], "type": "Keyword", - "value": "enum", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 20, "line": 1, }, "start": Object { - "column": 10, + "column": 19, "line": 1, }, }, "range": Array [ - 10, - 11, + 19, + 20, ], "type": "Identifier", - "value": "E", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 31, "line": 1, }, "start": Object { - "column": 12, + "column": 21, "line": 1, }, }, "range": Array [ - 12, - 13, + 21, + 31, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, ], "type": "Punctuator", "value": "{", @@ -78513,17 +78554,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, + "column": 36, "line": 1, }, "start": Object { - "column": 13, + "column": 35, "line": 1, }, }, "range": Array [ - 13, - 14, + 35, + 36, ], "type": "Punctuator", "value": "}", @@ -78533,53 +78574,16 @@ Object { } `; -exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` +exports[`typescript fixtures/errorRecovery/decorator-on-enum-declaration.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, - }, - }, - "range": Array [ - 20, - 22, - ], - "type": "TSInterfaceBody", - }, "decorators": Array [ Object { "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "deco", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { @@ -78587,15 +78591,16 @@ Object { "line": 1, }, }, + "name": "dec", "range": Array [ 1, - 7, + 4, ], - "type": "CallExpression", + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 7, + "column": 4, "line": 1, }, "start": Object { @@ -78605,51 +78610,51 @@ Object { }, "range": Array [ 0, - 7, + 4, ], "type": "Decorator", }, ], - "heritage": Array [], "id": Object { "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 1, }, "start": Object { "column": 10, - "line": 2, + "line": 1, }, }, - "name": "M", + "name": "E", "range": Array [ - 18, - 19, + 10, + 11, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 14, - "line": 2, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, + "members": Array [], "range": Array [ 0, - 22, + 14, ], - "type": "TSInterfaceDeclaration", + "type": "TSEnumDeclaration", }, ], "loc": Object { "end": Object { "column": 14, - "line": 2, + "line": 1, }, "start": Object { "column": 0, @@ -78658,7 +78663,248 @@ Object { }, "range": Array [ 0, - 22, + 14, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 4, + ], + "type": "Identifier", + "value": "dec", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 9, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "E", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/errorRecovery/decorator-on-interface-declaration.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 20, + 22, + ], + "type": "TSInterfaceBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "deco", + "range": Array [ + 1, + 5, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "M", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, ], "sourceType": "script", "tokens": Array [ @@ -80051,7 +80297,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -80198,6 +80443,229 @@ Object { } `; +exports[`typescript fixtures/errorRecovery/interface-implements.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 27, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "d", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "e", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "TSInterfaceHeritage", + }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 27, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 22, + ], + "type": "Keyword", + "value": "implements", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "e", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/errorRecovery/interface-index-signature-export.src 1`] = ` Object { "body": Array [ @@ -80327,7 +80795,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -80747,7 +81214,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -81167,7 +81633,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -81587,7 +82052,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -82007,7 +82471,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -82446,7 +82909,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -82903,7 +83365,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -83360,7 +83821,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -83817,7 +84277,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -84274,7 +84733,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -84583,6 +85041,300 @@ Object { } `; +exports[`typescript fixtures/errorRecovery/interface-multiple-extends.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 40, + ], + "type": "TSInterfaceBody", + }, + "extends": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "TSInterfaceHeritage", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "TSInterfaceHeritage", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 21, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 33, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/errorRecovery/interface-property-export.src 1`] = ` Object { "body": Array [ @@ -84677,7 +85429,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -84990,7 +85741,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -85303,7 +86053,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -85616,7 +86365,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -85929,7 +86677,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -86260,7 +87007,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { @@ -90388,7 +91134,6 @@ Object { ], "type": "TSInterfaceBody", }, - "heritage": Array [], "id": Object { "loc": Object { "end": Object { From 9c4acbe3dccb8f12ee829f5374580aa3de85d7a6 Mon Sep 17 00:00:00 2001 From: Armano Date: Sat, 12 Jan 2019 21:46:40 +0100 Subject: [PATCH 83/84] refactor: migrate node-utils from commonjs to es6 module (#121) --- .../typescript-estree/src/ast-converter.ts | 4 +- .../typescript-estree/src/convert-comments.ts | 10 +- packages/typescript-estree/src/convert.ts | 260 ++++++++---------- packages/typescript-estree/src/node-utils.ts | 111 +++----- packages/typescript-estree/src/parser.ts | 4 +- 5 files changed, 167 insertions(+), 222 deletions(-) diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 5ceece050e7a..ce6f14b63f71 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -7,7 +7,7 @@ */ import convert, { getASTMaps, resetASTMaps, convertError } from './convert'; import { convertComments } from './convert-comments'; -import nodeUtils from './node-utils'; +import { convertTokens } from './node-utils'; import ts from 'typescript'; import { Extra } from './temp-types-based-on-js-source'; @@ -42,7 +42,7 @@ export default ( * Optionally convert and include all tokens in the AST */ if (extra.tokens) { - estree.tokens = nodeUtils.convertTokens(ast); + estree.tokens = convertTokens(ast); } /** diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index 31d83cc1b7bc..ac7f8504d8aa 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -6,7 +6,7 @@ */ import ts from 'typescript'; -import nodeUtils from './node-utils'; +import { getLocFor, getNodeContainer } from './node-utils'; import { ESTreeComment, LineAndColumnData @@ -75,7 +75,7 @@ function getCommentFromTriviaScanner( const text = isBlock ? comment.replace(/^\/\*/, '').replace(/\*\/$/, '') : comment.replace(/^\/\//, ''); - const loc = nodeUtils.getLocFor(range.pos, range.end, ast); + const loc = getLocFor(range.pos, range.end, ast); const esprimaComment = convertTypeScriptCommentToEsprimaComment( isBlock, @@ -128,7 +128,7 @@ export function convertComments( break; } case ts.SyntaxKind.GreaterThanToken: - container = nodeUtils.getNodeContainer(ast, start, end); + container = getNodeContainer(ast, start, end); if ( container && container.parent && @@ -141,7 +141,7 @@ export function convertComments( } break; case ts.SyntaxKind.CloseBraceToken: - container = nodeUtils.getNodeContainer(ast, start, end); + container = getNodeContainer(ast, start, end); if ( container.kind === ts.SyntaxKind.TemplateMiddle || @@ -153,7 +153,7 @@ export function convertComments( break; case ts.SyntaxKind.SlashToken: case ts.SyntaxKind.SlashEqualsToken: - container = nodeUtils.getNodeContainer(ast, start, end); + container = getNodeContainer(ast, start, end); if (container.kind === ts.SyntaxKind.RegularExpressionLiteral) { kind = triviaScanner.reScanSlashToken(); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index bfd00b3404ab..4b6b4aa4c55c 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -6,7 +6,27 @@ * MIT License */ import ts from 'typescript'; -import nodeUtils from './node-utils'; +import { + canContainDirective, + createError, + getLoc, + getLocFor, + findNextToken, + convertToken, + hasModifier, + fixExports, + getTSNodeAccessibility, + getTextForTokenKind, + isJSXToken, + isComputedProperty, + isESTreeClassMember, + isComma, + getBinaryExpressionType, + isOptional, + findFirstMatchingToken, + unescapeStringLiteralText, + getDeclarationKind +} from './node-utils'; import { AST_NODE_TYPES } from './ast-node-types'; import { ESTreeNode } from './temp-types-based-on-js-source'; import { TSNode } from './ts-nodes'; @@ -46,7 +66,7 @@ interface ConvertConfig { * @returns {Object} converted error object */ export function convertError(error: any) { - return nodeUtils.createError( + return createError( error.file, error.start, error.message || error.messageText @@ -81,7 +101,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { let result: ESTreeNode = { type: '' as AST_NODE_TYPES, range: [node.getStart(ast), node.end], - loc: nodeUtils.getLoc(node, ast) + loc: getLoc(node, ast) }; function converter( @@ -145,7 +165,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { : 1; const annotationStartCol = child.getFullStart() - offset; - const loc = nodeUtils.getLocFor(annotationStartCol, child.end, ast); + const loc = getLocFor(annotationStartCol, child.end, ast); return { type: AST_NODE_TYPES.TSTypeAnnotation, loc, @@ -164,7 +184,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ): ESTreeNode[] { // directives has to be unique, if directive is registered twice pick only first one const unique: string[] = []; - const allowDirectives = nodeUtils.canContainDirective(node); + const allowDirectives = canContainDirective(node); return ( nodes @@ -217,18 +237,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { typeArgumentsParent.kind === SyntaxKind.TypeReference) ) { const lastTypeArgument = typeArguments[typeArguments.length - 1]; - const greaterThanToken = nodeUtils.findNextToken( - lastTypeArgument, - ast, - ast - ); + const greaterThanToken = findNextToken(lastTypeArgument, ast, ast); end = greaterThanToken!.end; } } return { type: AST_NODE_TYPES.TSTypeParameterInstantiation, range: [start, end], - loc: nodeUtils.getLocFor(start, end, ast), + loc: getLocFor(start, end, ast), params: typeArguments.map(typeArgument => convertChildType(typeArgument)) }; } @@ -244,20 +260,12 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const firstTypeParameter = typeParameters[0]; const lastTypeParameter = typeParameters[typeParameters.length - 1]; - const greaterThanToken = nodeUtils.findNextToken( - lastTypeParameter, - ast, - ast - ); + const greaterThanToken = findNextToken(lastTypeParameter, ast, ast); return { type: AST_NODE_TYPES.TSTypeParameterDeclaration, range: [firstTypeParameter.pos - 1, greaterThanToken!.end], - loc: nodeUtils.getLocFor( - firstTypeParameter.pos - 1, - greaterThanToken!.end, - ast - ), + loc: getLocFor(firstTypeParameter.pos - 1, greaterThanToken!.end, ast), params: typeParameters.map(typeParameter => convertChildType(typeParameter) ) @@ -379,7 +387,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { function convertTypeScriptJSXTagNameToESTreeName( tagName: ts.JsxTagNameExpression ): ESTreeNode { - const tagNameToken = nodeUtils.convertToken(tagName, ast); + const tagNameToken = convertToken(tagName, ast); if (tagNameToken.type === AST_NODE_TYPES.JSXMemberExpression) { const isNestedMemberExpression = @@ -471,7 +479,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { typeAnnotationParent: ESTreeNode ): void { typeAnnotationParent.range[1] = (node as any).type.getEnd(); - typeAnnotationParent.loc = nodeUtils.getLocFor( + typeAnnotationParent.loc = getLocFor( typeAnnotationParent.range[0], typeAnnotationParent.range[1], ast @@ -492,11 +500,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { }); result.range[1] = node.endOfFileToken.end; - result.loc = nodeUtils.getLocFor( - node.getStart(ast), - result.range[1], - ast - ); + result.loc = getLocFor(node.getStart(ast), result.range[1], ast); break; case SyntaxKind.Block: @@ -665,7 +669,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // Declarations case SyntaxKind.FunctionDeclaration: { - const isDeclare = nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node); + const isDeclare = hasModifier(SyntaxKind.DeclareKeyword, node); let functionDeclarationType = AST_NODE_TYPES.FunctionDeclaration; if (isDeclare || !node.body) { functionDeclarationType = AST_NODE_TYPES.TSDeclareFunction; @@ -676,7 +680,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { id: convertChild(node.name), generator: !!node.asteriskToken, expression: false, - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + async: hasModifier(SyntaxKind.AsyncKeyword, node), params: convertParameters(node.parameters), body: convertChild(node.body) || undefined }); @@ -698,7 +702,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = fixExports(node, result, ast); break; } @@ -725,15 +729,15 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.VariableDeclaration, declarations: node.declarationList.declarations.map(convertChild), - kind: nodeUtils.getDeclarationKind(node.declarationList) + kind: getDeclarationKind(node.declarationList) }); - if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + if (hasModifier(SyntaxKind.DeclareKeyword, node)) { result.declare = true; } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = fixExports(node, result, ast); break; // mostly for for-of, for-in @@ -741,7 +745,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { Object.assign(result, { type: AST_NODE_TYPES.VariableDeclaration, declarations: node.declarations.map(convertChild), - kind: nodeUtils.getDeclarationKind(node) + kind: getDeclarationKind(node) }); break; @@ -801,7 +805,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { config.inTypeMode, config.allowPattern ), - computed: nodeUtils.isComputedProperty(node.name), + computed: isComputedProperty(node.name), method: false, shorthand: false, kind: 'init' @@ -858,20 +862,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.PropertyDeclaration: { - const isAbstract = nodeUtils.hasModifier( - SyntaxKind.AbstractKeyword, - node - ); + const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node); Object.assign(result, { type: isAbstract ? AST_NODE_TYPES.TSAbstractClassProperty : AST_NODE_TYPES.ClassProperty, key: convertChild(node.name), value: convertChild(node.initializer), - computed: nodeUtils.isComputedProperty(node.name), - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), - readonly: - nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined + computed: isComputedProperty(node.name), + static: hasModifier(SyntaxKind.StaticKeyword, node), + readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined }); if (node.type) { @@ -882,7 +882,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.decorators = node.decorators.map(convertChild); } - const accessibility = nodeUtils.getTSNodeAccessibility(node); + const accessibility = getTSNodeAccessibility(node); if (accessibility) { result.accessibility = accessibility; } @@ -907,14 +907,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.MethodDeclaration: { - const openingParen = nodeUtils.findFirstMatchingToken( + const openingParen = findFirstMatchingToken( node.name, ast, (token: any) => { if (!token || !token.kind) { return false; } - return nodeUtils.getTextForTokenKind(token.kind) === '('; + return getTextForTokenKind(token.kind) === '('; }, ast ); @@ -928,7 +928,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { id: null, generator: !!node.asteriskToken, expression: false, - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + async: hasModifier(SyntaxKind.AsyncKeyword, node), body: convertChild(node.body), range: [node.parameters.pos - 1, result.range[1]], loc: { @@ -951,7 +951,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.Property, key: convertChild(node.name), value: method, - computed: nodeUtils.isComputedProperty(node.name), + computed: isComputedProperty(node.name), method: nodeIsMethod, shorthand: false, kind: 'init' @@ -967,7 +967,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { /** * TypeScript class methods can be defined as "abstract" */ - const methodDefinitionType = nodeUtils.hasModifier( + const methodDefinitionType = hasModifier( SyntaxKind.AbstractKeyword, node ) @@ -978,8 +978,8 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: methodDefinitionType, key: convertChild(node.name), value: method, - computed: nodeUtils.isComputedProperty(node.name), - static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node), + computed: isComputedProperty(node.name), + static: hasModifier(SyntaxKind.StaticKeyword, node), kind: 'method' }); @@ -987,7 +987,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.decorators = node.decorators.map(convertChild); } - const accessibility = nodeUtils.getTSNodeAccessibility(node); + const accessibility = getTSNodeAccessibility(node); if (accessibility) { result.accessibility = accessibility; } @@ -1024,16 +1024,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // TypeScript uses this even for static methods named "constructor" case SyntaxKind.Constructor: { - const constructorIsStatic = nodeUtils.hasModifier( - SyntaxKind.StaticKeyword, - node - ), - constructorIsAbstract = nodeUtils.hasModifier( - SyntaxKind.AbstractKeyword, - node - ), + const constructorIsStatic = hasModifier(SyntaxKind.StaticKeyword, node), + constructorIsAbstract = hasModifier(SyntaxKind.AbstractKeyword, node), firstConstructorToken = constructorIsStatic - ? nodeUtils.findNextToken(node.getFirstToken()!, ast, ast) + ? findNextToken(node.getFirstToken()!, ast, ast) : node.getFirstToken(), constructorLoc = ast.getLineAndCharacterOfPosition( node.parameters.pos - 1 @@ -1062,8 +1056,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { constructorIdentifierLocEnd = ast.getLineAndCharacterOfPosition( (firstConstructorToken as any).getEnd(ast) ), - constructorIsComputed = - !!node.name && nodeUtils.isComputedProperty(node.name); + constructorIsComputed = !!node.name && isComputedProperty(node.name); let constructorKey; @@ -1122,7 +1115,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { : 'constructor' }); - const accessibility = nodeUtils.getTSNodeAccessibility(node); + const accessibility = getTSNodeAccessibility(node); if (accessibility) { result.accessibility = accessibility; } @@ -1137,7 +1130,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { generator: !!node.asteriskToken, params: convertParameters(node.parameters), body: convertChild(node.body), - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + async: hasModifier(SyntaxKind.AsyncKeyword, node), expression: false }); @@ -1228,11 +1221,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { left: convertChild(node.name), right: convertChild(node.initializer), range: [node.name.getStart(ast), node.initializer.end], - loc: nodeUtils.getLocFor( - node.name.getStart(ast), - node.initializer.end, - ast - ) + loc: getLocFor(node.name.getStart(ast), node.initializer.end, ast) }; } } @@ -1245,7 +1234,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { id: null, params: convertParameters(node.parameters), body: convertChild(node.body), - async: nodeUtils.hasModifier(SyntaxKind.AsyncKeyword, node), + async: hasModifier(SyntaxKind.AsyncKeyword, node), expression: node.body.kind !== SyntaxKind.Block }); @@ -1396,15 +1385,11 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { return { type: AST_NODE_TYPES.TSParameterProperty, range: [node.getStart(ast), node.end], - loc: nodeUtils.getLoc(node, ast), - accessibility: nodeUtils.getTSNodeAccessibility(node) || undefined, - readonly: - nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || - undefined, - static: - nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, - export: - nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined, + loc: getLoc(node, ast), + accessibility: getTSNodeAccessibility(node) || undefined, + readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: hasModifier(SyntaxKind.ExportKeyword, node) || undefined, parameter: result }; } @@ -1428,7 +1413,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { node.typeParameters[node.typeParameters.length - 1]; if (!lastClassToken || lastTypeParameter.pos > lastClassToken.pos) { - lastClassToken = nodeUtils.findNextToken(lastTypeParameter, ast, ast); + lastClassToken = findNextToken(lastTypeParameter, ast, ast); } result.typeParameters = convertTSTypeParametersToTypeParametersDeclaration( node.typeParameters @@ -1440,7 +1425,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { * TypeScript class declarations can be defined as "abstract" */ if (node.kind === SyntaxKind.ClassDeclaration) { - if (nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)) { + if (hasModifier(SyntaxKind.AbstractKeyword, node)) { classNodeType = `TSAbstract${classNodeType}`; } } @@ -1452,21 +1437,21 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { const lastModifier = node.modifiers![node.modifiers!.length - 1]; if (!lastClassToken || lastModifier.pos > lastClassToken.pos) { - lastClassToken = nodeUtils.findNextToken(lastModifier, ast, ast); + lastClassToken = findNextToken(lastModifier, ast, ast); } } else if (!lastClassToken) { // no name lastClassToken = node.getFirstToken(); } - const openBrace = nodeUtils.findNextToken(lastClassToken, ast, ast)!; + const openBrace = findNextToken(lastClassToken, ast, ast)!; const superClass = heritageClauses.find( clause => clause.token === SyntaxKind.ExtendsKeyword ); if (superClass) { if (superClass.types.length > 1) { - throw nodeUtils.createError( + throw createError( ast, superClass.types[1].pos, 'Classes can only extend a single class.' @@ -1491,7 +1476,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.ClassBody, body: [], range: [openBrace.getStart(ast), node.end], - loc: nodeUtils.getLocFor(openBrace.getStart(ast), node.end, ast) + loc: getLocFor(openBrace.getStart(ast), node.end, ast) }, superClass: superClass && superClass.types[0] @@ -1505,7 +1490,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ); } - if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + if (hasModifier(SyntaxKind.DeclareKeyword, node)) { result.declare = true; } @@ -1513,16 +1498,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.decorators = node.decorators.map(convertChild); } - const filteredMembers = node.members.filter( - nodeUtils.isESTreeClassMember - ); + const filteredMembers = node.members.filter(isESTreeClassMember); if (filteredMembers.length) { result.body.body = filteredMembers.map(convertChild); } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = fixExports(node, result, ast); break; } @@ -1587,7 +1570,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // have to adjust location information due to tree differences result.range[1] = node.name!.end; - result.loc = nodeUtils.getLocFor(result.range[0], result.range[1], ast); + result.loc = getLocFor(result.range[0], result.range[1], ast); break; case SyntaxKind.ExportDeclaration: @@ -1632,7 +1615,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.PrefixUnaryExpression: case SyntaxKind.PostfixUnaryExpression: { - const operator = nodeUtils.getTextForTokenKind(node.operator) || ''; + const operator = getTextForTokenKind(node.operator) || ''; Object.assign(result, { /** * ESTree uses UpdateExpression for ++/-- @@ -1677,7 +1660,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.TypeOperator: Object.assign(result, { type: AST_NODE_TYPES.TSTypeOperator, - operator: nodeUtils.getTextForTokenKind(node.operator), + operator: getTextForTokenKind(node.operator), typeAnnotation: convertChild(node.type) }); break; @@ -1686,7 +1669,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.BinaryExpression: // TypeScript uses BinaryExpression for sequences as well - if (nodeUtils.isComma(node.operatorToken)) { + if (isComma(node.operatorToken)) { Object.assign(result, { type: AST_NODE_TYPES.SequenceExpression, expressions: [] @@ -1711,10 +1694,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { (result as any).expressions.push(right); } } else { - const type = nodeUtils.getBinaryExpressionType(node.operatorToken); + const type = getBinaryExpressionType(node.operatorToken); Object.assign(result, { type, - operator: nodeUtils.getTextForTokenKind(node.operatorToken.kind), + operator: getTextForTokenKind(node.operatorToken.kind), left: converter( node.left, config.inTypeMode, @@ -1734,7 +1717,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.PropertyAccessExpression: - if (nodeUtils.isJSXToken(parent!)) { + if (isJSXToken(parent!)) { const jsxMemberExpression = { type: AST_NODE_TYPES.MemberExpression, object: convertChild(node.expression), @@ -1807,14 +1790,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { break; case SyntaxKind.MetaProperty: { - const newToken = nodeUtils.convertToken(node.getFirstToken()!, ast); + const newToken = convertToken(node.getFirstToken()!, ast); Object.assign(result, { type: AST_NODE_TYPES.MetaProperty, meta: { type: AST_NODE_TYPES.Identifier, range: newToken.range, loc: newToken.loc, - name: nodeUtils.getTextForTokenKind(node.keywordToken) + name: getTextForTokenKind(node.keywordToken) }, property: convertChild(node.name) }); @@ -1839,7 +1822,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if ((parent as any).name && (parent as any).name === node) { (result as any).value = node.text; } else { - (result as any).value = nodeUtils.unescapeStringLiteralText(node.text); + (result as any).value = unescapeStringLiteralText(node.text); } break; @@ -2034,7 +2017,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } case SyntaxKind.JsxAttribute: { - const attributeName = nodeUtils.convertToken(node.name, ast); + const attributeName = convertToken(node.name, ast); attributeName.type = AST_NODE_TYPES.JSXIdentifier; attributeName.name = attributeName.value; delete attributeName.value; @@ -2068,7 +2051,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { raw: ast.text.slice(start, end) }); - result.loc = nodeUtils.getLocFor(start, end, ast); + result.loc = getLocFor(start, end, ast); result.range = [start, end]; break; @@ -2195,9 +2178,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword) { result.readonly = true; } else { - result.readonly = nodeUtils.getTextForTokenKind( - node.readonlyToken.kind - ); + result.readonly = getTextForTokenKind(node.readonlyToken.kind); } } @@ -2205,9 +2186,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (node.questionToken.kind === SyntaxKind.QuestionToken) { result.optional = true; } else { - result.optional = nodeUtils.getTextForTokenKind( - node.questionToken.kind - ); + result.optional = getTextForTokenKind(node.questionToken.kind); } } @@ -2232,7 +2211,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { typeAnnotation: convertChildType(node.type) }); - if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + if (hasModifier(SyntaxKind.DeclareKeyword, node)) { result.declare = true; } @@ -2244,19 +2223,19 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = fixExports(node, result, ast); break; } case SyntaxKind.MethodSignature: { Object.assign(result, { type: AST_NODE_TYPES.TSMethodSignature, - computed: nodeUtils.isComputedProperty(node.name), + computed: isComputedProperty(node.name), key: convertChild(node.name), params: convertParameters(node.parameters) }); - if (nodeUtils.isOptional(node)) { + if (isOptional(node)) { result.optional = true; } @@ -2264,7 +2243,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.returnType = convertTypeAnnotation(node.type); } - if (nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node)) { + if (hasModifier(SyntaxKind.ReadonlyKeyword, node)) { result.readonly = true; } @@ -2274,16 +2253,16 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ); } - const accessibility = nodeUtils.getTSNodeAccessibility(node); + const accessibility = getTSNodeAccessibility(node); if (accessibility) { result.accessibility = accessibility; } - if (nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node)) { + if (hasModifier(SyntaxKind.ExportKeyword, node)) { result.export = true; } - if (nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node)) { + if (hasModifier(SyntaxKind.StaticKeyword, node)) { result.static = true; } break; @@ -2292,22 +2271,19 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { case SyntaxKind.PropertySignature: { Object.assign(result, { type: AST_NODE_TYPES.TSPropertySignature, - optional: nodeUtils.isOptional(node) || undefined, - computed: nodeUtils.isComputedProperty(node.name), + optional: isOptional(node) || undefined, + computed: isComputedProperty(node.name), key: convertChild(node.name), typeAnnotation: node.type ? convertTypeAnnotation(node.type) : undefined, initializer: convertChild(node.initializer) || undefined, - readonly: - nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, - static: - nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined, - export: - nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined + readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, + static: hasModifier(SyntaxKind.StaticKeyword, node) || undefined, + export: hasModifier(SyntaxKind.ExportKeyword, node) || undefined }); - const accessibility = nodeUtils.getTSNodeAccessibility(node); + const accessibility = getTSNodeAccessibility(node); if (accessibility) { result.accessibility = accessibility; } @@ -2322,20 +2298,20 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { typeAnnotation: node.type ? convertTypeAnnotation(node.type) : null }); - if (nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node)) { + if (hasModifier(SyntaxKind.ReadonlyKeyword, node)) { result.readonly = true; } - const accessibility = nodeUtils.getTSNodeAccessibility(node); + const accessibility = getTSNodeAccessibility(node); if (accessibility) { result.accessibility = accessibility; } - if (nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node)) { + if (hasModifier(SyntaxKind.ExportKeyword, node)) { result.export = true; } - if (nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node)) { + if (hasModifier(SyntaxKind.StaticKeyword, node)) { result.static = true; } break; @@ -2393,7 +2369,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { !interfaceLastClassToken || interfaceLastTypeParameter.pos > interfaceLastClassToken.pos ) { - interfaceLastClassToken = nodeUtils.findNextToken( + interfaceLastClassToken = findNextToken( interfaceLastTypeParameter, ast, ast @@ -2404,7 +2380,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { ); } - const interfaceOpenBrace = nodeUtils.findNextToken( + const interfaceOpenBrace = findNextToken( interfaceLastClassToken, ast, ast @@ -2414,11 +2390,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.TSInterfaceBody, body: node.members.map(member => convertChild(member)), range: [interfaceOpenBrace.getStart(ast), node.end], - loc: nodeUtils.getLocFor( - interfaceOpenBrace.getStart(ast), - node.end, - ast - ) + loc: getLocFor(interfaceOpenBrace.getStart(ast), node.end, ast) }; Object.assign(result, { @@ -2464,14 +2436,14 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { if (node.decorators) { result.decorators = node.decorators.map(convertChild); } - if (nodeUtils.hasModifier(SyntaxKind.AbstractKeyword, node)) { + if (hasModifier(SyntaxKind.AbstractKeyword, node)) { result.abstract = true; } - if (nodeUtils.hasModifier(SyntaxKind.DeclareKeyword, node)) { + if (hasModifier(SyntaxKind.DeclareKeyword, node)) { result.declare = true; } // check for exports - result = nodeUtils.fixExports(node, result, ast); + result = fixExports(node, result, ast); break; } @@ -2510,7 +2482,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { // apply modifiers first... applyModifiersToResult(node.modifiers); // ...then check for exports - result = nodeUtils.fixExports(node, result, ast); + result = fixExports(node, result, ast); /** * Semantically, decorators are not allowed on enum declarations, * but the TypeScript compiler will parse them and produce a valid AST, @@ -2554,7 +2526,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { result.global = true; } // ...then check for exports - result = nodeUtils.fixExports(node, result, ast); + result = fixExports(node, result, ast); break; } @@ -2636,7 +2608,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null { type: AST_NODE_TYPES.TSImportEqualsDeclaration, id: convertChild(node.name), moduleReference: convertChild(node.moduleReference), - isExport: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) + isExport: hasModifier(SyntaxKind.ExportKeyword, node) }); break; } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index b25ad78b8e4d..02b4925890f4 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -11,7 +11,6 @@ import { ESTreeNode, ESTreeToken } from './temp-types-based-on-js-source'; -import { TSNode } from './ts-nodes'; import { AST_NODE_TYPES } from './ast-node-types'; const SyntaxKind = ts.SyntaxKind; @@ -100,49 +99,12 @@ const TOKEN_TO_TEXT: { readonly [P in ts.SyntaxKind]?: string } = { [SyntaxKind.ImportKeyword]: 'import' }; -export default { - /** - * Expose the enum of possible TSNode `kind`s. - */ - SyntaxKind, - isAssignmentOperator, - isLogicalOperator, - getTextForTokenKind, - isESTreeClassMember, - hasModifier, - isComma, - getBinaryExpressionType, - getLocFor, - getLoc, - isToken, - canContainDirective, - isJSXToken, - getDeclarationKind, - getTSNodeAccessibility, - findNextToken, - findFirstMatchingToken, - findFirstMatchingAncestor, - hasJSXAncestor, - unescapeStringLiteralText, - isComputedProperty, - isOptional, - fixExports, - getTokenType, - convertToken, - convertTokens, - getNodeContainer, - isComment, - isJSDocComment, - createError, - firstDefined -}; - /** * Returns true if the given ts.Token is the assignment operator * @param {ts.Token} operator the operator token * @returns {boolean} is assignment */ -function isAssignmentOperator( +export function isAssignmentOperator( operator: ts.Token ): boolean { return ASSIGNMENT_OPERATORS.indexOf(operator.kind) > -1; @@ -153,7 +115,9 @@ function isAssignmentOperator( * @param {ts.Token} operator the operator token * @returns {boolean} is a logical operator */ -function isLogicalOperator(operator: ts.Token): boolean { +export function isLogicalOperator( + operator: ts.Token +): boolean { return LOGICAL_OPERATORS.indexOf(operator.kind) > -1; } @@ -162,7 +126,7 @@ function isLogicalOperator(operator: ts.Token): boolean { * @param {number} kind the token's SyntaxKind * @returns {string} the token applicable token as a string */ -function getTextForTokenKind(kind: ts.SyntaxKind): string | undefined { +export function getTextForTokenKind(kind: ts.SyntaxKind): string | undefined { return TOKEN_TO_TEXT[kind]; } @@ -171,7 +135,7 @@ function getTextForTokenKind(kind: ts.SyntaxKind): string | undefined { * @param {ts.Node} node TypeScript AST node * @returns {boolean} is valid ESTree class member */ -function isESTreeClassMember(node: ts.Node): boolean { +export function isESTreeClassMember(node: ts.Node): boolean { return node.kind !== SyntaxKind.SemicolonClassElement; } @@ -181,7 +145,7 @@ function isESTreeClassMember(node: ts.Node): boolean { * @param {ts.Node} node TypeScript AST node * @returns {boolean} has the modifier specified */ -function hasModifier( +export function hasModifier( modifierKind: ts.KeywordSyntaxKind, node: ts.Node ): boolean { @@ -197,7 +161,7 @@ function hasModifier( * @param {ts.Node} token the TypeScript token * @returns {boolean} is comma */ -function isComma(token: ts.Node): boolean { +export function isComma(token: ts.Node): boolean { return token.kind === SyntaxKind.CommaToken; } @@ -206,7 +170,7 @@ function isComma(token: ts.Node): boolean { * @param {ts.Node} node the TypeScript node * @returns {boolean} is comment */ -function isComment(node: ts.Node): boolean { +export function isComment(node: ts.Node): boolean { return ( node.kind === SyntaxKind.SingleLineCommentTrivia || node.kind === SyntaxKind.MultiLineCommentTrivia @@ -218,7 +182,7 @@ function isComment(node: ts.Node): boolean { * @param {ts.Node} node the TypeScript node * @returns {boolean} is JSDoc comment */ -function isJSDocComment(node: ts.Node): boolean { +export function isJSDocComment(node: ts.Node): boolean { return node.kind === SyntaxKind.JSDocComment; } @@ -227,7 +191,7 @@ function isJSDocComment(node: ts.Node): boolean { * @param {ts.Token} operator the operator token * @returns {string} the binary expression type */ -function getBinaryExpressionType( +export function getBinaryExpressionType( operator: ts.Token ): | AST_NODE_TYPES.AssignmentExpression @@ -249,7 +213,7 @@ function getBinaryExpressionType( * @param {ts.SourceFile} ast the AST object * @returns {ESTreeNodeLoc} the loc data */ -function getLocFor( +export function getLocFor( start: number, end: number, ast: ts.SourceFile @@ -274,7 +238,7 @@ function getLocFor( * @param {ts.Node} node * @returns {boolean} returns true if node can contain directive */ -function canContainDirective(node: ts.Node): boolean { +export function canContainDirective(node: ts.Node): boolean { switch (node.kind) { case ts.SyntaxKind.SourceFile: case ts.SyntaxKind.ModuleBlock: @@ -304,7 +268,10 @@ function canContainDirective(node: ts.Node): boolean { * @param {ts.SourceFile} ast the AST object * @returns {ESTreeLoc} the loc data */ -function getLoc(nodeOrToken: ts.Node, ast: ts.SourceFile): ESTreeNodeLoc { +export function getLoc( + nodeOrToken: ts.Node, + ast: ts.SourceFile +): ESTreeNodeLoc { return getLocFor(nodeOrToken.getStart(ast), nodeOrToken.end, ast); } @@ -313,7 +280,7 @@ function getLoc(nodeOrToken: ts.Node, ast: ts.SourceFile): ESTreeNodeLoc { * @param {ts.Node} node the ts.Node * @returns {boolean} is a token */ -function isToken(node: ts.Node): boolean { +export function isToken(node: ts.Node): boolean { return ( node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken ); @@ -324,7 +291,7 @@ function isToken(node: ts.Node): boolean { * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is a JSX token */ -function isJSXToken(node: ts.Node): boolean { +export function isJSXToken(node: ts.Node): boolean { return ( node.kind >= SyntaxKind.JsxElement && node.kind <= SyntaxKind.JsxAttribute ); @@ -335,7 +302,7 @@ function isJSXToken(node: ts.Node): boolean { * @param {ts.VariableDeclarationList} node TypeScript AST node * @returns {string} declaration kind */ -function getDeclarationKind( +export function getDeclarationKind( node: ts.VariableDeclarationList ): 'let' | 'const' | 'var' { if (node.flags & ts.NodeFlags.Let) { @@ -352,7 +319,7 @@ function getDeclarationKind( * @param {ts.Node} node The ts.Node * @returns {string | null} accessibility "public", "protected", "private", or null */ -function getTSNodeAccessibility( +export function getTSNodeAccessibility( node: ts.Node ): 'public' | 'protected' | 'private' | null { const modifiers = node.modifiers; @@ -383,7 +350,7 @@ function getTSNodeAccessibility( * @param {ts.SourceFile} ast The TS AST * @returns {ts.Node|undefined} the next TSToken */ -function findNextToken( +export function findNextToken( previousToken: ts.Node, parent: ts.Node, ast: ts.SourceFile @@ -416,7 +383,7 @@ function findNextToken( * @param {ts.SourceFile} ast The TS AST * @returns {ts.Node|undefined} a matching ts.Token */ -function findFirstMatchingToken( +export function findFirstMatchingToken( previousToken: ts.Node | undefined, parent: ts.Node, predicate: (node: ts.Node) => boolean, @@ -437,7 +404,7 @@ function findFirstMatchingToken( * @param {Function} predicate The predicate function to apply to each checked ancestor * @returns {ts.Node|undefined} a matching parent ts.Node */ -function findFirstMatchingAncestor( +export function findFirstMatchingAncestor( node: ts.Node, predicate: (node: ts.Node) => boolean ): ts.Node | undefined { @@ -455,7 +422,7 @@ function findFirstMatchingAncestor( * @param {ts.Node} node ts.Node to be checked * @returns {boolean} has JSX ancestor */ -function hasJSXAncestor(node: ts.Node): boolean { +export function hasJSXAncestor(node: ts.Node): boolean { return !!findFirstMatchingAncestor(node, isJSXToken); } @@ -464,7 +431,7 @@ function hasJSXAncestor(node: ts.Node): boolean { * @param {string} text The escaped string literal text. * @returns {string} The unescaped string literal text. */ -function unescapeStringLiteralText(text: string): string { +export function unescapeStringLiteralText(text: string): string { return unescape(text); } @@ -473,7 +440,7 @@ function unescapeStringLiteralText(text: string): string { * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is Computed Property */ -function isComputedProperty(node: ts.Node): boolean { +export function isComputedProperty(node: ts.Node): boolean { return node.kind === SyntaxKind.ComputedPropertyName; } @@ -482,7 +449,9 @@ function isComputedProperty(node: ts.Node): boolean { * @param {ts.Node} node ts.Node to be checked * @returns {boolean} is Optional */ -function isOptional(node: { questionToken?: ts.QuestionToken }): boolean { +export function isOptional(node: { + questionToken?: ts.QuestionToken; +}): boolean { return node.questionToken ? node.questionToken.kind === SyntaxKind.QuestionToken : false; @@ -495,7 +464,7 @@ function isOptional(node: { questionToken?: ts.QuestionToken }): boolean { * @param {ts.SourceFile} ast the AST * @returns {ESTreeNode} the ESTreeNode with fixed exports */ -function fixExports( +export function fixExports( node: ts.Node, result: ESTreeNode, ast: ts.SourceFile @@ -539,7 +508,7 @@ function fixExports( * @param {ts.Token} token the ts.Token * @returns {string} the token type */ -function getTokenType(token: any): string { +export function getTokenType(token: any): string { // Need two checks for keywords since some are also identifiers if (token.originalKeywordKind) { switch (token.originalKeywordKind) { @@ -647,7 +616,7 @@ function getTokenType(token: any): string { * @param {ts.SourceFile} ast the AST object * @returns {ESTreeToken} the converted ESTreeToken */ -function convertToken(token: ts.Node, ast: ts.SourceFile): ESTreeToken { +export function convertToken(token: ts.Node, ast: ts.SourceFile): ESTreeToken { const start = token.kind === SyntaxKind.JsxText ? token.getFullStart() @@ -676,7 +645,7 @@ function convertToken(token: ts.Node, ast: ts.SourceFile): ESTreeToken { * @param {ts.SourceFile} ast the AST object * @returns {ESTreeToken[]} the converted ESTreeTokens */ -function convertTokens(ast: ts.SourceFile): ESTreeToken[] { +export function convertTokens(ast: ts.SourceFile): ESTreeToken[] { const result: ESTreeToken[] = []; /** * @param {ts.Node} node the ts.Node @@ -711,7 +680,7 @@ function convertTokens(ast: ts.SourceFile): ESTreeToken[] { * @returns {ts.Node} typescript container token * @private */ -function getNodeContainer( +export function getNodeContainer( ast: ts.SourceFile, start: number, end: number @@ -745,7 +714,11 @@ function getNodeContainer( * @param {string} message the error message * @returns {Object} converted error object */ -function createError(ast: ts.SourceFile, start: number, message: string) { +export function createError( + ast: ts.SourceFile, + start: number, + message: string +) { const loc = ast.getLineAndCharacterOfPosition(start); return { index: start, @@ -759,7 +732,7 @@ function createError(ast: ts.SourceFile, start: number, message: string) { * @param {ts.Node} n the TSNode * @param {ts.SourceFile} ast the TS AST */ -function nodeHasTokens(n: ts.Node, ast: ts.SourceFile) { +export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile) { // If we have a token or node that has a non-zero width, it must have tokens. // Note: getWidth() does not take trivia into account. return n.kind === SyntaxKind.EndOfFileToken @@ -775,7 +748,7 @@ function nodeHasTokens(n: ts.Node, ast: ts.SourceFile) { * @param {(element: T, index: number) => (U|undefined)} callback * @returns {U|undefined} */ -function firstDefined( +export function firstDefined( array: ReadonlyArray | undefined, callback: (element: T, index: number) => U | undefined ): U | undefined { diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 1371b509f4be..1a39cfd2f31f 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -14,7 +14,7 @@ import ts from 'typescript'; import convert from './ast-converter'; import { convertError } from './convert'; import { Program } from './estree/spec'; -import util from './node-utils'; +import { firstDefined } from './node-utils'; import { ESTreeComment, ESTreeToken, @@ -74,7 +74,7 @@ function resetExtra(): void { * @returns {{ast: ts.SourceFile, program: ts.Program} | undefined} If found, returns the source file corresponding to the code and the containing program */ function getASTFromProject(code: string, options: ParserOptions) { - return util.firstDefined( + return firstDefined( calculateProjectParserOptions( code, options.filePath || getFileName(options), From f95c1c896112bd60e320d27f8e506746cc6b5e41 Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 13 Jan 2019 18:21:38 +0100 Subject: [PATCH 84/84] test: add test cases for broken converting (#123) --- .../tests/ast-alignment/fixtures-to-test.ts | 38 +- .../class-multi-line-keyword-abstract.src.ts | 2 + .../class-multi-line-keyword-declare.src.ts | 2 + ...class-with-constructor-and-modifier.src.ts | 5 + ...ss-with-constructor-and-return-type.src.ts | 5 + ...ith-constructor-and-type-parameters.src.ts | 5 + .../basics/class-with-method.src.ts | 5 + ...th-two-methods-computed-constructor.src.ts | 7 + ...face-with-extends-member-expression.src.ts | 2 + .../basics/object-with-typed-methods.src.ts | 13 + .../type-assertion-arrow-function.src.ts | 1 + .../semantic-diagnostics-enabled.ts.snap | 20 + .../lib/__snapshots__/typescript.ts.snap | 42356 +++++++++------- 13 files changed, 24614 insertions(+), 17847 deletions(-) create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-method.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/object-with-typed-methods.src.ts create mode 100644 packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion-arrow-function.src.ts diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 30d8bbd6f289..2f20b5e9a22a 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -290,6 +290,7 @@ tester.addFixturePatternConfig('typescript/basics', { fileType: 'ts', ignore: [ /** + * babel error: https://github.com/babel/babel/issues/9305 * TypeScript does not report any diagnostics for this file, but Babel throws: * [SyntaxError: Unexpected token, expected "{" (2:8) 1 | class Foo { @@ -327,6 +328,12 @@ tester.addFixturePatternConfig('typescript/basics', { 'export-declare-const-named-enum', 'interface-with-extends-type-parameters', 'interface-with-optional-properties', + /** + * Babel parses it as TSQualifiedName + * ts parses it as MemberExpression + * TODO: report it to babel + */ + 'interface-with-extends-member-expression', /** * Babel bug for parsing exported abstract interface * https://github.com/babel/babel/issues/9304 @@ -368,7 +375,36 @@ tester.addFixturePatternConfig('typescript/basics', { * PR for type assertions ranges has been merged into Babel: https://github.com/babel/babel/pull/9284 * TODO: remove me in next babel > 7.2.3 */ - 'type-assertion' + 'type-assertion', + /** + * Babel parses this incorrectly + * https://github.com/babel/babel/issues/9324 + */ + 'type-assertion-arrow-function', + /** + * Babel parses this incorrectly + * https://github.com/babel/babel/issues/9325 + */ + 'class-multi-line-keyword-declare', + 'class-multi-line-keyword-abstract', + /** + * There is difference in range between babel and ts-estree + */ + 'class-with-constructor-and-modifier', + /** + * ts-estree: missing returnType in constructor + * babel: parses it correctly + */ + 'class-with-constructor-and-return-type', + /** + * ts-estree: missing typeParameters in constructor + * babel: parses it correctly + */ + 'class-with-constructor-and-type-parameters', + /** + * There is deference in AST between babel and ts-estree + */ + 'object-with-typed-methods' ], ignoreSourceType: [ /** diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts new file mode 100644 index 000000000000..7c56988be397 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts @@ -0,0 +1,2 @@ +abstract +class B {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts new file mode 100644 index 000000000000..2710f781ffdb --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts @@ -0,0 +1,2 @@ +declare +class B {} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts new file mode 100644 index 000000000000..ba1998078db8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts @@ -0,0 +1,5 @@ +class C { + protected constructor() { } + + public ['constructor']() { } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts new file mode 100644 index 000000000000..a895ae3be7e0 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts @@ -0,0 +1,5 @@ +class C { + constructor(): number { } + + ['constructor'](): number { } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts new file mode 100644 index 000000000000..90628efe1fbe --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts @@ -0,0 +1,5 @@ +class C { + constructor() { } + + ['constructor']() { } +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-method.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-method.src.ts new file mode 100644 index 000000000000..a84bffcd4946 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-method.src.ts @@ -0,0 +1,5 @@ +class C { + foo(): number { } + bar() { } + baz() {} +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts new file mode 100644 index 000000000000..96a9937ece81 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts @@ -0,0 +1,7 @@ +class A { + "constructor"(): number { + } + + ["constructor"](): number { + } +}; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts new file mode 100644 index 000000000000..4cceca6404c7 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts @@ -0,0 +1,2 @@ +interface foo extends bar.baz { +} diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/object-with-typed-methods.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/object-with-typed-methods.src.ts new file mode 100644 index 000000000000..10549508c43e --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/object-with-typed-methods.src.ts @@ -0,0 +1,13 @@ +const foo = { + "constructor"(): number { + return 1 + }, + foo(): number { + return 1 + }, + get a(): number { + return 1 + }, + set a(x: number): number { + } +}; diff --git a/packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion-arrow-function.src.ts b/packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion-arrow-function.src.ts new file mode 100644 index 000000000000..f3827b2de3b8 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/typescript/basics/type-assertion-arrow-function.src.ts @@ -0,0 +1 @@ +var asserted2 = ((n) => { return n; }); diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 312d4449b5f0..09a733c9fd3b 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -1856,8 +1856,18 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-simple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src.ts.src 1`] = ` @@ -1894,6 +1904,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-method.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin-reference.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -1927,6 +1939,8 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-default.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -2018,6 +2032,8 @@ Object { } `; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-member-expression.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-generic.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -2042,6 +2058,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-escaped-properties.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-typed-methods.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/parenthesized-use-strict.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/symbol-type-param.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; @@ -2054,6 +2072,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-arrow-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-arrow-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-function.src.ts.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 183fd7e8dc9a..1446f08f1890 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -7566,6 +7566,414 @@ Object { } `; +exports[`typescript fixtures/basics/class-multi-line-keyword-abstract.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "abstract", + "range": Array [ + 0, + 8, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 17, + 19, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "B", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 9, + 19, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 20, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "abstract", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 9, + 14, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-multi-line-keyword-declare.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "declare", + "range": Array [ + 0, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "name": "B", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 18, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Keyword", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 13, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/basics/class-with-accessibility-modifiers.src 1`] = ` Object { "body": Array [ @@ -8919,19 +9327,19 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-modifier.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { + "accessibility": "protected", "computed": false, - "definite": true, "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 11, "line": 2, }, "start": Object { @@ -8939,16 +9347,17 @@ Object { "line": 2, }, }, - "name": "a", + "name": "constructor", "range": Array [ 12, - 13, + 21, ], "type": "Identifier", }, + "kind": "constructor", "loc": Object { "end": Object { - "column": 13, + "column": 29, "line": 2, }, "start": Object { @@ -8958,51 +9367,136 @@ Object { }, "range": Array [ 12, - 23, + 39, ], "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 39, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 12, + "column": 29, "line": 2, }, "start": Object { - "column": 4, + "column": 23, "line": 2, }, }, + "params": Array [], "range": Array [ - 14, - 22, + 33, + 39, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "type": "FunctionExpression", + }, + }, + Object { + "accessibility": "public", + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 51, + 64, + ], + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 43, + 71, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 30, + "line": 4, }, "start": Object { - "column": 6, - "line": 2, + "column": 27, + "line": 4, }, }, "range": Array [ - 16, - 22, + 68, + 71, ], - "type": "TSStringKeyword", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, }, + "params": Array [], + "range": Array [ + 65, + 71, + ], + "type": "FunctionExpression", }, - "value": null, }, ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 8, @@ -9011,7 +9505,7 @@ Object { }, "range": Array [ 8, - 25, + 73, ], "type": "ClassBody", }, @@ -9026,7 +9520,7 @@ Object { "line": 1, }, }, - "name": "X", + "name": "C", "range": Array [ 6, 7, @@ -9036,7 +9530,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -9045,7 +9539,7 @@ Object { }, "range": Array [ 0, - 25, + 73, ], "superClass": null, "type": "ClassDeclaration", @@ -9054,7 +9548,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -9063,7 +9557,7 @@ Object { }, "range": Array [ 0, - 26, + 74, ], "sourceType": "script", "tokens": Array [ @@ -9101,7 +9595,7 @@ Object { 7, ], "type": "Identifier", - "value": "X", + "value": "C", }, Object { "loc": Object { @@ -9124,7 +9618,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 11, "line": 2, }, "start": Object { @@ -9134,97 +9628,259 @@ Object { }, "range": Array [ 12, - 13, + 21, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 22, + 33, ], "type": "Identifier", - "value": "a", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 4, + "column": 24, "line": 2, }, "start": Object { - "column": 3, + "column": 23, "line": 2, }, }, "range": Array [ - 13, - 14, + 33, + 34, ], "type": "Punctuator", - "value": "!", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 25, "line": 2, }, "start": Object { - "column": 4, + "column": 24, "line": 2, }, }, "range": Array [ - 14, - 15, + 34, + 35, ], "type": "Punctuator", - "value": ":", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 27, "line": 2, }, "start": Object { - "column": 6, + "column": 26, "line": 2, }, }, "range": Array [ - 16, - 22, + 36, + 37, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 29, "line": 2, }, "start": Object { - "column": 12, + "column": 28, "line": 2, }, }, "range": Array [ - 22, - 23, + 38, + 39, ], "type": "Punctuator", - "value": ";", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Keyword", + "value": "public", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "range": Array [ + 51, + 64, + ], + "type": "String", + "value": "'constructor'", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 64, + 65, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 66, + 67, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 24, - 25, + 72, + 73, ], "type": "Punctuator", "value": "}", @@ -9234,7 +9890,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-export-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-return-type.src 1`] = ` Object { "body": Array [ Object { @@ -9245,35 +9901,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "name": "constructor", "range": Array [ - 16, - 27, + 12, + 23, ], "type": "Identifier", }, "kind": "constructor", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 27, + "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 16, - 54, + 12, + 37, ], "static": false, "type": "MethodDefinition", @@ -9283,17 +9939,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 27, + "line": 2, }, "start": Object { - "column": 34, + "column": 24, "line": 2, }, }, "range": Array [ - 46, - 54, + 34, + 37, ], "type": "BlockStatement", }, @@ -9302,90 +9958,132 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 27, + "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, - "params": Array [ - Object { - "export": true, + "params": Array [], + "range": Array [ + 23, + 37, + ], + "type": "FunctionExpression", + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 42, + 55, + ], + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 41, + 70, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 67, + 70, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [], + "range": Array [ + 56, + 70, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 58, + 66, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, - "line": 2, + "column": 27, + "line": 4, }, "start": Object { - "column": 16, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "name": "a", - "range": Array [ - 35, - 44, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 36, - 44, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 38, - 44, - ], - "type": "TSStringKeyword", - }, + "column": 21, + "line": 4, }, }, "range": Array [ - 28, - 44, + 60, + 66, ], - "type": "TSParameterProperty", + "type": "TSNumberKeyword", }, - ], - "range": Array [ - 27, - 54, - ], + }, "type": "FunctionExpression", }, }, @@ -9396,20 +10094,20 @@ Object { "line": 5, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 56, + 8, + 72, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -9417,10 +10115,10 @@ Object { "line": 1, }, }, - "name": "Foo", + "name": "C", "range": Array [ 6, - 9, + 7, ], "type": "Identifier", }, @@ -9436,7 +10134,7 @@ Object { }, "range": Array [ 0, - 56, + 72, ], "superClass": null, "type": "ClassDeclaration", @@ -9445,7 +10143,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 7, + "line": 6, }, "start": Object { "column": 0, @@ -9454,7 +10152,7 @@ Object { }, "range": Array [ 0, - 58, + 73, ], "sourceType": "script", "tokens": Array [ @@ -9479,7 +10177,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -9489,25 +10187,25 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", "value": "{", @@ -9515,17 +10213,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 16, - 27, + 12, + 23, ], "type": "Identifier", "value": "constructor", @@ -9533,17 +10231,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 2, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "range": Array [ - 27, - 28, + 23, + 24, ], "type": "Punctuator", "value": "(", @@ -9551,53 +10249,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 28, - 34, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, + "column": 15, "line": 2, }, "start": Object { - "column": 23, + "column": 14, "line": 2, }, }, "range": Array [ - 35, - 36, + 24, + 25, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 16, "line": 2, }, "start": Object { - "column": 24, + "column": 15, "line": 2, }, }, "range": Array [ - 36, - 37, + 25, + 26, ], "type": "Punctuator", "value": ":", @@ -9605,366 +10285,233 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 23, "line": 2, }, "start": Object { - "column": 26, + "column": 17, "line": 2, }, }, "range": Array [ - 38, - 44, + 27, + 33, ], "type": "Identifier", - "value": "string", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 25, "line": 2, }, "start": Object { - "column": 32, + "column": 24, "line": 2, }, }, "range": Array [ - 44, - 45, + 34, + 35, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 35, + "column": 27, "line": 2, }, "start": Object { - "column": 34, + "column": 26, "line": 2, }, }, "range": Array [ - 46, - 47, + 36, + 37, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 4, }, "start": Object { - "column": 4, + "column": 2, "line": 4, }, }, "range": Array [ - 53, - 54, + 41, + 42, ], "type": "Punctuator", - "value": "}", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 5, + "column": 3, + "line": 4, }, }, "range": Array [ + 42, 55, - 56, ], - "type": "Punctuator", - "value": "}", + "type": "String", + "value": "'constructor'", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 80, - "line": 1, - }, - "start": Object { - "column": 78, - "line": 1, - }, - }, - "range": Array [ - 78, - 80, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "ClassWithParentAndInterface", - "range": Array [ - 6, - 33, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 66, - "line": 1, - }, - }, - "name": "MyInterface", - "range": Array [ - 66, - 77, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 77, - "line": 1, - }, - "start": Object { - "column": 66, - "line": 1, - }, - }, - "range": Array [ - 66, - 77, - ], - "type": "TSClassImplements", - }, - ], "loc": Object { "end": Object { - "column": 80, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 16, + "line": 4, }, }, "range": Array [ - 0, - 80, + 55, + 56, ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 1, - }, - "start": Object { - "column": 42, - "line": 1, - }, - }, - "name": "MyOtherClass", - "range": Array [ - 42, - 54, - ], - "type": "Identifier", - }, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "]", }, - }, - "range": Array [ - 0, - 81, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 0, - 5, + 56, + 57, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 6, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 6, - 33, + 57, + 58, ], - "type": "Identifier", - "value": "ClassWithParentAndInterface", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 20, + "line": 4, }, "start": Object { - "column": 34, - "line": 1, + "column": 19, + "line": 4, }, }, "range": Array [ - 34, - 41, + 58, + 59, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 54, - "line": 1, + "column": 27, + "line": 4, }, "start": Object { - "column": 42, - "line": 1, + "column": 21, + "line": 4, }, }, "range": Array [ - 42, - 54, + 60, + 66, ], "type": "Identifier", - "value": "MyOtherClass", - }, - Object { - "loc": Object { - "end": Object { - "column": 65, - "line": 1, - }, - "start": Object { - "column": 55, - "line": 1, - }, - }, - "range": Array [ - 55, - 65, - ], - "type": "Keyword", - "value": "implements", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 77, - "line": 1, + "column": 29, + "line": 4, }, "start": Object { - "column": 66, - "line": 1, + "column": 28, + "line": 4, }, }, "range": Array [ - 66, - 77, + 67, + 68, ], - "type": "Identifier", - "value": "MyInterface", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 79, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 78, - "line": 1, + "column": 30, + "line": 4, }, }, "range": Array [ - 78, - 79, + 69, + 70, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 80, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 79, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ - 79, - 80, + 71, + 72, ], "type": "Punctuator", "value": "}", @@ -9974,193 +10521,280 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` +exports[`typescript fixtures/basics/class-with-constructor-and-type-parameters.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "range": Array [ - 28, - 32, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 32, - ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "superTypeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ + "body": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 12, + 23, + ], + "type": "Identifier", + }, + "kind": "constructor", "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 25, - 26, + 12, + 32, ], - "type": "TSTypeReference", - "typeName": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, }, - "name": "B", + "params": Array [], "range": Array [ - 25, 26, + 32, ], - "type": "Identifier", + "type": "FunctionExpression", }, }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", - }, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [ Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 3, + "line": 4, + }, + }, + "range": Array [ + 37, + 50, + ], + "raw": "'constructor'", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 10, - "line": 1, + "column": 2, + "line": 4, }, }, - "name": Object { + "range": Array [ + 36, + 60, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 57, + 60, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 10, - "line": 1, + "column": 20, + "line": 4, }, }, - "name": "A", + "params": Array [], "range": Array [ - 10, - 11, + 54, + 60, ], - "type": "Identifier", + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": "T", + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + }, + "range": Array [ + 52, + 53, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 51, + 54, + ], + "type": "TSTypeParameterDeclaration", + }, }, - "range": Array [ - 10, - 11, - ], - "type": "TSTypeParameter", }, ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, "range": Array [ - 9, - 12, + 8, + 62, ], - "type": "TSTypeParameterDeclaration", + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 62, + ], + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -10169,7 +10803,7 @@ Object { }, "range": Array [ 0, - 33, + 63, ], "sourceType": "script", "tokens": Array [ @@ -10194,7 +10828,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -10204,169 +10838,151 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 10, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - "value": "A", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 11, 12, + 23, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { "column": 13, - "line": 1, + "line": 2, }, }, "range": Array [ - 13, - 20, + 23, + 24, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 21, 24, + 25, ], "type": "Identifier", - "value": "Bar", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 24, 25, + 26, ], "type": "Punctuator", - "value": "<", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 25, 26, + 27, ], - "type": "Identifier", - "value": "B", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 26, 27, + 28, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 28, 29, + 30, ], "type": "Punctuator", "value": "{", @@ -10374,12 +10990,12 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 21, + "line": 2, }, }, "range": Array [ @@ -10389,262 +11005,339 @@ Object { "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 41, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 3, + "line": 4, }, - "range": Array [ - 41, - 45, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 2, + "line": 4, }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "[", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 3, + "line": 4, }, }, "range": Array [ - 0, - 45, + 37, + 50, ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, + "type": "String", + "value": "'constructor'", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, }, - "name": "Bar", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", }, - "superTypeParameters": Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, + "range": Array [ + 50, + 51, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, }, - "params": Array [ + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 51, + 52, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 19, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 25, + "line": 4, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-definite-assignment.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "TSTypeReference", - "typeName": Object { + "computed": false, + "definite": true, + "key": Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 2, + "line": 2, }, }, - "name": "C", + "name": "a", "range": Array [ - 35, - 36, + 12, + 13, ], "type": "Identifier", }, - }, - Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 38, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 38, - 39, + 12, + 23, ], - "type": "TSTypeReference", - "typeName": Object { + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 39, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 38, - "line": 1, + "column": 4, + "line": 2, }, }, - "name": "D", "range": Array [ - 38, - 39, + 14, + 22, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, + }, + }, + "range": Array [ + 16, + 22, + ], + "type": "TSStringKeyword", + }, }, + "value": null, }, ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, "range": Array [ - 34, - 40, + 8, + 25, ], - "type": "TSTypeParameterInstantiation", + "type": "ClassBody", }, - "type": "ClassDeclaration", - "typeParameters": Object { + "id": Object { "loc": Object { "end": Object { - "column": 22, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, - "params": Array [ - Object { - "constraint": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "B", - "range": Array [ - 20, - 21, - ], - "type": "Identifier", - }, - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 10, - 21, - ], - "type": "TSTypeParameter", - }, - ], + "name": "X", "range": Array [ - 9, - 22, + 6, + 7, ], - "type": "TSTypeParameterDeclaration", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 25, + ], + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { @@ -10659,7 +11352,7 @@ Object { }, "range": Array [ 0, - 46, + 26, ], "sourceType": "script", "tokens": Array [ @@ -10684,7 +11377,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -10694,271 +11387,145 @@ Object { }, "range": Array [ 6, - 9, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 8, "line": 1, }, }, "range": Array [ + 8, 9, - 10, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 10, - 11, + 12, + 13, ], "type": "Identifier", - "value": "A", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 4, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 3, + "line": 2, }, }, "range": Array [ - 12, - 19, + 13, + 14, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "!", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 20, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 20, - 21, + 14, + 15, ], - "type": "Identifier", - "value": "B", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 21, + 16, 22, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 23, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ + 22, 23, - 30, - ], - "type": "Keyword", - "value": "extends", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 34, ], - "type": "Identifier", - "value": "Bar", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 34, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 34, - 35, + 24, + 25, ], "type": "Punctuator", - "value": "<", + "value": "}", }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - "value": "C", - }, - Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 36, - "line": 1, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - "value": "D", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 42, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 3, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` -Object { - "body": Array [ + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-export-parameter-properties.src 1`] = ` +Object { + "body": Array [ Object { "body": Object { "body": Array [ @@ -10967,35 +11534,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, - "name": "getBar", + "name": "constructor", "range": Array [ - 14, - 20, + 16, + 27, ], "type": "Identifier", }, - "kind": "method", + "kind": "constructor", "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, "range": Array [ - 14, - 28, + 16, + 54, ], "static": false, "type": "MethodDefinition", @@ -11005,17 +11572,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 14, + "column": 34, "line": 2, }, }, "range": Array [ - 26, - 28, + 46, + 54, ], "type": "BlockStatement", }, @@ -11024,81 +11591,98 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 11, + "column": 15, "line": 2, }, }, - "params": Array [], - "range": Array [ - 23, - 28, - ], - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, + "params": Array [ + Object { + "export": true, + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, }, - }, - "params": Array [ - Object { + "parameter": Object { "loc": Object { "end": Object { - "column": 10, + "column": 32, "line": 2, }, "start": Object { - "column": 9, + "column": 23, "line": 2, }, }, - "name": Object { + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 10, + "column": 32, "line": 2, }, "start": Object { - "column": 9, + "column": 24, "line": 2, }, }, - "name": "T", "range": Array [ - 21, - 22, + 36, + 44, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSStringKeyword", + }, }, - "range": Array [ - 21, - 22, - ], - "type": "TSTypeParameter", }, - ], - "range": Array [ - 20, - 23, - ], - "type": "TSTypeParameterDeclaration", - }, + "range": Array [ + 28, + 44, + ], + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 10, @@ -11107,7 +11691,7 @@ Object { }, "range": Array [ 10, - 30, + 56, ], "type": "ClassBody", }, @@ -11132,7 +11716,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -11141,7 +11725,7 @@ Object { }, "range": Array [ 0, - 30, + 56, ], "superClass": null, "type": "ClassDeclaration", @@ -11150,7 +11734,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 7, }, "start": Object { "column": 0, @@ -11159,7 +11743,7 @@ Object { }, "range": Array [ 0, - 31, + 58, ], "sourceType": "script", "tokens": Array [ @@ -11220,107 +11804,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 15, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, "range": Array [ - 14, - 20, + 16, + 27, ], "type": "Identifier", - "value": "getBar", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 2, }, "start": Object { - "column": 8, + "column": 15, "line": 2, }, }, "range": Array [ - 20, - 21, + 27, + 28, ], "type": "Punctuator", - "value": "<", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 22, "line": 2, }, "start": Object { - "column": 9, + "column": 16, "line": 2, }, }, "range": Array [ - 21, - 22, + 28, + 34, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, ], "type": "Identifier", - "value": "T", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 25, "line": 2, }, "start": Object { - "column": 10, + "column": 24, "line": 2, }, }, "range": Array [ - 22, - 23, + 36, + 37, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 32, "line": 2, }, "start": Object { - "column": 11, + "column": 26, "line": 2, }, }, "range": Array [ - 23, - 24, + 38, + 44, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 33, "line": 2, }, "start": Object { - "column": 12, + "column": 32, "line": 2, }, }, "range": Array [ - 24, - 25, + 44, + 45, ], "type": "Punctuator", "value": ")", @@ -11328,17 +11930,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 35, "line": 2, }, "start": Object { - "column": 14, + "column": 34, "line": 2, }, }, "range": Array [ - 26, - 27, + 46, + 47, ], "type": "Punctuator", "value": "{", @@ -11346,17 +11948,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 15, - "line": 2, + "column": 4, + "line": 4, }, }, "range": Array [ - 27, - 28, + 53, + 54, ], "type": "Punctuator", "value": "}", @@ -11365,16 +11967,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 29, - 30, + 55, + 56, ], "type": "Punctuator", "value": "}", @@ -11384,236 +11986,122 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-and-implements.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "getBar", - "range": Array [ - 14, - 20, - ], - "type": "Identifier", - }, - "kind": "method", + "body": Array [], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 80, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "ClassWithParentAndInterface", + "range": Array [ + 6, + 33, + ], + "type": "Identifier", + }, + "implements": Array [ + Object { + "expression": Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 77, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 66, + "line": 1, }, }, + "name": "MyInterface", "range": Array [ - 14, - 34, + 66, + 77, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 32, - 34, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "params": Array [], - "range": Array [ - 29, - 34, - ], - "type": "FunctionExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "params": Array [ - Object { - "default": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 25, - 28, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "name": "Bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "range": Array [ - 21, - 28, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 20, - 29, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, + "type": "Identifier", }, - "start": Object { - "column": 10, - "line": 1, + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 66, + "line": 1, + }, }, + "range": Array [ + 66, + 77, + ], + "type": "TSClassImplements", + }, + ], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, }, - "range": Array [ - 10, - 36, - ], - "type": "ClassBody", }, - "id": Object { + "range": Array [ + 0, + 80, + ], + "superClass": Object { "loc": Object { "end": Object { - "column": 9, + "column": 54, "line": 1, }, "start": Object { - "column": 6, + "column": 42, "line": 1, }, }, - "name": "Foo", + "name": "MyOtherClass", "range": Array [ - 6, - 9, + 42, + 54, ], "type": "Identifier", }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 36, - ], - "superClass": null, "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -11622,7 +12110,7 @@ Object { }, "range": Array [ 0, - 37, + 81, ], "sourceType": "script", "tokens": Array [ @@ -11647,7 +12135,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 9, + "column": 33, "line": 1, }, "start": Object { @@ -11657,187 +12145,97 @@ Object { }, "range": Array [ 6, - 9, + 33, ], "type": "Identifier", - "value": "Foo", + "value": "ClassWithParentAndInterface", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 41, "line": 1, }, "start": Object { - "column": 10, + "column": 34, "line": 1, }, }, "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 14, - 20, - ], - "type": "Identifier", - "value": "getBar", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 20, - 21, + 34, + 41, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 54, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 42, + "line": 1, }, }, "range": Array [ - 21, - 22, + 42, + 54, ], "type": "Identifier", - "value": "T", + "value": "MyOtherClass", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 65, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 55, + "line": 1, }, }, "range": Array [ - 23, - 24, + 55, + 65, ], - "type": "Punctuator", - "value": "=", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 77, + "line": 1, }, "start": Object { - "column": 13, - "line": 2, + "column": 66, + "line": 1, }, }, "range": Array [ - 25, - 28, + 66, + 77, ], "type": "Identifier", - "value": "Bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": ")", + "value": "MyInterface", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 79, + "line": 1, }, "start": Object { - "column": 20, - "line": 2, + "column": 78, + "line": 1, }, }, "range": Array [ - 32, - 33, + 78, + 79, ], "type": "Punctuator", "value": "{", @@ -11845,35 +12243,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, + "column": 80, + "line": 1, }, "start": Object { - "column": 0, - "line": 3, + "column": 79, + "line": 1, }, }, "range": Array [ - 35, - 36, + 79, + 80, ], "type": "Punctuator", "value": "}", @@ -11883,7 +12263,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-generic.src 1`] = ` Object { "body": Array [ Object { @@ -11895,13 +12275,13 @@ Object { "line": 3, }, "start": Object { - "column": 25, + "column": 28, "line": 1, }, }, "range": Array [ - 25, - 29, + 28, + 32, ], "type": "ClassBody", }, @@ -11923,59 +12303,147 @@ Object { ], "type": "Identifier", }, - "implements": Array [ - Object { - "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "superTypeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 24, + "column": 26, "line": 1, }, "start": Object { - "column": 21, + "column": 25, "line": 1, }, }, - "name": "Bar", "range": Array [ - 21, - 24, + 25, + 26, ], - "type": "Identifier", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, - "start": Object { - "column": 21, - "line": 1, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", }, + "range": Array [ + 10, + 11, + ], + "type": "TSTypeParameter", }, - "range": Array [ - 21, - 24, - ], - "type": "TSClassImplements", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 0, - 29, - ], - "superClass": null, - "type": "ClassDeclaration", }, ], "loc": Object { @@ -11990,7 +12458,7 @@ Object { }, "range": Array [ 0, - 30, + 33, ], "sourceType": "script", "tokens": Array [ @@ -12033,21 +12501,75 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 10, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, "range": Array [ + 9, 10, - 20, ], - "type": "Keyword", - "value": "implements", - }, + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 20, + ], + "type": "Keyword", + "value": "extends", + }, Object { "loc": Object { "end": Object { @@ -12066,6 +12588,24 @@ Object { "type": "Identifier", "value": "Bar", }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "<", + }, Object { "loc": Object { "end": Object { @@ -12081,6 +12621,42 @@ Object { 25, 26, ], + "type": "Identifier", + "value": "B", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], "type": "Punctuator", "value": "{", }, @@ -12096,8 +12672,8 @@ Object { }, }, "range": Array [ - 28, - 29, + 31, + 32, ], "type": "Punctuator", "value": "}", @@ -12107,7 +12683,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` +exports[`typescript fixtures/basics/class-with-extends-generic-multiple.src 1`] = ` Object { "body": Array [ Object { @@ -12115,24 +12691,24 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 80, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 78, + "column": 41, "line": 1, }, }, "range": Array [ - 78, - 80, + 41, + 45, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 33, + "column": 9, "line": 1, }, "start": Object { @@ -12140,89 +12716,230 @@ Object { "line": 1, }, }, - "name": "ClassWithParentAndInterface", + "name": "Foo", "range": Array [ 6, - 33, + 9, ], "type": "Identifier", }, - "implements": Array [ - Object { - "expression": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "superClass": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "superTypeParameters": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 56, + "column": 36, "line": 1, }, "start": Object { - "column": 45, + "column": 35, "line": 1, }, }, - "name": "MyInterface", "range": Array [ - 45, - 56, + 35, + 36, ], - "type": "Identifier", + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "name": "C", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, }, - "loc": Object { - "end": Object { - "column": 56, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, }, - "start": Object { - "column": 45, - "line": 1, + "range": Array [ + 38, + 39, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "D", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", }, }, - "range": Array [ - 45, - 56, - ], - "type": "TSClassImplements", - }, - ], - "loc": Object { - "end": Object { - "column": 80, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + ], + "range": Array [ + 34, + 40, + ], + "type": "TSTypeParameterInstantiation", }, - "range": Array [ - 0, - 80, - ], - "superClass": Object { + "type": "ClassDeclaration", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 77, + "column": 22, "line": 1, }, "start": Object { - "column": 65, + "column": 9, "line": 1, }, }, - "name": "MyOtherClass", + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "B", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 10, + 21, + ], + "type": "TSTypeParameter", + }, + ], "range": Array [ - 65, - 77, + 9, + 22, ], - "type": "Identifier", + "type": "TSTypeParameterDeclaration", }, - "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -12231,7 +12948,7 @@ Object { }, "range": Array [ 0, - 81, + 46, ], "sourceType": "script", "tokens": Array [ @@ -12256,7 +12973,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, + "column": 9, "line": 1, }, "start": Object { @@ -12266,61 +12983,61 @@ Object { }, "range": Array [ 6, - 33, + 9, ], "type": "Identifier", - "value": "ClassWithParentAndInterface", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 44, + "column": 10, "line": 1, }, "start": Object { - "column": 34, + "column": 9, "line": 1, }, }, "range": Array [ - 34, - 44, + 9, + 10, ], - "type": "Keyword", - "value": "implements", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 56, + "column": 11, "line": 1, }, "start": Object { - "column": 45, + "column": 10, "line": 1, }, }, "range": Array [ - 45, - 56, + 10, + 11, ], "type": "Identifier", - "value": "MyInterface", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 64, + "column": 19, "line": 1, }, "start": Object { - "column": 57, + "column": 12, "line": 1, }, }, "range": Array [ - 57, - 64, + 12, + 19, ], "type": "Keyword", "value": "extends", @@ -12328,349 +13045,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 77, + "column": 21, "line": 1, }, "start": Object { - "column": 65, + "column": 20, "line": 1, }, }, "range": Array [ - 65, - 77, + 20, + 21, ], "type": "Identifier", - "value": "MyOtherClass", + "value": "B", }, Object { "loc": Object { "end": Object { - "column": 79, + "column": 22, "line": 1, }, "start": Object { - "column": 78, + "column": 21, "line": 1, }, }, "range": Array [ - 78, - 79, + 21, + 22, ], "type": "Punctuator", - "value": "{", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 80, + "column": 30, "line": 1, }, "start": Object { - "column": 79, + "column": 23, "line": 1, }, }, "range": Array [ - 79, - 80, + 23, + 30, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "extends", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 28, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, }, - "range": Array [ - 28, - 32, - ], - "type": "ClassBody", }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 24, - ], - "type": "TSClassImplements", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "S", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 24, - 27, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 32, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 33, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + "value": "Bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, }, }, "range": Array [ - 10, - 20, + 34, + 35, ], - "type": "Keyword", - "value": "implements", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 36, "line": 1, }, "start": Object { - "column": 21, + "column": 35, "line": 1, }, }, "range": Array [ - 21, - 24, + 35, + 36, ], "type": "Identifier", - "value": "Bar", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 37, "line": 1, }, "start": Object { - "column": 24, + "column": 36, "line": 1, }, }, "range": Array [ - 24, - 25, + 36, + 37, ], "type": "Punctuator", - "value": "<", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 26, + "column": 39, "line": 1, }, "start": Object { - "column": 25, + "column": 38, "line": 1, }, }, "range": Array [ - 25, - 26, + 38, + 39, ], "type": "Identifier", - "value": "S", + "value": "D", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 40, "line": 1, }, "start": Object { - "column": 26, + "column": 39, "line": 1, }, }, "range": Array [ - 26, - 27, + 39, + 40, ], "type": "Punctuator", "value": ">", @@ -12678,17 +13207,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 29, + "column": 42, "line": 1, }, "start": Object { - "column": 28, + "column": 41, "line": 1, }, }, "range": Array [ - 28, - 29, + 41, + 42, ], "type": "Punctuator", "value": "{", @@ -12705,8 +13234,8 @@ Object { }, }, "range": Array [ - 31, - 32, + 44, + 45, ], "type": "Punctuator", "value": "}", @@ -12716,172 +13245,179 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` +exports[`typescript fixtures/basics/class-with-generic-method.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 35, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, }, + "name": "getBar", + "range": Array [ + 14, + 20, + ], + "type": "Identifier", }, - "name": "Bar", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 24, - ], - "type": "TSClassImplements", - "typeParameters": Object { + "kind": "method", "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 2, + "line": 2, }, }, - "params": Array [ - Object { + "range": Array [ + 14, + 28, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 25, 26, + 28, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "S", - "range": Array [ - 25, - 26, - ], - "type": "Identifier", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, }, }, - Object { + "params": Array [], + "range": Array [ + 23, + 28, + ], + "type": "FunctionExpression", + "typeParameters": Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 8, + "line": 2, }, }, - "range": Array [ - 28, - 29, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, }, - "start": Object { - "column": 28, - "line": 1, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", }, - "name": "T", - "range": Array [ - 28, - 29, - ], - "type": "Identifier", - }, + ], + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", }, - ], - "range": Array [ - 24, - 30, - ], - "type": "TSTypeParameterInstantiation", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 1, }, }, - ], + "range": Array [ + 10, + 30, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { "column": 1, @@ -12894,7 +13430,7 @@ Object { }, "range": Array [ 0, - 35, + 30, ], "superClass": null, "type": "ClassDeclaration", @@ -12912,7 +13448,7 @@ Object { }, "range": Array [ 0, - 36, + 31, ], "sourceType": "script", "tokens": Array [ @@ -12955,7 +13491,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 20, + "column": 11, "line": 1, }, "start": Object { @@ -12965,43 +13501,43 @@ Object { }, "range": Array [ 10, - 20, + 11, ], - "type": "Keyword", - "value": "implements", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 21, - 24, + 14, + 20, ], "type": "Identifier", - "value": "Bar", + "value": "getBar", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 24, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 24, - 25, + 20, + 21, ], "type": "Punctuator", "value": "<", @@ -13009,93 +13545,111 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 25, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 25, - 26, + 21, + 22, ], "type": "Identifier", - "value": "S", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 26, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ - 26, - 27, + 22, + 23, ], "type": "Punctuator", - "value": ",", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 28, - 29, + 23, + 24, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 29, - "line": 1, + "column": 12, + "line": 2, }, }, "range": Array [ - 29, - 30, + 24, + 25, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 31, - 32, + 26, + 27, ], "type": "Punctuator", "value": "{", }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "}", + }, Object { "loc": Object { "end": Object { @@ -13108,8 +13662,8 @@ Object { }, }, "range": Array [ - 34, - 35, + 29, + 30, ], "type": "Punctuator", "value": "}", @@ -13119,874 +13673,236 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` +exports[`typescript fixtures/basics/class-with-generic-method-default.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { "body": Array [ Object { - "argument": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, - }, - }, - "range": Array [ - 79, - 82, - ], - "type": "ClassBody", - }, - "id": null, + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 33, + "column": 8, "line": 2, }, "start": Object { - "column": 11, + "column": 2, "line": 2, }, }, + "name": "getBar", "range": Array [ - 60, - 82, + 14, + 20, ], - "superClass": Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 25, - "line": 2, - }, - }, - "name": "Base", - "range": Array [ - 74, - 78, - ], - "type": "Identifier", - }, - "type": "ClassExpression", + "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 33, + "column": 22, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 53, - 82, - ], - "type": "ReturnStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 47, - "line": 1, - }, - }, - "range": Array [ - 47, - 84, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "M", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 38, - "line": 1, - }, - }, - "name": "Base", - "range": Array [ - 38, - 45, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 42, - "line": 1, - }, - }, - "range": Array [ - 42, - 45, + 14, + 34, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, - }, - "start": Object { - "column": 44, - "line": 1, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "TSTypeReference", - "typeName": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 44, - "line": 1, + "column": 20, + "line": 2, }, }, - "name": "T", "range": Array [ - 44, - 45, + 32, + 34, ], - "type": "Identifier", + "type": "BlockStatement", }, - }, - }, - }, - ], - "range": Array [ - 0, - 84, - ], - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "constraint": Object { + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 17, + "line": 2, }, }, + "params": Array [], "range": Array [ - 21, - 36, + 29, + 34, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Constructor", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - }, + "type": "FunctionExpression", "typeParameters": Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 8, + "line": 2, }, }, "params": Array [ Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + }, "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 9, + "line": 2, }, }, - "members": Array [], + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, "range": Array [ - 33, - 35, + 21, + 28, ], - "type": "TSTypeLiteral", + "type": "TSTypeParameter", }, ], "range": Array [ - 32, - 36, + 20, + 29, ], - "type": "TSTypeParameterInstantiation", - }, - }, - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, + "type": "TSTypeParameterDeclaration", }, - "name": "T", - "range": Array [ - 11, - 12, - ], - "type": "Identifier", }, - "range": Array [ - 11, - 36, - ], - "type": "TSTypeParameter", }, ], - "range": Array [ - 10, - 37, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - Object { - "body": Object { - "body": Array [], "loc": Object { "end": Object { - "column": 42, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 39, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 125, - 128, + 10, + 36, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { "column": 6, - "line": 5, + "line": 1, }, }, - "name": "X", + "name": "Foo", "range": Array [ - 92, - 93, - ], - "type": "Identifier", - }, - "implements": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 5, - }, - "start": Object { - "column": 37, - "line": 5, - }, - }, - "name": "I", - "range": Array [ - 123, - 124, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 38, - "line": 5, - }, - "start": Object { - "column": 37, - "line": 5, - }, - }, - "range": Array [ - 123, - 124, - ], - "type": "TSClassImplements", - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 86, - 128, - ], - "superClass": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 5, - }, - "start": Object { - "column": 23, - "line": 5, - }, - }, - "name": "C", - "range": Array [ - 109, - 110, - ], - "type": "Identifier", - }, - ], - "callee": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "name": "M", - "range": Array [ - 102, - 103, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 16, - "line": 5, - }, - }, - "range": Array [ - 102, - 111, - ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 5, - }, - "start": Object { - "column": 17, - "line": 5, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 5, - }, - "start": Object { - "column": 18, - "line": 5, - }, - }, - "range": Array [ - 104, - 107, - ], - "type": "TSAnyKeyword", - }, - ], - "range": Array [ - 103, - 108, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - "type": "ClassDeclaration", - }, - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 11, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, - }, - "range": Array [ - 138, - 141, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, - }, - "name": "C", - "range": Array [ - 136, - 137, + 6, + 9, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 7, + "line": 1, }, }, "range": Array [ - 130, - 141, + 0, + 36, ], "superClass": null, "type": "ClassDeclaration", }, - Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 12, - "line": 8, - }, - }, - "range": Array [ - 154, - 157, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 8, - }, - "start": Object { - "column": 10, - "line": 8, - }, - }, - "name": "I", - "range": Array [ - 152, - 153, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 8, - }, - }, - "range": Array [ - 142, - 157, - ], - "type": "TSInterfaceDeclaration", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 9, - }, - "start": Object { - "column": 5, - "line": 9, - }, - }, - "name": "Constructor", - "range": Array [ - 163, - 174, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 48, - "line": 9, - }, - "start": Object { - "column": 0, - "line": 9, - }, - }, - "range": Array [ - 158, - 206, - ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 22, - "line": 9, - }, - }, - "params": Array [ - Object { - "argument": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 9, - }, - "start": Object { - "column": 30, - "line": 9, - }, - }, - "name": "args", - "range": Array [ - 188, - 192, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 27, - "line": 9, - }, - }, - "range": Array [ - 185, - 199, - ], - "type": "RestElement", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 34, - "line": 9, - }, - }, - "range": Array [ - 192, - 199, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "elementType": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 9, - }, - "start": Object { - "column": 36, - "line": 9, - }, - }, - "range": Array [ - 194, - 197, - ], - "type": "TSAnyKeyword", - }, - "loc": Object { - "end": Object { - "column": 41, - "line": 9, - }, - "start": Object { - "column": 36, - "line": 9, - }, - }, - "range": Array [ - 194, - 199, - ], - "type": "TSArrayType", - }, - }, - }, - ], - "range": Array [ - 180, - 205, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 43, - "line": 9, - }, - }, - "range": Array [ - 201, - 205, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 46, - "line": 9, - }, - }, - "range": Array [ - 204, - 205, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 46, - "line": 9, - }, - }, - "name": "T", - "range": Array [ - 204, - 205, - ], - "type": "Identifier", - }, - }, - }, - "type": "TSConstructorType", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 9, - }, - "start": Object { - "column": 16, - "line": 9, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 9, - }, - "start": Object { - "column": 17, - "line": 9, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 9, - }, - "start": Object { - "column": 17, - "line": 9, - }, - }, - "name": "T", - "range": Array [ - 175, - 176, - ], - "type": "Identifier", - }, - "range": Array [ - 175, - 176, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 174, - 177, - ], - "type": "TSTypeParameterDeclaration", - }, - }, ], "loc": Object { "end": Object { "column": 0, - "line": 10, + "line": 4, }, "start": Object { "column": 0, @@ -13995,14 +13911,14 @@ Object { }, "range": Array [ 0, - 207, + 37, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -14012,28 +13928,28 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 9, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ + 6, 9, - 10, ], "type": "Identifier", - "value": "M", + "value": "Foo", }, Object { "loc": Object { @@ -14051,400 +13967,577 @@ Object { 11, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 11, - 12, + 14, + 20, ], "type": "Identifier", - "value": "T", + "value": "getBar", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 9, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 8, + "line": 2, }, }, "range": Array [ - 13, 20, + 21, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 10, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ 21, - 32, + 22, ], "type": "Identifier", - "value": "Constructor", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 32, - 33, + 23, + 24, ], "type": "Punctuator", - "value": "<", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 33, - 34, + 25, + 28, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 34, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 34, - 35, + 28, + 29, ], "type": "Punctuator", - "value": "}", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 35, - 36, + 29, + 30, ], "type": "Punctuator", - "value": ">", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 36, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 36, - 37, + 30, + 31, ], "type": "Punctuator", - "value": ">", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 37, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 37, - 38, + 32, + 33, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 38, - "line": 1, + "column": 21, + "line": 2, }, }, "range": Array [ - 38, - 42, + 33, + 34, ], - "type": "Identifier", - "value": "Base", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 42, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 42, - 43, + 35, + 36, ], "type": "Punctuator", - "value": ":", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 45, - "line": 1, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 25, + "line": 1, + }, }, - "start": Object { - "column": 44, - "line": 1, + "range": Array [ + 25, + 29, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, - "range": Array [ - 44, - 45, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSClassImplements", + }, ], - "type": "Identifier", - "value": "T", - }, - Object { "loc": Object { "end": Object { - "column": 46, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 45, + "column": 0, "line": 1, }, }, "range": Array [ - 45, - 46, + 0, + 29, ], - "type": "Punctuator", - "value": ")", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 30, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 48, + "column": 5, "line": 1, }, "start": Object { - "column": 47, + "column": 0, "line": 1, }, }, "range": Array [ - 47, - 48, + 0, + 5, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 9, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 6, + "line": 1, }, }, "range": Array [ - 53, - 59, + 6, + 9, ], - "type": "Keyword", - "value": "return", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 20, + "line": 1, }, "start": Object { - "column": 11, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 60, - 65, + 10, + 20, ], "type": "Keyword", - "value": "class", + "value": "implements", }, Object { "loc": Object { "end": Object { "column": 24, - "line": 2, + "line": 1, }, "start": Object { - "column": 17, - "line": 2, + "column": 21, + "line": 1, }, }, "range": Array [ - 66, - 73, + 21, + 24, ], - "type": "Keyword", - "value": "extends", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 2, + "column": 26, + "line": 1, }, "start": Object { "column": 25, - "line": 2, + "line": 1, }, }, "range": Array [ - 74, - 78, + 25, + 26, ], - "type": "Identifier", - "value": "Base", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 2, + "column": 1, + "line": 3, }, "start": Object { - "column": 30, - "line": 2, + "column": 0, + "line": 3, }, }, "range": Array [ - 79, - 80, + 28, + 29, ], "type": "Punctuator", - "value": "{", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-and-extends.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 80, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, }, - "start": Object { - "column": 32, - "line": 2, + "range": Array [ + 78, + 80, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "ClassWithParentAndInterface", + "range": Array [ + 6, + 33, + ], + "type": "Identifier", }, - "range": Array [ - 81, - 82, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "name": "MyInterface", + "range": Array [ + 45, + 56, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 56, + ], + "type": "TSClassImplements", + }, ], - "type": "Punctuator", - "value": "}", - }, - Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 80, + "line": 1, }, "start": Object { "column": 0, - "line": 3, + "line": 1, }, }, "range": Array [ - 83, - 84, + 0, + 80, ], - "type": "Punctuator", - "value": "}", + "superClass": Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "name": "MyOtherClass", + "range": Array [ + 65, + 77, + ], + "type": "Identifier", + }, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 81, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 5, - "line": 5, + "line": 1, }, "start": Object { "column": 0, - "line": 5, + "line": 1, }, }, "range": Array [ - 86, - 91, + 0, + 5, ], "type": "Keyword", "value": "class", @@ -14452,251 +14545,313 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 5, + "column": 33, + "line": 1, }, "start": Object { "column": 6, - "line": 5, + "line": 1, }, }, "range": Array [ - 92, - 93, + 6, + 33, ], "type": "Identifier", - "value": "X", + "value": "ClassWithParentAndInterface", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 44, + "line": 1, }, "start": Object { - "column": 8, - "line": 5, + "column": 34, + "line": 1, }, }, "range": Array [ - 94, - 101, + 34, + 44, ], "type": "Keyword", - "value": "extends", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 5, + "column": 56, + "line": 1, }, "start": Object { - "column": 16, - "line": 5, + "column": 45, + "line": 1, }, }, "range": Array [ - 102, - 103, + 45, + 56, ], "type": "Identifier", - "value": "M", + "value": "MyInterface", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 64, + "line": 1, }, "start": Object { - "column": 17, - "line": 5, + "column": 57, + "line": 1, }, }, "range": Array [ - 103, - 104, + 57, + 64, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 5, + "column": 77, + "line": 1, }, "start": Object { - "column": 18, - "line": 5, + "column": 65, + "line": 1, }, }, "range": Array [ - 104, - 107, + 65, + 77, ], "type": "Identifier", - "value": "any", + "value": "MyOtherClass", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 5, + "column": 79, + "line": 1, }, "start": Object { - "column": 21, - "line": 5, + "column": 78, + "line": 1, }, }, "range": Array [ - 107, - 108, + 78, + 79, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 5, + "column": 80, + "line": 1, }, "start": Object { - "column": 22, - "line": 5, + "column": 79, + "line": 1, }, }, "range": Array [ - 108, - 109, + 79, + 80, ], "type": "Punctuator", - "value": "(", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-generic.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 5, - }, - "start": Object { - "column": 23, - "line": 5, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 28, + "line": 1, + }, }, + "range": Array [ + 28, + 32, + ], + "type": "ClassBody", }, - "range": Array [ - 109, - 110, - ], - "type": "Identifier", - "value": "C", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 5, - }, - "start": Object { - "column": 24, - "line": 5, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, - "range": Array [ - 110, - 111, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 5, - }, - "start": Object { - "column": 26, - "line": 5, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSClassImplements", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 27, + ], + "type": "TSTypeParameterInstantiation", + }, }, - }, - "range": Array [ - 112, - 122, ], - "type": "Keyword", - "value": "implements", - }, - Object { "loc": Object { "end": Object { - "column": 38, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 37, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 123, - 124, + 0, + 32, ], - "type": "Identifier", - "value": "I", + "superClass": null, + "type": "ClassDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 5, - }, - "start": Object { - "column": 39, - "line": 5, - }, - }, - "range": Array [ - 125, - 126, - ], - "type": "Punctuator", - "value": "{", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 5, - }, - "start": Object { - "column": 41, - "line": 5, - }, - }, - "range": Array [ - 127, - 128, - ], - "type": "Punctuator", - "value": "}", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 33, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { "column": 5, - "line": 7, + "line": 1, }, "start": Object { "column": 0, - "line": 7, + "line": 1, }, }, "range": Array [ - 130, - 135, + 0, + 5, ], "type": "Keyword", "value": "class", @@ -14704,737 +14859,940 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 9, + "line": 1, }, "start": Object { "column": 6, - "line": 7, + "line": 1, }, }, "range": Array [ - 136, - 137, + 6, + 9, ], "type": "Identifier", - "value": "C", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 7, + "column": 20, + "line": 1, }, "start": Object { - "column": 8, - "line": 7, + "column": 10, + "line": 1, }, }, "range": Array [ - 138, - 139, + 10, + 20, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 7, + "column": 24, + "line": 1, }, "start": Object { - "column": 10, - "line": 7, + "column": 21, + "line": 1, }, }, "range": Array [ - 140, - 141, + 21, + 24, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 25, + "line": 1, }, "start": Object { - "column": 0, - "line": 8, + "column": 24, + "line": 1, }, }, "range": Array [ - 142, - 151, + 24, + 25, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 8, + "column": 26, + "line": 1, }, "start": Object { - "column": 10, - "line": 8, + "column": 25, + "line": 1, }, }, "range": Array [ - 152, - 153, + 25, + 26, ], "type": "Identifier", - "value": "I", + "value": "S", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 8, + "column": 27, + "line": 1, }, "start": Object { - "column": 12, - "line": 8, + "column": 26, + "line": 1, }, }, "range": Array [ - 154, - 155, + 26, + 27, ], "type": "Punctuator", - "value": "{", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 8, + "column": 29, + "line": 1, }, "start": Object { - "column": 14, - "line": 8, + "column": 28, + "line": 1, }, }, "range": Array [ - 156, - 157, + 28, + 29, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 9, + "column": 1, + "line": 3, }, "start": Object { "column": 0, - "line": 9, + "line": 3, }, }, "range": Array [ - 158, - 162, + 31, + 32, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-implements-generic-multiple.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 9, - }, - "start": Object { - "column": 5, - "line": 9, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 1, + }, }, + "range": Array [ + 31, + 35, + ], + "type": "ClassBody", }, - "range": Array [ - 163, - 174, - ], - "type": "Identifier", - "value": "Constructor", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 9, - }, - "start": Object { - "column": 16, - "line": 9, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, - "range": Array [ - 174, - 175, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 9, - }, - "start": Object { - "column": 17, - "line": 9, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "TSClassImplements", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "S", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 24, + 30, + ], + "type": "TSTypeParameterInstantiation", + }, }, - }, - "range": Array [ - 175, - 176, ], - "type": "Identifier", - "value": "T", - }, - Object { "loc": Object { "end": Object { - "column": 19, - "line": 9, + "column": 1, + "line": 3, }, "start": Object { - "column": 18, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 176, - 177, + 0, + 35, ], - "type": "Punctuator", - "value": ">", + "superClass": null, + "type": "ClassDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 9, - }, - "start": Object { - "column": 20, - "line": 9, - }, - }, - "range": Array [ - 178, - 179, - ], - "type": "Punctuator", - "value": "=", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 25, - "line": 9, + "column": 5, + "line": 1, }, "start": Object { - "column": 22, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 180, - 183, + 0, + 5, ], "type": "Keyword", - "value": "new", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 9, + "column": 9, + "line": 1, }, "start": Object { - "column": 26, - "line": 9, + "column": 6, + "line": 1, }, }, "range": Array [ - 184, - 185, + 6, + 9, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 9, + "column": 20, + "line": 1, }, "start": Object { - "column": 27, - "line": 9, + "column": 10, + "line": 1, }, }, "range": Array [ - 185, - 188, + 10, + 20, ], - "type": "Punctuator", - "value": "...", + "type": "Keyword", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 9, + "column": 24, + "line": 1, }, "start": Object { - "column": 30, - "line": 9, + "column": 21, + "line": 1, }, }, "range": Array [ - 188, - 192, + 21, + 24, ], "type": "Identifier", - "value": "args", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 9, + "column": 25, + "line": 1, }, "start": Object { - "column": 34, - "line": 9, + "column": 24, + "line": 1, }, }, "range": Array [ - 192, - 193, + 24, + 25, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 9, + "column": 26, + "line": 1, }, "start": Object { - "column": 36, - "line": 9, + "column": 25, + "line": 1, }, }, "range": Array [ - 194, - 197, + 25, + 26, ], "type": "Identifier", - "value": "any", + "value": "S", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 9, + "column": 27, + "line": 1, }, "start": Object { - "column": 39, - "line": 9, + "column": 26, + "line": 1, }, }, "range": Array [ - 197, - 198, + 26, + 27, ], "type": "Punctuator", - "value": "[", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 9, + "column": 29, + "line": 1, }, "start": Object { - "column": 40, - "line": 9, + "column": 28, + "line": 1, }, }, "range": Array [ - 198, - 199, + 28, + 29, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 9, + "column": 30, + "line": 1, }, "start": Object { - "column": 41, - "line": 9, + "column": 29, + "line": 1, }, }, "range": Array [ - 199, - 200, + 29, + 30, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 9, + "column": 32, + "line": 1, }, "start": Object { - "column": 43, - "line": 9, + "column": 31, + "line": 1, }, }, "range": Array [ - 201, - 203, + 31, + 32, ], "type": "Punctuator", - "value": "=>", - }, - Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 9, - }, - "start": Object { - "column": 46, - "line": 9, - }, - }, - "range": Array [ - 204, - 205, - ], - "type": "Identifier", - "value": "T", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 48, - "line": 9, + "column": 1, + "line": 3, }, "start": Object { - "column": 47, - "line": 9, + "column": 0, + "line": 3, }, }, "range": Array [ - 205, - 206, + 34, + 35, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` +exports[`typescript fixtures/basics/class-with-method.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 46, - "line": 1, - }, - }, - "range": Array [ - 46, - 49, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "M", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 37, - "line": 1, + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 12, + 15, + ], + "type": "Identifier", }, - }, - "name": "Base", - "range": Array [ - 37, - 44, - ], - "type": "Identifier", - "typeAnnotation": Object { + "kind": "method", "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 41, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 41, - 44, + 12, + 29, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 43, - "line": 1, + "column": 5, + "line": 2, }, }, + "params": Array [], "range": Array [ - 43, - 44, + 15, + 29, ], - "type": "TSTypeReference", - "typeName": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 43, - "line": 1, + "column": 7, + "line": 2, }, }, - "name": "T", "range": Array [ - 43, - 44, + 17, + 25, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 19, + 25, + ], + "type": "TSNumberKeyword", + }, }, + "type": "FunctionExpression", }, }, - }, - ], - "range": Array [ - 0, - 49, - ], - "type": "FunctionDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ Object { - "constraint": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 2, + "line": 3, }, }, + "name": "bar", "range": Array [ - 21, + 32, 35, ], - "type": "TSTypeReference", - "typeName": Object { + "type": "Identifier", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 32, + 44, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 14, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, + "column": 11, + "line": 3, }, }, - "name": "Constructor", "range": Array [ - 21, - 32, + 41, + 44, ], - "type": "Identifier", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, }, + "params": Array [], + "range": Array [ + 38, + 44, + ], + "type": "FunctionExpression", "typeParameters": Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 8, + "line": 3, }, "start": Object { - "column": 32, - "line": 1, + "column": 5, + "line": 3, }, }, "params": Array [ Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 33, - "line": 1, + "column": 6, + "line": 3, }, }, - "range": Array [ - 33, - 34, - ], - "type": "TSTypeReference", - "typeName": Object { + "name": Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 33, - "line": 1, + "column": 6, + "line": 3, }, }, - "name": "M", + "name": "T", "range": Array [ - 33, - 34, + 36, + 37, ], "type": "Identifier", }, + "range": Array [ + 36, + 37, + ], + "type": "TSTypeParameter", }, ], "range": Array [ - 32, 35, + 38, ], - "type": "TSTypeParameterInstantiation", + "type": "TSTypeParameterDeclaration", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, }, + "name": "baz", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 10, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 2, + "line": 4, }, }, - "name": Object { + "range": Array [ + 47, + 55, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 53, + 55, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 10, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 5, + "line": 4, }, }, - "name": "T", + "params": Array [], "range": Array [ - 11, - 12, + 50, + 55, ], - "type": "Identifier", + "type": "FunctionExpression", }, - "range": Array [ - 11, - 35, - ], - "type": "TSTypeParameter", }, ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 57, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "C", "range": Array [ - 10, - 36, + 6, + 7, ], - "type": "TSTypeParameterDeclaration", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, }, + "range": Array [ + 0, + 57, + ], + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 6, }, "start": Object { "column": 0, @@ -15443,14 +15801,14 @@ Object { }, "range": Array [ 0, - 50, + 58, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -15460,487 +15818,295 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 10, + 6, + 7, ], "type": "Identifier", - "value": "M", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 9, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 11, + 8, + 9, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 11, 12, + 15, ], "type": "Identifier", - "value": "T", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 13, - 20, + 15, + 16, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 21, - "line": 1, + "column": 6, + "line": 2, }, }, "range": Array [ - 21, - 32, + 16, + 17, ], - "type": "Identifier", - "value": "Constructor", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 32, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 32, - 33, + 17, + 18, ], "type": "Punctuator", - "value": "<", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 33, - "line": 1, + "column": 9, + "line": 2, }, }, "range": Array [ - 33, - 34, + 19, + 25, ], "type": "Identifier", - "value": "M", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 34, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 34, - 35, + 26, + 27, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 36, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 35, - 36, + 28, + 29, ], "type": "Punctuator", - "value": ">", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 1, + "column": 5, + "line": 3, }, "start": Object { - "column": 36, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 36, - 37, + 32, + 35, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 6, + "line": 3, }, "start": Object { - "column": 37, - "line": 1, + "column": 5, + "line": 3, }, }, "range": Array [ - 37, - 41, + 35, + 36, ], - "type": "Identifier", - "value": "Base", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 41, - "line": 1, + "column": 6, + "line": 3, }, }, "range": Array [ - 41, - 42, + 36, + 37, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 8, + "line": 3, }, "start": Object { - "column": 43, - "line": 1, + "column": 7, + "line": 3, }, }, "range": Array [ - 43, - 44, + 37, + 38, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 45, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 44, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 44, - 45, + 38, + 39, ], "type": "Punctuator", - "value": ")", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 1, + "column": 10, + "line": 3, }, "start": Object { - "column": 46, - "line": 1, - }, - }, - "range": Array [ - 46, - 47, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, + "column": 9, + "line": 3, }, }, "range": Array [ - 48, - 49, + 39, + 40, ], "type": "Punctuator", - "value": "}", + "value": ")", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "accessibility": "private", - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "range": Array [ - 23, - 28, - ], - "raw": "'foo'", - "type": "Literal", - "value": "foo", - }, - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 14, - 43, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "name": "undefined", - "range": Array [ - 33, - 42, - ], - "type": "Identifier", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 45, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, + "column": 12, "line": 3, }, "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 45, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 46, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - "value": "X", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, + "column": 11, + "line": 3, }, }, "range": Array [ - 8, - 9, + 41, + 42, ], "type": "Punctuator", "value": "{", @@ -15948,161 +16114,125 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 2, + "column": 14, + "line": 3, }, "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 14, - 21, - ], - "type": "Keyword", - "value": "private", - }, - Object { - "loc": Object { - "end": Object { "column": 13, - "line": 2, - }, - "start": Object { - "column": 12, - "line": 2, + "line": 3, }, }, "range": Array [ - 22, - 23, + 43, + 44, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 5, + "line": 4, }, "start": Object { - "column": 13, - "line": 2, + "column": 2, + "line": 4, }, }, "range": Array [ - 23, - 28, + 47, + 50, ], - "type": "String", - "value": "'foo'", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 6, + "line": 4, }, "start": Object { - "column": 18, - "line": 2, + "column": 5, + "line": 4, }, }, "range": Array [ - 28, - 29, + 50, + 51, ], "type": "Punctuator", - "value": "]", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 7, + "line": 4, }, "start": Object { - "column": 19, - "line": 2, + "column": 6, + "line": 4, }, }, "range": Array [ - 29, - 30, + 51, + 52, ], "type": "Punctuator", - "value": "?", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 9, + "line": 4, }, "start": Object { - "column": 21, - "line": 2, + "column": 8, + "line": 4, }, }, "range": Array [ - 31, - 32, + 53, + 54, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "range": Array [ - 33, - 42, - ], - "type": "Keyword", - "value": "undefined", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 33, - "line": 2, + "column": 10, + "line": 4, }, "start": Object { - "column": 32, - "line": 2, + "column": 9, + "line": 4, }, }, "range": Array [ - 42, - 43, + 54, + 55, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 44, - 45, + 56, + 57, ], "type": "Punctuator", "value": "}", @@ -16112,692 +16242,1170 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-optional-methods.src 1`] = ` +exports[`typescript fixtures/basics/class-with-mixin.src 1`] = ` Object { "body": Array [ Object { + "async": false, "body": Object { "body": Array [ Object { - "computed": false, - "key": Object { + "argument": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 79, + 82, + ], + "type": "ClassBody", + }, + "id": null, "loc": Object { "end": Object { - "column": 5, + "column": 33, "line": 2, }, "start": Object { - "column": 2, + "column": 11, "line": 2, }, }, - "name": "foo", - "optional": true, "range": Array [ - 14, - 17, + 60, + 82, ], - "type": "Identifier", + "superClass": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "Base", + "range": Array [ + 74, + 78, + ], + "type": "Identifier", + }, + "type": "ClassExpression", }, - "kind": "method", "loc": Object { "end": Object { - "column": 9, + "column": 33, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, "range": Array [ - 14, - 21, + 53, + 82, ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": null, - "expression": false, - "generator": false, - "id": null, + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 84, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "M", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "Base", + "range": Array [ + 38, + 45, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 45, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 45, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 44, + "line": 1, }, }, - "params": Array [], "range": Array [ - 18, - 21, + 44, + 45, ], - "type": "FunctionExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, }, - }, - "name": "bar", - "optional": true, - "range": Array [ - 24, - 27, - ], - "type": "Identifier", - }, - "kind": "method", - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, + "name": "T", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", }, }, - "range": Array [ - 24, - 39, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": null, - "expression": false, - "generator": false, - "id": null, + }, + }, + ], + "range": Array [ + 0, + 84, + ], + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 36, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 21, + "line": 1, }, }, - "params": Array [], "range": Array [ - 28, - 39, + 21, + 36, ], - "returnType": Object { + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 21, + "line": 1, }, }, + "name": "Constructor", "range": Array [ - 30, - 38, + 21, + 32, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 32, - 38, - ], - "type": "TSStringKeyword", - }, + "type": "Identifier", }, - "type": "FunctionExpression", - }, - }, - Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 4, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "members": Array [], + "range": Array [ + 33, + 35, + ], + "type": "TSTypeLiteral", + }, + ], + "range": Array [ + 32, + 36, + ], + "type": "TSTypeParameterInstantiation", }, - "name": "baz", - "optional": true, - "range": Array [ - 50, - 53, - ], - "type": "Identifier", }, - "kind": "method", "loc": Object { "end": Object { - "column": 25, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 11, + "line": 1, }, }, - "range": Array [ - 42, - 65, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": null, - "expression": false, - "generator": false, - "id": null, + "name": Object { "loc": Object { "end": Object { - "column": 25, - "line": 4, + "column": 12, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 11, + "line": 1, }, }, - "params": Array [], + "name": "T", "range": Array [ - 54, - 65, + 11, + 12, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "range": Array [ - 56, - 64, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "range": Array [ - 58, - 64, - ], - "type": "TSStringKeyword", - }, - }, - "type": "FunctionExpression", + "type": "Identifier", }, + "range": Array [ + 11, + 36, + ], + "type": "TSTypeParameter", }, ], + "range": Array [ + 10, + 37, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 1, + "column": 42, "line": 5, }, "start": Object { - "column": 10, - "line": 1, + "column": 39, + "line": 5, }, }, "range": Array [ - 10, - 67, + 125, + 128, ], "type": "ClassBody", }, "id": Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 7, + "line": 5, }, "start": Object { "column": 6, - "line": 1, + "line": 5, }, }, - "name": "Foo", + "name": "X", "range": Array [ - 6, - 9, + 92, + 93, ], "type": "Identifier", }, + "implements": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "name": "I", + "range": Array [ + 123, + 124, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 38, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 123, + 124, + ], + "type": "TSClassImplements", + }, + ], "loc": Object { "end": Object { - "column": 1, + "column": 42, "line": 5, }, "start": Object { "column": 0, - "line": 1, + "line": 5, }, }, "range": Array [ - 0, - 67, + 86, + 128, ], - "superClass": null, + "superClass": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 5, + }, + "start": Object { + "column": 23, + "line": 5, + }, + }, + "name": "C", + "range": Array [ + 109, + 110, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "name": "M", + "range": Array [ + 102, + 103, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 102, + 111, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 104, + 107, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 103, + 108, + ], + "type": "TSTypeParameterInstantiation", + }, + }, "type": "ClassDeclaration", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 68, - ], - "sourceType": "script", - "tokens": Array [ Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, }, - "start": Object { - "column": 0, - "line": 1, + "range": Array [ + 138, + 141, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, }, + "name": "C", + "range": Array [ + 136, + 137, + ], + "type": "Identifier", }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 11, + "line": 7, }, "start": Object { - "column": 6, - "line": 1, + "column": 0, + "line": 7, }, }, "range": Array [ - 6, - 9, + 130, + 141, ], - "type": "Identifier", - "value": "Foo", + "superClass": null, + "type": "ClassDeclaration", }, Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 154, + 157, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 8, + }, + "start": Object { + "column": 10, + "line": 8, + }, + }, + "name": "I", + "range": Array [ + 152, + 153, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 15, + "line": 8, }, "start": Object { - "column": 10, - "line": 1, + "column": 0, + "line": 8, }, }, "range": Array [ - 10, - 11, + 142, + 157, ], - "type": "Punctuator", - "value": "{", + "type": "TSInterfaceDeclaration", }, Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 5, + "line": 9, + }, + }, + "name": "Constructor", + "range": Array [ + 163, + 174, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 5, - "line": 2, + "column": 48, + "line": 9, }, "start": Object { - "column": 2, - "line": 2, + "column": 0, + "line": 9, }, }, "range": Array [ - 14, - 17, + 158, + 206, ], - "type": "Identifier", - "value": "foo", + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 22, + "line": 9, + }, + }, + "params": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 9, + }, + "start": Object { + "column": 30, + "line": 9, + }, + }, + "name": "args", + "range": Array [ + 188, + 192, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 27, + "line": 9, + }, + }, + "range": Array [ + 185, + 199, + ], + "type": "RestElement", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 34, + "line": 9, + }, + }, + "range": Array [ + 192, + 199, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "elementType": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 197, + ], + "type": "TSAnyKeyword", + }, + "loc": Object { + "end": Object { + "column": 41, + "line": 9, + }, + "start": Object { + "column": 36, + "line": 9, + }, + }, + "range": Array [ + 194, + 199, + ], + "type": "TSArrayType", + }, + }, + }, + ], + "range": Array [ + 180, + 205, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 43, + "line": 9, + }, + }, + "range": Array [ + 201, + 205, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 46, + "line": 9, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 9, + }, + "start": Object { + "column": 46, + "line": 9, + }, + }, + "name": "T", + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + }, + }, + }, + "type": "TSConstructorType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "name": "T", + "range": Array [ + 175, + 176, + ], + "type": "Identifier", + }, + "range": Array [ + 175, + 176, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 174, + 177, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 207, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 5, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 17, - 18, + 0, + 8, ], - "type": "Punctuator", - "value": "?", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 10, + "line": 1, }, "start": Object { - "column": 6, - "line": 2, + "column": 9, + "line": 1, }, }, "range": Array [ - 18, - 19, + 9, + 10, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 11, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 10, + "line": 1, }, }, "range": Array [ - 19, - 20, + 10, + 11, ], "type": "Punctuator", - "value": ")", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 12, + "line": 1, }, "start": Object { - "column": 8, - "line": 2, + "column": 11, + "line": 1, }, }, "range": Array [ - 20, - 21, + 11, + 12, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 13, + "line": 1, }, }, "range": Array [ - 24, - 27, + 13, + 20, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 27, - 28, + 21, + 32, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "Constructor", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 32, + "line": 1, }, }, "range": Array [ - 28, - 29, + 32, + 33, ], "type": "Punctuator", - "value": "(", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 34, + "line": 1, }, "start": Object { - "column": 7, - "line": 3, + "column": 33, + "line": 1, }, }, "range": Array [ - 29, - 30, + 33, + 34, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 35, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 34, + "line": 1, }, }, "range": Array [ - 30, - 31, + 34, + 35, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 36, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 35, + "line": 1, }, }, "range": Array [ - 32, - 38, + 35, + 36, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 37, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 36, + "line": 1, }, }, "range": Array [ - 38, - 39, + 36, + 37, ], "type": "Punctuator", - "value": ";", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 38, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 37, + "line": 1, }, }, "range": Array [ - 42, - 49, + 37, + 38, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 42, + "line": 1, }, "start": Object { - "column": 10, - "line": 4, + "column": 38, + "line": 1, }, }, "range": Array [ - 50, - 53, + 38, + 42, ], "type": "Identifier", - "value": "baz", + "value": "Base", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 43, + "line": 1, }, "start": Object { - "column": 13, - "line": 4, + "column": 42, + "line": 1, }, }, "range": Array [ - 53, - 54, + 42, + 43, ], "type": "Punctuator", - "value": "?", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 45, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 44, + "line": 1, }, }, "range": Array [ - 54, - 55, + 44, + 45, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 46, + "line": 1, }, "start": Object { - "column": 15, - "line": 4, + "column": 45, + "line": 1, }, }, "range": Array [ - 55, - 56, + 45, + 46, ], "type": "Punctuator", "value": ")", @@ -16805,924 +17413,647 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 48, + "line": 1, }, "start": Object { - "column": 16, - "line": 4, + "column": 47, + "line": 1, }, }, "range": Array [ - 56, - 57, + 47, + 48, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 10, + "line": 2, }, "start": Object { - "column": 18, - "line": 4, + "column": 4, + "line": 2, }, }, "range": Array [ - 58, - 64, + 53, + 59, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 4, + "column": 16, + "line": 2, }, "start": Object { - "column": 24, - "line": 4, + "column": 11, + "line": 2, }, }, "range": Array [ - 64, + 60, 65, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 24, + "line": 2, }, "start": Object { - "column": 0, - "line": 5, + "column": 17, + "line": 2, }, }, "range": Array [ 66, - 67, + 73, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "extends", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-optional-properties.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 14, - 19, - ], - "static": false, - "type": "ClassProperty", - "value": null, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 22, - 25, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "optional": true, - "range": Array [ - 22, - 36, - ], - "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "range": Array [ - 27, - 35, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 3, - }, - "start": Object { - "column": 9, - "line": 3, - }, - }, - "range": Array [ - 29, - 35, - ], - "type": "TSStringKeyword", - }, - }, - "value": null, - }, - Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 4, - }, - "start": Object { - "column": 10, - "line": 4, - }, - }, - "name": "baz", - "range": Array [ - 47, - 50, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 24, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "optional": true, - "range": Array [ - 39, - 61, - ], - "static": false, - "type": "ClassProperty", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 4, - }, - }, - "range": Array [ - 52, - 60, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 4, - }, - "start": Object { - "column": 17, - "line": 4, - }, - }, - "range": Array [ - 54, - 60, - ], - "type": "TSStringKeyword", - }, - }, - "value": null, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 63, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 29, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 25, + "line": 2, }, }, "range": Array [ - 0, - 63, + 74, + 78, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "Base", }, - }, - "range": Array [ - 0, - 64, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 31, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 30, + "line": 2, }, }, "range": Array [ - 0, - 5, + 79, + 80, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 33, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 6, - 9, + 81, + 82, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 10, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 10, - 11, + 83, + 84, ], "type": "Punctuator", - "value": "{", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 5, - "line": 2, + "line": 5, }, "start": Object { - "column": 2, - "line": 2, + "column": 0, + "line": 5, }, }, "range": Array [ - 14, - 17, + 86, + 91, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 2, + "column": 7, + "line": 5, }, "start": Object { - "column": 5, - "line": 2, + "column": 6, + "line": 5, }, }, "range": Array [ - 17, - 18, + 92, + 93, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 15, + "line": 5, }, "start": Object { - "column": 6, - "line": 2, + "column": 8, + "line": 5, }, }, "range": Array [ - 18, - 19, + 94, + 101, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 17, + "line": 5, }, "start": Object { - "column": 2, - "line": 3, + "column": 16, + "line": 5, }, }, "range": Array [ - 22, - 25, + 102, + 103, ], "type": "Identifier", - "value": "bar", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 18, + "line": 5, }, "start": Object { - "column": 5, - "line": 3, + "column": 17, + "line": 5, }, }, "range": Array [ - 25, - 26, + 103, + 104, ], "type": "Punctuator", - "value": "?", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 21, + "line": 5, }, "start": Object { - "column": 7, - "line": 3, + "column": 18, + "line": 5, }, }, "range": Array [ - 27, - 28, + 104, + 107, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 22, + "line": 5, }, "start": Object { - "column": 9, - "line": 3, + "column": 21, + "line": 5, }, }, "range": Array [ - 29, - 35, + 107, + 108, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 23, + "line": 5, }, "start": Object { - "column": 15, - "line": 3, + "column": 22, + "line": 5, }, }, "range": Array [ - 35, - 36, + 108, + 109, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 24, + "line": 5, }, "start": Object { - "column": 2, - "line": 4, + "column": 23, + "line": 5, }, }, "range": Array [ - 39, - 46, + 109, + 110, + ], + "type": "Identifier", + "value": "C", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 110, + 111, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 5, + }, + "start": Object { + "column": 26, + "line": 5, + }, + }, + "range": Array [ + 112, + 122, ], "type": "Keyword", - "value": "private", + "value": "implements", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 38, + "line": 5, }, "start": Object { - "column": 10, - "line": 4, + "column": 37, + "line": 5, }, }, "range": Array [ - 47, - 50, + 123, + 124, ], "type": "Identifier", - "value": "baz", + "value": "I", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 40, + "line": 5, }, "start": Object { - "column": 13, - "line": 4, + "column": 39, + "line": 5, }, }, "range": Array [ - 50, - 51, + 125, + 126, ], "type": "Punctuator", - "value": "?", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 4, + "column": 42, + "line": 5, }, "start": Object { - "column": 15, - "line": 4, + "column": 41, + "line": 5, }, }, "range": Array [ - 52, - 53, + 127, + 128, ], "type": "Punctuator", - "value": ":", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 4, + "column": 5, + "line": 7, }, "start": Object { - "column": 17, - "line": 4, + "column": 0, + "line": 7, }, }, "range": Array [ - 54, - 60, + 130, + 135, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 136, + 137, ], "type": "Identifier", - "value": "string", + "value": "C", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 9, + "line": 7, }, "start": Object { - "column": 23, - "line": 4, + "column": 8, + "line": 7, }, }, "range": Array [ - 60, - 61, + 138, + 139, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 11, + "line": 7, }, "start": Object { - "column": 0, - "line": 5, + "column": 10, + "line": 7, }, }, "range": Array [ - 62, - 63, + 140, + 141, ], "type": "Punctuator", "value": "}", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-optional-property-undefined.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "accessibility": "private", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 27, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 12, - 37, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 2, - }, - "start": Object { - "column": 17, - "line": 2, - }, - }, - "name": "undefined", - "range": Array [ - 27, - 36, - ], - "type": "Identifier", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 9, + "line": 8, }, - "range": Array [ - 8, - 39, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 0, + "line": 8, }, - "name": "X", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", }, + "range": Array [ + 142, + 151, + ], + "type": "Keyword", + "value": "interface", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 11, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 8, }, }, "range": Array [ - 0, - 39, + 152, + 153, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, + "type": "Identifier", + "value": "I", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 8, + }, + "start": Object { + "column": 12, + "line": 8, + }, + }, + "range": Array [ + 154, + 155, + ], + "type": "Punctuator", + "value": "{", }, - }, - "range": Array [ - 0, - 41, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 15, + "line": 8, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 8, }, }, "range": Array [ - 0, - 5, + 156, + 157, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 4, + "line": 9, }, "start": Object { - "column": 6, - "line": 1, + "column": 0, + "line": 9, }, }, "range": Array [ - 6, - 7, + 158, + 162, ], "type": "Identifier", - "value": "X", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 16, + "line": 9, }, "start": Object { - "column": 8, - "line": 1, + "column": 5, + "line": 9, }, }, "range": Array [ - 8, - 9, + 163, + 174, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Constructor", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 17, + "line": 9, }, "start": Object { - "column": 2, - "line": 2, + "column": 16, + "line": 9, }, }, "range": Array [ - 12, - 19, + 174, + 175, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 18, + "line": 9, }, "start": Object { - "column": 10, - "line": 2, + "column": 17, + "line": 9, }, }, "range": Array [ - 20, - 23, + 175, + 176, ], "type": "Identifier", - "value": "foo", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 19, + "line": 9, }, "start": Object { - "column": 13, - "line": 2, + "column": 18, + "line": 9, }, }, "range": Array [ - 23, - 24, + 176, + 177, ], "type": "Punctuator", - "value": "?", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 21, + "line": 9, }, "start": Object { - "column": 15, - "line": 2, + "column": 20, + "line": 9, }, }, "range": Array [ - 25, - 26, + 178, + 179, ], "type": "Punctuator", "value": "=", @@ -17730,908 +18061,745 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 25, + "line": 9, }, "start": Object { - "column": 17, - "line": 2, + "column": 22, + "line": 9, }, }, "range": Array [ - 27, - 36, + 180, + 183, ], "type": "Keyword", - "value": "undefined", + "value": "new", }, Object { "loc": Object { "end": Object { "column": 27, - "line": 2, + "line": 9, }, "start": Object { "column": 26, - "line": 2, + "line": 9, }, }, "range": Array [ - 36, - 37, + 184, + 185, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 30, + "line": 9, }, "start": Object { - "column": 0, - "line": 3, + "column": 27, + "line": 9, }, }, "range": Array [ - 38, - 39, + 185, + 188, ], "type": "Punctuator", - "value": "}", + "value": "...", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-private-parameter-properties.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "constructor", - "range": Array [ - 14, - 25, - ], - "type": "Identifier", - }, - "kind": "constructor", - "loc": Object { - "end": Object { - "column": 59, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 14, - 201, - ], - "static": false, - "type": "MethodDefinition", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 59, - "line": 5, - }, - "start": Object { - "column": 57, - "line": 5, - }, - }, - "range": Array [ - 199, - 201, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 59, - "line": 5, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "params": Array [ - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "name": "firstName", - "range": Array [ - 34, - 51, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 31, - "line": 2, - }, - }, - "range": Array [ - 43, - 51, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 2, - }, - "start": Object { - "column": 33, - "line": 2, - }, - }, - "range": Array [ - 45, - 51, - ], - "type": "TSStringKeyword", - }, - }, - }, - "range": Array [ - 26, - 51, - ], - "type": "TSParameterProperty", - }, - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 31, - "line": 3, - }, - }, - "name": "lastName", - "range": Array [ - 84, - 100, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 39, - "line": 3, - }, - }, - "range": Array [ - 92, - 100, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 3, - }, - "start": Object { - "column": 41, - "line": 3, - }, - }, - "range": Array [ - 94, - 100, - ], - "type": "TSStringKeyword", - }, - }, - }, - "range": Array [ - 67, - 100, - ], - "readonly": true, - "type": "TSParameterProperty", - }, - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "parameter": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 22, - "line": 4, - }, - }, - "name": "age", - "range": Array [ - 124, - 135, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 25, - "line": 4, - }, - }, - "range": Array [ - 127, - 135, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 27, - "line": 4, - }, - }, - "range": Array [ - 129, - 135, - ], - "type": "TSNumberKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "range": Array [ - 116, - 140, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 4, - }, - "start": Object { - "column": 36, - "line": 4, - }, - }, - "range": Array [ - 138, - 140, - ], - "raw": "30", - "type": "Literal", - "value": 30, - }, - "type": "AssignmentPattern", - }, - "range": Array [ - 116, - 140, - ], - "type": "TSParameterProperty", - }, - Object { - "accessibility": "private", - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "parameter": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 5, - }, - "start": Object { - "column": 31, - "line": 5, - }, - }, - "name": "student", - "range": Array [ - 173, - 189, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 5, - }, - "start": Object { - "column": 38, - "line": 5, - }, - }, - "range": Array [ - 180, - 189, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 47, - "line": 5, - }, - "start": Object { - "column": 40, - "line": 5, - }, - }, - "range": Array [ - 182, - 189, - ], - "type": "TSBooleanKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, - }, - "range": Array [ - 156, - 197, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 5, - }, - "start": Object { - "column": 50, - "line": 5, - }, - }, - "range": Array [ - 192, - 197, - ], - "raw": "false", - "type": "Literal", - "value": false, - }, - "type": "AssignmentPattern", - }, - "range": Array [ - 156, - 197, - ], - "readonly": true, - "type": "TSParameterProperty", - }, - ], - "range": Array [ - 25, - 201, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 203, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 34, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 30, + "line": 9, }, }, "range": Array [ - 0, - 203, + 188, + 192, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "args", }, - }, - "range": Array [ - 0, - 203, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 35, + "line": 9, }, "start": Object { - "column": 0, - "line": 1, + "column": 34, + "line": 9, }, }, "range": Array [ - 0, - 5, + 192, + 193, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 39, + "line": 9, }, "start": Object { - "column": 6, - "line": 1, + "column": 36, + "line": 9, }, }, "range": Array [ - 6, - 9, + 194, + 197, ], "type": "Identifier", - "value": "Foo", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 40, + "line": 9, }, "start": Object { - "column": 10, - "line": 1, + "column": 39, + "line": 9, }, }, "range": Array [ - 10, - 11, + 197, + 198, ], "type": "Punctuator", - "value": "{", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 2, + "column": 41, + "line": 9, }, "start": Object { - "column": 2, - "line": 2, + "column": 40, + "line": 9, }, }, "range": Array [ - 14, - 25, + 198, + 199, ], - "type": "Identifier", - "value": "constructor", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 42, + "line": 9, }, "start": Object { - "column": 13, - "line": 2, + "column": 41, + "line": 9, }, }, "range": Array [ - 25, - 26, + 199, + 200, ], "type": "Punctuator", - "value": "(", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 2, + "column": 45, + "line": 9, }, "start": Object { - "column": 14, - "line": 2, + "column": 43, + "line": 9, }, }, "range": Array [ - 26, - 33, + 201, + 203, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": "=>", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 2, + "column": 47, + "line": 9, }, "start": Object { - "column": 22, - "line": 2, + "column": 46, + "line": 9, }, }, "range": Array [ - 34, - 43, + 204, + 205, ], "type": "Identifier", - "value": "firstName", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 2, + "column": 48, + "line": 9, }, "start": Object { - "column": 31, - "line": 2, + "column": 47, + "line": 9, }, }, "range": Array [ - 43, - 44, + 205, + 206, ], "type": "Punctuator", - "value": ":", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-mixin-reference.src 1`] = ` +Object { + "body": Array [ Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 46, + "line": 1, + }, + }, + "range": Array [ + 46, + 49, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "M", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 39, + "column": 1, "line": 2, }, "start": Object { - "column": 33, - "line": 2, + "column": 0, + "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "Base", + "range": Array [ + 37, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + }, + }, + }, + ], "range": Array [ - 45, - 51, + 0, + 49, ], - "type": "Identifier", - "value": "string", + "type": "FunctionDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 35, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "M", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 32, + 35, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 11, + 12, + ], + "type": "Identifier", + }, + "range": Array [ + 11, + 35, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 10, + 36, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 40, - "line": 2, + "column": 8, + "line": 1, }, "start": Object { - "column": 39, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 51, - 52, + 0, + 8, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 3, + "column": 10, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 9, + "line": 1, }, }, "range": Array [ - 67, - 74, + 9, + 10, ], - "type": "Keyword", - "value": "private", + "type": "Identifier", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 3, + "column": 11, + "line": 1, }, "start": Object { - "column": 22, - "line": 3, + "column": 10, + "line": 1, }, }, "range": Array [ - 75, - 83, + 10, + 11, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 3, + "column": 12, + "line": 1, }, "start": Object { - "column": 31, - "line": 3, + "column": 11, + "line": 1, }, }, "range": Array [ - 84, - 92, + 11, + 12, ], "type": "Identifier", - "value": "lastName", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 40, - "line": 3, + "column": 20, + "line": 1, }, "start": Object { - "column": 39, - "line": 3, + "column": 13, + "line": 1, }, }, "range": Array [ - 92, - 93, + 13, + 20, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 41, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 94, - 100, + 21, + 32, ], "type": "Identifier", - "value": "string", + "value": "Constructor", }, Object { "loc": Object { "end": Object { - "column": 48, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 47, - "line": 3, + "column": 32, + "line": 1, }, }, "range": Array [ - 100, - 101, + 32, + 33, ], "type": "Punctuator", - "value": ",", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 4, + "column": 34, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 33, + "line": 1, }, }, "range": Array [ - 116, - 123, + 33, + 34, ], - "type": "Keyword", - "value": "private", + "type": "Identifier", + "value": "M", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 4, + "column": 35, + "line": 1, }, "start": Object { - "column": 22, - "line": 4, + "column": 34, + "line": 1, }, }, "range": Array [ - 124, - 127, + 34, + 35, ], - "type": "Identifier", - "value": "age", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 36, + "line": 1, }, "start": Object { - "column": 25, - "line": 4, + "column": 35, + "line": 1, }, }, "range": Array [ - 127, - 128, + 35, + 36, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 41, + ], + "type": "Identifier", + "value": "Base", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, ], "type": "Punctuator", "value": ":", @@ -18639,269 +18807,425 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, - "line": 4, + "column": 44, + "line": 1, }, "start": Object { - "column": 27, - "line": 4, + "column": 43, + "line": 1, }, }, "range": Array [ - 129, - 135, + 43, + 44, ], "type": "Identifier", - "value": "number", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 4, + "column": 45, + "line": 1, }, "start": Object { - "column": 34, - "line": 4, + "column": 44, + "line": 1, }, }, "range": Array [ - 136, - 137, + 44, + 45, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 4, + "column": 47, + "line": 1, }, "start": Object { - "column": 36, - "line": 4, + "column": 46, + "line": 1, }, }, "range": Array [ - 138, - 140, + 46, + 47, ], - "type": "Numeric", - "value": "30", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 4, + "column": 1, + "line": 2, }, "start": Object { - "column": 38, - "line": 4, + "column": 0, + "line": 2, }, }, "range": Array [ - 140, - 141, + 48, + 49, ], "type": "Punctuator", - "value": ",", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-computed-property.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 28, + ], + "raw": "'foo'", + "type": "Literal", + "value": "foo", + }, + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 14, + 43, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "undefined", + "range": Array [ + 33, + 42, + ], + "type": "Identifier", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 45, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 21, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 14, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 156, - 163, + 0, + 45, ], - "type": "Keyword", - "value": "private", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 30, - "line": 5, + "column": 5, + "line": 1, }, "start": Object { - "column": 22, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 164, - 172, + 0, + 5, ], - "type": "Identifier", - "value": "readonly", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 5, + "column": 7, + "line": 1, }, "start": Object { - "column": 31, - "line": 5, + "column": 6, + "line": 1, }, }, "range": Array [ - 173, - 180, + 6, + 7, ], "type": "Identifier", - "value": "student", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 38, - "line": 5, + "column": 8, + "line": 1, }, }, "range": Array [ - 180, - 181, + 8, + 9, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 5, + "column": 11, + "line": 2, }, "start": Object { - "column": 40, - "line": 5, + "column": 4, + "line": 2, }, }, "range": Array [ - 182, - 189, + 14, + 21, ], - "type": "Identifier", - "value": "boolean", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 5, + "column": 13, + "line": 2, }, "start": Object { - "column": 48, - "line": 5, + "column": 12, + "line": 2, }, }, "range": Array [ - 190, - 191, + 22, + 23, ], "type": "Punctuator", - "value": "=", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 55, - "line": 5, + "column": 18, + "line": 2, }, "start": Object { - "column": 50, - "line": 5, + "column": 13, + "line": 2, }, }, "range": Array [ - 192, - 197, + 23, + 28, ], - "type": "Boolean", - "value": "false", + "type": "String", + "value": "'foo'", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 5, + "column": 19, + "line": 2, }, "start": Object { - "column": 55, - "line": 5, + "column": 18, + "line": 2, }, }, "range": Array [ - 197, - 198, + 28, + 29, ], "type": "Punctuator", - "value": ")", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 58, - "line": 5, + "column": 20, + "line": 2, }, "start": Object { - "column": 57, - "line": 5, + "column": 19, + "line": 2, }, }, "range": Array [ - 199, - 200, + 29, + 30, ], "type": "Punctuator", - "value": "{", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 59, - "line": 5, + "column": 22, + "line": 2, }, "start": Object { - "column": 58, - "line": 5, + "column": 21, + "line": 2, }, }, "range": Array [ - 200, - 201, + 31, + 32, ], "type": "Punctuator", - "value": "}", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "range": Array [ + 33, + 42, + ], + "type": "Keyword", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 3, }, "start": Object { "column": 0, - "line": 6, + "line": 3, }, }, "range": Array [ - 202, - 203, + 44, + 45, ], "type": "Punctuator", "value": "}", @@ -18911,7 +19235,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` +exports[`typescript fixtures/basics/class-with-optional-methods.src 1`] = ` Object { "body": Array [ Object { @@ -18922,7 +19246,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 2, }, "start": Object { @@ -18930,16 +19254,18 @@ Object { "line": 2, }, }, - "name": "a", + "name": "foo", + "optional": true, "range": Array [ 14, - 15, + 17, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 2, }, "start": Object { @@ -18949,14 +19275,19 @@ Object { }, "range": Array [ 14, - 20, + 21, ], "static": false, - "type": "ClassProperty", + "type": "MethodDefinition", "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 2, }, "start": Object { @@ -18964,13 +19295,12 @@ Object { "line": 2, }, }, + "params": Array [], "range": Array [ 18, - 19, + 21, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "FunctionExpression", }, }, Object { @@ -18978,7 +19308,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 3, }, "start": Object { @@ -18986,16 +19316,18 @@ Object { "line": 3, }, }, - "name": "b", + "name": "bar", + "optional": true, "range": Array [ - 23, 24, + 27, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 9, + "column": 17, "line": 3, }, "start": Object { @@ -19004,15 +19336,20 @@ Object { }, }, "range": Array [ - 23, - 30, + 24, + 39, ], "static": false, - "type": "ClassProperty", + "type": "MethodDefinition", "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 8, + "column": 17, "line": 3, }, "start": Object { @@ -19020,278 +19357,150 @@ Object { "line": 3, }, }, - "properties": Array [], + "params": Array [], "range": Array [ - 27, - 29, + 28, + 39, ], - "type": "ObjectExpression", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, + "returnType": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, }, - }, - "name": "c", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 33, - 40, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 8, - "line": 4, - }, - "start": Object { - "column": 6, - "line": 4, + "range": Array [ + 30, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSStringKeyword", }, }, - "range": Array [ - 37, - 39, - ], - "type": "ArrayExpression", + "type": "FunctionExpression", }, }, Object { + "accessibility": "private", "computed": false, "key": Object { "loc": Object { "end": Object { - "column": 3, - "line": 5, + "column": 13, + "line": 4, }, "start": Object { - "column": 2, - "line": 5, + "column": 10, + "line": 4, }, }, - "name": "d", + "name": "baz", + "optional": true, "range": Array [ - 43, - 44, + 50, + 53, ], "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 25, + "line": 4, }, "start": Object { "column": 2, - "line": 5, + "line": 4, }, }, "range": Array [ - 43, - 50, + 42, + 65, ], "static": false, - "type": "ClassProperty", + "type": "MethodDefinition", "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "range": Array [ - 47, - 49, - ], - "raw": "\\"\\"", - "type": "Literal", - "value": "", - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 6, + "column": 25, + "line": 4, }, "start": Object { - "column": 2, - "line": 6, + "column": 14, + "line": 4, }, }, - "name": "e", + "params": Array [], "range": Array [ - 53, 54, + 65, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 6, - }, - "start": Object { - "column": 2, - "line": 6, - }, - }, - "range": Array [ - 53, - 80, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "arguments": Array [ - Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 6, - }, - "start": Object { - "column": 17, - "line": 6, - }, - }, - "properties": Array [], - "range": Array [ - 68, - 70, - ], - "type": "ObjectExpression", - }, - Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 6, - }, - "start": Object { - "column": 21, - "line": 6, - }, - }, - "range": Array [ - 72, - 74, - ], - "type": "ArrayExpression", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 6, - }, - "start": Object { - "column": 25, - "line": 6, - }, - }, - "range": Array [ - 76, - 77, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - ], - "loc": Object { - "end": Object { - "column": 27, - "line": 6, - }, - "start": Object { - "column": 16, - "line": 6, - }, - }, - "range": Array [ - 67, - 78, - ], - "type": "ArrayExpression", - }, - ], - "callee": Object { + "returnType": Object { "loc": Object { "end": Object { - "column": 15, - "line": 6, + "column": 24, + "line": 4, }, "start": Object { - "column": 10, - "line": 6, + "column": 16, + "line": 4, }, }, - "name": "Array", "range": Array [ - 61, - 66, + 56, + 64, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 6, - }, - "start": Object { - "column": 6, - "line": 6, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 58, + 64, + ], + "type": "TSStringKeyword", }, }, - "range": Array [ - 57, - 79, - ], - "type": "NewExpression", + "type": "FunctionExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 7, + "line": 5, }, "start": Object { "column": 10, @@ -19300,7 +19509,7 @@ Object { }, "range": Array [ 10, - 82, + 67, ], "type": "ClassBody", }, @@ -19325,7 +19534,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 7, + "line": 5, }, "start": Object { "column": 0, @@ -19334,7 +19543,7 @@ Object { }, "range": Array [ 0, - 82, + 67, ], "superClass": null, "type": "ClassDeclaration", @@ -19343,7 +19552,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 8, + "line": 6, }, "start": Object { "column": 0, @@ -19352,7 +19561,7 @@ Object { }, "range": Array [ 0, - 83, + 68, ], "sourceType": "script", "tokens": Array [ @@ -19413,7 +19622,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 2, }, "start": Object { @@ -19423,28 +19632,28 @@ Object { }, "range": Array [ 14, - 15, + 17, ], "type": "Identifier", - "value": "a", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 2, }, "start": Object { - "column": 4, + "column": 5, "line": 2, }, }, "range": Array [ - 16, 17, + 18, ], "type": "Punctuator", - "value": "=", + "value": "?", }, Object { "loc": Object { @@ -19461,8 +19670,8 @@ Object { 18, 19, ], - "type": "Numeric", - "value": "2", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { @@ -19480,12 +19689,30 @@ Object { 20, ], "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", "value": ";", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 5, "line": 3, }, "start": Object { @@ -19494,29 +19721,29 @@ Object { }, }, "range": Array [ - 23, 24, + 27, ], "type": "Identifier", - "value": "b", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 6, "line": 3, }, "start": Object { - "column": 4, + "column": 5, "line": 3, }, }, "range": Array [ - 25, - 26, + 27, + 28, ], "type": "Punctuator", - "value": "=", + "value": "?", }, Object { "loc": Object { @@ -19530,11 +19757,11 @@ Object { }, }, "range": Array [ - 27, 28, + 29, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { @@ -19548,11 +19775,11 @@ Object { }, }, "range": Array [ - 28, 29, + 30, ], "type": "Punctuator", - "value": "}", + "value": ")", }, Object { "loc": Object { @@ -19566,296 +19793,526 @@ Object { }, }, "range": Array [ - 29, 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 4, + "column": 16, + "line": 3, }, "start": Object { - "column": 2, - "line": 4, + "column": 10, + "line": 3, }, }, "range": Array [ - 33, - 34, + 32, + 38, ], "type": "Identifier", - "value": "c", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 17, + "line": 3, }, "start": Object { - "column": 4, - "line": 4, + "column": 16, + "line": 3, }, }, "range": Array [ - 35, - 36, + 38, + 39, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 4, }, "start": Object { - "column": 6, + "column": 2, "line": 4, }, }, "range": Array [ - 37, - 38, + 42, + 49, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 13, "line": 4, }, "start": Object { - "column": 7, + "column": 10, "line": 4, }, }, "range": Array [ - 38, - 39, + 50, + 53, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 14, "line": 4, }, "start": Object { - "column": 8, + "column": 13, "line": 4, }, }, "range": Array [ - 39, - 40, + 53, + 54, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 5, - }, - "start": Object { - "column": 2, - "line": 5, - }, - }, - "range": Array [ - 43, - 44, - ], - "type": "Identifier", - "value": "d", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 15, + "line": 4, }, "start": Object { - "column": 4, - "line": 5, + "column": 14, + "line": 4, }, }, "range": Array [ - 45, - 46, + 54, + 55, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 16, + "line": 4, }, "start": Object { - "column": 6, - "line": 5, + "column": 15, + "line": 4, }, }, "range": Array [ - 47, - 49, + 55, + 56, ], - "type": "String", - "value": "\\"\\"", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 17, + "line": 4, }, "start": Object { - "column": 8, - "line": 5, + "column": 16, + "line": 4, }, }, "range": Array [ - 49, - 50, + 56, + 57, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 6, + "column": 24, + "line": 4, }, "start": Object { - "column": 2, - "line": 6, + "column": 18, + "line": 4, }, }, "range": Array [ - 53, - 54, + 58, + 64, ], "type": "Identifier", - "value": "e", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 6, + "column": 25, + "line": 4, }, "start": Object { - "column": 4, - "line": 6, + "column": 24, + "line": 4, }, }, "range": Array [ - 55, - 56, + 64, + 65, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 6, + "column": 1, + "line": 5, }, "start": Object { - "column": 6, - "line": 6, + "column": 0, + "line": 5, }, }, "range": Array [ - 57, - 60, + 66, + 67, ], - "type": "Keyword", - "value": "new", - }, + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-properties.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 14, + 19, + ], + "static": false, + "type": "ClassProperty", + "value": null, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 22, + 36, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 27, + 35, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 9, + "line": 3, + }, + }, + "range": Array [ + 29, + 35, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 4, + }, + }, + "name": "baz", + "range": Array [ + 47, + 50, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "optional": true, + "range": Array [ + 39, + 61, + ], + "static": false, + "type": "ClassProperty", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 4, + }, + }, + "range": Array [ + 52, + 60, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 54, + 60, + ], + "type": "TSStringKeyword", + }, + }, + "value": null, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 63, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 15, - "line": 6, + "column": 1, + "line": 5, }, "start": Object { - "column": 10, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 61, - 66, + 0, + 63, ], - "type": "Identifier", - "value": "Array", + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 64, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 16, - "line": 6, + "column": 5, + "line": 1, }, "start": Object { - "column": 15, - "line": 6, + "column": 0, + "line": 1, }, }, "range": Array [ - 66, - 67, + 0, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 6, + "column": 9, + "line": 1, }, "start": Object { - "column": 16, - "line": 6, + "column": 6, + "line": 1, }, }, "range": Array [ - 67, - 68, + 6, + 9, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 6, + "column": 11, + "line": 1, }, "start": Object { - "column": 17, - "line": 6, + "column": 10, + "line": 1, }, }, "range": Array [ - 68, - 69, + 10, + 11, ], "type": "Punctuator", "value": "{", @@ -19863,203 +20320,610 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 6, + "column": 5, + "line": 2, }, "start": Object { - "column": 18, - "line": 6, + "column": 2, + "line": 2, }, }, "range": Array [ - 69, - 70, + 14, + 17, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 6, + "column": 6, + "line": 2, }, "start": Object { - "column": 19, - "line": 6, + "column": 5, + "line": 2, }, }, "range": Array [ - 70, - 71, + 17, + 18, ], "type": "Punctuator", - "value": ",", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 6, + "column": 7, + "line": 2, }, "start": Object { - "column": 21, - "line": 6, + "column": 6, + "line": 2, }, }, "range": Array [ - 72, - 73, + 18, + 19, ], "type": "Punctuator", - "value": "[", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 6, + "column": 5, + "line": 3, }, "start": Object { - "column": 22, - "line": 6, + "column": 2, + "line": 3, }, }, "range": Array [ - 73, - 74, + 22, + 25, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 25, + 26, ], "type": "Punctuator", - "value": "]", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 6, + "column": 8, + "line": 3, }, "start": Object { - "column": 23, - "line": 6, + "column": 7, + "line": 3, }, }, "range": Array [ - 74, - 75, + 27, + 28, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 6, + "column": 15, + "line": 3, }, "start": Object { - "column": 25, - "line": 6, + "column": 9, + "line": 3, }, }, "range": Array [ - 76, - 77, + 29, + 35, ], - "type": "Numeric", - "value": "2", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 6, + "column": 16, + "line": 3, }, "start": Object { - "column": 26, - "line": 6, + "column": 15, + "line": 3, }, }, "range": Array [ - 77, - 78, + 35, + 36, ], "type": "Punctuator", - "value": "]", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 6, + "column": 9, + "line": 4, }, "start": Object { - "column": 27, - "line": 6, + "column": 2, + "line": 4, }, }, "range": Array [ - 78, - 79, + 39, + 46, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 6, + "column": 13, + "line": 4, }, "start": Object { - "column": 28, - "line": 6, + "column": 10, + "line": 4, }, }, "range": Array [ - 79, - 80, + 47, + 50, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 13, + "line": 4, + }, + }, + "range": Array [ + 50, + 51, ], "type": "Punctuator", - "value": ";", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 16, + "line": 4, }, "start": Object { - "column": 0, - "line": 7, + "column": 15, + "line": 4, }, }, "range": Array [ - 81, - 82, + 52, + 53, ], "type": "Punctuator", - "value": "}", + "value": ":", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 2, - }, - "start": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 54, + 60, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 4, + }, + "start": Object { + "column": 23, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-optional-property-undefined.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "accessibility": "private", + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 12, + 37, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "name": "undefined", + "range": Array [ + 27, + 36, + ], + "type": "Identifier", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 39, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 41, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "X", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 19, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 36, + ], + "type": "Keyword", + "value": "undefined", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-private-parameter-properties.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { "column": 2, "line": 2, }, @@ -20074,7 +20938,7 @@ Object { "kind": "constructor", "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { @@ -20084,7 +20948,7 @@ Object { }, "range": Array [ 14, - 209, + 201, ], "static": false, "type": "MethodDefinition", @@ -20094,17 +20958,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { - "column": 59, + "column": 57, "line": 5, }, }, "range": Array [ - 207, - 209, + 199, + 201, ], "type": "BlockStatement", }, @@ -20113,7 +20977,7 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { @@ -20123,10 +20987,10 @@ Object { }, "params": Array [ Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { @@ -20137,50 +21001,50 @@ Object { "parameter": Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 24, + "column": 22, "line": 2, }, }, "name": "firstName", "range": Array [ - 36, - 53, + 34, + 51, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 33, + "column": 31, "line": 2, }, }, "range": Array [ - 45, - 53, + 43, + 51, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 35, + "column": 33, "line": 2, }, }, "range": Array [ - 47, - 53, + 45, + 51, ], "type": "TSStringKeyword", }, @@ -20188,15 +21052,15 @@ Object { }, "range": Array [ 26, - 53, + 51, ], "type": "TSParameterProperty", }, Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { @@ -20207,67 +21071,67 @@ Object { "parameter": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 33, + "column": 31, "line": 3, }, }, "name": "lastName", "range": Array [ - 88, - 104, + 84, + 100, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 41, + "column": 39, "line": 3, }, }, "range": Array [ - 96, - 104, + 92, + 100, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 43, + "column": 41, "line": 3, }, }, "range": Array [ - 98, - 104, + 94, + 100, ], "type": "TSStringKeyword", }, }, }, "range": Array [ - 69, - 104, + 67, + 100, ], "readonly": true, "type": "TSParameterProperty", }, Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { @@ -20279,50 +21143,50 @@ Object { "left": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 24, + "column": 22, "line": 4, }, }, "name": "age", "range": Array [ - 130, - 141, + 124, + 135, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 27, + "column": 25, "line": 4, }, }, "range": Array [ - 133, - 141, + 127, + 135, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 29, + "column": 27, "line": 4, }, }, "range": Array [ + 129, 135, - 141, ], "type": "TSNumberKeyword", }, @@ -20330,7 +21194,7 @@ Object { }, "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { @@ -20339,23 +21203,23 @@ Object { }, }, "range": Array [ - 120, - 146, + 116, + 140, ], "right": Object { "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { - "column": 38, + "column": 36, "line": 4, }, }, "range": Array [ - 144, - 146, + 138, + 140, ], "raw": "30", "type": "Literal", @@ -20364,16 +21228,16 @@ Object { "type": "AssignmentPattern", }, "range": Array [ - 120, - 146, + 116, + 140, ], "type": "TSParameterProperty", }, Object { - "accessibility": "protected", + "accessibility": "private", "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { @@ -20385,50 +21249,50 @@ Object { "left": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 33, + "column": 31, "line": 5, }, }, "name": "student", "range": Array [ - 181, - 197, + 173, + 189, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 40, + "column": 38, "line": 5, }, }, "range": Array [ - 188, - 197, + 180, + 189, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 42, + "column": 40, "line": 5, }, }, "range": Array [ - 190, - 197, + 182, + 189, ], "type": "TSBooleanKeyword", }, @@ -20436,7 +21300,7 @@ Object { }, "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { @@ -20445,23 +21309,23 @@ Object { }, }, "range": Array [ - 162, - 205, + 156, + 197, ], "right": Object { "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { - "column": 52, + "column": 50, "line": 5, }, }, "range": Array [ - 200, - 205, + 192, + 197, ], "raw": "false", "type": "Literal", @@ -20470,8 +21334,8 @@ Object { "type": "AssignmentPattern", }, "range": Array [ - 162, - 205, + 156, + 197, ], "readonly": true, "type": "TSParameterProperty", @@ -20479,7 +21343,7 @@ Object { ], "range": Array [ 25, - 209, + 201, ], "type": "FunctionExpression", }, @@ -20497,7 +21361,7 @@ Object { }, "range": Array [ 10, - 211, + 203, ], "type": "ClassBody", }, @@ -20531,7 +21395,7 @@ Object { }, "range": Array [ 0, - 211, + 203, ], "superClass": null, "type": "ClassDeclaration", @@ -20549,7 +21413,7 @@ Object { }, "range": Array [ 0, - 211, + 203, ], "sourceType": "script", "tokens": Array [ @@ -20646,7 +21510,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 2, }, "start": Object { @@ -20656,25 +21520,25 @@ Object { }, "range": Array [ 26, - 35, + 33, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 33, + "column": 31, "line": 2, }, "start": Object { - "column": 24, + "column": 22, "line": 2, }, }, "range": Array [ - 36, - 45, + 34, + 43, ], "type": "Identifier", "value": "firstName", @@ -20682,17 +21546,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, + "column": 32, "line": 2, }, "start": Object { - "column": 33, + "column": 31, "line": 2, }, }, "range": Array [ - 45, - 46, + 43, + 44, ], "type": "Punctuator", "value": ":", @@ -20700,17 +21564,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 2, }, "start": Object { - "column": 35, + "column": 33, "line": 2, }, }, "range": Array [ - 47, - 53, + 45, + 51, ], "type": "Identifier", "value": "string", @@ -20718,17 +21582,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 42, + "column": 40, "line": 2, }, "start": Object { - "column": 41, + "column": 39, "line": 2, }, }, "range": Array [ - 53, - 54, + 51, + 52, ], "type": "Punctuator", "value": ",", @@ -20736,7 +21600,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 3, }, "start": Object { @@ -20745,26 +21609,26 @@ Object { }, }, "range": Array [ - 69, - 78, + 67, + 74, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 3, }, "start": Object { - "column": 24, + "column": 22, "line": 3, }, }, "range": Array [ - 79, - 87, + 75, + 83, ], "type": "Identifier", "value": "readonly", @@ -20772,17 +21636,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 3, }, "start": Object { - "column": 33, + "column": 31, "line": 3, }, }, "range": Array [ - 88, - 96, + 84, + 92, ], "type": "Identifier", "value": "lastName", @@ -20790,17 +21654,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 42, + "column": 40, "line": 3, }, "start": Object { - "column": 41, + "column": 39, "line": 3, }, }, "range": Array [ - 96, - 97, + 92, + 93, ], "type": "Punctuator", "value": ":", @@ -20808,17 +21672,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 3, }, "start": Object { - "column": 43, + "column": 41, "line": 3, }, }, "range": Array [ - 98, - 104, + 94, + 100, ], "type": "Identifier", "value": "string", @@ -20826,17 +21690,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 50, + "column": 48, "line": 3, }, "start": Object { - "column": 49, + "column": 47, "line": 3, }, }, "range": Array [ - 104, - 105, + 100, + 101, ], "type": "Punctuator", "value": ",", @@ -20844,7 +21708,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 4, }, "start": Object { @@ -20853,26 +21717,26 @@ Object { }, }, "range": Array [ - 120, - 129, + 116, + 123, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 25, "line": 4, }, "start": Object { - "column": 24, + "column": 22, "line": 4, }, }, "range": Array [ - 130, - 133, + 124, + 127, ], "type": "Identifier", "value": "age", @@ -20880,17 +21744,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 28, + "column": 26, "line": 4, }, "start": Object { - "column": 27, + "column": 25, "line": 4, }, }, "range": Array [ - 133, - 134, + 127, + 128, ], "type": "Punctuator", "value": ":", @@ -20898,17 +21762,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 35, + "column": 33, "line": 4, }, "start": Object { - "column": 29, + "column": 27, "line": 4, }, }, "range": Array [ + 129, 135, - 141, ], "type": "Identifier", "value": "number", @@ -20916,17 +21780,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 37, + "column": 35, "line": 4, }, "start": Object { - "column": 36, + "column": 34, "line": 4, }, }, "range": Array [ - 142, - 143, + 136, + 137, ], "type": "Punctuator", "value": "=", @@ -20934,17 +21798,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 4, }, "start": Object { - "column": 38, + "column": 36, "line": 4, }, }, "range": Array [ - 144, - 146, + 138, + 140, ], "type": "Numeric", "value": "30", @@ -20952,17 +21816,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 4, }, "start": Object { - "column": 40, + "column": 38, "line": 4, }, }, "range": Array [ - 146, - 147, + 140, + 141, ], "type": "Punctuator", "value": ",", @@ -20970,7 +21834,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, + "column": 21, "line": 5, }, "start": Object { @@ -20979,26 +21843,26 @@ Object { }, }, "range": Array [ - 162, - 171, + 156, + 163, ], "type": "Keyword", - "value": "protected", + "value": "private", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 30, "line": 5, }, "start": Object { - "column": 24, + "column": 22, "line": 5, }, }, "range": Array [ + 164, 172, - 180, ], "type": "Identifier", "value": "readonly", @@ -21006,17 +21870,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 40, + "column": 38, "line": 5, }, "start": Object { - "column": 33, + "column": 31, "line": 5, }, }, "range": Array [ - 181, - 188, + 173, + 180, ], "type": "Identifier", "value": "student", @@ -21024,17 +21888,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 39, "line": 5, }, "start": Object { - "column": 40, + "column": 38, "line": 5, }, }, "range": Array [ - 188, - 189, + 180, + 181, ], "type": "Punctuator", "value": ":", @@ -21042,17 +21906,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 49, + "column": 47, "line": 5, }, "start": Object { - "column": 42, + "column": 40, "line": 5, }, }, "range": Array [ - 190, - 197, + 182, + 189, ], "type": "Identifier", "value": "boolean", @@ -21060,17 +21924,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 51, + "column": 49, "line": 5, }, "start": Object { - "column": 50, + "column": 48, "line": 5, }, }, "range": Array [ - 198, - 199, + 190, + 191, ], "type": "Punctuator", "value": "=", @@ -21078,17 +21942,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 57, + "column": 55, "line": 5, }, "start": Object { - "column": 52, + "column": 50, "line": 5, }, }, "range": Array [ - 200, - 205, + 192, + 197, ], "type": "Boolean", "value": "false", @@ -21096,17 +21960,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 58, + "column": 56, "line": 5, }, "start": Object { - "column": 57, + "column": 55, "line": 5, }, }, "range": Array [ - 205, - 206, + 197, + 198, ], "type": "Punctuator", "value": ")", @@ -21114,17 +21978,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 60, + "column": 58, "line": 5, }, "start": Object { - "column": 59, + "column": 57, "line": 5, }, }, "range": Array [ - 207, - 208, + 199, + 200, ], "type": "Punctuator", "value": "{", @@ -21132,17 +21996,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 61, + "column": 59, "line": 5, }, "start": Object { - "column": 60, + "column": 58, "line": 5, }, }, "range": Array [ - 208, - 209, + 200, + 201, ], "type": "Punctuator", "value": "}", @@ -21159,8 +22023,8 @@ Object { }, }, "range": Array [ - 210, - 211, + 202, + 203, ], "type": "Punctuator", "value": "}", @@ -21170,7 +22034,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-public-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-property-values.src 1`] = ` Object { "body": Array [ Object { @@ -21181,7 +22045,7 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 2, }, "start": Object { @@ -21189,18 +22053,17 @@ Object { "line": 2, }, }, - "name": "constructor", + "name": "a", "range": Array [ 14, - 25, + 15, ], "type": "Identifier", }, - "kind": "constructor", "loc": Object { "end": Object { - "column": 58, - "line": 5, + "column": 8, + "line": 2, }, "start": Object { "column": 2, @@ -21209,411 +22072,349 @@ Object { }, "range": Array [ 14, - 197, + 20, ], "static": false, - "type": "MethodDefinition", + "type": "ClassProperty", "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 58, - "line": 5, - }, - "start": Object { - "column": 56, - "line": 5, - }, + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 6, + "line": 2, }, - "range": Array [ - 195, - 197, - ], - "type": "BlockStatement", }, - "expression": false, - "generator": false, - "id": null, + "range": Array [ + 18, + 19, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + }, + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 58, - "line": 5, + "column": 3, + "line": 3, }, "start": Object { - "column": 13, - "line": 2, + "column": 2, + "line": 3, }, }, - "params": Array [ - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 14, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "name": "firstName", - "range": Array [ - 33, - 50, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, - }, - }, - "range": Array [ - 42, - 50, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 2, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 44, - 50, - ], - "type": "TSStringKeyword", - }, - }, - }, - "range": Array [ - 26, - 50, - ], - "type": "TSParameterProperty", + "name": "b", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 23, + 30, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, }, - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 30, - "line": 3, - }, - }, - "name": "lastName", - "range": Array [ - 82, - 98, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 38, - "line": 3, - }, - }, - "range": Array [ - 90, - 98, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 3, - }, - "start": Object { - "column": 40, - "line": 3, - }, - }, - "range": Array [ - 92, - 98, - ], - "type": "TSStringKeyword", - }, - }, - }, - "range": Array [ - 66, - 98, - ], - "readonly": true, - "type": "TSParameterProperty", + "start": Object { + "column": 6, + "line": 3, }, - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 37, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "parameter": Object { - "left": Object { + }, + "properties": Array [], + "range": Array [ + 27, + 29, + ], + "type": "ObjectExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "name": "c", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 33, + 40, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 6, + "line": 4, + }, + }, + "range": Array [ + 37, + 39, + ], + "type": "ArrayExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "name": "d", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 43, + 50, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "range": Array [ + 47, + 49, + ], + "raw": "\\"\\"", + "type": "Literal", + "value": "", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "name": "e", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "range": Array [ + 53, + 80, + ], + "static": false, + "type": "ClassProperty", + "value": Object { + "arguments": Array [ + Object { + "elements": Array [ + Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 19, + "line": 6, }, "start": Object { - "column": 21, - "line": 4, + "column": 17, + "line": 6, }, }, - "name": "age", + "properties": Array [], "range": Array [ - 121, - 132, + 68, + 70, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 4, - }, - "start": Object { - "column": 24, - "line": 4, - }, - }, - "range": Array [ - 124, - 132, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 4, - }, - "start": Object { - "column": 26, - "line": 4, - }, - }, - "range": Array [ - 126, - 132, - ], - "type": "TSNumberKeyword", - }, - }, - }, - "loc": Object { - "end": Object { - "column": 37, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, + "type": "ObjectExpression", }, - "range": Array [ - 114, - 137, - ], - "right": Object { + Object { + "elements": Array [], "loc": Object { "end": Object { - "column": 37, - "line": 4, + "column": 23, + "line": 6, }, "start": Object { - "column": 35, - "line": 4, + "column": 21, + "line": 6, }, }, "range": Array [ - 135, - 137, + 72, + 74, ], - "raw": "30", - "type": "Literal", - "value": 30, - }, - "type": "AssignmentPattern", - }, - "range": Array [ - 114, - 137, - ], - "type": "TSParameterProperty", - }, - Object { - "accessibility": "public", - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, + "type": "ArrayExpression", }, - }, - "parameter": Object { - "left": Object { + Object { "loc": Object { "end": Object { - "column": 46, - "line": 5, + "column": 26, + "line": 6, }, "start": Object { - "column": 30, - "line": 5, + "column": 25, + "line": 6, }, }, - "name": "student", "range": Array [ - 169, - 185, + 76, + 77, ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 5, - }, - "start": Object { - "column": 37, - "line": 5, - }, - }, - "range": Array [ - 176, - 185, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 5, - }, - "start": Object { - "column": 39, - "line": 5, - }, - }, - "range": Array [ - 178, - 185, - ], - "type": "TSBooleanKeyword", - }, - }, + "raw": "2", + "type": "Literal", + "value": 2, }, - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 5, - }, + ], + "loc": Object { + "end": Object { + "column": 27, + "line": 6, }, - "range": Array [ - 153, - 193, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 54, - "line": 5, - }, - "start": Object { - "column": 49, - "line": 5, - }, - }, - "range": Array [ - 188, - 193, - ], - "raw": "false", - "type": "Literal", - "value": false, + "start": Object { + "column": 16, + "line": 6, }, - "type": "AssignmentPattern", }, "range": Array [ - 153, - 193, + 67, + 78, ], - "readonly": true, - "type": "TSParameterProperty", + "type": "ArrayExpression", }, ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "name": "Array", + "range": Array [ + 61, + 66, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, "range": Array [ - 25, - 197, + 57, + 79, ], - "type": "FunctionExpression", + "type": "NewExpression", }, }, ], "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 7, }, "start": Object { "column": 10, @@ -21622,7 +22423,7 @@ Object { }, "range": Array [ 10, - 199, + 82, ], "type": "ClassBody", }, @@ -21647,7 +22448,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 6, + "line": 7, }, "start": Object { "column": 0, @@ -21656,7 +22457,7 @@ Object { }, "range": Array [ 0, - 199, + 82, ], "superClass": null, "type": "ClassDeclaration", @@ -21664,8 +22465,8 @@ Object { ], "loc": Object { "end": Object { - "column": 1, - "line": 6, + "column": 0, + "line": 8, }, "start": Object { "column": 0, @@ -21674,7 +22475,7 @@ Object { }, "range": Array [ 0, - 199, + 83, ], "sourceType": "script", "tokens": Array [ @@ -21735,7 +22536,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 3, "line": 2, }, "start": Object { @@ -21745,547 +22546,619 @@ Object { }, "range": Array [ 14, - 25, + 15, ], "type": "Identifier", - "value": "constructor", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 5, "line": 2, }, "start": Object { - "column": 13, + "column": 4, "line": 2, }, }, "range": Array [ - 25, - 26, + 16, + 17, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 7, "line": 2, }, "start": Object { - "column": 14, + "column": 6, "line": 2, }, }, "range": Array [ - 26, - 32, + 18, + 19, ], - "type": "Keyword", - "value": "public", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 30, + "column": 8, "line": 2, }, "start": Object { - "column": 21, + "column": 7, "line": 2, }, }, "range": Array [ - 33, - 42, + 19, + 20, ], - "type": "Identifier", - "value": "firstName", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 2, + "column": 3, + "line": 3, }, "start": Object { - "column": 30, - "line": 2, + "column": 2, + "line": 3, }, }, "range": Array [ - 42, - 43, + 23, + 24, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 2, + "column": 5, + "line": 3, }, "start": Object { - "column": 32, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 44, - 50, + 25, + 26, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 38, - "line": 2, + "column": 6, + "line": 3, }, }, "range": Array [ - 50, - 51, + 27, + 28, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 8, "line": 3, }, "start": Object { - "column": 14, + "column": 7, "line": 3, }, }, "range": Array [ - 66, - 72, + 28, + 29, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 9, "line": 3, }, "start": Object { - "column": 21, + "column": 8, "line": 3, }, }, "range": Array [ - 73, - 81, + 29, + 30, ], - "type": "Identifier", - "value": "readonly", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 3, + "column": 3, + "line": 4, }, "start": Object { - "column": 30, - "line": 3, + "column": 2, + "line": 4, }, }, "range": Array [ - 82, - 90, + 33, + 34, ], "type": "Identifier", - "value": "lastName", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 39, - "line": 3, + "column": 5, + "line": 4, }, "start": Object { - "column": 38, - "line": 3, + "column": 4, + "line": 4, }, }, "range": Array [ - 90, - 91, + 35, + 36, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 3, + "column": 7, + "line": 4, }, "start": Object { - "column": 40, - "line": 3, + "column": 6, + "line": 4, }, }, "range": Array [ - 92, - 98, + 37, + 38, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 47, - "line": 3, + "column": 8, + "line": 4, }, "start": Object { - "column": 46, - "line": 3, + "column": 7, + "line": 4, }, }, "range": Array [ - 98, - 99, + 38, + 39, ], "type": "Punctuator", - "value": ",", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 20, + "column": 9, "line": 4, }, "start": Object { - "column": 14, + "column": 8, "line": 4, }, }, "range": Array [ - 114, - 120, + 39, + 40, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 4, + "column": 3, + "line": 5, }, "start": Object { - "column": 21, - "line": 4, + "column": 2, + "line": 5, }, }, "range": Array [ - 121, - 124, + 43, + 44, ], "type": "Identifier", - "value": "age", + "value": "d", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 4, + "column": 5, + "line": 5, }, "start": Object { - "column": 24, - "line": 4, + "column": 4, + "line": 5, }, }, "range": Array [ - 124, - 125, + 45, + 46, ], "type": "Punctuator", - "value": ":", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 4, + "column": 8, + "line": 5, }, "start": Object { - "column": 26, - "line": 4, + "column": 6, + "line": 5, }, }, "range": Array [ - 126, - 132, + 47, + 49, ], - "type": "Identifier", - "value": "number", + "type": "String", + "value": "\\"\\"", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 4, + "column": 9, + "line": 5, }, "start": Object { - "column": 33, - "line": 4, + "column": 8, + "line": 5, }, }, "range": Array [ - 133, - 134, + 49, + 50, ], "type": "Punctuator", - "value": "=", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 4, + "column": 3, + "line": 6, }, "start": Object { - "column": 35, - "line": 4, + "column": 2, + "line": 6, }, }, "range": Array [ - 135, - 137, + 53, + 54, ], - "type": "Numeric", - "value": "30", + "type": "Identifier", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 4, + "column": 5, + "line": 6, }, "start": Object { - "column": 37, - "line": 4, + "column": 4, + "line": 6, }, }, "range": Array [ - 137, - 138, + 55, + 56, ], "type": "Punctuator", - "value": ",", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 5, + "column": 9, + "line": 6, }, "start": Object { - "column": 14, - "line": 5, + "column": 6, + "line": 6, }, }, "range": Array [ - 153, - 159, + 57, + 60, ], "type": "Keyword", - "value": "public", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 5, + "column": 15, + "line": 6, }, "start": Object { - "column": 21, - "line": 5, + "column": 10, + "line": 6, }, }, "range": Array [ - 160, - 168, + 61, + 66, ], "type": "Identifier", - "value": "readonly", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 37, - "line": 5, + "column": 16, + "line": 6, }, "start": Object { - "column": 30, - "line": 5, + "column": 15, + "line": 6, }, }, "range": Array [ - 169, - 176, + 66, + 67, ], - "type": "Identifier", - "value": "student", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 38, - "line": 5, + "column": 17, + "line": 6, }, "start": Object { - "column": 37, - "line": 5, + "column": 16, + "line": 6, }, }, "range": Array [ - 176, - 177, + 67, + 68, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 46, - "line": 5, + "column": 18, + "line": 6, }, "start": Object { - "column": 39, - "line": 5, + "column": 17, + "line": 6, }, }, "range": Array [ - 178, - 185, + 68, + 69, ], - "type": "Identifier", - "value": "boolean", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 48, - "line": 5, + "column": 19, + "line": 6, }, "start": Object { - "column": 47, - "line": 5, + "column": 18, + "line": 6, }, }, "range": Array [ - 186, - 187, + 69, + 70, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 54, - "line": 5, + "column": 20, + "line": 6, }, "start": Object { - "column": 49, - "line": 5, + "column": 19, + "line": 6, }, }, "range": Array [ - 188, - 193, + 70, + 71, ], - "type": "Boolean", - "value": "false", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 55, - "line": 5, + "column": 22, + "line": 6, }, "start": Object { - "column": 54, - "line": 5, + "column": 21, + "line": 6, }, }, "range": Array [ - 193, - 194, + 72, + 73, ], "type": "Punctuator", - "value": ")", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 57, - "line": 5, + "column": 23, + "line": 6, }, "start": Object { - "column": 56, - "line": 5, + "column": 22, + "line": 6, }, }, "range": Array [ - 195, - 196, + 73, + 74, ], "type": "Punctuator", - "value": "{", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 58, - "line": 5, + "column": 24, + "line": 6, }, "start": Object { - "column": 57, - "line": 5, + "column": 23, + "line": 6, }, }, "range": Array [ - 196, - 197, + 74, + 75, ], "type": "Punctuator", - "value": "}", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 26, "line": 6, }, "start": Object { - "column": 0, + "column": 25, "line": 6, }, }, "range": Array [ - 198, - 199, + 76, + 77, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 6, + }, + "start": Object { + "column": 26, + "line": 6, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 6, + }, + "start": Object { + "column": 27, + "line": 6, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 6, + }, + "start": Object { + "column": 28, + "line": 6, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 81, + 82, ], "type": "Punctuator", "value": "}", @@ -22295,7 +23168,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-readonly-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-protected-parameter-properties.src 1`] = ` Object { "body": Array [ Object { @@ -22324,8 +23197,8 @@ Object { "kind": "constructor", "loc": Object { "end": Object { - "column": 53, - "line": 3, + "column": 61, + "line": 5, }, "start": Object { "column": 2, @@ -22334,7 +23207,7 @@ Object { }, "range": Array [ 14, - 107, + 209, ], "static": false, "type": "MethodDefinition", @@ -22344,17 +23217,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 53, - "line": 3, + "column": 61, + "line": 5, }, "start": Object { - "column": 51, - "line": 3, + "column": 59, + "line": 5, }, }, "range": Array [ - 105, - 107, + 207, + 209, ], "type": "BlockStatement", }, @@ -22363,8 +23236,8 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 53, - "line": 3, + "column": 61, + "line": 5, }, "start": Object { "column": 13, @@ -22373,9 +23246,10 @@ Object { }, "params": Array [ Object { + "accessibility": "protected", "loc": Object { "end": Object { - "column": 40, + "column": 41, "line": 2, }, "start": Object { @@ -22386,50 +23260,50 @@ Object { "parameter": Object { "loc": Object { "end": Object { - "column": 40, + "column": 41, "line": 2, }, "start": Object { - "column": 23, + "column": 24, "line": 2, }, }, "name": "firstName", "range": Array [ - 35, - 52, + 36, + 53, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 40, + "column": 41, "line": 2, }, "start": Object { - "column": 32, + "column": 33, "line": 2, }, }, "range": Array [ - 44, - 52, + 45, + 53, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 40, + "column": 41, "line": 2, }, "start": Object { - "column": 34, + "column": 35, "line": 2, }, }, "range": Array [ - 46, - 52, + 47, + 53, ], "type": "TSStringKeyword", }, @@ -22437,12 +23311,12 @@ Object { }, "range": Array [ 26, - 52, + 53, ], - "readonly": true, "type": "TSParameterProperty", }, Object { + "accessibility": "protected", "loc": Object { "end": Object { "column": 49, @@ -22454,96 +23328,273 @@ Object { }, }, "parameter": Object { - "left": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 88, + 104, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 39, + "column": 49, "line": 3, }, "start": Object { - "column": 23, + "column": 41, "line": 3, }, }, - "name": "lastName", "range": Array [ - 77, - 93, + 96, + 104, ], - "type": "Identifier", + "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 39, + "column": 49, "line": 3, }, "start": Object { - "column": 31, + "column": 43, "line": 3, }, }, "range": Array [ - 85, - 93, + 98, + 104, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 39, - "line": 3, - }, - "start": Object { - "column": 33, - "line": 3, - }, - }, - "range": Array [ - 87, - 93, + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 69, + 104, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "name": "age", + "range": Array [ + 130, + 141, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 27, + "line": 4, + }, + }, + "range": Array [ + 133, + 141, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 4, + }, + }, + "range": Array [ + 135, + 141, ], - "type": "TSStringKeyword", + "type": "TSNumberKeyword", }, }, }, "loc": Object { "end": Object { - "column": 49, - "line": 3, + "column": 40, + "line": 4, }, "start": Object { "column": 14, - "line": 3, + "line": 4, }, }, "range": Array [ - 68, - 103, + 120, + 146, ], "right": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 4, + }, + "start": Object { + "column": 38, + "line": 4, + }, + }, + "range": Array [ + 144, + 146, + ], + "raw": "30", + "type": "Literal", + "value": 30, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 120, + 146, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "protected", + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameter": Object { + "left": Object { "loc": Object { "end": Object { "column": 49, - "line": 3, + "line": 5, }, "start": Object { - "column": 42, - "line": 3, + "column": 33, + "line": 5, }, }, + "name": "student", "range": Array [ - 96, - 103, + 181, + 197, ], - "raw": "'Smith'", + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 40, + "line": 5, + }, + }, + "range": Array [ + 188, + 197, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 5, + }, + "start": Object { + "column": 42, + "line": 5, + }, + }, + "range": Array [ + 190, + 197, + ], + "type": "TSBooleanKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 162, + 205, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 5, + }, + "start": Object { + "column": 52, + "line": 5, + }, + }, + "range": Array [ + 200, + 205, + ], + "raw": "false", "type": "Literal", - "value": "Smith", + "value": false, }, "type": "AssignmentPattern", }, "range": Array [ - 68, - 103, + 162, + 205, ], "readonly": true, "type": "TSParameterProperty", @@ -22551,7 +23602,7 @@ Object { ], "range": Array [ 25, - 107, + 209, ], "type": "FunctionExpression", }, @@ -22560,7 +23611,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 6, }, "start": Object { "column": 10, @@ -22569,7 +23620,7 @@ Object { }, "range": Array [ 10, - 109, + 211, ], "type": "ClassBody", }, @@ -22594,7 +23645,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -22603,7 +23654,7 @@ Object { }, "range": Array [ 0, - 109, + 211, ], "superClass": null, "type": "ClassDeclaration", @@ -22612,7 +23663,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -22621,7 +23672,7 @@ Object { }, "range": Array [ 0, - 109, + 211, ], "sourceType": "script", "tokens": Array [ @@ -22718,7 +23769,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 2, }, "start": Object { @@ -22728,25 +23779,25 @@ Object { }, "range": Array [ 26, - 34, + 35, ], - "type": "Identifier", - "value": "readonly", + "type": "Keyword", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 32, + "column": 33, "line": 2, }, "start": Object { - "column": 23, + "column": 24, "line": 2, }, }, "range": Array [ - 35, - 44, + 36, + 45, ], "type": "Identifier", "value": "firstName", @@ -22754,17 +23805,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 33, + "column": 34, "line": 2, }, "start": Object { - "column": 32, + "column": 33, "line": 2, }, }, "range": Array [ - 44, 45, + 46, ], "type": "Punctuator", "value": ":", @@ -22772,17 +23823,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 40, + "column": 41, "line": 2, }, "start": Object { - "column": 34, + "column": 35, "line": 2, }, }, "range": Array [ - 46, - 52, + 47, + 53, ], "type": "Identifier", "value": "string", @@ -22790,17 +23841,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 42, "line": 2, }, "start": Object { - "column": 40, + "column": 41, "line": 2, }, }, "range": Array [ - 52, 53, + 54, ], "type": "Punctuator", "value": ",", @@ -22808,7 +23859,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, + "column": 23, "line": 3, }, "start": Object { @@ -22817,8 +23868,26 @@ Object { }, }, "range": Array [ - 68, - 76, + 69, + 78, + ], + "type": "Keyword", + "value": "protected", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 3, + }, + }, + "range": Array [ + 79, + 87, ], "type": "Identifier", "value": "readonly", @@ -22826,17 +23895,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, + "column": 41, "line": 3, }, "start": Object { - "column": 23, + "column": 33, "line": 3, }, }, "range": Array [ - 77, - 85, + 88, + 96, ], "type": "Identifier", "value": "lastName", @@ -22844,17 +23913,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 32, + "column": 42, "line": 3, }, "start": Object { - "column": 31, + "column": 41, "line": 3, }, }, "range": Array [ - 85, - 86, + 96, + 97, ], "type": "Punctuator", "value": ":", @@ -22862,17 +23931,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 39, + "column": 49, "line": 3, }, "start": Object { - "column": 33, + "column": 43, "line": 3, }, }, "range": Array [ - 87, - 93, + 98, + 104, ], "type": "Identifier", "value": "string", @@ -22880,425 +23949,341 @@ Object { Object { "loc": Object { "end": Object { - "column": 41, + "column": 50, "line": 3, }, "start": Object { - "column": 40, + "column": 49, "line": 3, }, }, "range": Array [ - 94, - 95, + 104, + 105, ], "type": "Punctuator", - "value": "=", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 49, - "line": 3, + "column": 23, + "line": 4, }, "start": Object { - "column": 42, - "line": 3, + "column": 14, + "line": 4, }, }, "range": Array [ - 96, - 103, + 120, + 129, ], - "type": "String", - "value": "'Smith'", + "type": "Keyword", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 50, - "line": 3, + "column": 27, + "line": 4, }, "start": Object { - "column": 49, - "line": 3, + "column": 24, + "line": 4, }, }, "range": Array [ - 103, - 104, + 130, + 133, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "age", }, Object { "loc": Object { "end": Object { - "column": 52, - "line": 3, + "column": 28, + "line": 4, }, "start": Object { - "column": 51, - "line": 3, + "column": 27, + "line": 4, }, }, "range": Array [ - 105, - 106, + 133, + 134, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 53, - "line": 3, + "column": 35, + "line": 4, }, "start": Object { - "column": 52, - "line": 3, + "column": 29, + "line": 4, }, }, "range": Array [ - 106, - 107, + 135, + 141, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 37, "line": 4, }, "start": Object { - "column": 0, + "column": 36, "line": 4, }, }, "range": Array [ - 108, - 109, + 142, + 143, ], "type": "Punctuator", - "value": "}", + "value": "=", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-readonly-property.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "accessibility": "public", - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 32, - 35, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 16, - 47, - ], - "readonly": true, - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 38, - 46, - ], - "raw": "'string'", - "type": "Literal", - "value": "string", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 40, + "line": 4, }, - "range": Array [ - 10, - 49, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, + "start": Object { + "column": 38, + "line": 4, }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", }, + "range": Array [ + 144, + 146, + ], + "type": "Numeric", + "value": "30", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 41, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 40, + "line": 4, }, }, "range": Array [ - 0, - 49, + 146, + 147, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ",", }, - }, - "range": Array [ - 0, - 50, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 23, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 14, + "line": 5, }, }, "range": Array [ - 0, - 5, + 162, + 171, ], "type": "Keyword", - "value": "class", + "value": "protected", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 32, + "line": 5, }, "start": Object { - "column": 6, - "line": 1, + "column": 24, + "line": 5, }, }, "range": Array [ - 6, - 9, + 172, + 180, ], "type": "Identifier", - "value": "Foo", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 40, + "line": 5, }, "start": Object { - "column": 10, - "line": 1, + "column": 33, + "line": 5, }, }, "range": Array [ - 10, - 11, + 181, + 188, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "student", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 41, + "line": 5, }, "start": Object { - "column": 4, - "line": 2, + "column": 40, + "line": 5, }, }, "range": Array [ - 16, - 22, + 188, + 189, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 2, + "column": 49, + "line": 5, }, "start": Object { - "column": 11, - "line": 2, + "column": 42, + "line": 5, }, }, "range": Array [ - 23, - 31, + 190, + 197, ], "type": "Identifier", - "value": "readonly", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 51, + "line": 5, }, "start": Object { - "column": 20, - "line": 2, + "column": 50, + "line": 5, }, }, "range": Array [ - 32, - 35, + 198, + 199, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 57, + "line": 5, }, "start": Object { - "column": 24, - "line": 2, + "column": 52, + "line": 5, }, }, "range": Array [ - 36, - 37, + 200, + 205, + ], + "type": "Boolean", + "value": "false", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 5, + }, + "start": Object { + "column": 57, + "line": 5, + }, + }, + "range": Array [ + 205, + 206, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 2, + "column": 60, + "line": 5, }, "start": Object { - "column": 26, - "line": 2, + "column": 59, + "line": 5, }, }, "range": Array [ - 38, - 46, + 207, + 208, ], - "type": "String", - "value": "'string'", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 2, + "column": 61, + "line": 5, }, "start": Object { - "column": 34, - "line": 2, + "column": 60, + "line": 5, }, }, "range": Array [ - 46, - 47, + 208, + 209, ], "type": "Punctuator", - "value": ";", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 6, }, "start": Object { "column": 0, - "line": 3, + "line": 6, }, }, "range": Array [ - 48, - 49, + 210, + 211, ], "type": "Punctuator", "value": "}", @@ -23308,7 +24293,7 @@ Object { } `; -exports[`typescript fixtures/basics/class-with-static-parameter-properties.src 1`] = ` +exports[`typescript fixtures/basics/class-with-public-parameter-properties.src 1`] = ` Object { "body": Array [ Object { @@ -23319,35 +24304,35 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "name": "constructor", "range": Array [ - 16, - 27, + 14, + 25, ], "type": "Identifier", }, "kind": "constructor", "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 58, + "line": 5, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 16, - 54, + 14, + 197, ], "static": false, "type": "MethodDefinition", @@ -23357,17 +24342,17 @@ Object { "body": Array [], "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 58, + "line": 5, }, "start": Object { - "column": 34, - "line": 2, + "column": 56, + "line": 5, }, }, "range": Array [ - 46, - 54, + 195, + 197, ], "type": "BlockStatement", }, @@ -23376,420 +24361,391 @@ Object { "id": null, "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 58, + "line": 5, }, "start": Object { - "column": 15, + "column": 13, "line": 2, }, }, "params": Array [ Object { + "accessibility": "public", "loc": Object { "end": Object { - "column": 32, + "column": 38, "line": 2, }, "start": Object { - "column": 16, + "column": 14, "line": 2, }, }, "parameter": Object { "loc": Object { "end": Object { - "column": 32, + "column": 38, "line": 2, }, "start": Object { - "column": 23, + "column": 21, "line": 2, }, }, - "name": "a", + "name": "firstName", "range": Array [ - 35, - 44, + 33, + 50, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, + "column": 38, "line": 2, }, "start": Object { - "column": 24, + "column": 30, "line": 2, }, }, "range": Array [ - 36, - 44, + 42, + 50, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 32, + "column": 38, "line": 2, }, "start": Object { - "column": 26, + "column": 32, "line": 2, }, }, "range": Array [ - 38, 44, + 50, ], "type": "TSStringKeyword", }, }, }, "range": Array [ - 28, - 44, + 26, + 50, ], - "static": true, "type": "TSParameterProperty", }, - ], - "range": Array [ - 27, - 54, - ], - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 56, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 56, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 59, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 5, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 11, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 16, - 27, - ], - "type": "Identifier", - "value": "constructor", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 28, - 34, - ], - "type": "Keyword", - "value": "static", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 2, - }, - "start": Object { - "column": 23, - "line": 2, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Identifier", - "value": "a", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 24, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 2, - }, - "start": Object { - "column": 26, - "line": 2, - }, - }, - "range": Array [ - 38, - 44, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 32, - "line": 2, - }, - }, - "range": Array [ - 44, - 45, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "start": Object { - "column": 34, - "line": 2, - }, - }, - "range": Array [ - 46, - 47, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 5, - }, - }, - "range": Array [ - 55, - 56, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [], + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 30, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 82, + 98, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 38, + "line": 3, + }, + }, + "range": Array [ + 90, + 98, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 40, + "line": 3, + }, + }, + "range": Array [ + 92, + 98, + ], + "type": "TSStringKeyword", + }, + }, + }, + "range": Array [ + 66, + 98, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 4, + }, + }, + "name": "age", + "range": Array [ + 121, + 132, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 24, + "line": 4, + }, + }, + "range": Array [ + 124, + 132, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 4, + }, + "start": Object { + "column": 26, + "line": 4, + }, + }, + "range": Array [ + 126, + 132, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 114, + 137, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 4, + }, + }, + "range": Array [ + 135, + 137, + ], + "raw": "30", + "type": "Literal", + "value": 30, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 114, + 137, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 30, + "line": 5, + }, + }, + "name": "student", + "range": Array [ + 169, + 185, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 37, + "line": 5, + }, + }, + "range": Array [ + 176, + 185, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 5, + }, + "start": Object { + "column": 39, + "line": 5, + }, + }, + "range": Array [ + 178, + 185, + ], + "type": "TSBooleanKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 5, + }, + }, + "range": Array [ + 153, + 193, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 54, + "line": 5, + }, + "start": Object { + "column": 49, + "line": 5, + }, + }, + "range": Array [ + 188, + 193, + ], + "raw": "false", + "type": "Literal", + "value": false, + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 153, + 193, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 197, + ], + "type": "FunctionExpression", + }, + }, + ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 6, }, "start": Object { - "column": 13, + "column": 10, "line": 1, }, }, "range": Array [ - 13, - 17, + 10, + 199, ], "type": "ClassBody", }, @@ -23814,7 +24770,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 6, }, "start": Object { "column": 0, @@ -23823,70 +24779,16 @@ Object { }, "range": Array [ 0, - 17, + 199, ], "superClass": null, "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 10, - 11, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 9, - 12, - ], - "type": "TSTypeParameterDeclaration", - }, }, ], "loc": Object { "end": Object { - "column": 0, - "line": 4, + "column": 1, + "line": 6, }, "start": Object { "column": 0, @@ -23895,7 +24797,7 @@ Object { }, "range": Array [ 0, - 18, + 199, ], "sourceType": "script", "tokens": Array [ @@ -23938,1010 +24840,575 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, + 11, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 10, - 11, + 14, + 25, ], "type": "Identifier", - "value": "T", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 14, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 13, + "line": 2, }, }, "range": Array [ - 11, - 12, + 25, + 26, ], "type": "Punctuator", - "value": ">", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 13, - "line": 1, + "column": 14, + "line": 2, }, }, "range": Array [ - 13, - 14, + 26, + 32, ], - "type": "Punctuator", - "value": "{", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 30, + "line": 2, }, "start": Object { - "column": 0, - "line": 3, + "column": 21, + "line": 2, }, }, "range": Array [ - 16, - 17, + 33, + 42, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "firstName", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "range": Array [ - 19, - 23, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 6, - 9, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 31, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 30, + "line": 2, }, }, "range": Array [ - 0, - 23, + 42, + 43, ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [ - Object { - "default": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 17, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 10, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 10, - 17, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 9, - 18, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": ":", }, - }, - "range": Array [ - 0, - 24, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 38, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 0, - 5, + 44, + 50, ], - "type": "Keyword", - "value": "class", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 39, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 38, + "line": 2, }, }, "range": Array [ - 6, - 9, + 50, + 51, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 20, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 9, - 10, + 66, + 72, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 29, + "line": 3, }, "start": Object { - "column": 10, - "line": 1, + "column": 21, + "line": 3, }, }, "range": Array [ - 10, - 11, + 73, + 81, ], "type": "Identifier", - "value": "T", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 38, + "line": 3, }, "start": Object { - "column": 12, - "line": 1, + "column": 30, + "line": 3, }, }, "range": Array [ - 12, - 13, + 82, + 90, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "lastName", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 39, + "line": 3, }, "start": Object { - "column": 14, - "line": 1, + "column": 38, + "line": 3, }, }, "range": Array [ - 14, - 17, + 90, + 91, ], - "type": "Identifier", - "value": "Bar", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 46, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 40, + "line": 3, }, }, "range": Array [ - 17, - 18, + 92, + 98, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 47, + "line": 3, }, "start": Object { - "column": 19, - "line": 1, + "column": 46, + "line": 3, }, }, "range": Array [ - 19, - 20, + 98, + 99, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 20, + "line": 4, }, "start": Object { - "column": 0, - "line": 3, + "column": 14, + "line": 4, }, }, "range": Array [ - 22, - 23, + 114, + 120, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "public", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 15, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 6, - 7, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 24, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 21, + "line": 4, }, }, "range": Array [ - 0, - 15, + 121, + 124, ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "name": "__P", - "range": Array [ - 8, - 11, - ], - "type": "Identifier", - }, - "range": Array [ - 8, - 11, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 7, - 12, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "age", }, - }, - "range": Array [ - 0, - 16, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 25, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 24, + "line": 4, }, }, "range": Array [ - 0, - 5, + 124, + 125, ], - "type": "Keyword", - "value": "class", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 32, + "line": 4, }, "start": Object { - "column": 6, - "line": 1, + "column": 26, + "line": 4, }, }, "range": Array [ - 6, - 7, + 126, + 132, ], "type": "Identifier", - "value": "A", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 34, + "line": 4, }, "start": Object { - "column": 7, - "line": 1, + "column": 33, + "line": 4, }, }, "range": Array [ - 7, - 8, + 133, + 134, ], "type": "Punctuator", - "value": "<", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 37, + "line": 4, }, "start": Object { - "column": 8, - "line": 1, + "column": 35, + "line": 4, }, }, "range": Array [ - 8, - 11, + 135, + 137, ], - "type": "Identifier", - "value": "__P", + "type": "Numeric", + "value": "30", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 38, + "line": 4, }, "start": Object { - "column": 11, - "line": 1, + "column": 37, + "line": 4, }, }, "range": Array [ - 11, - 12, + 137, + 138, ], "type": "Punctuator", - "value": ">", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 20, + "line": 5, }, "start": Object { - "column": 13, - "line": 1, + "column": 14, + "line": 5, }, }, "range": Array [ - 13, - 14, + 153, + 159, ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "public", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/const-enum.src 1`] = ` -Object { - "body": Array [ Object { - "const": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 11, - 14, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 29, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 21, + "line": 5, }, }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "initializer": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 27, - 28, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 28, - ], - "type": "TSEnumMember", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 34, - 37, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 34, - 37, - ], - "type": "TSEnumMember", - }, - ], "range": Array [ - 0, - 39, + 160, + 168, ], - "type": "TSEnumDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "readonly", }, - }, - "range": Array [ - 0, - 39, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, - "line": 1, + "column": 37, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 30, + "line": 5, }, }, "range": Array [ - 0, - 5, + 169, + 176, ], - "type": "Keyword", - "value": "const", + "type": "Identifier", + "value": "student", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 1, + "column": 38, + "line": 5, }, "start": Object { - "column": 6, - "line": 1, + "column": 37, + "line": 5, }, }, "range": Array [ - 6, - 10, + 176, + 177, ], - "type": "Keyword", - "value": "enum", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 46, + "line": 5, }, "start": Object { - "column": 11, - "line": 1, + "column": 39, + "line": 5, }, }, "range": Array [ - 11, - 14, + 178, + 185, ], "type": "Identifier", - "value": "Foo", + "value": "boolean", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 48, + "line": 5, }, "start": Object { - "column": 15, - "line": 1, + "column": 47, + "line": 5, }, }, "range": Array [ - 15, - 16, + 186, + 187, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 54, + "line": 5, }, "start": Object { - "column": 4, - "line": 2, + "column": 49, + "line": 5, }, }, "range": Array [ - 21, - 24, + 188, + 193, ], - "type": "Identifier", - "value": "foo", + "type": "Boolean", + "value": "false", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 2, + "column": 55, + "line": 5, }, "start": Object { - "column": 8, - "line": 2, + "column": 54, + "line": 5, }, }, "range": Array [ - 25, - 26, + 193, + 194, ], "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 27, - 28, - ], - "type": "Numeric", - "value": "1", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 2, + "column": 57, + "line": 5, }, "start": Object { - "column": 11, - "line": 2, + "column": 56, + "line": 5, }, }, "range": Array [ - 28, - 29, + 195, + 196, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 58, + "line": 5, }, "start": Object { - "column": 4, - "line": 3, + "column": 57, + "line": 5, }, }, "range": Array [ - 34, - 37, + 196, + 197, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 4, + "line": 6, }, "start": Object { "column": 0, - "line": 4, + "line": 6, }, }, "range": Array [ - 38, - 39, + 198, + 199, ], "type": "Punctuator", "value": "}", @@ -24951,7 +25418,7 @@ Object { } `; -exports[`typescript fixtures/basics/declare-class-with-optional-method.src 1`] = ` +exports[`typescript fixtures/basics/class-with-readonly-parameter-properties.src 1`] = ` Object { "body": Array [ Object { @@ -24962,155 +25429,313 @@ Object { "key": Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, - "name": "bar", - "optional": true, + "name": "constructor", "range": Array [ - 24, - 27, + 14, + 25, ], "type": "Identifier", }, - "kind": "method", + "kind": "constructor", "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 53, + "line": 3, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 24, - 36, + 14, + 107, ], "static": false, "type": "MethodDefinition", "value": Object { "async": false, - "body": null, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 53, + "line": 3, + }, + "start": Object { + "column": 51, + "line": 3, + }, + }, + "range": Array [ + 105, + 107, + ], + "type": "BlockStatement", + }, "expression": false, "generator": false, "id": null, "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 53, + "line": 3, }, "start": Object { - "column": 8, + "column": 13, "line": 2, }, }, - "params": Array [], - "range": Array [ - 28, - 36, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 30, - 35, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 15, + "column": 40, "line": 2, }, "start": Object { - "column": 12, + "column": 14, "line": 2, }, }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "firstName", + "range": Array [ + 35, + 52, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 32, + "line": 2, + }, + }, + "range": Array [ + 44, + 52, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 52, + ], + "type": "TSStringKeyword", + }, + }, + }, "range": Array [ - 32, - 35, + 26, + 52, ], - "type": "TSAnyKeyword", + "readonly": true, + "type": "TSParameterProperty", }, - }, - "type": "FunctionExpression", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "range": Array [ - 18, - 38, - ], - "type": "ClassBody", - }, - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 14, - 17, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 38, - ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], + Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "parameter": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 23, + "line": 3, + }, + }, + "name": "lastName", + "range": Array [ + 77, + 93, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 31, + "line": 3, + }, + }, + "range": Array [ + 85, + 93, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 3, + }, + }, + "range": Array [ + 87, + 93, + ], + "type": "TSStringKeyword", + }, + }, + }, + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 68, + 103, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 3, + }, + "start": Object { + "column": 42, + "line": 3, + }, + }, + "range": Array [ + 96, + 103, + ], + "raw": "'Smith'", + "type": "Literal", + "value": "Smith", + }, + "type": "AssignmentPattern", + }, + "range": Array [ + 68, + 103, + ], + "readonly": true, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 25, + 107, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 109, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 109, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -25119,14 +25744,14 @@ Object { }, "range": Array [ 0, - 38, + 109, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, + "column": 5, "line": 1, }, "start": Object { @@ -25136,25 +25761,7 @@ Object { }, "range": Array [ 0, - 7, - ], - "type": "Identifier", - "value": "declare", - }, - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 13, + 5, ], "type": "Keyword", "value": "class", @@ -25162,17 +25769,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 9, "line": 1, }, "start": Object { - "column": 14, + "column": 6, "line": 1, }, }, "range": Array [ - 14, - 17, + 6, + 9, ], "type": "Identifier", "value": "Foo", @@ -25180,17 +25787,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, + "column": 11, "line": 1, }, "start": Object { - "column": 18, + "column": 10, "line": 1, }, }, "range": Array [ - 18, - 19, + 10, + 11, ], "type": "Punctuator", "value": "{", @@ -25198,89 +25805,89 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 13, "line": 2, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, "range": Array [ - 24, - 27, + 14, + 25, ], "type": "Identifier", - "value": "bar", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 14, "line": 2, }, "start": Object { - "column": 7, + "column": 13, "line": 2, }, }, "range": Array [ - 27, - 28, + 25, + 26, ], "type": "Punctuator", - "value": "?", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 22, "line": 2, }, "start": Object { - "column": 8, + "column": 14, "line": 2, }, }, "range": Array [ - 28, - 29, + 26, + 34, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 32, "line": 2, }, "start": Object { - "column": 9, + "column": 23, "line": 2, }, }, "range": Array [ - 29, - 30, + 35, + 44, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "firstName", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 33, "line": 2, }, "start": Object { - "column": 10, + "column": 32, "line": 2, }, }, "range": Array [ - 30, - 31, + 44, + 45, ], "type": "Punctuator", "value": ":", @@ -25288,349 +25895,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, + "column": 40, "line": 2, }, "start": Object { - "column": 12, + "column": 34, "line": 2, }, }, "range": Array [ - 32, - 35, + 46, + 52, ], "type": "Identifier", - "value": "any", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 41, "line": 2, }, "start": Object { - "column": 15, + "column": 40, "line": 2, }, }, "range": Array [ - 35, - 36, + 52, + 53, ], "type": "Punctuator", - "value": ";", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 1, + "column": 22, "line": 3, }, "start": Object { - "column": 0, + "column": 14, "line": 3, }, }, "range": Array [ - 37, - 38, + 68, + 76, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "readonly", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/declare-function.src 1`] = ` -Object { - "body": Array [ Object { - "async": false, - "declare": true, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 31, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 23, + "line": 3, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 32, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], "range": Array [ - 0, - 42, + 77, + 85, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 41, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "TSStringKeyword", - }, - }, - "type": "TSDeclareFunction", - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "lastName", }, - }, - "range": Array [ - 0, - 42, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 32, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 31, + "line": 3, }, }, "range": Array [ - 0, - 7, + 85, + 86, ], - "type": "Identifier", - "value": "declare", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 39, + "line": 3, }, "start": Object { - "column": 8, - "line": 1, + "column": 33, + "line": 3, }, }, "range": Array [ - 8, - 16, + 87, + 93, ], - "type": "Keyword", - "value": "function", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 41, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 40, + "line": 3, }, }, "range": Array [ - 17, - 20, + 94, + 95, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 49, + "line": 3, }, "start": Object { - "column": 20, - "line": 1, + "column": 42, + "line": 3, }, }, "range": Array [ - 20, - 21, + 96, + 103, ], - "type": "Punctuator", - "value": "(", + "type": "String", + "value": "'Smith'", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 50, + "line": 3, }, "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 32, - "line": 1, + "column": 49, + "line": 3, }, }, "range": Array [ - 32, - 33, + 103, + 104, ], "type": "Punctuator", "value": ")", @@ -25638,217 +26057,165 @@ Object { Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 52, + "line": 3, }, "start": Object { - "column": 33, - "line": 1, + "column": 51, + "line": 3, }, }, "range": Array [ - 33, - 34, + 105, + 106, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 53, + "line": 3, }, "start": Object { - "column": 35, - "line": 1, + "column": 52, + "line": 3, }, }, "range": Array [ - 35, - 41, + 106, + 107, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 41, - "line": 1, + "column": 0, + "line": 4, }, }, "range": Array [ - 41, - 42, + 108, + 109, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/destructuring-assignment.src 1`] = ` +exports[`typescript fixtures/basics/class-with-readonly-property.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "init", + "body": Object { + "body": Array [ + Object { + "accessibility": "public", + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 3, - "line": 1, + "column": 20, + "line": 2, }, }, - "method": false, + "name": "foo", "range": Array [ - 3, - 11, + 32, + 35, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 47, + ], + "readonly": true, + "static": false, + "type": "ClassProperty", + "value": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, }, - "range": Array [ - 3, - 11, - ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 11, - ], - "type": "ArrayExpression", + "start": Object { + "column": 26, + "line": 2, }, - "type": "AssignmentPattern", }, + "range": Array [ + 38, + 46, + ], + "raw": "'string'", + "type": "Literal", + "value": "string", }, - ], - "range": Array [ - 1, - 13, - ], - "type": "ObjectPattern", - }, + }, + ], "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 1, + "column": 10, "line": 1, }, }, - "operator": "=", "range": Array [ - 1, - 19, + 10, + 49, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, }, - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", }, - "type": "AssignmentExpression", + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -25857,15 +26224,16 @@ Object { }, "range": Array [ 0, - 21, + 49, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 0, + "line": 4, }, "start": Object { "column": 0, @@ -25874,14 +26242,14 @@ Object { }, "range": Array [ 0, - 21, + 50, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -25891,133 +26259,115 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 1, }, "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { "column": 6, "line": 1, }, - "start": Object { - "column": 3, - "line": 1, - }, }, "range": Array [ - 3, 6, + 9, ], "type": "Identifier", - "value": "foo", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 1, }, "start": Object { - "column": 7, + "column": 10, "line": 1, }, }, "range": Array [ - 7, - 8, + 10, + 11, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 1, + "line": 2, }, "start": Object { - "column": 9, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 9, - 10, + 16, + 22, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 10, - 11, + 23, + 31, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "readonly", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 23, + "line": 2, }, "start": Object { - "column": 12, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 12, - 13, + 32, + 35, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 25, + "line": 2, }, "start": Object { - "column": 14, - "line": 1, + "column": 24, + "line": 2, }, }, "range": Array [ - 14, - 15, + 36, + 37, ], "type": "Punctuator", "value": "=", @@ -26025,975 +26375,256 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 34, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 16, - 19, + 38, + 46, ], - "type": "Identifier", - "value": "bar", + "type": "String", + "value": "'string'", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 19, - "line": 1, + "column": 34, + "line": 2, }, }, "range": Array [ - 19, - 20, + 46, + 47, ], "type": "Punctuator", - "value": ")", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 20, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 20, - 21, + 48, + 49, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/destructuring-assignment-nested.src 1`] = ` +exports[`typescript fixtures/basics/class-with-static-parameter-properties.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 81, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "kind": "init", + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 79, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 3, - "line": 1, + "column": 4, + "line": 2, }, }, - "method": false, + "name": "constructor", "range": Array [ - 3, - 79, + 16, + 27, ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 16, + 54, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 46, + 54, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 73, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 16, + "line": 2, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", + "parameter": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, }, - "kind": "init", + "start": Object { + "column": 23, + "line": 2, + }, + }, + "name": "a", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 71, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 24, + "line": 2, }, }, - "method": false, "range": Array [ - 10, - 71, + 36, + 44, ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 66, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 17, - 64, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "a", - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - }, - Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 28, - 42, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "left": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - }, - ], - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 36, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 42, - ], - "right": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "range": Array [ - 40, - 41, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - ], - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 42, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 26, - 44, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 58, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 58, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 1, - }, - "start": Object { - "column": 47, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 52, - "line": 1, - }, - "start": Object { - "column": 49, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 57, - "line": 1, - }, - "start": Object { - "column": 49, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 49, - 57, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 56, - "line": 1, - }, - "start": Object { - "column": 55, - "line": 1, - }, - }, - "range": Array [ - 55, - 56, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - ], - "loc": Object { - "end": Object { - "column": 57, - "line": 1, - }, - "start": Object { - "column": 54, - "line": 1, - }, - }, - "range": Array [ - 54, - 57, - ], - "type": "ArrayExpression", - }, - }, - ], - "range": Array [ - 47, - 58, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentPattern", - }, - ], - "loc": Object { - "end": Object { - "column": 59, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 59, - ], - "type": "ArrayPattern", - }, - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 64, - ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 62, - "line": 1, - }, - }, - "range": Array [ - 62, - 64, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", - }, - }, - ], - "range": Array [ - 15, - 66, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 71, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, }, "start": Object { - "column": 15, - "line": 1, + "column": 26, + "line": 2, }, }, "range": Array [ - 15, - 71, + 38, + 44, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 71, - "line": 1, - }, - "start": Object { - "column": 69, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 69, - 71, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentPattern", + "type": "TSStringKeyword", }, }, - ], - "range": Array [ - 8, - 73, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 79, - "line": 1, - }, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "range": Array [ - 8, - 79, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 79, - "line": 1, - }, - "start": Object { - "column": 76, - "line": 1, - }, }, - "properties": Array [], "range": Array [ - 76, - 79, + 28, + 44, ], - "type": "ObjectExpression", + "static": true, + "type": "TSParameterProperty", }, - "type": "AssignmentPattern", - }, + ], + "range": Array [ + 27, + 54, + ], + "type": "FunctionExpression", }, - ], - "range": Array [ - 1, - 81, - ], - "type": "ObjectPattern", - }, + }, + ], "loc": Object { "end": Object { - "column": 127, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 1, + "column": 10, "line": 1, }, }, - "operator": "=", "range": Array [ - 1, - 127, + 10, + 56, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 127, - "line": 1, - }, - "start": Object { - "column": 84, - "line": 1, - }, + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 89, - "line": 1, - }, - "start": Object { - "column": 86, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 86, - 89, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 126, - "line": 1, - }, - "start": Object { - "column": 86, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 86, - 126, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 126, - "line": 1, - }, - "start": Object { - "column": 91, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 96, - "line": 1, - }, - "start": Object { - "column": 93, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 93, - 96, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 124, - "line": 1, - }, - "start": Object { - "column": 93, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 93, - 124, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 124, - "line": 1, - }, - "start": Object { - "column": 98, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 103, - "line": 1, - }, - "start": Object { - "column": 100, - "line": 1, - }, - }, - "name": "baz", - "range": Array [ - 100, - 103, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 122, - "line": 1, - }, - "start": Object { - "column": 100, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 100, - 122, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 107, - "line": 1, - }, - "start": Object { - "column": 106, - "line": 1, - }, - }, - "range": Array [ - 106, - 107, - ], - "raw": "2", - "type": "Literal", - "value": 2, - }, - Object { - "loc": Object { - "end": Object { - "column": 121, - "line": 1, - }, - "start": Object { - "column": 109, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 114, - "line": 1, - }, - "start": Object { - "column": 111, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 111, - 114, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 119, - "line": 1, - }, - "start": Object { - "column": 111, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 111, - 119, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { - "column": 118, - "line": 1, - }, - "start": Object { - "column": 117, - "line": 1, - }, - }, - "range": Array [ - 117, - 118, - ], - "raw": "3", - "type": "Literal", - "value": 3, - }, - ], - "loc": Object { - "end": Object { - "column": 119, - "line": 1, - }, - "start": Object { - "column": 116, - "line": 1, - }, - }, - "range": Array [ - 116, - 119, - ], - "type": "ArrayExpression", - }, - }, - ], - "range": Array [ - 109, - 121, - ], - "type": "ObjectExpression", - }, - ], - "loc": Object { - "end": Object { - "column": 122, - "line": 1, - }, - "start": Object { - "column": 105, - "line": 1, - }, - }, - "range": Array [ - 105, - 122, - ], - "type": "ArrayExpression", - }, - }, - ], - "range": Array [ - 98, - 124, - ], - "type": "ObjectExpression", - }, - }, - ], - "range": Array [ - 91, - 126, - ], - "type": "ObjectExpression", - }, - }, - ], - "range": Array [ - 84, - 127, - ], - "type": "ObjectExpression", }, - "type": "AssignmentExpression", + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 129, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { "column": 0, @@ -27002,15 +26633,16 @@ Object { }, "range": Array [ 0, - 129, + 56, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 8, }, "start": Object { "column": 0, @@ -27019,14 +26651,14 @@ Object { }, "range": Array [ 0, - 130, + 59, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -27036,205 +26668,115 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 1, }, "start": Object { - "column": 1, + "column": 6, "line": 1, }, }, "range": Array [ - 1, - 2, + 6, + 9, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 11, "line": 1, }, "start": Object { - "column": 3, + "column": 10, "line": 1, }, }, "range": Array [ - 3, - 6, + 10, + 11, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 6, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 6, - 7, + 16, + 27, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "constructor", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 8, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 8, - 9, + 27, + 28, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 22, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 14, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 20, - ], - "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, + "line": 2, }, }, "range": Array [ - 22, - 23, + 28, + 34, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "static", }, Object { "loc": Object { "end": Object { "column": 24, - "line": 1, + "line": 2, }, "start": Object { "column": 23, - "line": 1, + "line": 2, }, }, "range": Array [ - 23, - 24, + 35, + 36, ], "type": "Identifier", "value": "a", @@ -27243,250 +26785,70 @@ Object { "loc": Object { "end": Object { "column": 25, - "line": 1, + "line": 2, }, "start": Object { "column": 24, - "line": 1, + "line": 2, }, }, "range": Array [ - 24, - 25, + 36, + 37, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 1, + "column": 32, + "line": 2, }, "start": Object { "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 27, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, + "line": 2, }, }, "range": Array [ - 28, - 31, + 38, + 44, ], "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 31, - "line": 1, - }, - }, - "range": Array [ - 31, - 32, - ], - "type": "Punctuator", - "value": ":", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Identifier", - "value": "x", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 38, - "line": 1, - }, - "start": Object { - "column": 37, - "line": 1, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "start": Object { - "column": 39, - "line": 1, - }, - }, - "range": Array [ - 39, - 40, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 40, - "line": 1, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Numeric", - "value": "3", - }, - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 41, - "line": 1, - }, - }, - "range": Array [ - 41, - 42, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, + "line": 2, }, "start": Object { - "column": 43, - "line": 1, + "column": 32, + "line": 2, }, }, "range": Array [ - 43, 44, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 46, - "line": 1, - }, - "start": Object { - "column": 45, - "line": 1, - }, - }, - "range": Array [ 45, - 46, ], "type": "Punctuator", - "value": "=", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 48, - "line": 1, + "column": 35, + "line": 2, }, "start": Object { - "column": 47, - "line": 1, + "column": 34, + "line": 2, }, }, "range": Array [ + 46, 47, - 48, ], "type": "Punctuator", "value": "{", @@ -27494,413 +26856,646 @@ Object { Object { "loc": Object { "end": Object { - "column": 52, - "line": 1, - }, - "start": Object { - "column": 49, - "line": 1, - }, - }, - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 1, + "column": 5, + "line": 4, }, "start": Object { - "column": 52, - "line": 1, + "column": 4, + "line": 4, }, }, "range": Array [ - 52, 53, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 55, - "line": 1, - }, - "start": Object { - "column": 54, - "line": 1, - }, - }, - "range": Array [ 54, - 55, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 56, - "line": 1, + "column": 1, + "line": 5, }, "start": Object { - "column": 55, - "line": 1, + "column": 0, + "line": 5, }, }, "range": Array [ 55, 56, ], - "type": "Numeric", - "value": "2", - }, - Object { - "loc": Object { - "end": Object { - "column": 57, - "line": 1, - }, - "start": Object { - "column": 56, - "line": 1, - }, - }, - "range": Array [ - 56, - 57, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 1, - }, - "start": Object { - "column": 57, - "line": 1, - }, - }, - "range": Array [ - 57, - 58, - ], "type": "Punctuator", "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-two-methods-computed-constructor.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 25, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 44, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 39, + 44, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 28, + 44, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 30, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 32, + 38, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "range": Array [ + 26, + 27, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 25, + 28, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 49, + 62, + ], + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", + }, + "kind": "method", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "range": Array [ + 48, + 82, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 31, + "line": 5, + }, + }, + "range": Array [ + 77, + 82, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 20, + "line": 5, + }, + }, + "params": Array [], + "range": Array [ + 66, + 82, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 5, + }, + "start": Object { + "column": 22, + "line": 5, + }, + }, + "range": Array [ + 68, + 76, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 5, + }, + "start": Object { + "column": 24, + "line": 5, + }, + }, + "range": Array [ + 70, + 76, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 17, + "line": 5, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "name": "T", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", + }, + "range": Array [ + 64, + 65, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 63, + 66, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 84, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 59, - "line": 1, - }, - "start": Object { - "column": 58, - "line": 1, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 61, - "line": 1, - }, - "start": Object { - "column": 60, - "line": 1, - }, - }, - "range": Array [ - 60, - 61, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 63, - "line": 1, - }, - "start": Object { - "column": 62, - "line": 1, - }, - }, - "range": Array [ - 62, - 63, - ], - "type": "Punctuator", - "value": "[", - }, - Object { - "loc": Object { - "end": Object { - "column": 64, - "line": 1, - }, - "start": Object { - "column": 63, - "line": 1, - }, - }, - "range": Array [ - 63, - 64, - ], - "type": "Punctuator", - "value": "]", - }, - Object { - "loc": Object { - "end": Object { - "column": 66, - "line": 1, - }, - "start": Object { - "column": 65, - "line": 1, - }, - }, - "range": Array [ - 65, - 66, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 68, - "line": 1, + "column": 1, + "line": 7, }, "start": Object { - "column": 67, + "column": 0, "line": 1, }, }, "range": Array [ - 67, - 68, + 0, + 84, ], - "type": "Punctuator", - "value": "=", + "superClass": null, + "type": "ClassDeclaration", }, Object { "loc": Object { "end": Object { - "column": 70, - "line": 1, + "column": 2, + "line": 7, }, "start": Object { - "column": 69, - "line": 1, + "column": 1, + "line": 7, }, }, "range": Array [ - 69, - 70, + 84, + 85, ], - "type": "Punctuator", - "value": "{", + "type": "EmptyStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 86, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 71, + "column": 5, "line": 1, }, "start": Object { - "column": 70, + "column": 0, "line": 1, }, }, "range": Array [ - 70, - 71, + 0, + 5, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 73, + "column": 7, "line": 1, }, "start": Object { - "column": 72, + "column": 6, "line": 1, }, }, "range": Array [ - 72, - 73, + 6, + 7, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 75, + "column": 9, "line": 1, }, "start": Object { - "column": 74, + "column": 8, "line": 1, }, }, "range": Array [ - 74, - 75, + 8, + 9, ], "type": "Punctuator", - "value": "=", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 77, - "line": 1, + "column": 15, + "line": 2, }, "start": Object { - "column": 76, - "line": 1, + "column": 2, + "line": 2, }, }, "range": Array [ - 76, - 77, + 12, + 25, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"constructor\\"", }, Object { "loc": Object { "end": Object { - "column": 79, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 78, - "line": 1, + "column": 15, + "line": 2, }, }, "range": Array [ - 78, - 79, + 25, + 26, ], "type": "Punctuator", - "value": "}", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 81, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 80, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 80, - 81, + 26, + 27, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 83, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 82, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 82, - 83, + 27, + 28, ], "type": "Punctuator", - "value": "=", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 85, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 84, - "line": 1, - }, + "column": 18, + "line": 2, + }, }, "range": Array [ - 84, - 85, + 28, + 29, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 89, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 86, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 86, - 89, + 29, + 30, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 90, - "line": 1, + "column": 21, + "line": 2, }, "start": Object { - "column": 89, - "line": 1, + "column": 20, + "line": 2, }, }, "range": Array [ - 89, - 90, + 30, + 31, ], "type": "Punctuator", "value": ":", @@ -27908,17 +27503,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 92, - "line": 1, + "column": 28, + "line": 2, }, "start": Object { - "column": 91, - "line": 1, + "column": 22, + "line": 2, }, }, "range": Array [ - 91, - 92, + 32, + 38, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 39, + 40, ], "type": "Punctuator", "value": "{", @@ -27926,558 +27539,688 @@ Object { Object { "loc": Object { "end": Object { - "column": 96, - "line": 1, + "column": 3, + "line": 3, }, "start": Object { - "column": 93, - "line": 1, + "column": 2, + "line": 3, }, }, "range": Array [ - 93, - 96, + 43, + 44, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 97, - "line": 1, + "column": 3, + "line": 5, }, "start": Object { - "column": 96, - "line": 1, + "column": 2, + "line": 5, }, }, "range": Array [ - 96, - 97, + 48, + 49, ], "type": "Punctuator", - "value": ":", + "value": "[", }, Object { "loc": Object { "end": Object { - "column": 99, - "line": 1, + "column": 16, + "line": 5, }, "start": Object { - "column": 98, - "line": 1, + "column": 3, + "line": 5, }, }, "range": Array [ - 98, - 99, + 49, + 62, ], - "type": "Punctuator", - "value": "{", + "type": "String", + "value": "\\"constructor\\"", }, Object { "loc": Object { "end": Object { - "column": 103, - "line": 1, + "column": 17, + "line": 5, }, "start": Object { - "column": 100, - "line": 1, + "column": 16, + "line": 5, }, }, "range": Array [ - 100, - 103, + 62, + 63, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": "]", }, Object { "loc": Object { "end": Object { - "column": 104, - "line": 1, + "column": 18, + "line": 5, }, "start": Object { - "column": 103, - "line": 1, + "column": 17, + "line": 5, }, }, "range": Array [ - 103, - 104, + 63, + 64, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 106, - "line": 1, + "column": 19, + "line": 5, }, "start": Object { - "column": 105, - "line": 1, + "column": 18, + "line": 5, }, }, "range": Array [ - 105, - 106, + 64, + 65, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 5, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 65, + 66, ], "type": "Punctuator", - "value": "[", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 107, - "line": 1, + "column": 21, + "line": 5, }, "start": Object { - "column": 106, - "line": 1, + "column": 20, + "line": 5, }, }, "range": Array [ - 106, - 107, + 66, + 67, ], - "type": "Numeric", - "value": "2", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 108, - "line": 1, + "column": 22, + "line": 5, }, "start": Object { - "column": 107, - "line": 1, + "column": 21, + "line": 5, }, }, "range": Array [ - 107, - 108, + 67, + 68, ], "type": "Punctuator", - "value": ",", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 110, - "line": 1, + "column": 23, + "line": 5, }, "start": Object { - "column": 109, - "line": 1, + "column": 22, + "line": 5, }, }, "range": Array [ - 109, - 110, + 68, + 69, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 114, - "line": 1, + "column": 30, + "line": 5, }, "start": Object { - "column": 111, - "line": 1, + "column": 24, + "line": 5, }, }, "range": Array [ - 111, - 114, + 70, + 76, ], "type": "Identifier", - "value": "foo", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 115, - "line": 1, + "column": 32, + "line": 5, }, "start": Object { - "column": 114, - "line": 1, + "column": 31, + "line": 5, }, }, "range": Array [ - 114, - 115, + 77, + 78, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 117, - "line": 1, + "column": 3, + "line": 6, }, "start": Object { - "column": 116, - "line": 1, + "column": 2, + "line": 6, }, }, "range": Array [ - 116, - 117, + 81, + 82, ], "type": "Punctuator", - "value": "[", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 118, - "line": 1, + "column": 1, + "line": 7, }, "start": Object { - "column": 117, - "line": 1, + "column": 0, + "line": 7, }, }, "range": Array [ - 117, - 118, + 83, + 84, ], - "type": "Numeric", - "value": "3", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 119, - "line": 1, + "column": 2, + "line": 7, }, "start": Object { - "column": 118, - "line": 1, + "column": 1, + "line": 7, }, }, "range": Array [ - 118, - 119, + 84, + 85, ], "type": "Punctuator", - "value": "]", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/class-with-type-parameter.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 17, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 121, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 120, + "column": 0, "line": 1, }, }, "range": Array [ - 120, - 121, + 0, + 17, ], - "type": "Punctuator", - "value": "}", + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 10, + 11, + ], + "type": "Identifier", + }, + "range": Array [ + 10, + 11, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 9, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 18, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 122, + "column": 5, "line": 1, }, "start": Object { - "column": 121, + "column": 0, "line": 1, }, }, "range": Array [ - 121, - 122, + 0, + 5, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 124, + "column": 9, "line": 1, }, "start": Object { - "column": 123, + "column": 6, "line": 1, }, }, "range": Array [ - 123, - 124, + 6, + 9, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 126, + "column": 10, "line": 1, }, "start": Object { - "column": 125, + "column": 9, "line": 1, }, }, "range": Array [ - 125, - 126, + 9, + 10, ], "type": "Punctuator", - "value": "}", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 127, + "column": 11, "line": 1, }, "start": Object { - "column": 126, + "column": 10, "line": 1, }, }, "range": Array [ - 126, - 127, + 10, + 11, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 128, + "column": 12, "line": 1, }, "start": Object { - "column": 127, + "column": 11, "line": 1, }, }, "range": Array [ - 127, - 128, + 11, + 12, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 129, + "column": 14, "line": 1, }, "start": Object { - "column": 128, + "column": 13, "line": 1, }, }, "range": Array [ - 128, - 129, + 13, + 14, ], "type": "Punctuator", - "value": ";", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/destructuring-assignment-object.src 1`] = ` +exports[`typescript fixtures/basics/class-with-type-parameter-default.src 1`] = ` Object { "body": Array [ Object { - "expression": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 23, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [ + Object { + "default": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { "loc": Object { "end": Object { - "column": 6, + "column": 17, "line": 1, }, "start": Object { - "column": 3, + "column": 14, "line": 1, }, }, - "name": "foo", + "name": "Bar", "range": Array [ - 3, - 6, + 14, + 17, ], "type": "Identifier", }, - "kind": "init", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": Object { "loc": Object { "end": Object { "column": 11, "line": 1, }, "start": Object { - "column": 3, + "column": 10, "line": 1, }, }, - "method": false, + "name": "T", "range": Array [ - 3, + 10, 11, ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 3, - 6, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 11, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "properties": Array [], - "range": Array [ - 9, - 11, - ], - "type": "ObjectExpression", - }, - "type": "AssignmentPattern", - }, + "type": "Identifier", }, - ], - "range": Array [ - 1, - 13, - ], - "type": "ObjectPattern", - }, - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameter", }, - }, - "operator": "=", + ], "range": Array [ - 1, - 19, + 9, + 18, ], - "right": Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 16, - 19, - ], - "type": "Identifier", - }, - "type": "AssignmentExpression", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 0, - 21, - ], - "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 0, - "line": 2, + "line": 4, }, "start": Object { "column": 0, @@ -28486,14 +28229,14 @@ Object { }, "range": Array [ 0, - 22, + 24, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, + "column": 5, "line": 1, }, "start": Object { @@ -28503,64 +28246,28 @@ Object { }, "range": Array [ 0, - 1, + 5, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 2, + "column": 9, "line": 1, }, "start": Object { - "column": 1, - "line": 1, - }, - }, - "range": Array [ - 1, - 2, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { "column": 6, "line": 1, }, - "start": Object { - "column": 3, - "line": 1, - }, }, "range": Array [ - 3, 6, + 9, ], "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 8, - ], - "type": "Punctuator", - "value": "=", + "value": "Foo", }, Object { "loc": Object { @@ -28578,7 +28285,7 @@ Object { 10, ], "type": "Punctuator", - "value": "{", + "value": "<", }, Object { "loc": Object { @@ -28595,8 +28302,8 @@ Object { 10, 11, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { @@ -28614,12 +28321,12 @@ Object { 13, ], "type": "Punctuator", - "value": "}", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 17, "line": 1, }, "start": Object { @@ -28629,28 +28336,28 @@ Object { }, "range": Array [ 14, - 15, + 17, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 18, "line": 1, }, "start": Object { - "column": 16, + "column": 17, "line": 1, }, }, "range": Array [ - 16, - 19, + 17, + 18, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { @@ -28668,243 +28375,147 @@ Object { 20, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 20, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 20, - 21, + 22, + 23, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/destructuring-assignment-property.src 1`] = ` +exports[`typescript fixtures/basics/class-with-type-parameter-underscore.src 1`] = ` Object { "body": Array [ Object { - "async": false, "body": Object { "body": Array [], "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { - "column": 33, + "column": 13, "line": 1, }, }, "range": Array [ - 33, - 37, + 13, + 15, ], - "type": "BlockStatement", + "type": "ClassBody", }, - "expression": false, - "generator": false, "id": Object { "loc": Object { "end": Object { - "column": 12, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, - "name": "Foo", + "name": "A", "range": Array [ - 9, - 12, + 6, + 7, ], "type": "Identifier", }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 15, + "line": 1, }, "start": Object { "column": 0, "line": 1, }, }, - "params": Array [ - Object { - "left": Object { + "range": Array [ + 0, + 15, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "params": Array [ + Object { "loc": Object { "end": Object { - "column": 25, + "column": 11, "line": 1, }, "start": Object { - "column": 13, + "column": 8, "line": 1, }, }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, }, - "method": false, - "range": Array [ - 15, - 23, - ], - "shorthand": true, - "type": "Property", - "value": Object { - "left": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 23, - ], - "right": Object { - "elements": Array [], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 23, - ], - "type": "ArrayExpression", - }, - "type": "AssignmentPattern", + "start": Object { + "column": 8, + "line": 1, }, }, - ], + "name": "__P", + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + }, "range": Array [ - 13, - 25, + 8, + 11, ], - "type": "ObjectPattern", + "type": "TSTypeParameter", }, - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "range": Array [ - 13, - 31, - ], - "right": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "bar", - "range": Array [ - 28, - 31, - ], - "type": "Identifier", - }, - "type": "AssignmentPattern", - }, - ], - "range": Array [ - 0, - 37, - ], - "type": "FunctionDeclaration", + ], + "range": Array [ + 7, + 12, + ], + "type": "TSTypeParameterDeclaration", + }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 2, }, "start": Object { "column": 0, @@ -28913,14 +28524,14 @@ Object { }, "range": Array [ 0, - 38, + 16, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 1, }, "start": Object { @@ -28930,46 +28541,82 @@ Object { }, "range": Array [ 0, - 8, + 5, ], "type": "Keyword", - "value": "function", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 7, "line": 1, }, "start": Object { - "column": 9, + "column": 6, "line": 1, }, }, "range": Array [ - 9, - 12, + 6, + 7, ], "type": "Identifier", - "value": "Foo", + "value": "A", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, "line": 1, }, "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 11, + ], + "type": "Identifier", + "value": "__P", + }, + Object { + "loc": Object { + "end": Object { "column": 12, "line": 1, }, + "start": Object { + "column": 11, + "line": 1, + }, }, "range": Array [ + 11, 12, - 13, ], "type": "Punctuator", - "value": "(", + "value": ">", }, Object { "loc": Object { @@ -28992,107 +28639,277 @@ Object { Object { "loc": Object { "end": Object { - "column": 18, + "column": 15, "line": 1, }, "start": Object { - "column": 15, + "column": 14, "line": 1, }, }, "range": Array [ + 14, 15, - 18, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/const-enum.src 1`] = ` +Object { + "body": Array [ Object { + "const": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 11, + 14, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 20, - "line": 1, + "column": 1, + "line": 4, }, "start": Object { - "column": 19, + "column": 0, "line": 1, }, }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 28, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 34, + 37, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "TSEnumMember", + }, + ], "range": Array [ - 19, - 20, + 0, + 39, ], - "type": "Punctuator", - "value": "=", + "type": "TSEnumDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 39, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 22, + "column": 5, "line": 1, }, "start": Object { - "column": 21, + "column": 0, "line": 1, }, }, "range": Array [ - 21, - 22, + 0, + 5, ], - "type": "Punctuator", - "value": "[", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 23, + "column": 10, "line": 1, }, "start": Object { - "column": 22, + "column": 6, "line": 1, }, }, "range": Array [ - 22, - 23, + 6, + 10, ], - "type": "Punctuator", - "value": "]", + "type": "Keyword", + "value": "enum", }, Object { "loc": Object { "end": Object { - "column": 25, + "column": 14, "line": 1, }, "start": Object { - "column": 24, + "column": 11, "line": 1, }, }, "range": Array [ - 24, - 25, + 11, + 14, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 27, + "column": 16, "line": 1, }, "start": Object { - "column": 26, + "column": 15, "line": 1, }, }, "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 25, 26, - 27, ], "type": "Punctuator", "value": "=", @@ -29100,71 +28917,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 11, + "line": 2, }, "start": Object { - "column": 28, - "line": 1, + "column": 10, + "line": 2, }, }, "range": Array [ + 27, 28, - 31, ], - "type": "Identifier", - "value": "bar", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 32, - "line": 1, + "column": 12, + "line": 2, }, "start": Object { - "column": 31, - "line": 1, + "column": 11, + "line": 2, }, }, "range": Array [ - 31, - 32, + 28, + 29, ], "type": "Punctuator", - "value": ")", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 34, - "line": 1, + "column": 7, + "line": 3, }, "start": Object { - "column": 33, - "line": 1, + "column": 4, + "line": 3, }, }, "range": Array [ - 33, 34, + 37, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 4, }, "start": Object { "column": 0, - "line": 3, + "line": 4, }, }, "range": Array [ - 36, - 37, + 38, + 39, ], "type": "Punctuator", "value": "}", @@ -29174,198 +28991,148 @@ Object { } `; -exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` +exports[`typescript fixtures/basics/declare-class-with-optional-method.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { - "directive": "use strict", - "expression": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 14, + "column": 7, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, + "name": "bar", + "optional": true, "range": Array [ - 15, + 24, 27, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", + "type": "Identifier", }, + "kind": "method", "loc": Object { "end": Object { - "column": 15, + "column": 16, "line": 2, }, "start": Object { - "column": 2, + "column": 4, "line": 2, }, }, "range": Array [ - 15, - 28, + 24, + 36, ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 35, - 36, - ], - "type": "Identifier", + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": null, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, }, - "init": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 39, - 40, - ], - "raw": "1", - "type": "Literal", - "value": 1, + "start": Object { + "column": 8, + "line": 2, }, + }, + "params": Array [], + "range": Array [ + 28, + 36, + ], + "returnType": Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 15, + "line": 2, }, "start": Object { - "column": 6, - "line": 3, + "column": 10, + "line": 2, }, }, "range": Array [ + 30, 35, - 40, ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 31, - 41, - ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "range": Array [ - 44, - 56, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 12, + "line": 2, + }, + }, + "range": Array [ + 32, + 35, + ], + "type": "TSAnyKeyword", + }, }, + "type": "FunctionExpression", }, - "range": Array [ - 44, - 57, - ], - "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { - "column": 11, + "column": 18, "line": 1, }, }, "range": Array [ - 11, - 59, + 18, + 38, ], - "type": "TSModuleBlock", + "type": "ClassBody", }, + "declare": true, "id": Object { "loc": Object { "end": Object { - "column": 10, + "column": 17, "line": 1, }, "start": Object { - "column": 7, + "column": 14, "line": 1, }, }, - "name": "foo", + "name": "Foo", "range": Array [ - 7, - 10, + 14, + 17, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { "column": 0, @@ -29374,15 +29141,16 @@ Object { }, "range": Array [ 0, - 59, + 38, ], - "type": "TSModuleDeclaration", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 1, + "line": 3, }, "start": Object { "column": 0, @@ -29391,14 +29159,14 @@ Object { }, "range": Array [ 0, - 60, + 38, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 7, "line": 1, }, "start": Object { @@ -29408,205 +29176,187 @@ Object { }, "range": Array [ 0, - 6, + 7, ], "type": "Identifier", - "value": "module", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 10, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 8, "line": 1, }, }, "range": Array [ - 7, - 10, + 8, + 13, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "class", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 17, "line": 1, }, "start": Object { - "column": 11, + "column": 14, "line": 1, }, }, "range": Array [ - 11, - 12, + 14, + 17, ], - "type": "Punctuator", - "value": "{", + "type": "Identifier", + "value": "Foo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 2, + "column": 19, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 18, + "line": 1, }, }, "range": Array [ - 15, - 27, + 18, + 19, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 7, "line": 2, }, "start": Object { - "column": 14, + "column": 4, "line": 2, }, }, "range": Array [ + 24, 27, - 28, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 8, + "line": 2, }, "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 31, - 34, - ], - "type": "Keyword", - "value": "var", - }, - Object { - "loc": Object { - "end": Object { "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, + "line": 2, }, }, "range": Array [ - 35, - 36, + 27, + 28, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 3, + "line": 2, }, "start": Object { "column": 8, - "line": 3, + "line": 2, }, }, "range": Array [ - 37, - 38, + 28, + 29, ], "type": "Punctuator", - "value": "=", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 10, + "line": 2, }, "start": Object { - "column": 10, - "line": 3, + "column": 9, + "line": 2, }, }, "range": Array [ - 39, - 40, + 29, + 30, ], - "type": "Numeric", - "value": "1", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 11, + "line": 2, }, "start": Object { - "column": 11, - "line": 3, + "column": 10, + "line": 2, }, }, "range": Array [ - 40, - 41, + 30, + 31, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 15, + "line": 2, }, "start": Object { - "column": 2, - "line": 4, + "column": 12, + "line": 2, }, }, "range": Array [ - 44, - 56, + 32, + 35, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 16, + "line": 2, }, "start": Object { - "column": 14, - "line": 4, + "column": 15, + "line": 2, }, }, "range": Array [ - 56, - 57, + 35, + 36, ], "type": "Punctuator", "value": ";", @@ -29615,16 +29365,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 5, + "line": 3, }, "start": Object { "column": 0, - "line": 5, + "line": 3, }, }, "range": Array [ - 58, - 59, + 37, + 38, ], "type": "Punctuator", "value": "}", @@ -29634,215 +29384,141 @@ Object { } `; -exports[`typescript fixtures/basics/directive-in-namespace.src 1`] = ` +exports[`typescript fixtures/basics/declare-function.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "directive": "use strict", - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 18, - 30, - ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", + "async": false, + "declare": true, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, }, - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, + "start": Object { + "column": 21, + "line": 1, }, - "range": Array [ - 18, - 31, - ], - "type": "ExpressionStatement", }, - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "name": "a", - "range": Array [ - 38, - 39, - ], - "type": "Identifier", - }, - "init": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 42, - 43, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 3, - }, - "start": Object { - "column": 6, - "line": 3, - }, - }, - "range": Array [ - 38, - 43, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "var", + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 34, - 44, + 24, + 32, ], - "type": "VariableDeclaration", - }, - Object { - "expression": Object { + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 32, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 26, + "line": 1, }, }, "range": Array [ - 47, - 59, + 26, + 32, ], - "raw": "\\"use strict\\"", - "type": "Literal", - "value": "use strict", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 4, - }, - "start": Object { - "column": 2, - "line": 4, - }, + "type": "TSStringKeyword", }, - "range": Array [ - 47, - 60, - ], - "type": "ExpressionStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 14, - "line": 1, }, }, - "range": Array [ - 14, - 62, - ], - "type": "TSModuleBlock", - }, - "id": Object { + ], + "range": Array [ + 0, + 42, + ], + "returnType": Object { "loc": Object { "end": Object { - "column": 13, + "column": 41, "line": 1, }, "start": Object { - "column": 10, + "column": 33, "line": 1, }, }, - "name": "foo", "range": Array [ - 10, - 13, + 33, + 41, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", }, }, - "range": Array [ - 0, - 62, - ], - "type": "TSModuleDeclaration", + "type": "TSDeclareFunction", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 6, + "column": 42, + "line": 1, }, "start": Object { "column": 0, @@ -29851,14 +29527,14 @@ Object { }, "range": Array [ 0, - 63, + 42, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 7, "line": 1, }, "start": Object { @@ -29868,257 +29544,350 @@ Object { }, "range": Array [ 0, - 9, + 7, ], "type": "Identifier", - "value": "namespace", + "value": "declare", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 16, "line": 1, }, "start": Object { - "column": 10, + "column": 8, "line": 1, }, }, "range": Array [ - 10, - 13, + 8, + 16, ], - "type": "Identifier", - "value": "foo", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 20, "line": 1, }, "start": Object { - "column": 14, + "column": 17, "line": 1, }, }, "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "range": Array [ - 18, - 30, + 17, + 20, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { - "column": 14, - "line": 2, + "column": 20, + "line": 1, }, }, "range": Array [ - 30, - 31, + 20, + 21, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "range": Array [ - 34, - 37, - ], - "type": "Keyword", - "value": "var", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 24, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 21, + "line": 1, }, }, "range": Array [ - 38, - 39, + 21, + 24, ], "type": "Identifier", - "value": "a", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 25, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 24, + "line": 1, }, }, "range": Array [ - 40, - 41, + 24, + 25, ], "type": "Punctuator", - "value": "=", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 32, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 26, + "line": 1, }, }, "range": Array [ - 42, - 43, + 26, + 32, ], - "type": "Numeric", - "value": "1", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 33, + "line": 1, }, "start": Object { - "column": 11, - "line": 3, + "column": 32, + "line": 1, }, }, "range": Array [ - 43, - 44, + 32, + 33, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 4, + "column": 34, + "line": 1, }, "start": Object { - "column": 2, - "line": 4, + "column": 33, + "line": 1, }, }, "range": Array [ - 47, - 59, + 33, + 34, ], - "type": "String", - "value": "\\"use strict\\"", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 4, + "column": 41, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 35, + "line": 1, }, }, "range": Array [ - 59, - 60, + 35, + 41, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 42, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 41, + "line": 1, }, }, "range": Array [ - 61, - 62, + 41, + 42, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/export-as-namespace.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment.src 1`] = ` Object { "body": Array [ Object { - "id": Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 11, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 11, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 13, + ], + "type": "ObjectPattern", + }, "loc": Object { "end": Object { - "column": 21, + "column": 19, "line": 1, }, "start": Object { - "column": 20, + "column": 1, "line": 1, }, }, - "name": "a", + "operator": "=", "range": Array [ - 20, - 21, + 1, + 19, ], - "type": "Identifier", + "right": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", }, "loc": Object { "end": Object { - "column": 22, + "column": 21, "line": 1, }, "start": Object { @@ -30128,15 +29897,15 @@ Object { }, "range": Array [ 0, - 22, + 21, ], - "type": "TSNamespaceExportDeclaration", + "type": "ExpressionStatement", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 2, + "column": 21, + "line": 1, }, "start": Object { "column": 0, @@ -30145,14 +29914,14 @@ Object { }, "range": Array [ 0, - 23, + 21, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 1, "line": 1, }, "start": Object { @@ -30162,211 +29931,187 @@ Object { }, "range": Array [ 0, - 6, + 1, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 2, "line": 1, }, "start": Object { - "column": 7, + "column": 1, "line": 1, }, }, "range": Array [ - 7, - 9, + 1, + 2, ], - "type": "Identifier", - "value": "as", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 19, + "column": 6, "line": 1, }, "start": Object { - "column": 10, + "column": 3, "line": 1, }, }, "range": Array [ - 10, - 19, + 3, + 6, ], "type": "Identifier", - "value": "namespace", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 21, + "column": 8, "line": 1, }, "start": Object { - "column": 20, + "column": 7, "line": 1, }, }, "range": Array [ - 20, - 21, + 7, + 8, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 22, + "column": 10, "line": 1, }, "start": Object { - "column": 21, + "column": 9, "line": 1, }, }, "range": Array [ - 21, - 22, + 9, + 10, ], "type": "Punctuator", - "value": ";", + "value": "[", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-assignment.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, }, - "name": "foo", - "range": Array [ - 9, - 12, - ], - "type": "Identifier", }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "]", + }, + Object { "loc": Object { "end": Object { "column": 13, "line": 1, }, "start": Object { - "column": 0, + "column": 12, "line": 1, }, }, "range": Array [ - 0, + 12, 13, ], - "type": "TSExportAssignment", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "}", }, - }, - "range": Array [ - 0, - 14, - ], - "sourceType": "module", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 6, + "column": 15, "line": 1, }, "start": Object { - "column": 0, + "column": 14, "line": 1, }, }, "range": Array [ - 0, - 6, + 14, + 15, ], - "type": "Keyword", - "value": "export", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 19, "line": 1, }, "start": Object { - "column": 7, + "column": 16, "line": 1, }, }, "range": Array [ - 7, - 8, + 16, + 19, ], - "type": "Punctuator", - "value": "=", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 12, + "column": 20, "line": 1, }, "start": Object { - "column": 9, + "column": 19, "line": 1, }, }, "range": Array [ - 9, - 12, + 19, + 20, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 13, + "column": 21, "line": 1, }, "start": Object { - "column": 12, + "column": 20, "line": 1, }, }, "range": Array [ - 12, - 13, + 20, + 21, ], "type": "Punctuator", "value": ";", @@ -30376,1023 +30121,5318 @@ Object { } `; -exports[`typescript fixtures/basics/export-declare-const-named-enum.src 1`] = ` +exports[`typescript fixtures/basics/destructuring-assignment-nested.src 1`] = ` Object { "body": Array [ Object { - "declaration": Object { - "const": true, - "declare": true, - "id": Object { + "expression": Object { + "left": Object { "loc": Object { "end": Object { - "column": 29, + "column": 81, "line": 1, }, "start": Object { - "column": 26, + "column": 1, "line": 1, }, }, - "name": "Foo", - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - }, - "initializer": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 42, - 43, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 36, - 43, - ], - "type": "TSEnumMember", - }, - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 49, - 52, - ], - "type": "TSEnumMember", - }, - ], - "range": Array [ - 21, - 54, - ], - "type": "TSEnumDeclaration", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 54, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 55, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 14, - ], - "type": "Identifier", - "value": "declare", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 20, - ], - "type": "Keyword", - "value": "const", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 25, - ], - "type": "Keyword", - "value": "enum", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "range": Array [ - 26, - 29, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 30, - "line": 1, - }, - }, - "range": Array [ - 30, - 31, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 36, - 39, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 40, - 41, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 42, - 43, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 43, - 44, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-declare-named-enum.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "declare": true, - "id": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "members": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 30, - 33, - ], - "type": "Identifier", - }, - "initializer": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", }, - "range": Array [ - 36, - 37, - ], - "raw": "1", - "type": "Literal", - "value": 1, - }, - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 30, - 37, - ], - "type": "TSEnumMember", - }, - Object { - "id": Object { + "kind": "init", "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 79, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 3, + "line": 1, }, }, - "name": "bar", + "method": false, "range": Array [ - 43, - 46, + 3, + 79, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "TSEnumMember", - }, - ], - "range": Array [ - 15, - 48, - ], - "type": "TSEnumDeclaration", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 48, - ], - "source": null, - "specifiers": Array [], - "type": "ExportNamedDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 49, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 14, - ], - "type": "Identifier", - "value": "declare", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 19, - ], - "type": "Keyword", - "value": "enum", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 23, - ], - "type": "Identifier", - "value": "Foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 30, - 33, - ], - "type": "Identifier", - "value": "foo", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "range": Array [ - 34, - 35, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 2, - }, - "start": Object { - "column": 10, - "line": 2, - }, - }, - "range": Array [ - 36, - 37, - ], - "type": "Numeric", - "value": "1", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 2, - }, - "start": Object { - "column": 11, - "line": 2, - }, - }, - "range": Array [ - 37, - 38, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 43, - 46, - ], - "type": "Identifier", - "value": "bar", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "range": Array [ - 47, - 48, - ], - "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 28, - ], - "type": "ClassBody", - }, - "id": null, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 28, - ], - "superClass": null, - "type": "ClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 73, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, }, - }, - "name": "T", - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - }, - "range": Array [ - 21, - 22, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 20, - 23, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 28, - ], - "type": "ExportDefaultDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 29, - ], - "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 6, - ], - "type": "Keyword", - "value": "export", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 14, - ], - "type": "Keyword", - "value": "default", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 20, - ], - "type": "Keyword", - "value": "class", - }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "start": Object { - "column": 20, - "line": 1, - }, - }, - "range": Array [ - 20, - 21, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "range": Array [ - 21, - 22, - ], - "type": "Identifier", - "value": "T", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": ">", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 10, + 71, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 17, + 64, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 28, + 42, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "left": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 36, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 42, + ], + "right": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 26, + 44, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 58, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 49, + 57, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + ], + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 47, + 58, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + ], + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 59, + ], + "type": "ArrayPattern", + }, + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 64, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 64, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 15, + 66, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 71, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 69, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 69, + 71, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 8, + 73, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 79, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 76, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 76, + 79, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 81, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 127, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 127, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 127, + "line": 1, + }, + "start": Object { + "column": 84, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 89, + "line": 1, + }, + "start": Object { + "column": 86, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 86, + 89, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 126, + "line": 1, + }, + "start": Object { + "column": 86, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 86, + 126, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 126, + "line": 1, + }, + "start": Object { + "column": 91, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 96, + "line": 1, + }, + "start": Object { + "column": 93, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 93, + 96, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 93, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 93, + 124, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 98, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 103, + "line": 1, + }, + "start": Object { + "column": 100, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 100, + 103, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 122, + "line": 1, + }, + "start": Object { + "column": 100, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 100, + 122, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 107, + "line": 1, + }, + "start": Object { + "column": 106, + "line": 1, + }, + }, + "range": Array [ + 106, + 107, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + Object { + "loc": Object { + "end": Object { + "column": 121, + "line": 1, + }, + "start": Object { + "column": 109, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 114, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 119, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 111, + 119, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "elements": Array [ + Object { + "loc": Object { + "end": Object { + "column": 118, + "line": 1, + }, + "start": Object { + "column": 117, + "line": 1, + }, + }, + "range": Array [ + 117, + 118, + ], + "raw": "3", + "type": "Literal", + "value": 3, + }, + ], + "loc": Object { + "end": Object { + "column": 119, + "line": 1, + }, + "start": Object { + "column": 116, + "line": 1, + }, + }, + "range": Array [ + 116, + 119, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 109, + 121, + ], + "type": "ObjectExpression", + }, + ], + "loc": Object { + "end": Object { + "column": 122, + "line": 1, + }, + "start": Object { + "column": 105, + "line": 1, + }, + }, + "range": Array [ + 105, + 122, + ], + "type": "ArrayExpression", + }, + }, + ], + "range": Array [ + 98, + 124, + ], + "type": "ObjectExpression", + }, + }, + ], + "range": Array [ + 91, + 126, + ], + "type": "ObjectExpression", + }, + }, + ], + "range": Array [ + 84, + 127, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 129, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 129, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 130, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 20, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 40, + "line": 1, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 1, + }, + "start": Object { + "column": 45, + "line": 1, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 1, + }, + "start": Object { + "column": 47, + "line": 1, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 52, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 1, + }, + "start": Object { + "column": 52, + "line": 1, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 55, + "line": 1, + }, + "start": Object { + "column": 54, + "line": 1, + }, + }, + "range": Array [ + 54, + 55, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 56, + "line": 1, + }, + "start": Object { + "column": 55, + "line": 1, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 57, + "line": 1, + }, + "start": Object { + "column": 56, + "line": 1, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 57, + "line": 1, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 59, + "line": 1, + }, + "start": Object { + "column": 58, + "line": 1, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 60, + "line": 1, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 63, + "line": 1, + }, + "start": Object { + "column": 62, + "line": 1, + }, + }, + "range": Array [ + 62, + 63, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 64, + "line": 1, + }, + "start": Object { + "column": 63, + "line": 1, + }, + }, + "range": Array [ + 63, + 64, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 66, + "line": 1, + }, + "start": Object { + "column": 65, + "line": 1, + }, + }, + "range": Array [ + 65, + 66, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 68, + "line": 1, + }, + "start": Object { + "column": 67, + "line": 1, + }, + }, + "range": Array [ + 67, + 68, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 70, + "line": 1, + }, + "start": Object { + "column": 69, + "line": 1, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 1, + }, + "start": Object { + "column": 70, + "line": 1, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 73, + "line": 1, + }, + "start": Object { + "column": 72, + "line": 1, + }, + }, + "range": Array [ + 72, + 73, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 75, + "line": 1, + }, + "start": Object { + "column": 74, + "line": 1, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 77, + "line": 1, + }, + "start": Object { + "column": 76, + "line": 1, + }, + }, + "range": Array [ + 76, + 77, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 79, + "line": 1, + }, + "start": Object { + "column": 78, + "line": 1, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 81, + "line": 1, + }, + "start": Object { + "column": 80, + "line": 1, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 83, + "line": 1, + }, + "start": Object { + "column": 82, + "line": 1, + }, + }, + "range": Array [ + 82, + 83, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 85, + "line": 1, + }, + "start": Object { + "column": 84, + "line": 1, + }, + }, + "range": Array [ + 84, + 85, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 89, + "line": 1, + }, + "start": Object { + "column": 86, + "line": 1, + }, + }, + "range": Array [ + 86, + 89, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 90, + "line": 1, + }, + "start": Object { + "column": 89, + "line": 1, + }, + }, + "range": Array [ + 89, + 90, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 92, + "line": 1, + }, + "start": Object { + "column": 91, + "line": 1, + }, + }, + "range": Array [ + 91, + 92, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 96, + "line": 1, + }, + "start": Object { + "column": 93, + "line": 1, + }, + }, + "range": Array [ + 93, + 96, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 97, + "line": 1, + }, + "start": Object { + "column": 96, + "line": 1, + }, + }, + "range": Array [ + 96, + 97, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 99, + "line": 1, + }, + "start": Object { + "column": 98, + "line": 1, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 103, + "line": 1, + }, + "start": Object { + "column": 100, + "line": 1, + }, + }, + "range": Array [ + 100, + 103, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 104, + "line": 1, + }, + "start": Object { + "column": 103, + "line": 1, + }, + }, + "range": Array [ + 103, + 104, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 106, + "line": 1, + }, + "start": Object { + "column": 105, + "line": 1, + }, + }, + "range": Array [ + 105, + 106, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 107, + "line": 1, + }, + "start": Object { + "column": 106, + "line": 1, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Numeric", + "value": "2", + }, + Object { + "loc": Object { + "end": Object { + "column": 108, + "line": 1, + }, + "start": Object { + "column": 107, + "line": 1, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 110, + "line": 1, + }, + "start": Object { + "column": 109, + "line": 1, + }, + }, + "range": Array [ + 109, + 110, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 114, + "line": 1, + }, + "start": Object { + "column": 111, + "line": 1, + }, + }, + "range": Array [ + 111, + 114, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 115, + "line": 1, + }, + "start": Object { + "column": 114, + "line": 1, + }, + }, + "range": Array [ + 114, + 115, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 117, + "line": 1, + }, + "start": Object { + "column": 116, + "line": 1, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 118, + "line": 1, + }, + "start": Object { + "column": 117, + "line": 1, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Numeric", + "value": "3", + }, + Object { + "loc": Object { + "end": Object { + "column": 119, + "line": 1, + }, + "start": Object { + "column": 118, + "line": 1, + }, + }, + "range": Array [ + 118, + 119, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 121, + "line": 1, + }, + "start": Object { + "column": 120, + "line": 1, + }, + }, + "range": Array [ + 120, + 121, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 122, + "line": 1, + }, + "start": Object { + "column": 121, + "line": 1, + }, + }, + "range": Array [ + 121, + 122, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 124, + "line": 1, + }, + "start": Object { + "column": 123, + "line": 1, + }, + }, + "range": Array [ + 123, + 124, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 126, + "line": 1, + }, + "start": Object { + "column": 125, + "line": 1, + }, + }, + "range": Array [ + 125, + 126, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 127, + "line": 1, + }, + "start": Object { + "column": 126, + "line": 1, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 128, + "line": 1, + }, + "start": Object { + "column": 127, + "line": 1, + }, + }, + "range": Array [ + 127, + 128, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 129, + "line": 1, + }, + "start": Object { + "column": 128, + "line": 1, + }, + }, + "range": Array [ + 128, + 129, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/destructuring-assignment-object.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 3, + 11, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 11, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "properties": Array [], + "range": Array [ + 9, + 11, + ], + "type": "ObjectExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 1, + 13, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "operator": "=", + "range": Array [ + 1, + 19, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + }, + "type": "AssignmentExpression", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 21, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 6, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 19, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/destructuring-assignment-property.src 1`] = ` +Object { + "body": Array [ + Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 37, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [ + Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "method": false, + "range": Array [ + 15, + 23, + ], + "shorthand": true, + "type": "Property", + "value": Object { + "left": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 23, + ], + "right": Object { + "elements": Array [], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 23, + ], + "type": "ArrayExpression", + }, + "type": "AssignmentPattern", + }, + }, + ], + "range": Array [ + 13, + 25, + ], + "type": "ObjectPattern", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 31, + ], + "right": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + }, + "type": "AssignmentPattern", + }, + ], + "range": Array [ + 0, + 37, + ], + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 8, + ], + "type": "Keyword", + "value": "function", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 31, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/directive-in-module.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 27, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 28, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 35, + 40, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 31, + 41, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 44, + 56, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 44, + 57, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 59, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 59, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 60, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Identifier", + "value": "module", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 10, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 15, + 27, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 31, + 34, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 44, + 56, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 56, + 57, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 58, + 59, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/directive-in-namespace.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "directive": "use strict", + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 30, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 31, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": "a", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 38, + 43, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "var", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 34, + 44, + ], + "type": "VariableDeclaration", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 47, + 59, + ], + "raw": "\\"use strict\\"", + "type": "Literal", + "value": "use strict", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 47, + 60, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 62, + ], + "type": "TSModuleBlock", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 62, + ], + "type": "TSModuleDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 63, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Identifier", + "value": "namespace", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 18, + 30, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "range": Array [ + 34, + 37, + ], + "type": "Keyword", + "value": "var", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "range": Array [ + 47, + 59, + ], + "type": "String", + "value": "\\"use strict\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 14, + "line": 4, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-as-namespace.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "a", + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 22, + ], + "type": "TSNamespaceExportDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 23, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 9, + ], + "type": "Identifier", + "value": "as", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 19, + ], + "type": "Identifier", + "value": "namespace", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-assignment.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 13, + ], + "type": "TSExportAssignment", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 8, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 12, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-declare-const-named-enum.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "const": true, + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 36, + 43, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 21, + 54, + ], + "type": "TSEnumDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 54, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 55, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 36, + 39, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-declare-named-enum.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "declare": true, + "id": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "members": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 30, + 33, + ], + "type": "Identifier", + }, + "initializer": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 30, + 37, + ], + "type": "TSEnumMember", + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 43, + 46, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "TSEnumMember", + }, + ], + "range": Array [ + 15, + 48, + ], + "type": "TSEnumDeclaration", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 48, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 49, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Identifier", + "value": "declare", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 19, + ], + "type": "Keyword", + "value": "enum", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 2, + }, + "start": Object { + "column": 10, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 43, + 46, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/export-default-class-with-generic.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 28, + ], + "type": "ClassBody", + }, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 28, + ], + "superClass": null, + "type": "ClassDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + }, + "range": Array [ + 21, + 22, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 20, + 23, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 6, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 14, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, "start": Object { "column": 0, "line": 3, @@ -43565,149 +47605,1607 @@ Object { "line": 1, }, }, - "range": Array [ - 14, - 295, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, + "range": Array [ + 14, + 295, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 295, + ], + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 16, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 297, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 9, + ], + "type": "Keyword", + "value": "interface", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "baa", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 37, + 40, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 43, + 49, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 56, + 59, + ], + "type": "Identifier", + "value": "bax", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 59, + 60, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 4, + }, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 11, + "line": 4, + }, + }, + "range": Array [ + 62, + 68, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "range": Array [ + 75, + 78, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 80, + 81, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 82, + 88, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 88, + 89, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 94, + 95, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 5, + "line": 6, + }, + }, + "range": Array [ + 95, + 98, + ], + "type": "Identifier", + "value": "eee", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 98, + 99, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 6, + }, + "start": Object { + "column": 10, + "line": 6, + }, + }, + "range": Array [ + 100, + 106, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 6, + }, + "start": Object { + "column": 16, + "line": 6, + }, + }, + "range": Array [ + 106, + 107, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 6, + }, + "start": Object { + "column": 17, + "line": 6, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 6, + }, + "start": Object { + "column": 19, + "line": 6, + }, + }, + "range": Array [ + 109, + 115, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 6, + }, + "start": Object { + "column": 25, + "line": 6, + }, + }, + "range": Array [ + 115, + 116, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 4, + "line": 7, + }, + }, + "range": Array [ + 121, + 122, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 7, + }, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "range": Array [ + 122, + 125, + ], + "type": "Identifier", + "value": "fff", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 125, + 126, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "start": Object { + "column": 9, + "line": 7, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 128, + 134, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 17, + "line": 7, + }, + }, + "range": Array [ + 134, + 135, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 7, + }, + "start": Object { + "column": 18, + "line": 7, + }, + }, + "range": Array [ + 135, + 136, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 7, + }, + "start": Object { + "column": 20, + "line": 7, + }, + }, + "range": Array [ + 137, + 143, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 7, + }, + "start": Object { + "column": 26, + "line": 7, + }, + }, + "range": Array [ + 143, + 144, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 4, + "line": 8, + }, + }, + "range": Array [ + 149, + 152, + ], + "type": "Identifier", + "value": "doo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 152, + 153, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 8, + }, + "start": Object { + "column": 8, + "line": 8, + }, + }, + "range": Array [ + 153, + 154, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "start": Object { + "column": 9, + "line": 8, + }, + }, + "range": Array [ + 154, + 155, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 156, + 160, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 8, + }, + "start": Object { + "column": 15, + "line": 8, + }, + }, + "range": Array [ + 160, + 161, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 166, + 169, + ], + "type": "Identifier", + "value": "doo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 9, + }, + "start": Object { + "column": 7, + "line": 9, + }, + }, + "range": Array [ + 169, + 170, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 9, + }, + "start": Object { + "column": 8, + "line": 9, + }, + }, + "range": Array [ + 170, + 171, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 9, + }, + "start": Object { + "column": 9, + "line": 9, + }, + }, + "range": Array [ + 171, + 172, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 9, + }, + "start": Object { + "column": 10, + "line": 9, + }, + }, + "range": Array [ + 172, + 173, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 9, + }, + "start": Object { + "column": 12, + "line": 9, + }, + }, + "range": Array [ + 174, + 175, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 9, + }, + "start": Object { + "column": 13, + "line": 9, + }, + }, + "range": Array [ + 175, + 176, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 9, + }, + "start": Object { + "column": 15, + "line": 9, + }, + }, + "range": Array [ + 177, + 178, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 9, + }, + "start": Object { + "column": 16, + "line": 9, + }, + }, + "range": Array [ + 178, + 179, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 9, + }, + "start": Object { + "column": 17, + "line": 9, + }, + }, + "range": Array [ + 179, + 180, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 9, + }, + "start": Object { + "column": 19, + "line": 9, + }, + }, + "range": Array [ + 181, + 185, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 9, + }, + "start": Object { + "column": 23, + "line": 9, + }, + }, + "range": Array [ + 185, + 186, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 10, + }, + "start": Object { + "column": 4, + "line": 10, + }, + }, + "range": Array [ + 191, + 192, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 10, + }, + "start": Object { + "column": 5, + "line": 10, + }, + }, + "range": Array [ + 192, + 195, + ], + "type": "Identifier", + "value": "loo", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 10, + }, + "start": Object { + "column": 8, + "line": 10, + }, + }, + "range": Array [ + 195, + 196, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 10, + }, + "start": Object { + "column": 9, + "line": 10, + }, + }, + "range": Array [ + 196, + 197, + ], + "type": "Punctuator", + "value": "?", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 10, + }, + "start": Object { + "column": 10, + "line": 10, + }, + }, + "range": Array [ + 197, + 198, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 10, + }, + "start": Object { + "column": 11, + "line": 10, + }, + }, + "range": Array [ + 198, + 199, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 10, + }, + "start": Object { + "column": 12, + "line": 10, + }, + }, + "range": Array [ + 199, + 200, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 10, + }, + "start": Object { + "column": 14, + "line": 10, + }, + }, + "range": Array [ + 201, + 202, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 10, + }, + "start": Object { + "column": 15, + "line": 10, + }, + }, + "range": Array [ + 202, + 203, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 10, + }, + "start": Object { + "column": 17, + "line": 10, + }, + }, + "range": Array [ + 204, + 205, + ], + "type": "Identifier", + "value": "c", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 10, + }, + "start": Object { + "column": 18, + "line": 10, + }, + }, + "range": Array [ + 205, + 206, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 10, + }, + }, + "range": Array [ + 206, + 207, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 10, + }, + "start": Object { + "column": 21, + "line": 10, + }, + }, + "range": Array [ + 208, + 212, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 10, + }, + "start": Object { + "column": 25, + "line": 10, + }, + }, + "range": Array [ + 212, + 213, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 4, + "line": 11, + }, + }, + "range": Array [ + 218, + 221, + ], + "type": "Identifier", + "value": "boo", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 11, + }, + "start": Object { + "column": 7, + "line": 11, }, - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", }, + "range": Array [ + 221, + 222, + ], + "type": "Punctuator", + "value": "<", + }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 14, + "column": 9, + "line": 11, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 11, }, }, "range": Array [ - 0, - 295, + 222, + 223, ], - "type": "TSInterfaceDeclaration", + "type": "Identifier", + "value": "J", }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 16, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "range": Array [ + 223, + 224, + ], + "type": "Punctuator", + "value": ">", }, - "start": Object { - "column": 0, - "line": 1, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 11, + }, + "start": Object { + "column": 10, + "line": 11, + }, + }, + "range": Array [ + 224, + 225, + ], + "type": "Punctuator", + "value": "(", }, - }, - "range": Array [ - 0, - 297, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 12, + "line": 11, }, "start": Object { - "column": 0, - "line": 1, + "column": 11, + "line": 11, }, }, "range": Array [ - 0, - 9, + 225, + 226, ], - "type": "Keyword", - "value": "interface", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 1, + "line": 11, }, "start": Object { - "column": 10, - "line": 1, + "column": 12, + "line": 11, }, }, "range": Array [ - 10, - 13, + 226, + 227, ], - "type": "Identifier", - "value": "Foo", + "type": "Punctuator", + "value": ",", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 1, + "line": 11, }, "start": Object { "column": 14, - "line": 1, + "line": 11, }, }, "range": Array [ - 14, - 15, + 228, + 229, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 11, + }, + "start": Object { + "column": 15, + "line": 11, + }, + }, + "range": Array [ + 229, + 230, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 11, }, "start": Object { - "column": 4, - "line": 2, + "column": 17, + "line": 11, }, }, "range": Array [ - 20, - 23, + 231, + 232, ], "type": "Identifier", - "value": "baa", + "value": "c", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 19, + "line": 11, }, "start": Object { - "column": 7, - "line": 2, + "column": 18, + "line": 11, }, }, "range": Array [ - 23, - 24, + 232, + 233, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 11, + }, + "start": Object { + "column": 19, + "line": 11, + }, + }, + "range": Array [ + 233, + 234, ], "type": "Punctuator", "value": ":", @@ -43715,35 +49213,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 25, + "line": 11, }, "start": Object { - "column": 9, - "line": 2, + "column": 21, + "line": 11, }, }, "range": Array [ - 25, - 31, + 235, + 239, ], - "type": "Identifier", - "value": "number", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 26, + "line": 11, }, "start": Object { - "column": 15, - "line": 2, + "column": 25, + "line": 11, }, }, "range": Array [ - 31, - 32, + 239, + 240, ], "type": "Punctuator", "value": ";", @@ -43752,1492 +49250,2630 @@ Object { "loc": Object { "end": Object { "column": 7, - "line": 3, + "line": 12, }, "start": Object { "column": 4, - "line": 3, + "line": 12, }, }, "range": Array [ - 37, - 40, + 245, + 248, ], - "type": "Identifier", - "value": "bar", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 9, + "line": 12, }, "start": Object { - "column": 7, - "line": 3, + "column": 8, + "line": 12, }, }, "range": Array [ - 40, - 41, + 249, + 250, ], "type": "Punctuator", - "value": "?", + "value": "(", }, Object { "loc": Object { "end": Object { + "column": 10, + "line": 12, + }, + "start": Object { "column": 9, - "line": 3, + "line": 12, + }, + }, + "range": Array [ + 250, + 251, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 12, }, "start": Object { - "column": 8, - "line": 3, + "column": 10, + "line": 12, }, }, "range": Array [ - 41, - 42, + 251, + 252, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 13, + "line": 12, }, "start": Object { - "column": 10, - "line": 3, + "column": 12, + "line": 12, }, }, "range": Array [ - 43, - 49, + 253, + 254, ], "type": "Identifier", - "value": "number", + "value": "b", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 14, + "line": 12, }, "start": Object { - "column": 16, - "line": 3, + "column": 13, + "line": 12, }, }, "range": Array [ - 49, - 50, + 254, + 255, ], "type": "Punctuator", - "value": ";", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 4, + "column": 15, + "line": 12, }, "start": Object { - "column": 4, - "line": 4, + "column": 14, + "line": 12, }, }, "range": Array [ - 55, - 56, + 255, + 256, ], "type": "Punctuator", - "value": "[", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 4, + "column": 16, + "line": 12, }, "start": Object { - "column": 5, - "line": 4, + "column": 15, + "line": 12, }, }, "range": Array [ - 56, - 59, + 256, + 257, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 12, + }, + "start": Object { + "column": 17, + "line": 12, + }, + }, + "range": Array [ + 258, + 264, ], "type": "Identifier", - "value": "bax", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 12, + }, + "start": Object { + "column": 23, + "line": 12, + }, + }, + "range": Array [ + 264, + 265, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 13, + }, + }, + "range": Array [ + 270, + 273, + ], + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 4, + "line": 13, }, "start": Object { "column": 8, - "line": 4, + "line": 13, }, }, "range": Array [ - 59, - 60, + 274, + 275, ], "type": "Punctuator", - "value": "]", + "value": "<", }, Object { "loc": Object { "end": Object { "column": 10, - "line": 4, + "line": 13, }, "start": Object { "column": 9, - "line": 4, + "line": 13, }, }, "range": Array [ - 60, - 61, + 275, + 276, + ], + "type": "Identifier", + "value": "F", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 13, + }, + "start": Object { + "column": 10, + "line": 13, + }, + }, + "range": Array [ + 276, + 277, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 12, + "line": 13, }, "start": Object { "column": 11, - "line": 4, + "line": 13, }, }, "range": Array [ - 62, - 68, + 277, + 278, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 13, + }, + }, + "range": Array [ + 278, + 279, + ], + "type": "Identifier", + "value": "a", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 13, + }, + "start": Object { + "column": 13, + "line": 13, + }, + }, + "range": Array [ + 279, + 280, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 13, + }, + "start": Object { + "column": 15, + "line": 13, + }, + }, + "range": Array [ + 281, + 282, + ], + "type": "Identifier", + "value": "b", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 13, + }, + "start": Object { + "column": 16, + "line": 13, + }, + }, + "range": Array [ + 282, + 283, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "?", }, Object { "loc": Object { "end": Object { "column": 18, - "line": 4, + "line": 13, }, "start": Object { "column": 17, - "line": 4, + "line": 13, }, }, "range": Array [ - 68, - 69, + 283, + 284, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 5, + "column": 19, + "line": 13, }, "start": Object { - "column": 4, - "line": 5, + "column": 18, + "line": 13, }, }, "range": Array [ - 74, - 75, + 284, + 285, ], "type": "Punctuator", - "value": "[", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 26, + "line": 13, }, "start": Object { - "column": 5, - "line": 5, + "column": 20, + "line": 13, }, }, "range": Array [ - 75, - 78, + 286, + 292, ], "type": "Identifier", - "value": "baz", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 27, + "line": 13, }, "start": Object { - "column": 8, - "line": 5, + "column": 26, + "line": 13, }, }, "range": Array [ - 78, - 79, + 292, + 293, ], "type": "Punctuator", - "value": "]", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 1, + "line": 14, }, "start": Object { - "column": 9, - "line": 5, + "column": 0, + "line": 14, }, }, "range": Array [ - 79, - 80, + 294, + 295, ], "type": "Punctuator", - "value": "?", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "public", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 33, + 34, + ], + "type": "Identifier", + }, + "range": Array [ + 26, + 34, + ], + "type": "TSParameterProperty", + }, + Object { + "accessibility": "private", + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 44, + 45, + ], + "type": "Identifier", + }, + "range": Array [ + 36, + 45, + ], + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 21, + 47, + ], + "type": "TSConstructSignatureDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 49, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 11, - "line": 5, + "column": 1, + "line": 3, }, "start": Object { - "column": 10, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 80, - 81, + 0, + 49, ], - "type": "Punctuator", - "value": ":", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 50, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 18, - "line": 5, + "column": 9, + "line": 1, }, "start": Object { - "column": 12, - "line": 5, + "column": 0, + "line": 1, }, }, "range": Array [ - 82, - 88, + 0, + 9, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 5, + "column": 14, + "line": 1, }, "start": Object { - "column": 18, - "line": 5, + "column": 10, + "line": 1, }, }, "range": Array [ - 88, - 89, + 10, + 14, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 6, + "column": 16, + "line": 1, }, "start": Object { - "column": 4, - "line": 6, + "column": 15, + "line": 1, }, }, "range": Array [ - 94, - 95, + 15, + 16, ], "type": "Punctuator", - "value": "[", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 6, + "column": 7, + "line": 2, }, "start": Object { - "column": 5, - "line": 6, + "column": 4, + "line": 2, }, }, "range": Array [ - 95, - 98, + 21, + 24, ], - "type": "Identifier", - "value": "eee", + "type": "Keyword", + "value": "new", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 6, + "line": 2, }, "start": Object { "column": 8, - "line": 6, + "line": 2, }, }, "range": Array [ - 98, - 99, + 25, + 26, ], "type": "Punctuator", - "value": ":", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 6, + "column": 15, + "line": 2, }, "start": Object { - "column": 10, - "line": 6, + "column": 9, + "line": 2, }, }, "range": Array [ - 100, - 106, + 26, + 32, ], - "type": "Identifier", - "value": "number", + "type": "Keyword", + "value": "public", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 6, + "line": 2, }, "start": Object { "column": 16, - "line": 6, + "line": 2, }, }, "range": Array [ - 106, - 107, + 33, + 34, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { "column": 18, - "line": 6, + "line": 2, }, "start": Object { "column": 17, - "line": 6, + "line": 2, }, }, "range": Array [ - 107, - 108, + 34, + 35, ], "type": "Punctuator", - "value": ":", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 6, + "column": 26, + "line": 2, }, "start": Object { "column": 19, - "line": 6, + "line": 2, }, }, "range": Array [ - 109, - 115, + 36, + 43, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 27, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, ], "type": "Identifier", - "value": "string", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 6, + "column": 29, + "line": 2, }, "start": Object { - "column": 25, - "line": 6, + "column": 28, + "line": 2, }, }, "range": Array [ - 115, - 116, + 45, + 46, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 7, + "column": 30, + "line": 2, }, "start": Object { - "column": 4, - "line": 7, + "column": 29, + "line": 2, }, }, "range": Array [ - 121, - 122, + 46, + 47, ], "type": "Punctuator", - "value": "[", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 7, + "column": 1, + "line": 3, }, "start": Object { - "column": 5, - "line": 7, + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 48, + 49, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-member-expression.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 33, + ], + "type": "TSInterfaceBody", + }, + "extends": Array [ + Object { + "expression": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 22, + 25, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "baz", + "range": Array [ + 26, + 29, + ], + "type": "Identifier", + }, + "range": Array [ + 22, + 29, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 29, + ], + "type": "TSInterfaceHeritage", }, - }, - "range": Array [ - 122, - 125, ], - "type": "Identifier", - "value": "fff", - }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 125, - 126, - ], - "type": "Punctuator", - "value": "?", - }, - Object { "loc": Object { "end": Object { - "column": 10, - "line": 7, + "column": 1, + "line": 2, }, "start": Object { - "column": 9, - "line": 7, + "column": 0, + "line": 1, }, }, "range": Array [ - 126, - 127, + 0, + 33, ], - "type": "Punctuator", - "value": ":", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 34, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 17, - "line": 7, + "column": 9, + "line": 1, }, "start": Object { - "column": 11, - "line": 7, + "column": 0, + "line": 1, }, }, "range": Array [ - 128, - 134, + 0, + 9, ], - "type": "Identifier", - "value": "number", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 7, + "column": 13, + "line": 1, }, "start": Object { - "column": 17, - "line": 7, + "column": 10, + "line": 1, }, }, "range": Array [ - 134, - 135, + 10, + 13, ], - "type": "Punctuator", - "value": "]", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 7, + "column": 21, + "line": 1, }, "start": Object { - "column": 18, - "line": 7, + "column": 14, + "line": 1, }, }, "range": Array [ - 135, - 136, + 14, + 21, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 7, + "column": 25, + "line": 1, }, "start": Object { - "column": 20, - "line": 7, + "column": 22, + "line": 1, }, }, "range": Array [ - 137, - 143, + 22, + 25, ], "type": "Identifier", - "value": "string", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 7, + "column": 26, + "line": 1, }, "start": Object { - "column": 26, - "line": 7, + "column": 25, + "line": 1, }, }, "range": Array [ - 143, - 144, + 25, + 26, ], "type": "Punctuator", - "value": ";", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 8, + "column": 29, + "line": 1, }, "start": Object { - "column": 4, - "line": 8, + "column": 26, + "line": 1, }, }, "range": Array [ - 149, - 152, + 26, + 29, ], "type": "Identifier", - "value": "doo", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 8, + "column": 31, + "line": 1, }, "start": Object { - "column": 7, - "line": 8, + "column": 30, + "line": 1, }, }, "range": Array [ - 152, - 153, + 30, + 31, ], "type": "Punctuator", - "value": "(", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 8, + "column": 1, + "line": 2, }, "start": Object { - "column": 8, - "line": 8, + "column": 0, + "line": 2, }, }, "range": Array [ - 153, - 154, + 32, + 33, ], "type": "Punctuator", - "value": ")", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "start": Object { - "column": 9, - "line": 8, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 32, + "line": 1, + }, }, + "range": Array [ + 32, + 36, + ], + "type": "TSInterfaceBody", }, - "range": Array [ - 154, - 155, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 8, - }, - "start": Object { - "column": 11, - "line": 8, + "extends": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "name": "Bar", + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "TSInterfaceHeritage", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "J", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 28, + 31, + ], + "type": "TSTypeParameterInstantiation", + }, }, - }, - "range": Array [ - 156, - 160, ], - "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 8, - }, - "start": Object { - "column": 15, - "line": 8, + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "Foo", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", }, - "range": Array [ - 160, - 161, - ], - "type": "Punctuator", - "value": ";", - }, - Object { "loc": Object { "end": Object { - "column": 7, - "line": 9, + "column": 1, + "line": 3, }, "start": Object { - "column": 4, - "line": 9, + "column": 0, + "line": 1, }, }, "range": Array [ - 166, - 169, + 0, + 36, ], - "type": "Identifier", - "value": "doo", - }, - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 9, - }, - "start": Object { - "column": 7, - "line": 9, + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 14, + 15, + ], + "type": "Identifier", + }, + "range": Array [ + 14, + 15, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 16, + ], + "type": "TSTypeParameterDeclaration", }, - "range": Array [ - 169, - 170, - ], - "type": "Punctuator", - "value": "?", }, - Object { - "loc": Object { - "end": Object { - "column": 9, - "line": 9, - }, - "start": Object { - "column": 8, - "line": 9, - }, - }, - "range": Array [ - 170, - 171, - ], - "type": "Punctuator", - "value": "(", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, }, - Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 9, - }, - "start": Object { - "column": 9, - "line": 9, - }, - }, - "range": Array [ - 171, - 172, - ], - "type": "Identifier", - "value": "a", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 37, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 11, - "line": 9, + "column": 9, + "line": 1, }, - "start": Object { - "column": 10, - "line": 9, + "start": Object { + "column": 0, + "line": 1, }, }, "range": Array [ - 172, - 173, + 0, + 9, ], - "type": "Punctuator", - "value": ",", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 9, + "line": 1, }, "start": Object { - "column": 12, - "line": 9, + "column": 10, + "line": 1, }, }, "range": Array [ - 174, - 175, + 10, + 13, ], "type": "Identifier", - "value": "b", + "value": "Foo", }, Object { "loc": Object { "end": Object { "column": 14, - "line": 9, + "line": 1, }, "start": Object { "column": 13, - "line": 9, + "line": 1, }, }, "range": Array [ - 175, - 176, + 13, + 14, ], "type": "Punctuator", - "value": ",", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 9, + "column": 15, + "line": 1, }, "start": Object { - "column": 15, - "line": 9, + "column": 14, + "line": 1, }, }, "range": Array [ - 177, - 178, + 14, + 15, ], "type": "Identifier", - "value": "c", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 9, + "column": 16, + "line": 1, }, "start": Object { - "column": 16, - "line": 9, + "column": 15, + "line": 1, }, }, "range": Array [ - 178, - 179, + 15, + 16, ], "type": "Punctuator", - "value": ")", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 9, + "column": 24, + "line": 1, }, "start": Object { "column": 17, - "line": 9, + "line": 1, }, }, "range": Array [ - 179, - 180, + 17, + 24, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "extends", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 9, + "column": 28, + "line": 1, }, "start": Object { - "column": 19, - "line": 9, + "column": 25, + "line": 1, }, }, "range": Array [ - 181, - 185, + 25, + 28, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "Bar", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 9, + "column": 29, + "line": 1, }, "start": Object { - "column": 23, - "line": 9, + "column": 28, + "line": 1, }, }, "range": Array [ - 185, - 186, + 28, + 29, ], "type": "Punctuator", - "value": ";", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 10, + "column": 30, + "line": 1, }, "start": Object { - "column": 4, - "line": 10, + "column": 29, + "line": 1, }, }, "range": Array [ - 191, - 192, + 29, + 30, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "J", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 10, + "column": 31, + "line": 1, }, "start": Object { - "column": 5, - "line": 10, + "column": 30, + "line": 1, }, }, "range": Array [ - 192, - 195, + 30, + 31, ], - "type": "Identifier", - "value": "loo", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 10, + "column": 33, + "line": 1, }, "start": Object { - "column": 8, - "line": 10, + "column": 32, + "line": 1, }, }, "range": Array [ - 195, - 196, + 32, + 33, ], "type": "Punctuator", - "value": "]", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 10, + "column": 1, + "line": 3, }, "start": Object { - "column": 9, - "line": 10, + "column": 0, + "line": 3, }, }, "range": Array [ - 196, - 197, + 35, + 36, ], "type": "Punctuator", - "value": "?", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 1, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 11, - "line": 10, + "column": 1, + "line": 2, }, "start": Object { - "column": 10, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 197, - 198, + 0, + 21, ], - "type": "Punctuator", - "value": "(", + "type": "TSInterfaceDeclaration", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 15, + 16, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 14, + 17, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 22, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 12, - "line": 10, + "column": 9, + "line": 1, }, "start": Object { - "column": 11, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 198, - 199, + 0, + 9, ], - "type": "Identifier", - "value": "a", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 10, + "column": 14, + "line": 1, }, "start": Object { - "column": 12, - "line": 10, + "column": 10, + "line": 1, }, }, "range": Array [ - 199, - 200, + 10, + 14, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "Test", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 10, + "line": 1, }, "start": Object { "column": 14, - "line": 10, + "line": 1, }, }, "range": Array [ - 201, - 202, + 14, + 15, ], - "type": "Identifier", - "value": "b", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { "column": 16, - "line": 10, + "line": 1, }, "start": Object { "column": 15, - "line": 10, + "line": 1, }, }, "range": Array [ - 202, - 203, + 15, + 16, ], - "type": "Punctuator", - "value": ",", + "type": "Identifier", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 10, + "column": 17, + "line": 1, }, "start": Object { - "column": 17, - "line": 10, + "column": 16, + "line": 1, }, }, "range": Array [ - 204, - 205, + 16, + 17, ], - "type": "Identifier", - "value": "c", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { "column": 19, - "line": 10, + "line": 1, }, "start": Object { "column": 18, - "line": 10, + "line": 1, }, }, "range": Array [ - 205, - 206, + 18, + 19, ], "type": "Punctuator", - "value": ")", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 20, - "line": 10, + "column": 1, + "line": 2, }, "start": Object { - "column": 19, - "line": 10, + "column": 0, + "line": 2, }, }, "range": Array [ - 206, - 207, + 20, + 21, ], "type": "Punctuator", - "value": ":", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` +Object { + "body": Array [ Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "name": "foo", + "range": Array [ + 76, + 79, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "name": "bar", + "range": Array [ + 80, + 83, + ], + "type": "Identifier", + }, + ], + "range": Array [ + 76, + 85, + ], + "type": "TSMethodSignature", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 87, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "Test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 25, - "line": 10, + "column": 1, + "line": 7, }, "start": Object { - "column": 21, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 208, - 212, + 0, + 87, ], - "type": "Keyword", - "value": "void", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 88, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 26, - "line": 10, + "column": 9, + "line": 1, }, "start": Object { - "column": 25, - "line": 10, + "column": 0, + "line": 1, }, }, "range": Array [ - 212, - 213, + 0, + 9, ], - "type": "Punctuator", - "value": ";", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 11, + "column": 14, + "line": 1, }, "start": Object { - "column": 4, - "line": 11, + "column": 10, + "line": 1, }, }, "range": Array [ - 218, - 221, + 10, + 14, ], "type": "Identifier", - "value": "boo", + "value": "Test", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 11, + "column": 16, + "line": 1, }, "start": Object { - "column": 7, - "line": 11, + "column": 15, + "line": 1, }, }, "range": Array [ - 221, - 222, + 15, + 16, ], "type": "Punctuator", - "value": "<", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 11, + "column": 7, + "line": 6, }, "start": Object { - "column": 8, - "line": 11, + "column": 4, + "line": 6, }, }, "range": Array [ - 222, - 223, + 76, + 79, ], "type": "Identifier", - "value": "J", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 11, + "column": 8, + "line": 6, }, "start": Object { - "column": 9, - "line": 11, + "column": 7, + "line": 6, }, }, "range": Array [ - 223, - 224, + 79, + 80, ], "type": "Punctuator", - "value": ">", + "value": "(", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 11, + "line": 6, }, "start": Object { - "column": 10, - "line": 11, + "column": 8, + "line": 6, }, }, "range": Array [ - 224, - 225, + 80, + 83, ], - "type": "Punctuator", - "value": "(", + "type": "Identifier", + "value": "bar", }, Object { "loc": Object { "end": Object { "column": 12, - "line": 11, + "line": 6, }, "start": Object { "column": 11, - "line": 11, + "line": 6, }, }, "range": Array [ - 225, - 226, + 83, + 84, ], - "type": "Identifier", - "value": "a", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 13, - "line": 11, + "line": 6, }, "start": Object { "column": 12, - "line": 11, + "line": 6, }, }, "range": Array [ - 226, - 227, + 84, + 85, ], "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 11, - }, - "start": Object { - "column": 14, - "line": 11, - }, - }, - "range": Array [ - 228, - 229, - ], - "type": "Identifier", - "value": "b", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 11, + "column": 1, + "line": 7, }, "start": Object { - "column": 15, - "line": 11, + "column": 0, + "line": 7, }, }, "range": Array [ - 229, - 230, + 86, + 87, ], "type": "Punctuator", - "value": ",", + "value": "}", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 11, + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "h", + "range": Array [ + 19, + 20, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 24, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 26, + 32, + ], + "type": "TSStringKeyword", + }, + }, + }, + ], + "range": Array [ + 19, + 40, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 33, + 39, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 35, + 39, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSMethodSignature", + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "name": "g", + "range": Array [ + 43, + 44, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 48, + 54, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 51, + 54, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 53, + 54, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 53, + 54, + ], + "type": "Identifier", + }, + }, + }, + }, + ], + "range": Array [ + 43, + 59, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 55, + 58, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 57, + 58, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 57, + 58, + ], + "type": "Identifier", + }, + }, + }, + "type": "TSMethodSignature", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "T", + "range": Array [ + 45, + 46, + ], + "type": "Identifier", + }, + "range": Array [ + 45, + 46, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 44, + 47, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 15, + "line": 1, + }, }, - "start": Object { - "column": 17, - "line": 11, + "range": Array [ + 15, + 61, + ], + "type": "TSInterfaceBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, }, + "name": "test", + "range": Array [ + 10, + 14, + ], + "type": "Identifier", }, - "range": Array [ - 231, - 232, - ], - "type": "Identifier", - "value": "c", - }, - Object { "loc": Object { "end": Object { - "column": 19, - "line": 11, + "column": 1, + "line": 4, }, "start": Object { - "column": 18, - "line": 11, + "column": 0, + "line": 1, }, }, "range": Array [ - 232, - 233, + 0, + 61, ], - "type": "Punctuator", - "value": ")", + "type": "TSInterfaceDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 62, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 20, - "line": 11, + "column": 9, + "line": 1, }, "start": Object { - "column": 19, - "line": 11, + "column": 0, + "line": 1, }, }, "range": Array [ - 233, - 234, + 0, + 9, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "interface", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 11, + "column": 14, + "line": 1, }, "start": Object { - "column": 21, - "line": 11, + "column": 10, + "line": 1, }, }, "range": Array [ - 235, - 239, + 10, + 14, ], - "type": "Keyword", - "value": "void", + "type": "Identifier", + "value": "test", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 11, + "column": 16, + "line": 1, }, "start": Object { - "column": 25, - "line": 11, + "column": 15, + "line": 1, }, }, "range": Array [ - 239, - 240, + 15, + 16, ], "type": "Punctuator", - "value": ";", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 12, + "column": 3, + "line": 2, }, "start": Object { - "column": 4, - "line": 12, + "column": 2, + "line": 2, }, }, "range": Array [ - 245, - 248, + 19, + 20, ], - "type": "Keyword", - "value": "new", + "type": "Identifier", + "value": "h", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 12, + "column": 4, + "line": 2, }, "start": Object { - "column": 8, - "line": 12, + "column": 3, + "line": 2, }, }, "range": Array [ - 249, - 250, + 20, + 21, ], "type": "Punctuator", "value": "(", @@ -45245,89 +51881,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 12, + "column": 7, + "line": 2, }, "start": Object { - "column": 9, - "line": 12, + "column": 4, + "line": 2, }, }, "range": Array [ - 250, - 251, + 21, + 24, ], "type": "Identifier", - "value": "a", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 12, + "column": 8, + "line": 2, }, "start": Object { - "column": 10, - "line": 12, + "column": 7, + "line": 2, }, }, "range": Array [ - 251, - 252, + 24, + 25, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 12, + "column": 15, + "line": 2, }, "start": Object { - "column": 12, - "line": 12, + "column": 9, + "line": 2, }, }, "range": Array [ - 253, - 254, + 26, + 32, ], "type": "Identifier", - "value": "b", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 12, + "column": 16, + "line": 2, }, "start": Object { - "column": 13, - "line": 12, - }, - }, - "range": Array [ - 254, - 255, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { "column": 15, - "line": 12, - }, - "start": Object { - "column": 14, - "line": 12, + "line": 2, }, }, "range": Array [ - 255, - 256, + 32, + 33, ], "type": "Punctuator", "value": ")", @@ -45335,17 +51953,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, - "line": 12, + "column": 17, + "line": 2, }, "start": Object { - "column": 15, - "line": 12, + "column": 16, + "line": 2, }, }, "range": Array [ - 256, - 257, + 33, + 34, ], "type": "Punctuator", "value": ":", @@ -45353,35 +51971,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 23, - "line": 12, + "column": 22, + "line": 2, }, "start": Object { - "column": 17, - "line": 12, + "column": 18, + "line": 2, }, }, "range": Array [ - 258, - 264, + 35, + 39, ], - "type": "Identifier", - "value": "string", + "type": "Keyword", + "value": "void", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 12, + "column": 23, + "line": 2, }, "start": Object { - "column": 23, - "line": 12, + "column": 22, + "line": 2, }, }, "range": Array [ - 264, - 265, + 39, + 40, ], "type": "Punctuator", "value": ";", @@ -45389,35 +52007,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 13, + "column": 3, + "line": 3, }, "start": Object { - "column": 4, - "line": 13, + "column": 2, + "line": 3, }, }, "range": Array [ - 270, - 273, + 43, + 44, ], - "type": "Keyword", - "value": "new", + "type": "Identifier", + "value": "g", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 13, + "column": 4, + "line": 3, }, "start": Object { - "column": 8, - "line": 13, + "column": 3, + "line": 3, }, }, "range": Array [ - 274, - 275, + 44, + 45, ], "type": "Punctuator", "value": "<", @@ -45425,35 +52043,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, - "line": 13, + "column": 5, + "line": 3, }, "start": Object { - "column": 9, - "line": 13, + "column": 4, + "line": 3, }, }, "range": Array [ - 275, - 276, + 45, + 46, ], "type": "Identifier", - "value": "F", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 13, + "column": 6, + "line": 3, }, "start": Object { - "column": 10, - "line": 13, + "column": 5, + "line": 3, }, }, "range": Array [ - 276, - 277, + 46, + 47, ], "type": "Punctuator", "value": ">", @@ -45461,17 +52079,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 12, - "line": 13, + "column": 7, + "line": 3, }, "start": Object { - "column": 11, - "line": 13, + "column": 6, + "line": 3, }, }, "range": Array [ - 277, - 278, + 47, + 48, ], "type": "Punctuator", "value": "(", @@ -45479,89 +52097,71 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, - "line": 13, + "column": 10, + "line": 3, }, "start": Object { - "column": 12, - "line": 13, + "column": 7, + "line": 3, }, }, "range": Array [ - 278, - 279, + 48, + 51, ], "type": "Identifier", - "value": "a", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 13, + "column": 11, + "line": 3, }, "start": Object { - "column": 13, - "line": 13, + "column": 10, + "line": 3, }, }, "range": Array [ - 279, - 280, + 51, + 52, ], "type": "Punctuator", - "value": ",", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 13, + "column": 13, + "line": 3, }, "start": Object { - "column": 15, - "line": 13, + "column": 12, + "line": 3, }, }, "range": Array [ - 281, - 282, + 53, + 54, ], "type": "Identifier", - "value": "b", - }, - Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 13, - }, - "start": Object { - "column": 16, - "line": 13, - }, - }, - "range": Array [ - 282, - 283, - ], - "type": "Punctuator", - "value": "?", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 13, + "column": 14, + "line": 3, }, "start": Object { - "column": 17, - "line": 13, + "column": 13, + "line": 3, }, }, "range": Array [ - 283, - 284, + 54, + 55, ], "type": "Punctuator", "value": ")", @@ -45569,17 +52169,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 13, + "column": 15, + "line": 3, }, "start": Object { - "column": 18, - "line": 13, + "column": 14, + "line": 3, }, }, "range": Array [ - 284, - 285, + 55, + 56, ], "type": "Punctuator", "value": ":", @@ -45587,35 +52187,35 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 13, + "column": 17, + "line": 3, }, "start": Object { - "column": 20, - "line": 13, + "column": 16, + "line": 3, }, }, "range": Array [ - 286, - 292, + 57, + 58, ], "type": "Identifier", - "value": "string", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 27, - "line": 13, + "column": 18, + "line": 3, }, "start": Object { - "column": 26, - "line": 13, + "column": 17, + "line": 3, }, }, "range": Array [ - 292, - 293, + 58, + 59, ], "type": "Punctuator", "value": ";", @@ -45624,16 +52224,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 14, + "line": 4, }, "start": Object { "column": 0, - "line": 14, + "line": 4, }, }, "range": Array [ - 294, - 295, + 60, + 61, ], "type": "Punctuator", "value": "}", @@ -45643,108 +52243,254 @@ Object { } `; -exports[`typescript fixtures/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` +exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` Object { "body": Array [ Object { "body": Object { "body": Array [ Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "optional": true, + "range": Array [ + 21, + 26, + ], + "type": "TSPropertySignature", + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "name": "bar", + "range": Array [ + 31, + 34, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "optional": true, + "range": Array [ + 31, + 44, + ], + "type": "TSPropertySignature", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 35, + 43, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 10, + "line": 3, + }, + }, + "range": Array [ + 37, + 43, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 4, + "line": 4, + }, + }, + "name": "baz", + "range": Array [ + 49, + 52, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 34, + "line": 4, }, "start": Object { "column": 4, - "line": 2, + "line": 4, }, }, + "optional": true, "params": Array [ Object { - "accessibility": "public", "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 12, + "line": 4, }, "start": Object { "column": 9, - "line": 2, - }, - }, - "parameter": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, + "line": 4, }, - "name": "x", - "range": Array [ - 33, - 34, - ], - "type": "Identifier", }, + "name": "foo", "range": Array [ - 26, - 34, + 54, + 57, ], - "type": "TSParameterProperty", + "type": "Identifier", }, Object { - "accessibility": "private", "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 26, + "line": 4, }, "start": Object { - "column": 19, - "line": 2, + "column": 14, + "line": 4, }, }, - "parameter": Object { + "name": "bar", + "optional": true, + "range": Array [ + 59, + 71, + ], + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 26, + "line": 4, }, "start": Object { - "column": 27, - "line": 2, + "column": 18, + "line": 4, }, }, - "name": "y", "range": Array [ - 44, - 45, + 63, + 71, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 65, + 71, + ], + "type": "TSStringKeyword", + }, + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, }, + "name": "baz", + "optional": true, "range": Array [ - 36, - 45, + 73, + 76, ], - "type": "TSParameterProperty", + "type": "Identifier", }, ], "range": Array [ - 21, - 47, + 49, + 79, ], - "type": "TSConstructSignatureDeclaration", + "type": "TSMethodSignature", }, ], "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 15, @@ -45753,7 +52499,7 @@ Object { }, "range": Array [ 15, - 49, + 81, ], "type": "TSInterfaceBody", }, @@ -45768,7 +52514,7 @@ Object { "line": 1, }, }, - "name": "Test", + "name": "test", "range": Array [ 10, 14, @@ -45778,7 +52524,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, @@ -45787,7 +52533,7 @@ Object { }, "range": Array [ 0, - 49, + 81, ], "type": "TSInterfaceDeclaration", }, @@ -45795,7 +52541,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 4, + "line": 6, }, "start": Object { "column": 0, @@ -45804,7 +52550,7 @@ Object { }, "range": Array [ 0, - 50, + 82, ], "sourceType": "script", "tokens": Array [ @@ -45842,7 +52588,7 @@ Object { 14, ], "type": "Identifier", - "value": "Test", + "value": "test", }, Object { "loc": Object { @@ -45877,72 +52623,72 @@ Object { 21, 24, ], - "type": "Keyword", - "value": "new", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 8, "line": 2, }, "start": Object { - "column": 8, + "column": 7, "line": 2, }, }, "range": Array [ + 24, 25, - 26, ], "type": "Punctuator", - "value": "(", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 9, "line": 2, }, "start": Object { - "column": 9, + "column": 8, "line": 2, }, }, "range": Array [ + 25, 26, - 32, ], - "type": "Keyword", - "value": "public", + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 7, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 33, + 31, 34, ], "type": "Identifier", - "value": "x", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 8, + "line": 3, }, "start": Object { - "column": 17, - "line": 2, + "column": 7, + "line": 3, }, }, "range": Array [ @@ -45950,76 +52696,58 @@ Object { 35, ], "type": "Punctuator", - "value": ",", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 9, + "line": 3, }, "start": Object { - "column": 19, - "line": 2, + "column": 8, + "line": 3, }, }, "range": Array [ + 35, 36, - 43, ], - "type": "Keyword", - "value": "private", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 2, + "column": 16, + "line": 3, }, "start": Object { - "column": 27, - "line": 2, + "column": 10, + "line": 3, }, }, "range": Array [ - 44, - 45, + 37, + 43, ], "type": "Identifier", - "value": "y", - }, - Object { - "loc": Object { - "end": Object { - "column": 29, - "line": 2, - }, - "start": Object { - "column": 28, - "line": 2, - }, - }, - "range": Array [ - 45, - 46, - ], - "type": "Punctuator", - "value": ")", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 2, + "column": 17, + "line": 3, }, "start": Object { - "column": 29, - "line": 2, + "column": 16, + "line": 3, }, }, "range": Array [ - 46, - 47, + 43, + 44, ], "type": "Punctuator", "value": ";", @@ -46027,456 +52755,269 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 7, + "line": 4, }, "start": Object { - "column": 0, - "line": 3, + "column": 4, + "line": 4, }, }, "range": Array [ - 48, 49, + 52, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "baz", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-extends-type-parameters.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "range": Array [ - 32, - 36, - ], - "type": "TSInterfaceBody", - }, - "extends": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "name": "Bar", - "range": Array [ - 25, - 28, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 28, - ], - "type": "TSInterfaceHeritage", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 30, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "J", - "range": Array [ - 29, - 30, - ], - "type": "Identifier", - }, - }, - ], - "range": Array [ - 28, - 31, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "id": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "Foo", - "range": Array [ - 10, - 13, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 36, - ], - "type": "TSInterfaceDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, + "column": 8, + "line": 4, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 14, - 15, - ], - "type": "Identifier", - }, - "range": Array [ - 14, - 15, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 13, - 16, - ], - "type": "TSTypeParameterDeclaration", - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "start": Object { + "column": 7, + "line": 4, + }, + }, + "range": Array [ + 52, + 53, + ], + "type": "Punctuator", + "value": "?", }, - }, - "range": Array [ - 0, - 37, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { "column": 9, - "line": 1, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 4, }, }, "range": Array [ - 0, - 9, + 53, + 54, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 12, + "line": 4, }, "start": Object { - "column": 10, - "line": 1, + "column": 9, + "line": 4, }, }, "range": Array [ - 10, - 13, + 54, + 57, ], "type": "Identifier", - "value": "Foo", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 13, + "line": 4, }, "start": Object { - "column": 13, - "line": 1, + "column": 12, + "line": 4, }, }, "range": Array [ - 13, - 14, + 57, + 58, ], "type": "Punctuator", - "value": "<", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 4, }, "start": Object { "column": 14, - "line": 1, + "line": 4, }, }, "range": Array [ - 14, - 15, + 59, + 62, ], "type": "Identifier", - "value": "T", + "value": "bar", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 18, + "line": 4, }, "start": Object { - "column": 15, - "line": 1, + "column": 17, + "line": 4, }, }, "range": Array [ - 15, - 16, + 62, + 63, ], "type": "Punctuator", - "value": ">", + "value": "?", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 1, + "column": 19, + "line": 4, }, "start": Object { - "column": 17, - "line": 1, + "column": 18, + "line": 4, }, }, "range": Array [ - 17, - 24, + 63, + 64, ], - "type": "Keyword", - "value": "extends", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 28, - "line": 1, + "column": 26, + "line": 4, }, "start": Object { - "column": 25, - "line": 1, + "column": 20, + "line": 4, }, }, "range": Array [ - 25, - 28, + 65, + 71, ], "type": "Identifier", - "value": "Bar", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, + "column": 27, + "line": 4, }, "start": Object { - "column": 28, - "line": 1, + "column": 26, + "line": 4, }, }, "range": Array [ - 28, - 29, + 71, + 72, ], "type": "Punctuator", - "value": "<", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 30, - "line": 1, + "column": 31, + "line": 4, }, "start": Object { - "column": 29, - "line": 1, + "column": 28, + "line": 4, }, }, "range": Array [ - 29, - 30, + 73, + 76, ], "type": "Identifier", - "value": "J", + "value": "baz", }, Object { "loc": Object { "end": Object { - "column": 31, - "line": 1, + "column": 32, + "line": 4, }, "start": Object { - "column": 30, - "line": 1, + "column": 31, + "line": 4, }, }, "range": Array [ - 30, - 31, + 76, + 77, ], "type": "Punctuator", - "value": ">", + "value": "?", }, Object { "loc": Object { "end": Object { "column": 33, - "line": 1, + "line": 4, }, "start": Object { "column": 32, - "line": 1, + "line": 4, }, }, "range": Array [ - 32, - 33, + 77, + 78, ], "type": "Punctuator", - "value": "{", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 33, + "line": 4, + }, + }, + "range": Array [ + 78, + 79, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 3, + "line": 5, }, "start": Object { "column": 0, - "line": 3, + "line": 5, }, }, "range": Array [ - 35, - 36, + 80, + 81, ], "type": "Punctuator", "value": "}", @@ -46486,25 +53027,62 @@ Object { } `; -exports[`typescript fixtures/basics/interface-with-generic.src 1`] = ` +exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` Object { "body": Array [ Object { "body": Object { - "body": Array [], + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 21, + 25, + ], + "type": "TSPropertySignature", + }, + ], "loc": Object { "end": Object { "column": 1, - "line": 2, + "line": 3, }, "start": Object { - "column": 18, + "column": 15, "line": 1, }, }, "range": Array [ - 18, - 21, + 15, + 27, ], "type": "TSInterfaceBody", }, @@ -46519,7 +53097,7 @@ Object { "line": 1, }, }, - "name": "Test", + "name": "test", "range": Array [ 10, 14, @@ -46529,7 +53107,7 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 2, + "line": 3, }, "start": Object { "column": 0, @@ -46538,69 +53116,15 @@ Object { }, "range": Array [ 0, - 21, + 27, ], "type": "TSInterfaceDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "T", - "range": Array [ - 15, - 16, - ], - "type": "Identifier", - }, - "range": Array [ - 15, - 16, - ], - "type": "TSTypeParameter", - }, - ], - "range": Array [ - 14, - 17, - ], - "type": "TSTypeParameterDeclaration", - }, }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 4, }, "start": Object { "column": 0, @@ -46609,7 +53133,7 @@ Object { }, "range": Array [ 0, - 22, + 28, ], "sourceType": "script", "tokens": Array [ @@ -46647,25 +53171,7 @@ Object { 14, ], "type": "Identifier", - "value": "Test", - }, - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "range": Array [ - 14, - 15, - ], - "type": "Punctuator", - "value": "<", + "value": "test", }, Object { "loc": Object { @@ -46682,59 +53188,59 @@ Object { 15, 16, ], - "type": "Identifier", - "value": "T", + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 7, + "line": 2, }, "start": Object { - "column": 16, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 16, - 17, + 21, + 24, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 8, + "line": 2, }, "start": Object { - "column": 18, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 18, - 19, + 24, + 25, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { "column": 1, - "line": 2, + "line": 3, }, "start": Object { "column": 0, - "line": 2, + "line": 3, }, }, "range": Array [ - 20, - 21, + 26, + 27, ], "type": "Punctuator", "value": "}", @@ -46744,124 +53250,102 @@ Object { } `; -exports[`typescript fixtures/basics/interface-with-jsdoc.src 1`] = ` +exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "name": "foo", - "range": Array [ - 76, - 79, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 13, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 6, - }, - "start": Object { - "column": 8, - "line": 6, - }, - }, - "name": "bar", - "range": Array [ - 80, - 83, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 76, - 85, - ], - "type": "TSMethodSignature", - }, - ], + "id": Object { "loc": Object { "end": Object { - "column": 1, - "line": 7, + "column": 6, + "line": 1, }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, + "name": "x", "range": Array [ - 15, - 87, + 5, + 6, ], - "type": "TSInterfaceBody", + "type": "Identifier", }, - "id": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 19, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 14, + "column": 18, "line": 1, }, "start": Object { - "column": 10, + "column": 9, "line": 1, }, }, - "name": "Test", + "operator": "keyof", "range": Array [ - 10, - 14, + 9, + 18, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "TSTypeOperator", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, }, }, - "range": Array [ - 0, - 87, - ], - "type": "TSInterfaceDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 8, + "line": 2, }, "start": Object { "column": 0, @@ -46870,14 +53354,14 @@ Object { }, "range": Array [ 0, - 88, + 20, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 4, "line": 1, }, "start": Object { @@ -46887,543 +53371,349 @@ Object { }, "range": Array [ 0, - 9, - ], - "type": "Keyword", - "value": "interface", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "range": Array [ - 10, - 14, + 4, ], "type": "Identifier", - "value": "Test", + "value": "type", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 6, "line": 1, }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 6, - }, - "start": Object { - "column": 4, - "line": 6, - }, - }, - "range": Array [ - 76, - 79, + 5, + 6, ], "type": "Identifier", - "value": "foo", + "value": "x", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 6, + "line": 1, }, "start": Object { "column": 7, - "line": 6, + "line": 1, }, }, "range": Array [ - 79, - 80, + 7, + 8, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 6, + "column": 14, + "line": 1, }, "start": Object { - "column": 8, - "line": 6, + "column": 9, + "line": 1, }, }, "range": Array [ - 80, - 83, + 9, + 14, ], "type": "Identifier", - "value": "bar", + "value": "keyof", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 6, + "column": 18, + "line": 1, }, "start": Object { - "column": 11, - "line": 6, + "column": 15, + "line": 1, }, }, "range": Array [ - 83, - 84, + 15, + 18, ], - "type": "Punctuator", - "value": ")", + "type": "Identifier", + "value": "foo", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 6, + "column": 19, + "line": 1, }, "start": Object { - "column": 12, - "line": 6, + "column": 18, + "line": 1, }, }, "range": Array [ - 84, - 85, + 18, + 19, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 86, - 87, - ], - "type": "Punctuator", - "value": "}", - }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/interface-with-method.src 1`] = ` +exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` Object { "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 2, - }, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "name": "h", - "range": Array [ - 19, - 20, - ], - "type": "Identifier", - }, + "declarations": Array [ + Object { + "id": Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 44, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 4, + "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "bar", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 24, - 32, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 2, - }, - "start": Object { - "column": 9, - "line": 2, - }, - }, - "range": Array [ - 26, - 32, - ], - "type": "TSStringKeyword", - }, - }, - }, - ], + "name": "nestedArray", "range": Array [ - 19, - 40, + 4, + 44, ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "range": Array [ - 33, - 39, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ - 35, - 39, - ], - "type": "TSVoidKeyword", - }, - }, - "type": "TSMethodSignature", - }, - Object { - "computed": false, - "key": Object { + "type": "Identifier", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 15, + "line": 1, }, }, - "name": "g", "range": Array [ - 43, + 15, 44, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 18, - "line": 3, - }, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 48, - 54, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 51, - 54, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "range": Array [ - 53, - 54, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "start": Object { - "column": 12, - "line": 3, - }, - }, - "name": "T", - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "range": Array [ - 43, - 59, - ], - "returnType": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 14, - "line": 3, - }, - }, - "range": Array [ - 55, - 58, - ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 17, + "line": 1, }, }, "range": Array [ - 57, - 58, + 17, + 44, ], "type": "TSTypeReference", "typeName": Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 22, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 17, + "line": 1, }, }, - "name": "T", + "name": "Array", "range": Array [ - 57, - 58, + 17, + 22, ], "type": "Identifier", }, - }, - }, - "type": "TSMethodSignature", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "params": Array [ - Object { + "typeParameters": Object { "loc": Object { "end": Object { - "column": 5, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 22, + "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, }, - "start": Object { - "column": 4, - "line": 3, + "range": Array [ + 23, + 43, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 42, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 41, + ], + "type": "TSStringKeyword", + }, + ], + "range": Array [ + 34, + 42, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + ], + "range": Array [ + 28, + 43, + ], + "type": "TSTypeParameterInstantiation", }, }, - "name": "T", - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - }, + ], "range": Array [ - 45, - 46, + 22, + 44, ], - "type": "TSTypeParameter", + "type": "TSTypeParameterInstantiation", }, - ], - "range": Array [ - 44, - 47, - ], - "type": "TSTypeParameterDeclaration", + }, }, }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 61, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, + "init": null, + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, }, + "range": Array [ + 4, + 44, + ], + "type": "VariableDeclarator", }, - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, + ], + "kind": "var", "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 44, + "line": 1, }, "start": Object { "column": 0, @@ -47432,15 +53722,15 @@ Object { }, "range": Array [ 0, - 61, + 44, ], - "type": "TSInterfaceDeclaration", + "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 0, - "line": 5, + "column": 44, + "line": 1, }, "start": Object { "column": 0, @@ -47449,14 +53739,14 @@ Object { }, "range": Array [ 0, - 62, + 44, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 3, "line": 1, }, "start": Object { @@ -47466,28 +53756,28 @@ Object { }, "range": Array [ 0, - 9, + 3, ], "type": "Keyword", - "value": "interface", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 4, "line": 1, }, }, "range": Array [ - 10, - 14, + 4, + 15, ], "type": "Identifier", - "value": "test", + "value": "nestedArray", }, Object { "loc": Object { @@ -47505,238 +53795,166 @@ Object { 16, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 2, + "column": 22, + "line": 1, }, "start": Object { - "column": 2, - "line": 2, + "column": 17, + "line": 1, }, }, "range": Array [ - 19, - 20, + 17, + 22, ], "type": "Identifier", - "value": "h", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 2, + "column": 23, + "line": 1, }, "start": Object { - "column": 3, - "line": 2, + "column": 22, + "line": 1, }, }, "range": Array [ - 20, - 21, + 22, + 23, ], "type": "Punctuator", - "value": "(", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 2, + "column": 28, + "line": 1, }, "start": Object { - "column": 4, - "line": 2, + "column": 23, + "line": 1, }, }, "range": Array [ - 21, - 24, + 23, + 28, ], "type": "Identifier", - "value": "bar", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 2, + "column": 29, + "line": 1, }, "start": Object { - "column": 7, - "line": 2, + "column": 28, + "line": 1, }, }, "range": Array [ - 24, - 25, + 28, + 29, ], "type": "Punctuator", - "value": ":", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 2, + "column": 34, + "line": 1, }, "start": Object { - "column": 9, - "line": 2, + "column": 29, + "line": 1, }, }, "range": Array [ - 26, - 32, + 29, + 34, ], "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 15, - "line": 2, - }, - }, - "range": Array [ - 32, - 33, - ], - "type": "Punctuator", - "value": ")", + "value": "Array", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 35, + "line": 1, }, "start": Object { - "column": 16, - "line": 2, + "column": 34, + "line": 1, }, }, "range": Array [ - 33, 34, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, - }, - }, - "range": Array [ 35, - 39, - ], - "type": "Keyword", - "value": "void", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 22, - "line": 2, - }, - }, - "range": Array [ - 39, - 40, ], "type": "Punctuator", - "value": ";", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 3, - "line": 3, + "column": 41, + "line": 1, }, "start": Object { - "column": 2, - "line": 3, + "column": 35, + "line": 1, }, }, "range": Array [ - 43, - 44, + 35, + 41, ], "type": "Identifier", - "value": "g", + "value": "string", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 3, + "column": 42, + "line": 1, }, "start": Object { - "column": 3, - "line": 3, + "column": 41, + "line": 1, }, }, "range": Array [ - 44, - 45, + 41, + 42, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 45, - 46, - ], - "type": "Identifier", - "value": "T", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 3, + "column": 43, + "line": 1, }, "start": Object { - "column": 5, - "line": 3, + "column": 42, + "line": 1, }, }, "range": Array [ - 46, - 47, + 42, + 43, ], "type": "Punctuator", "value": ">", @@ -47744,670 +53962,594 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 44, + "line": 1, }, "start": Object { - "column": 6, - "line": 3, + "column": 43, + "line": 1, }, }, "range": Array [ - 47, - 48, + 43, + 44, ], "type": "Punctuator", - "value": "(", + "value": ">", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +Object { + "body": Array [ Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 6, + 17, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "range": Array [ + 7, + 17, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 17, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 16, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 10, + 17, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 17, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 48, - 51, - ], - "type": "Identifier", - "value": "bar", - }, - Object { + ], + "kind": "const", "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 18, + "line": 1, }, "start": Object { - "column": 10, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 51, - 52, + 0, + 18, ], - "type": "Punctuator", - "value": ":", + "type": "VariableDeclaration", }, Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 3, + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "Observable", + "range": Array [ + 19, + 29, + ], + "type": "Identifier", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 11, + "line": 2, + }, + }, + "name": "empty", + "range": Array [ + 30, + 35, + ], + "type": "Identifier", + }, + "range": Array [ + 19, + 35, + ], + "type": "MemberExpression", }, - "start": Object { - "column": 12, - "line": 3, + "loc": Object { + "end": Object { + "column": 25, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 19, + 44, + ], + "type": "CallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 36, + 41, + ], + "type": "TSNeverKeyword", + }, + ], + "range": Array [ + 35, + 42, + ], + "type": "TSTypeParameterInstantiation", }, }, - "range": Array [ - 53, - 54, - ], - "type": "Identifier", - "value": "T", - }, - Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 26, + "line": 2, }, "start": Object { - "column": 13, - "line": 3, + "column": 0, + "line": 2, }, }, "range": Array [ - 54, - 55, + 19, + 45, ], - "type": "Punctuator", - "value": ")", + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 46, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 5, + "line": 1, }, "start": Object { - "column": 14, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 55, - 56, + 0, + 5, ], - "type": "Punctuator", - "value": ":", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 7, + "line": 1, }, "start": Object { - "column": 16, - "line": 3, + "column": 6, + "line": 1, }, }, "range": Array [ - 57, - 58, + 6, + 7, ], "type": "Identifier", - "value": "T", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 3, + "column": 8, + "line": 1, }, "start": Object { - "column": 17, - "line": 3, + "column": 7, + "line": 1, }, }, "range": Array [ - 58, - 59, + 7, + 8, ], "type": "Punctuator", - "value": ";", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 4, + "column": 10, + "line": 1, }, "start": Object { - "column": 0, - "line": 4, + "column": 9, + "line": 1, }, }, "range": Array [ - 60, - 61, + 9, + 10, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "X", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-with-optional-properties.src 1`] = ` -Object { - "body": Array [ - Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 9, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "optional": true, - "range": Array [ - 21, - 26, - ], - "type": "TSPropertySignature", - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "name": "bar", - "range": Array [ - 31, - 34, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 17, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "optional": true, - "range": Array [ - 31, - 44, - ], - "type": "TSPropertySignature", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "range": Array [ - 35, - 43, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 37, - 43, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "name": "baz", - "range": Array [ - 49, - 52, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 4, - }, - "start": Object { - "column": 4, - "line": 4, - }, - }, - "optional": true, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 4, - }, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "name": "foo", - "range": Array [ - 54, - 57, - ], - "type": "Identifier", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 14, - "line": 4, - }, - }, - "name": "bar", - "optional": true, - "range": Array [ - 59, - 71, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 18, - "line": 4, - }, - }, - "range": Array [ - 63, - 71, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 4, - }, - "start": Object { - "column": 20, - "line": 4, - }, - }, - "range": Array [ - 65, - 71, - ], - "type": "TSStringKeyword", - }, - }, - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 4, - }, - "start": Object { - "column": 28, - "line": 4, - }, - }, - "name": "baz", - "optional": true, - "range": Array [ - 73, - 76, - ], - "type": "Identifier", - }, - ], - "range": Array [ - 49, - 79, - ], - "type": "TSMethodSignature", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 5, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 81, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, + Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 11, + "line": 1, }, "start": Object { - "column": 0, + "column": 10, "line": 1, }, }, "range": Array [ - 0, - 81, + 10, + 11, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Punctuator", + "value": "<", }, - }, - "range": Array [ - 0, - 82, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 1, }, "start": Object { - "column": 0, + "column": 11, "line": 1, }, }, "range": Array [ - 0, - 9, + 11, + 16, ], - "type": "Keyword", - "value": "interface", + "type": "Identifier", + "value": "never", }, Object { "loc": Object { "end": Object { - "column": 14, + "column": 17, "line": 1, }, "start": Object { - "column": 10, + "column": 16, "line": 1, }, }, "range": Array [ - 10, - 14, + 16, + 17, ], - "type": "Identifier", - "value": "test", + "type": "Punctuator", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 18, "line": 1, }, "start": Object { - "column": 15, + "column": 17, "line": 1, }, }, "range": Array [ - 15, - 16, + 17, + 18, ], "type": "Punctuator", - "value": "{", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 10, "line": 2, }, "start": Object { - "column": 4, + "column": 0, "line": 2, }, }, "range": Array [ - 21, - 24, + 19, + 29, ], "type": "Identifier", - "value": "foo", + "value": "Observable", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 11, "line": 2, }, "start": Object { - "column": 7, + "column": 10, "line": 2, }, }, "range": Array [ - 24, - 25, + 29, + 30, ], "type": "Punctuator", - "value": "?", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 16, "line": 2, }, "start": Object { - "column": 8, + "column": 11, "line": 2, }, }, "range": Array [ - 25, - 26, + 30, + 35, ], - "type": "Punctuator", - "value": ";", + "type": "Identifier", + "value": "empty", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 17, + "line": 2, }, "start": Object { - "column": 4, - "line": 3, + "column": 16, + "line": 2, }, }, "range": Array [ - 31, - 34, + 35, + 36, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 3, + "column": 22, + "line": 2, }, "start": Object { - "column": 7, - "line": 3, + "column": 17, + "line": 2, }, }, "range": Array [ - 34, - 35, + 36, + 41, ], - "type": "Punctuator", - "value": "?", + "type": "Identifier", + "value": "never", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 23, + "line": 2, }, "start": Object { - "column": 8, - "line": 3, + "column": 22, + "line": 2, }, }, "range": Array [ - 35, - 36, + 41, + 42, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 24, + "line": 2, }, "start": Object { - "column": 10, - "line": 3, + "column": 23, + "line": 2, }, }, "range": Array [ - 37, + 42, 43, ], - "type": "Identifier", - "value": "string", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 3, + "column": 25, + "line": 2, }, "start": Object { - "column": 16, - "line": 3, + "column": 24, + "line": 2, }, }, "range": Array [ @@ -48415,130 +54557,465 @@ Object { 44, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 4, + "column": 26, + "line": 2, }, "start": Object { - "column": 4, - "line": 4, + "column": 25, + "line": 2, }, }, "range": Array [ - 49, - 52, + 44, + 45, ], - "type": "Identifier", - "value": "baz", + "type": "Punctuator", + "value": ";", }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` +Object { + "body": Array [ Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 19, + "line": 2, + }, + }, + "name": "e", + "range": Array [ + 56, + 57, + ], + "type": "Identifier", + }, + ], + "callee": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "validateEntity", + "range": Array [ + 41, + 55, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 58, + ], + "type": "CallExpression", + }, + "loc": Object { + "end": Object { + "column": 22, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 41, + 59, + ], + "type": "ExpressionStatement", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "name": "s", + "range": Array [ + 68, + 69, + ], + "type": "Identifier", + }, + "init": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "object": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "name": "e", + "range": Array [ + 72, + 73, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 12, + "line": 3, + }, + }, + "range": Array [ + 72, + 74, + ], + "type": "TSNonNullExpression", + }, + "property": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "name": "name", + "range": Array [ + 75, + 79, + ], + "type": "Identifier", + }, + "range": Array [ + 72, + 79, + ], + "type": "MemberExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 68, + 79, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 64, + 80, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 82, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "processEntity", + "range": Array [ + 9, + 22, + ], + "type": "Identifier", + }, "loc": Object { "end": Object { - "column": 8, + "column": 1, "line": 4, }, "start": Object { - "column": 7, - "line": 4, + "column": 0, + "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "e", + "optional": true, + "range": Array [ + 23, + 33, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 33, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 33, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "name": "Entity", + "range": Array [ + 27, + 33, + ], + "type": "Identifier", + }, + }, + }, + }, + ], "range": Array [ - 52, - 53, + 0, + 82, ], - "type": "Punctuator", - "value": "?", + "type": "FunctionDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 82, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 4, + "column": 8, + "line": 1, }, "start": Object { - "column": 8, - "line": 4, + "column": 0, + "line": 1, }, }, "range": Array [ - 53, - 54, + 0, + 8, ], - "type": "Punctuator", - "value": "(", + "type": "Keyword", + "value": "function", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 4, + "column": 22, + "line": 1, }, "start": Object { "column": 9, - "line": 4, + "line": 1, }, }, "range": Array [ - 54, - 57, + 9, + 22, ], "type": "Identifier", - "value": "foo", + "value": "processEntity", }, Object { "loc": Object { "end": Object { - "column": 13, - "line": 4, + "column": 23, + "line": 1, }, "start": Object { - "column": 12, - "line": 4, + "column": 22, + "line": 1, }, }, "range": Array [ - 57, - 58, + 22, + 23, ], "type": "Punctuator", - "value": ",", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 4, + "column": 24, + "line": 1, }, "start": Object { - "column": 14, - "line": 4, + "column": 23, + "line": 1, }, }, "range": Array [ - 59, - 62, + 23, + 24, ], "type": "Identifier", - "value": "bar", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 4, + "column": 25, + "line": 1, }, "start": Object { - "column": 17, - "line": 4, + "column": 24, + "line": 1, }, }, "range": Array [ - 62, - 63, + 24, + 25, ], "type": "Punctuator", "value": "?", @@ -48546,17 +55023,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 19, - "line": 4, + "column": 26, + "line": 1, }, "start": Object { - "column": 18, - "line": 4, + "column": 25, + "line": 1, }, }, "range": Array [ - 63, - 64, + 25, + 26, ], "type": "Punctuator", "value": ":", @@ -48564,330 +55041,143 @@ Object { Object { "loc": Object { "end": Object { - "column": 26, - "line": 4, + "column": 33, + "line": 1, }, "start": Object { - "column": 20, - "line": 4, - }, - }, - "range": Array [ - 65, - 71, - ], - "type": "Identifier", - "value": "string", - }, - Object { - "loc": Object { - "end": Object { "column": 27, - "line": 4, - }, - "start": Object { - "column": 26, - "line": 4, - }, - }, - "range": Array [ - 71, - 72, - ], - "type": "Punctuator", - "value": ",", - }, - Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 4, - }, - "start": Object { - "column": 28, - "line": 4, + "line": 1, }, }, "range": Array [ - 73, - 76, + 27, + 33, ], "type": "Identifier", - "value": "baz", - }, - Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 4, - }, - "start": Object { - "column": 31, - "line": 4, - }, - }, - "range": Array [ - 76, - 77, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 4, - }, - "start": Object { - "column": 32, - "line": 4, - }, - }, - "range": Array [ - 77, - 78, - ], - "type": "Punctuator", - "value": ")", + "value": "Entity", }, Object { "loc": Object { "end": Object { "column": 34, - "line": 4, + "line": 1, }, "start": Object { "column": 33, - "line": 4, + "line": 1, }, }, "range": Array [ - 78, - 79, + 33, + 34, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 36, + "line": 1, }, "start": Object { - "column": 0, - "line": 5, + "column": 35, + "line": 1, }, }, "range": Array [ - 80, - 81, + 35, + 36, ], "type": "Punctuator", - "value": "}", + "value": "{", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/interface-without-type-annotation.src 1`] = ` -Object { - "body": Array [ Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "foo", - "range": Array [ - 21, - 24, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 8, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 21, - 25, - ], - "type": "TSPropertySignature", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 3, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 27, - ], - "type": "TSInterfaceBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "name": "test", - "range": Array [ - 10, - 14, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 18, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 0, - 27, + 41, + 55, ], - "type": "TSInterfaceDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "validateEntity", }, - }, - "range": Array [ - 0, - 28, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 9, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 0, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 0, - 9, + 55, + 56, ], - "type": "Keyword", - "value": "interface", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 10, - "line": 1, + "column": 19, + "line": 2, }, }, "range": Array [ - 10, - 14, + 56, + 57, ], "type": "Identifier", - "value": "test", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 16, - ], - "type": "Punctuator", - "value": "{", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 21, "line": 2, }, "start": Object { - "column": 4, + "column": 20, "line": 2, }, }, "range": Array [ - 21, - 24, + 57, + 58, ], - "type": "Identifier", - "value": "foo", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 22, "line": 2, }, "start": Object { - "column": 7, + "column": 21, "line": 2, }, }, "range": Array [ - 24, - 25, + 58, + 59, ], "type": "Punctuator", "value": ";", @@ -48895,248 +55185,171 @@ Object { Object { "loc": Object { "end": Object { - "column": 1, + "column": 7, "line": 3, }, "start": Object { - "column": 0, + "column": 4, "line": 3, }, }, "range": Array [ - 26, - 27, + 64, + 67, ], - "type": "Punctuator", - "value": "}", + "type": "Keyword", + "value": "let", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/keyof-operator.src 1`] = ` -Object { - "body": Array [ Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 6, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 5, - 6, - ], - "type": "Identifier", - }, "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 9, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 8, + "line": 3, }, }, "range": Array [ - 0, - 19, + 68, + 69, ], - "type": "TSTypeAliasDeclaration", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "operator": "keyof", - "range": Array [ - 9, - 18, - ], - "type": "TSTypeOperator", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "range": Array [ - 15, - 18, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "name": "foo", - "range": Array [ - 15, - 18, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "s", }, - }, - "range": Array [ - 0, - 20, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, - "line": 1, + "column": 11, + "line": 3, }, "start": Object { - "column": 0, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 0, - 4, + 70, + 71, ], - "type": "Identifier", - "value": "type", + "type": "Punctuator", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 13, + "line": 3, }, "start": Object { - "column": 5, - "line": 1, + "column": 12, + "line": 3, }, }, "range": Array [ - 5, - 6, + 72, + 73, ], "type": "Identifier", - "value": "x", + "value": "e", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 14, + "line": 3, }, "start": Object { - "column": 7, - "line": 1, + "column": 13, + "line": 3, }, }, "range": Array [ - 7, - 8, + 73, + 74, ], "type": "Punctuator", - "value": "=", + "value": "!", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 1, + "column": 15, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 14, + "line": 3, }, }, "range": Array [ - 9, - 14, + 74, + 75, ], - "type": "Identifier", - "value": "keyof", + "type": "Punctuator", + "value": ".", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 19, + "line": 3, }, "start": Object { "column": 15, - "line": 1, + "line": 3, }, }, "range": Array [ - 15, - 18, + 75, + 79, ], "type": "Identifier", - "value": "foo", + "value": "name", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 1, + "column": 20, + "line": 3, }, "start": Object { - "column": 18, - "line": 1, + "column": 19, + "line": 3, }, }, "range": Array [ - 18, - 19, + 79, + 80, ], "type": "Punctuator", "value": ";", }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 81, + 82, + ], + "type": "Punctuator", + "value": "}", + }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/nested-type-arguments.src 1`] = ` +exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` Object { "body": Array [ Object { @@ -49145,7 +55358,7 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 44, + "column": 11, "line": 1, }, "start": Object { @@ -49153,213 +55366,51 @@ Object { "line": 1, }, }, - "name": "nestedArray", + "name": "x", "range": Array [ 4, - 44, + 11, ], "type": "Identifier", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 44, + "column": 11, "line": 1, }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, "range": Array [ - 15, - 44, + 5, + 11, ], "type": "TSTypeAnnotation", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 44, + "column": 11, "line": 1, }, "start": Object { - "column": 17, + "column": 7, "line": 1, }, }, "range": Array [ - 17, - 44, + 7, + 11, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 17, - 22, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 44, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 43, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 23, - 28, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 42, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 29, - 34, - ], - "type": "Identifier", - }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 41, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 41, - ], - "type": "TSStringKeyword", - }, - ], - "range": Array [ - 34, - 42, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 28, - 43, - ], - "type": "TSTypeParameterInstantiation", - }, - }, - ], - "range": Array [ - 22, - 44, - ], - "type": "TSTypeParameterInstantiation", - }, + "type": "TSNullKeyword", }, }, }, "init": null, "loc": Object { "end": Object { - "column": 44, + "column": 11, "line": 1, }, "start": Object { @@ -49369,15 +55420,15 @@ Object { }, "range": Array [ 4, - 44, + 11, ], "type": "VariableDeclarator", }, ], - "kind": "var", + "kind": "let", "loc": Object { "end": Object { - "column": 44, + "column": 12, "line": 1, }, "start": Object { @@ -49387,15 +55438,105 @@ Object { }, "range": Array [ 0, - 44, + 12, + ], + "type": "VariableDeclaration", + }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "name": "y", + "range": Array [ + 17, + 29, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 18, + 29, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 20, + 29, + ], + "type": "TSUndefinedKeyword", + }, + }, + }, + "init": null, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 4, + "line": 2, + }, + }, + "range": Array [ + 17, + 29, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 13, + 30, ], "type": "VariableDeclaration", }, ], "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { "column": 0, @@ -49404,7 +55545,7 @@ Object { }, "range": Array [ 0, - 44, + 30, ], "sourceType": "script", "tokens": Array [ @@ -49424,12 +55565,12 @@ Object { 3, ], "type": "Keyword", - "value": "var", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 5, "line": 1, }, "start": Object { @@ -49439,25 +55580,25 @@ Object { }, "range": Array [ 4, - 15, + 5, ], "type": "Identifier", - "value": "nestedArray", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 16, + "column": 6, "line": 1, }, "start": Object { - "column": 15, + "column": 5, "line": 1, }, }, "range": Array [ - 15, - 16, + 5, + 6, ], "type": "Punctuator", "value": ":", @@ -49465,465 +55606,560 @@ Object { Object { "loc": Object { "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 22, - ], - "type": "Identifier", - "value": "Array", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 28, + "column": 11, "line": 1, }, "start": Object { - "column": 23, + "column": 7, "line": 1, }, }, "range": Array [ - 23, - 28, + 7, + 11, ], - "type": "Identifier", - "value": "Array", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 29, + "column": 12, "line": 1, }, "start": Object { - "column": 28, + "column": 11, "line": 1, }, }, "range": Array [ - 28, - 29, + 11, + 12, ], "type": "Punctuator", - "value": "<", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "range": Array [ - 29, - 34, - ], - "type": "Identifier", - "value": "Array", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 35, - "line": 1, + "column": 3, + "line": 2, }, "start": Object { - "column": 34, - "line": 1, + "column": 0, + "line": 2, }, }, "range": Array [ - 34, - 35, + 13, + 16, ], - "type": "Punctuator", - "value": "<", + "type": "Keyword", + "value": "let", }, Object { "loc": Object { "end": Object { - "column": 41, - "line": 1, + "column": 5, + "line": 2, }, "start": Object { - "column": 35, - "line": 1, + "column": 4, + "line": 2, }, }, "range": Array [ - 35, - 41, + 17, + 18, ], "type": "Identifier", - "value": "string", + "value": "y", }, Object { "loc": Object { "end": Object { - "column": 42, - "line": 1, + "column": 6, + "line": 2, }, "start": Object { - "column": 41, - "line": 1, + "column": 5, + "line": 2, }, }, "range": Array [ - 41, - 42, + 18, + 19, ], "type": "Punctuator", - "value": ">", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 43, - "line": 1, + "column": 16, + "line": 2, }, "start": Object { - "column": 42, - "line": 1, + "column": 7, + "line": 2, }, }, "range": Array [ - 42, - 43, + 20, + 29, ], - "type": "Punctuator", - "value": ">", + "type": "Identifier", + "value": "undefined", }, Object { "loc": Object { "end": Object { - "column": 44, - "line": 1, + "column": 17, + "line": 2, }, "start": Object { - "column": 43, - "line": 1, + "column": 16, + "line": 2, }, }, "range": Array [ - 43, - 44, + 29, + 30, ], "type": "Punctuator", - "value": ">", + "value": ";", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/never-type-param.src 1`] = ` +exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` Object { "body": Array [ Object { - "declarations": Array [ - Object { - "id": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 7, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, - "name": "x", + "method": false, "range": Array [ - 6, - 17, + 3, + 13, ], - "type": "Identifier", - "typeAnnotation": Object { + "shorthand": false, + "type": "Property", + "value": Object { "loc": Object { "end": Object { - "column": 17, + "column": 13, "line": 1, }, "start": Object { - "column": 7, + "column": 9, "line": 1, }, }, "range": Array [ - 7, - 17, + 9, + 13, ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { + "raw": "null", + "type": "Literal", + "value": null, + }, + }, + ], + "range": Array [ + 1, + 15, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 17, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 1, + "line": 3, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 22, + 26, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "method": true, + "range": Array [ + 22, + 31, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 12, + "line": 3, }, "start": Object { - "column": 9, - "line": 1, + "column": 10, + "line": 3, }, }, "range": Array [ - 9, - 17, + 29, + 31, ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 3, }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ - 11, - 16, - ], - "type": "TSNeverKeyword", - }, - ], - "range": Array [ - 10, - 17, - ], - "type": "TSTypeParameterInstantiation", + "start": Object { + "column": 7, + "line": 3, }, }, + "params": Array [], + "range": Array [ + 26, + 31, + ], + "type": "FunctionExpression", }, }, - "init": null, - "loc": Object { - "end": Object { - "column": 17, - "line": 1, - }, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "range": Array [ - 6, - 17, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "const", + ], + "range": Array [ + 20, + 33, + ], + "type": "ObjectExpression", + }, "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 16, + "line": 3, }, "start": Object { "column": 0, - "line": 1, + "line": 3, }, }, "range": Array [ - 0, - 18, + 19, + 35, ], - "type": "VariableDeclaration", + "type": "ExpressionStatement", }, Object { "expression": Object { - "arguments": Array [], - "callee": Object { - "computed": false, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, }, - "object": Object { + "start": Object { + "column": 1, + "line": 5, + }, + }, + "properties": Array [ + Object { + "computed": true, + "key": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, + "kind": "init", "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 15, + "line": 5, }, "start": Object { - "column": 0, - "line": 2, + "column": 3, + "line": 5, }, }, - "name": "Observable", + "method": false, "range": Array [ - 19, - 29, + 40, + 52, ], - "type": "Identifier", + "shorthand": false, + "type": "Property", + "value": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 48, + 52, + ], + "raw": "null", + "type": "Literal", + "value": null, + }, }, - "property": Object { + ], + "range": Array [ + 38, + 54, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 37, + 56, + ], + "type": "ExpressionStatement", + }, + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "raw": "'__'", + "type": "Literal", + "value": "__", + }, "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 21, + "line": 7, }, "start": Object { - "column": 11, - "line": 2, + "column": 10, + "line": 7, }, }, - "name": "empty", "range": Array [ - 30, - 35, + 68, + 79, ], - "type": "Identifier", - }, - "range": Array [ - 19, - 35, - ], - "type": "MemberExpression", - }, - "loc": Object { - "end": Object { - "column": 25, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "range": Array [ - 19, - 44, - ], - "type": "CallExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 2, - }, - "start": Object { - "column": 16, - "line": 2, - }, - }, - "params": Array [ - Object { + "static": false, + "type": "ClassProperty", + "value": Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 21, + "line": 7, }, "start": Object { "column": 17, - "line": 2, + "line": 7, }, }, "range": Array [ - 36, - 41, + 75, + 79, ], - "type": "TSNeverKeyword", + "raw": "null", + "type": "Literal", + "value": null, }, - ], - "range": Array [ - 35, - 42, - ], - "type": "TSTypeParameterInstantiation", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 66, + 81, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, }, + "name": "X", + "range": Array [ + 64, + 65, + ], + "type": "Identifier", }, "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 23, + "line": 7, }, "start": Object { "column": 0, - "line": 2, + "line": 7, }, }, "range": Array [ - 19, - 45, + 58, + 81, ], - "type": "ExpressionStatement", + "superClass": null, + "type": "ClassDeclaration", }, ], "loc": Object { "end": Object { "column": 0, - "line": 3, + "line": 8, }, "start": Object { "column": 0, @@ -49932,14 +56168,14 @@ Object { }, "range": Array [ 0, - 46, + 82, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 1, "line": 1, }, "start": Object { @@ -49949,10 +56185,28 @@ Object { }, "range": Array [ 0, - 5, + 1, ], - "type": "Keyword", - "value": "const", + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 2, + ], + "type": "Punctuator", + "value": "{", }, Object { "loc": Object { @@ -49961,16 +56215,16 @@ Object { "line": 1, }, "start": Object { - "column": 6, + "column": 3, "line": 1, }, }, "range": Array [ - 6, + 3, 7, ], - "type": "Identifier", - "value": "x", + "type": "String", + "value": "'__'", }, Object { "loc": Object { @@ -49993,7 +56247,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 13, "line": 1, }, "start": Object { @@ -50003,28 +56257,28 @@ Object { }, "range": Array [ 9, - 10, + 13, ], - "type": "Identifier", - "value": "X", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], "type": "Punctuator", - "value": "<", + "value": "}", }, Object { "loc": Object { @@ -50033,16 +56287,16 @@ Object { "line": 1, }, "start": Object { - "column": 11, + "column": 15, "line": 1, }, }, "range": Array [ - 11, + 15, 16, ], - "type": "Identifier", - "value": "never", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -50060,53 +56314,107 @@ Object { 17, ], "type": "Punctuator", - "value": ">", + "value": ";", }, Object { "loc": Object { "end": Object { - "column": 18, - "line": 1, + "column": 1, + "line": 3, }, "start": Object { - "column": 17, - "line": 1, + "column": 0, + "line": 3, }, }, "range": Array [ - 17, - 18, + 19, + 20, ], "type": "Punctuator", - "value": ";", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 2, + "column": 2, + "line": 3, }, "start": Object { - "column": 0, - "line": 2, + "column": 1, + "line": 3, }, }, "range": Array [ - 19, - 29, + 20, + 21, ], - "type": "Identifier", - "value": "Observable", + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 3, + "line": 3, + }, + }, + "range": Array [ + 22, + 26, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 2, + "line": 3, }, "start": Object { "column": 10, - "line": 2, + "line": 3, }, }, "range": Array [ @@ -50114,789 +56422,1260 @@ Object { 30, ], "type": "Punctuator", - "value": ".", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { "column": 11, - "line": 2, + "line": 3, }, }, "range": Array [ 30, + 31, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 3, + }, + "start": Object { + "column": 13, + "line": 3, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 14, + "line": 3, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 34, 35, ], - "type": "Identifier", - "value": "empty", + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 1, + "line": 5, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 5, + }, + "start": Object { + "column": 3, + "line": 5, + }, + }, + "range": Array [ + 40, + 41, + ], + "type": "Punctuator", + "value": "[", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 4, + "line": 5, + }, + }, + "range": Array [ + 41, + 45, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 45, + 46, + ], + "type": "Punctuator", + "value": "]", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 5, + }, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 48, + 52, + ], + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 2, + "line": 5, }, "start": Object { "column": 16, - "line": 2, + "line": 5, }, }, "range": Array [ - 35, - 36, + 53, + 54, ], "type": "Punctuator", - "value": "<", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 22, - "line": 2, + "column": 18, + "line": 5, }, "start": Object { "column": 17, - "line": 2, + "line": 5, }, }, "range": Array [ - 36, - 41, + 54, + 55, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 5, + }, + "start": Object { + "column": 18, + "line": 5, + }, + }, + "range": Array [ + 55, + 56, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "range": Array [ + 58, + 63, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 7, + }, + "start": Object { + "column": 6, + "line": 7, + }, + }, + "range": Array [ + 64, + 65, ], "type": "Identifier", - "value": "never", + "value": "X", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 2, + "column": 9, + "line": 7, }, "start": Object { - "column": 22, - "line": 2, + "column": 8, + "line": 7, }, }, "range": Array [ - 41, - 42, + 66, + 67, ], "type": "Punctuator", - "value": ">", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 24, - "line": 2, + "column": 14, + "line": 7, + }, + "start": Object { + "column": 10, + "line": 7, + }, + }, + "range": Array [ + 68, + 72, + ], + "type": "String", + "value": "'__'", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 7, }, "start": Object { - "column": 23, - "line": 2, + "column": 15, + "line": 7, }, }, "range": Array [ - 42, - 43, + 73, + 74, ], "type": "Punctuator", - "value": "(", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 25, - "line": 2, + "column": 21, + "line": 7, }, "start": Object { - "column": 24, - "line": 2, + "column": 17, + "line": 7, }, }, "range": Array [ - 43, - 44, + 75, + 79, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "null", }, Object { "loc": Object { "end": Object { - "column": 26, - "line": 2, + "column": 23, + "line": 7, }, "start": Object { - "column": 25, - "line": 2, + "column": 22, + "line": 7, }, }, "range": Array [ - 44, - 45, + 80, + 81, ], "type": "Punctuator", - "value": ";", + "value": "}", }, ], "type": "Program", } `; -exports[`typescript fixtures/basics/non-null-assertion-operator.src 1`] = ` +exports[`typescript fixtures/basics/object-with-typed-methods.src 1`] = ` Object { "body": Array [ Object { - "async": false, - "body": Object { - "body": Array [ - Object { - "expression": Object { - "arguments": Array [ - Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "properties": Array [ + Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 20, + "column": 15, "line": 2, }, "start": Object { - "column": 19, + "column": 2, "line": 2, }, }, - "name": "e", "range": Array [ - 56, - 57, + 16, + 29, ], - "type": "Identifier", + "raw": "\\"constructor\\"", + "type": "Literal", + "value": "constructor", }, - ], - "callee": Object { + "kind": "constructor", "loc": Object { "end": Object { - "column": 18, - "line": 2, + "column": 3, + "line": 4, }, "start": Object { - "column": 4, + "column": 2, "line": 2, }, }, - "name": "validateEntity", + "method": true, "range": Array [ - 41, - 55, + 16, + 61, ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 11, + "line": 3, + }, + }, + "range": Array [ + 56, + 57, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 3, + }, + "start": Object { + "column": 4, + "line": 3, + }, + }, + "range": Array [ + 49, + 57, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "range": Array [ + 43, + 61, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "params": Array [], + "range": Array [ + 32, + 61, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 20, + "line": 2, + }, + }, + "range": Array [ + 34, + 42, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 22, + "line": 2, + }, + }, + "range": Array [ + 36, + 42, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "name": "T", + "range": Array [ + 30, + 31, + ], + "type": "Identifier", + }, + "range": Array [ + 30, + 31, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 29, + 32, + ], + "type": "TSTypeParameterDeclaration", + }, }, }, - "range": Array [ - 41, - 58, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 59, - ], - "type": "ExpressionStatement", - }, - Object { - "declarations": Array [ Object { - "id": Object { + "computed": false, + "key": Object { "loc": Object { "end": Object { - "column": 9, - "line": 3, + "column": 5, + "line": 5, }, "start": Object { - "column": 8, - "line": 3, + "column": 2, + "line": 5, }, }, - "name": "s", + "name": "foo", "range": Array [ + 65, 68, - 69, ], "type": "Identifier", }, - "init": Object { - "computed": false, + "kind": "init", + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "method": true, + "range": Array [ + 65, + 100, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 95, + 96, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 4, + "line": 6, + }, + }, + "range": Array [ + 88, + 96, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 19, + "line": 5, + }, + }, + "range": Array [ + 82, + 100, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 3, + "line": 7, }, "start": Object { - "column": 12, - "line": 3, + "column": 8, + "line": 5, }, }, - "object": Object { - "expression": Object { + "params": Array [], + "range": Array [ + 71, + 100, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 10, + "line": 5, + }, + }, + "range": Array [ + 73, + 81, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 13, - "line": 3, + "column": 18, + "line": 5, }, "start": Object { "column": 12, - "line": 3, + "line": 5, }, }, - "name": "e", "range": Array [ - 72, - 73, + 75, + 81, ], - "type": "Identifier", + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 5, + }, + "start": Object { + "column": 5, + "line": 5, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 5, + }, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "name": "T", + "range": Array [ + 69, + 70, + ], + "type": "Identifier", + }, + "range": Array [ + 69, + 70, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 68, + 71, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 8, }, + }, + "name": "a", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + "kind": "get", + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "method": false, + "range": Array [ + 104, + 138, + ], + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 11, + "line": 9, + }, + }, + "range": Array [ + 133, + 134, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 9, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "range": Array [ + 126, + 134, + ], + "type": "ReturnStatement", + }, + ], "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 3, + "line": 10, }, "start": Object { - "column": 12, - "line": 3, + "column": 18, + "line": 8, }, }, "range": Array [ - 72, - 74, + 120, + 138, ], - "type": "TSNonNullExpression", + "type": "BlockStatement", }, - "property": Object { + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "params": Array [], + "range": Array [ + 109, + 138, + ], + "returnType": Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 17, + "line": 8, }, "start": Object { - "column": 15, - "line": 3, + "column": 9, + "line": 8, }, }, - "name": "name", "range": Array [ - 75, - 79, + 111, + 119, ], - "type": "Identifier", + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 8, + }, + "start": Object { + "column": 11, + "line": 8, + }, + }, + "range": Array [ + 113, + 119, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 11, + }, + "start": Object { + "column": 6, + "line": 11, + }, }, + "name": "a", "range": Array [ - 72, - 79, + 146, + 147, ], - "type": "MemberExpression", + "type": "Identifier", }, + "kind": "set", "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 3, + "line": 12, }, "start": Object { - "column": 8, - "line": 3, + "column": 2, + "line": 11, }, }, + "method": false, "range": Array [ - 68, - 79, + 142, + 172, ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 4, - "line": 3, - }, - }, - "range": Array [ - 64, - 80, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 82, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "processEntity", - "range": Array [ - 9, - 22, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "e", - "optional": true, - "range": Array [ - 23, - 33, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 33, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 33, - ], - "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, + "shorthand": false, + "type": "Property", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 27, + "line": 11, + }, + }, + "range": Array [ + 167, + 172, + ], + "type": "BlockStatement", }, - "start": Object { - "column": 27, - "line": 1, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 7, + "line": 11, + }, }, - }, - "name": "Entity", - "range": Array [ - 27, - 33, - ], - "type": "Identifier", - }, - }, - }, - }, - ], - "range": Array [ - 0, - 82, - ], - "type": "FunctionDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 82, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 8, - ], - "type": "Keyword", - "value": "function", - }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 22, - ], - "type": "Identifier", - "value": "processEntity", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "range": Array [ - 22, - 23, - ], - "type": "Punctuator", - "value": "(", - }, - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "range": Array [ - 23, - 24, - ], - "type": "Identifier", - "value": "e", - }, - Object { - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "range": Array [ - 24, - 25, - ], - "type": "Punctuator", - "value": "?", - }, - Object { - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "range": Array [ - 25, - 26, - ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "range": Array [ - 27, - 33, - ], - "type": "Identifier", - "value": "Entity", - }, - Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "range": Array [ - 33, - 34, - ], - "type": "Punctuator", - "value": ")", - }, - Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "start": Object { - "column": 35, - "line": 1, - }, - }, - "range": Array [ - 35, - 36, - ], - "type": "Punctuator", - "value": "{", - }, - Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 41, - 55, - ], - "type": "Identifier", - "value": "validateEntity", - }, - Object { - "loc": Object { - "end": Object { - "column": 19, - "line": 2, - }, - "start": Object { - "column": 18, - "line": 2, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 8, + "line": 11, + }, + }, + "name": "x", + "range": Array [ + 148, + 157, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 9, + "line": 11, + }, + }, + "range": Array [ + 149, + 157, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 11, + }, + "start": Object { + "column": 11, + "line": 11, + }, + }, + "range": Array [ + 151, + 157, + ], + "type": "TSNumberKeyword", + }, + }, + }, + ], + "range": Array [ + 147, + 172, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 18, + "line": 11, + }, + }, + "range": Array [ + 158, + 166, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 11, + }, + "start": Object { + "column": 20, + "line": 11, + }, + }, + "range": Array [ + 160, + 166, + ], + "type": "TSNumberKeyword", + }, + }, + "type": "FunctionExpression", + }, + }, + ], + "range": Array [ + 12, + 174, + ], + "type": "ObjectExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 174, + ], + "type": "VariableDeclarator", }, - }, - "range": Array [ - 55, - 56, ], - "type": "Punctuator", - "value": "(", - }, - Object { + "kind": "const", "loc": Object { "end": Object { - "column": 20, - "line": 2, + "column": 2, + "line": 13, }, "start": Object { - "column": 19, - "line": 2, + "column": 0, + "line": 1, }, }, "range": Array [ - 56, - 57, + 0, + 175, ], - "type": "Identifier", - "value": "e", + "type": "VariableDeclaration", }, - Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 2, - }, - "start": Object { - "column": 20, - "line": 2, - }, - }, - "range": Array [ - 57, - 58, - ], - "type": "Punctuator", - "value": ")", + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 14, }, - Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "range": Array [ - 58, - 59, - ], - "type": "Punctuator", - "value": ";", + "start": Object { + "column": 0, + "line": 1, }, + }, + "range": Array [ + 0, + 176, + ], + "sourceType": "script", + "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 7, - "line": 3, + "column": 5, + "line": 1, }, "start": Object { - "column": 4, - "line": 3, + "column": 0, + "line": 1, }, }, "range": Array [ - 64, - 67, + 0, + 5, ], "type": "Keyword", - "value": "let", + "value": "const", }, Object { "loc": Object { "end": Object { "column": 9, - "line": 3, + "line": 1, }, "start": Object { - "column": 8, - "line": 3, + "column": 6, + "line": 1, }, }, "range": Array [ - 68, - 69, + 6, + 9, ], "type": "Identifier", - "value": "s", + "value": "foo", }, Object { "loc": Object { "end": Object { "column": 11, - "line": 3, + "line": 1, }, "start": Object { "column": 10, - "line": 3, + "line": 1, }, }, "range": Array [ - 70, - 71, + 10, + 11, ], "type": "Punctuator", "value": "=", @@ -50905,1006 +57684,376 @@ Object { "loc": Object { "end": Object { "column": 13, - "line": 3, + "line": 1, }, "start": Object { "column": 12, - "line": 3, - }, - }, - "range": Array [ - 72, - 73, - ], - "type": "Identifier", - "value": "e", - }, - Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 13, - "line": 3, + "line": 1, }, }, "range": Array [ - 73, - 74, + 12, + 13, ], "type": "Punctuator", - "value": "!", + "value": "{", }, Object { "loc": Object { "end": Object { "column": 15, - "line": 3, + "line": 2, }, "start": Object { - "column": 14, - "line": 3, + "column": 2, + "line": 2, }, }, "range": Array [ - 74, - 75, + 16, + 29, ], - "type": "Punctuator", - "value": ".", + "type": "String", + "value": "\\"constructor\\"", }, Object { "loc": Object { "end": Object { - "column": 19, - "line": 3, + "column": 16, + "line": 2, }, "start": Object { "column": 15, - "line": 3, - }, - }, - "range": Array [ - 75, - 79, - ], - "type": "Identifier", - "value": "name", - }, - Object { - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "start": Object { - "column": 19, - "line": 3, - }, - }, - "range": Array [ - 79, - 80, - ], - "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 1, - "line": 4, - }, - "start": Object { - "column": 0, - "line": 4, + "line": 2, }, }, "range": Array [ - 81, - 82, + 29, + 30, ], "type": "Punctuator", - "value": "}", - }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/null-and-undefined-type-annotations.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "name": "x", - "range": Array [ - 4, - 11, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "range": Array [ - 5, - 11, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "range": Array [ - 7, - 11, - ], - "type": "TSNullKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 11, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 11, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 12, - ], - "type": "VariableDeclaration", + "value": "<", }, Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "name": "y", - "range": Array [ - 17, - 29, - ], - "type": "Identifier", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 5, - "line": 2, - }, - }, - "range": Array [ - 18, - 29, - ], - "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 7, - "line": 2, - }, - }, - "range": Array [ - 20, - 29, - ], - "type": "TSUndefinedKeyword", - }, - }, - }, - "init": null, - "loc": Object { - "end": Object { - "column": 16, - "line": 2, - }, - "start": Object { - "column": 4, - "line": 2, - }, - }, - "range": Array [ - 17, - 29, - ], - "type": "VariableDeclarator", - }, - ], - "kind": "let", "loc": Object { "end": Object { "column": 17, "line": 2, }, "start": Object { - "column": 0, + "column": 16, "line": 2, }, }, "range": Array [ - 13, 30, - ], - "type": "VariableDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 17, - "line": 2, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 30, - ], - "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { - "column": 3, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 3, - ], - "type": "Keyword", - "value": "let", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 4, - "line": 1, - }, - }, - "range": Array [ - 4, - 5, + 31, ], "type": "Identifier", - "value": "x", + "value": "T", }, Object { "loc": Object { "end": Object { - "column": 6, - "line": 1, + "column": 18, + "line": 2, }, "start": Object { - "column": 5, - "line": 1, + "column": 17, + "line": 2, }, }, "range": Array [ - 5, - 6, + 31, + 32, ], "type": "Punctuator", - "value": ":", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 11, - "line": 1, + "column": 19, + "line": 2, }, "start": Object { - "column": 7, - "line": 1, + "column": 18, + "line": 2, }, }, "range": Array [ - 7, - 11, + 32, + 33, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 1, + "column": 20, + "line": 2, }, "start": Object { - "column": 11, - "line": 1, + "column": 19, + "line": 2, }, }, - "range": Array [ - 11, - 12, + "range": Array [ + 33, + 34, ], "type": "Punctuator", - "value": ";", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 3, + "column": 21, "line": 2, }, "start": Object { - "column": 0, + "column": 20, "line": 2, }, }, "range": Array [ - 13, - 16, + 34, + 35, ], - "type": "Keyword", - "value": "let", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 5, + "column": 28, "line": 2, }, "start": Object { - "column": 4, + "column": 22, "line": 2, }, }, "range": Array [ - 17, - 18, + 36, + 42, ], "type": "Identifier", - "value": "y", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 6, + "column": 30, "line": 2, }, "start": Object { - "column": 5, + "column": 29, "line": 2, }, }, "range": Array [ - 18, - 19, + 43, + 44, ], "type": "Punctuator", - "value": ":", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 2, + "column": 10, + "line": 3, }, "start": Object { - "column": 7, - "line": 2, + "column": 4, + "line": 3, }, }, "range": Array [ - 20, - 29, + 49, + 55, ], - "type": "Identifier", - "value": "undefined", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 2, + "column": 12, + "line": 3, }, "start": Object { - "column": 16, - "line": 2, + "column": 11, + "line": 3, }, }, "range": Array [ - 29, - 30, + 56, + 57, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "1", }, - ], - "type": "Program", -} -`; - -exports[`typescript fixtures/basics/object-with-escaped-properties.src 1`] = ` -Object { - "body": Array [ Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "range": Array [ - 3, - 7, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "method": false, - "range": Array [ - 3, - 13, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 13, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "range": Array [ - 9, - 13, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], - "range": Array [ - 1, - 15, - ], - "type": "ObjectExpression", - }, "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 3, + "line": 4, }, "start": Object { - "column": 0, - "line": 1, + "column": 2, + "line": 4, }, }, "range": Array [ - 0, - 17, + 60, + 61, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": "}", }, Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 3, - }, - "start": Object { - "column": 1, - "line": 3, - }, - }, - "properties": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "range": Array [ - 22, - 26, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 3, - "line": 3, - }, - }, - "method": true, - "range": Array [ - 22, - 31, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "async": false, - "body": Object { - "body": Array [], - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 10, - "line": 3, - }, - }, - "range": Array [ - 29, - 31, - ], - "type": "BlockStatement", - }, - "expression": false, - "generator": false, - "id": null, - "loc": Object { - "end": Object { - "column": 12, - "line": 3, - }, - "start": Object { - "column": 7, - "line": 3, - }, - }, - "params": Array [], - "range": Array [ - 26, - 31, - ], - "type": "FunctionExpression", - }, - }, - ], - "range": Array [ - 20, - 33, - ], - "type": "ObjectExpression", - }, "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 4, + "line": 4, }, "start": Object { - "column": 0, - "line": 3, + "column": 3, + "line": 4, }, }, "range": Array [ - 19, - 35, + 61, + 62, ], - "type": "ExpressionStatement", + "type": "Punctuator", + "value": ",", }, Object { - "expression": Object { - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "start": Object { - "column": 1, - "line": 5, - }, - }, - "properties": Array [ - Object { - "computed": true, - "key": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 5, - }, - "start": Object { - "column": 4, - "line": 5, - }, - }, - "range": Array [ - 41, - 45, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "kind": "init", - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 3, - "line": 5, - }, - }, - "method": false, - "range": Array [ - 40, - 52, - ], - "shorthand": false, - "type": "Property", - "value": Object { - "loc": Object { - "end": Object { - "column": 15, - "line": 5, - }, - "start": Object { - "column": 11, - "line": 5, - }, - }, - "range": Array [ - 48, - 52, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], - "range": Array [ - 38, - 54, - ], - "type": "ObjectExpression", - }, "loc": Object { "end": Object { - "column": 19, + "column": 5, "line": 5, }, "start": Object { - "column": 0, + "column": 2, "line": 5, }, }, "range": Array [ - 37, - 56, + 65, + 68, ], - "type": "ExpressionStatement", + "type": "Identifier", + "value": "foo", }, Object { - "body": Object { - "body": Array [ - Object { - "computed": false, - "key": Object { - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 68, - 72, - ], - "raw": "'__'", - "type": "Literal", - "value": "__", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 68, - 79, - ], - "static": false, - "type": "ClassProperty", - "value": Object { - "loc": Object { - "end": Object { - "column": 21, - "line": 7, - }, - "start": Object { - "column": 17, - "line": 7, - }, - }, - "range": Array [ - 75, - 79, - ], - "raw": "null", - "type": "Literal", - "value": null, - }, - }, - ], - "loc": Object { - "end": Object { - "column": 23, - "line": 7, - }, - "start": Object { - "column": 8, - "line": 7, - }, + "loc": Object { + "end": Object { + "column": 6, + "line": 5, }, - "range": Array [ - 66, - 81, - ], - "type": "ClassBody", - }, - "id": Object { - "loc": Object { - "end": Object { - "column": 7, - "line": 7, - }, - "start": Object { - "column": 6, - "line": 7, - }, + "start": Object { + "column": 5, + "line": 5, }, - "name": "X", - "range": Array [ - 64, - 65, - ], - "type": "Identifier", }, + "range": Array [ + 68, + 69, + ], + "type": "Punctuator", + "value": "<", + }, + Object { "loc": Object { "end": Object { - "column": 23, - "line": 7, + "column": 7, + "line": 5, }, "start": Object { - "column": 0, - "line": 7, + "column": 6, + "line": 5, }, }, "range": Array [ - 58, - 81, + 69, + 70, ], - "superClass": null, - "type": "ClassDeclaration", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "start": Object { - "column": 0, - "line": 1, + "type": "Identifier", + "value": "T", }, - }, - "range": Array [ - 0, - 82, - ], - "sourceType": "script", - "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 1, - "line": 1, + "column": 8, + "line": 5, }, "start": Object { - "column": 0, - "line": 1, + "column": 7, + "line": 5, }, }, "range": Array [ - 0, - 1, + 70, + 71, ], "type": "Punctuator", - "value": "(", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 1, + "column": 9, + "line": 5, }, "start": Object { - "column": 1, - "line": 1, + "column": 8, + "line": 5, }, }, "range": Array [ - 1, - 2, + 71, + 72, ], "type": "Punctuator", - "value": "{", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 1, + "column": 10, + "line": 5, }, "start": Object { - "column": 3, - "line": 1, + "column": 9, + "line": 5, }, }, "range": Array [ - 3, - 7, + 72, + 73, ], - "type": "String", - "value": "'__'", + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 1, + "column": 11, + "line": 5, }, "start": Object { - "column": 7, - "line": 1, + "column": 10, + "line": 5, }, }, "range": Array [ - 7, - 8, + 73, + 74, ], "type": "Punctuator", "value": ":", @@ -51912,143 +58061,161 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, - "line": 1, + "column": 18, + "line": 5, }, "start": Object { - "column": 9, - "line": 1, + "column": 12, + "line": 5, }, }, "range": Array [ - 9, - 13, + 75, + 81, ], - "type": "Keyword", - "value": "null", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 1, + "column": 20, + "line": 5, }, "start": Object { - "column": 14, - "line": 1, + "column": 19, + "line": 5, }, }, "range": Array [ - 14, - 15, + 82, + 83, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 1, + "column": 10, + "line": 6, }, "start": Object { - "column": 15, - "line": 1, + "column": 4, + "line": 6, }, }, "range": Array [ - 15, - 16, + 88, + 94, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 17, - "line": 1, + "column": 12, + "line": 6, }, "start": Object { - "column": 16, - "line": 1, + "column": 11, + "line": 6, }, }, "range": Array [ - 16, - 17, + 95, + 96, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 3, + "column": 3, + "line": 7, }, "start": Object { - "column": 0, - "line": 3, + "column": 2, + "line": 7, }, }, "range": Array [ - 19, - 20, + 99, + 100, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 3, + "column": 4, + "line": 7, }, "start": Object { - "column": 1, - "line": 3, + "column": 3, + "line": 7, }, }, "range": Array [ - 20, - 21, + 100, + 101, ], "type": "Punctuator", - "value": "{", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "range": Array [ + 104, + 107, + ], + "type": "Identifier", + "value": "get", }, Object { "loc": Object { "end": Object { "column": 7, - "line": 3, + "line": 8, }, "start": Object { - "column": 3, - "line": 3, + "column": 6, + "line": 8, }, }, "range": Array [ - 22, - 26, + 108, + 109, ], - "type": "String", - "value": "'__'", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 3, + "line": 8, }, "start": Object { "column": 7, - "line": 3, + "line": 8, }, }, "range": Array [ - 26, - 27, + 109, + 110, ], "type": "Punctuator", "value": "(", @@ -52057,16 +58224,16 @@ Object { "loc": Object { "end": Object { "column": 9, - "line": 3, + "line": 8, }, "start": Object { "column": 8, - "line": 3, + "line": 8, }, }, "range": Array [ - 27, - 28, + 110, + 111, ], "type": "Punctuator", "value": ")", @@ -52074,251 +58241,251 @@ Object { Object { "loc": Object { "end": Object { - "column": 11, - "line": 3, + "column": 10, + "line": 8, }, "start": Object { - "column": 10, - "line": 3, + "column": 9, + "line": 8, }, }, "range": Array [ - 29, - 30, + 111, + 112, ], "type": "Punctuator", - "value": "{", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 12, - "line": 3, + "column": 17, + "line": 8, }, "start": Object { "column": 11, - "line": 3, + "line": 8, }, }, "range": Array [ - 30, - 31, + 113, + 119, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 14, - "line": 3, + "column": 19, + "line": 8, }, "start": Object { - "column": 13, - "line": 3, + "column": 18, + "line": 8, }, }, "range": Array [ - 32, - 33, + 120, + 121, ], "type": "Punctuator", - "value": "}", + "value": "{", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 3, + "column": 10, + "line": 9, }, "start": Object { - "column": 14, - "line": 3, + "column": 4, + "line": 9, }, }, "range": Array [ - 33, - 34, + 126, + 132, ], - "type": "Punctuator", - "value": ")", + "type": "Keyword", + "value": "return", }, Object { "loc": Object { "end": Object { - "column": 16, - "line": 3, + "column": 12, + "line": 9, }, "start": Object { - "column": 15, - "line": 3, + "column": 11, + "line": 9, }, }, "range": Array [ - 34, - 35, + 133, + 134, ], - "type": "Punctuator", - "value": ";", + "type": "Numeric", + "value": "1", }, Object { "loc": Object { "end": Object { - "column": 1, - "line": 5, + "column": 3, + "line": 10, }, "start": Object { - "column": 0, - "line": 5, + "column": 2, + "line": 10, }, }, "range": Array [ - 37, - 38, + 137, + 138, ], "type": "Punctuator", - "value": "(", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 2, - "line": 5, + "column": 4, + "line": 10, }, "start": Object { - "column": 1, - "line": 5, + "column": 3, + "line": 10, }, }, "range": Array [ - 38, - 39, + 138, + 139, ], "type": "Punctuator", - "value": "{", + "value": ",", }, Object { "loc": Object { "end": Object { - "column": 4, - "line": 5, + "column": 5, + "line": 11, }, "start": Object { - "column": 3, - "line": 5, + "column": 2, + "line": 11, }, }, "range": Array [ - 40, - 41, + 142, + 145, ], - "type": "Punctuator", - "value": "[", + "type": "Identifier", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 8, - "line": 5, + "column": 7, + "line": 11, }, "start": Object { - "column": 4, - "line": 5, + "column": 6, + "line": 11, }, }, "range": Array [ - 41, - 45, + 146, + 147, ], - "type": "String", - "value": "'__'", + "type": "Identifier", + "value": "a", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 5, + "column": 8, + "line": 11, }, "start": Object { - "column": 8, - "line": 5, + "column": 7, + "line": 11, }, }, "range": Array [ - 45, - 46, + 147, + 148, ], "type": "Punctuator", - "value": "]", + "value": "(", }, Object { "loc": Object { "end": Object { - "column": 10, - "line": 5, + "column": 9, + "line": 11, }, "start": Object { - "column": 9, - "line": 5, + "column": 8, + "line": 11, }, }, "range": Array [ - 46, - 47, + 148, + 149, ], - "type": "Punctuator", - "value": ":", + "type": "Identifier", + "value": "x", }, Object { "loc": Object { "end": Object { - "column": 15, - "line": 5, + "column": 10, + "line": 11, }, "start": Object { - "column": 11, - "line": 5, + "column": 9, + "line": 11, }, }, "range": Array [ - 48, - 52, + 149, + 150, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": ":", }, Object { "loc": Object { "end": Object { "column": 17, - "line": 5, + "line": 11, }, "start": Object { - "column": 16, - "line": 5, + "column": 11, + "line": 11, }, }, "range": Array [ - 53, - 54, + 151, + 157, ], - "type": "Punctuator", - "value": "}", + "type": "Identifier", + "value": "number", }, Object { "loc": Object { "end": Object { "column": 18, - "line": 5, + "line": 11, }, "start": Object { "column": 17, - "line": 5, + "line": 11, }, }, "range": Array [ - 54, - 55, + 157, + 158, ], "type": "Punctuator", "value": ")", @@ -52327,70 +58494,52 @@ Object { "loc": Object { "end": Object { "column": 19, - "line": 5, + "line": 11, }, "start": Object { "column": 18, - "line": 5, + "line": 11, }, }, "range": Array [ - 55, - 56, + 158, + 159, ], "type": "Punctuator", - "value": ";", - }, - Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 7, - }, - "start": Object { - "column": 0, - "line": 7, - }, - }, - "range": Array [ - 58, - 63, - ], - "type": "Keyword", - "value": "class", + "value": ":", }, Object { "loc": Object { "end": Object { - "column": 7, - "line": 7, + "column": 26, + "line": 11, }, "start": Object { - "column": 6, - "line": 7, + "column": 20, + "line": 11, }, }, "range": Array [ - 64, - 65, + 160, + 166, ], "type": "Identifier", - "value": "X", + "value": "number", }, Object { "loc": Object { "end": Object { - "column": 9, - "line": 7, + "column": 28, + "line": 11, }, "start": Object { - "column": 8, - "line": 7, + "column": 27, + "line": 11, }, }, "range": Array [ - 66, - 67, + 167, + 168, ], "type": "Punctuator", "value": "{", @@ -52398,74 +58547,56 @@ Object { Object { "loc": Object { "end": Object { - "column": 14, - "line": 7, - }, - "start": Object { - "column": 10, - "line": 7, - }, - }, - "range": Array [ - 68, - 72, - ], - "type": "String", - "value": "'__'", - }, - Object { - "loc": Object { - "end": Object { - "column": 16, - "line": 7, + "column": 3, + "line": 12, }, "start": Object { - "column": 15, - "line": 7, + "column": 2, + "line": 12, }, }, "range": Array [ - 73, - 74, + 171, + 172, ], "type": "Punctuator", - "value": "=", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 21, - "line": 7, + "column": 1, + "line": 13, }, "start": Object { - "column": 17, - "line": 7, + "column": 0, + "line": 13, }, }, "range": Array [ - 75, - 79, + 173, + 174, ], - "type": "Keyword", - "value": "null", + "type": "Punctuator", + "value": "}", }, Object { "loc": Object { "end": Object { - "column": 23, - "line": 7, + "column": 2, + "line": 13, }, "start": Object { - "column": 22, - "line": 7, + "column": 1, + "line": 13, }, }, "range": Array [ - 80, - 81, + 174, + 175, ], "type": "Punctuator", - "value": "}", + "value": ";", }, ], "type": "Program", @@ -54257,14 +60388,345 @@ Object { }, "range": Array [ 0, - 31, + 31, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 15, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 23, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 28, + ], + "type": "Identifier", + "value": "baz", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + +exports[`typescript fixtures/basics/type-assertion.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 6, + 9, + ], + "type": "Identifier", + }, + "init": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "raw": "2", + "type": "Literal", + "value": 2, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 27, + ], + "type": "TSTypeAssertion", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 16, + ], + "type": "TSAnyKeyword", + }, + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 27, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 29, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 4, + "column": 5, "line": 1, }, "start": Object { @@ -54274,25 +60736,25 @@ Object { }, "range": Array [ 0, - 4, + 5, ], - "type": "Identifier", - "value": "type", + "type": "Keyword", + "value": "const", }, Object { "loc": Object { "end": Object { - "column": 8, + "column": 9, "line": 1, }, "start": Object { - "column": 5, + "column": 6, "line": 1, }, }, "range": Array [ - 5, - 8, + 6, + 9, ], "type": "Identifier", "value": "foo", @@ -54300,43 +60762,25 @@ Object { Object { "loc": Object { "end": Object { - "column": 10, + "column": 11, "line": 1, }, "start": Object { - "column": 9, + "column": 10, "line": 1, }, }, "range": Array [ - 9, 10, - ], - "type": "Punctuator", - "value": "=", - }, - Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "range": Array [ 11, - 12, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 15, + "column": 13, "line": 1, }, "start": Object { @@ -54346,10 +60790,10 @@ Object { }, "range": Array [ 12, - 15, + 13, ], - "type": "Identifier", - "value": "bar", + "type": "Punctuator", + "value": "<", }, Object { "loc": Object { @@ -54358,103 +60802,67 @@ Object { "line": 1, }, "start": Object { - "column": 15, + "column": 13, "line": 1, }, }, "range": Array [ - 15, + 13, 16, ], - "type": "Punctuator", - "value": ":", - }, - Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "range": Array [ - 17, - 23, - ], "type": "Identifier", - "value": "string", + "value": "any", }, Object { "loc": Object { "end": Object { - "column": 24, + "column": 17, "line": 1, }, "start": Object { - "column": 23, + "column": 16, "line": 1, }, }, "range": Array [ - 23, - 24, + 16, + 17, ], "type": "Punctuator", - "value": ",", + "value": ">", }, Object { "loc": Object { "end": Object { - "column": 28, + "column": 27, "line": 1, }, "start": Object { - "column": 25, + "column": 26, "line": 1, }, }, "range": Array [ - 25, - 28, + 26, + 27, ], - "type": "Identifier", - "value": "baz", + "type": "Numeric", + "value": "2", }, Object { "loc": Object { "end": Object { - "column": 29, - "line": 1, - }, - "start": Object { "column": 28, "line": 1, }, - }, - "range": Array [ - 28, - 29, - ], - "type": "Punctuator", - "value": "}", - }, - Object { - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, "start": Object { - "column": 29, + "column": 27, "line": 1, }, }, "range": Array [ - 29, - 30, + 27, + 28, ], "type": "Punctuator", "value": ";", @@ -54464,7 +60872,7 @@ Object { } `; -exports[`typescript fixtures/basics/type-assertion.src 1`] = ` +exports[`typescript fixtures/basics/type-assertion-arrow-function.src 1`] = ` Object { "body": Array [ Object { @@ -54473,95 +60881,171 @@ Object { "id": Object { "loc": Object { "end": Object { - "column": 9, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, - "name": "foo", + "name": "asserted2", "range": Array [ - 6, - 9, + 4, + 13, ], "type": "Identifier", }, "init": Object { "expression": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "name": "n", + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 40, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 42, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, "loc": Object { "end": Object { - "column": 27, + "column": 42, "line": 1, }, "start": Object { - "column": 26, + "column": 22, "line": 1, }, }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "n", + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + }, + ], "range": Array [ - 26, - 27, + 22, + 42, ], - "raw": "2", - "type": "Literal", - "value": 2, + "type": "ArrowFunctionExpression", }, "loc": Object { "end": Object { - "column": 27, + "column": 43, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 27, + 16, + 43, ], "type": "TSTypeAssertion", "typeAnnotation": Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "range": Array [ - 13, - 16, + 17, + 20, ], "type": "TSAnyKeyword", }, }, "loc": Object { "end": Object { - "column": 27, + "column": 43, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 27, + 4, + 43, ], "type": "VariableDeclarator", }, ], - "kind": "const", + "kind": "var", "loc": Object { "end": Object { - "column": 28, + "column": 44, "line": 1, }, "start": Object { @@ -54571,7 +61055,7 @@ Object { }, "range": Array [ 0, - 28, + 44, ], "type": "VariableDeclaration", }, @@ -54588,14 +61072,14 @@ Object { }, "range": Array [ 0, - 29, + 45, ], "sourceType": "script", "tokens": Array [ Object { "loc": Object { "end": Object { - "column": 5, + "column": 3, "line": 1, }, "start": Object { @@ -54605,43 +61089,43 @@ Object { }, "range": Array [ 0, - 5, + 3, ], "type": "Keyword", - "value": "const", + "value": "var", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 13, "line": 1, }, "start": Object { - "column": 6, + "column": 4, "line": 1, }, }, "range": Array [ - 6, - 9, + 4, + 13, ], "type": "Identifier", - "value": "foo", + "value": "asserted2", }, Object { "loc": Object { "end": Object { - "column": 11, + "column": 15, "line": 1, }, "start": Object { - "column": 10, + "column": 14, "line": 1, }, }, "range": Array [ - 10, - 11, + 14, + 15, ], "type": "Punctuator", "value": "=", @@ -54649,17 +61133,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 13, + "column": 17, "line": 1, }, "start": Object { - "column": 12, + "column": 16, "line": 1, }, }, "range": Array [ - 12, - 13, + 16, + 17, ], "type": "Punctuator", "value": "<", @@ -54667,17 +61151,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 16, + "column": 20, "line": 1, }, "start": Object { - "column": 13, + "column": 17, "line": 1, }, }, "range": Array [ - 13, - 16, + 17, + 20, ], "type": "Identifier", "value": "any", @@ -54685,17 +61169,17 @@ Object { Object { "loc": Object { "end": Object { - "column": 17, + "column": 21, "line": 1, }, "start": Object { - "column": 16, + "column": 20, "line": 1, }, }, "range": Array [ - 16, - 17, + 20, + 21, ], "type": "Punctuator", "value": ">", @@ -54703,20 +61187,74 @@ Object { Object { "loc": Object { "end": Object { - "column": 27, + "column": 22, "line": 1, }, "start": Object { - "column": 26, + "column": 21, "line": 1, }, }, "range": Array [ - 26, - 27, + 21, + 22, ], - "type": "Numeric", - "value": "2", + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "n", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", }, Object { "loc": Object { @@ -54725,15 +61263,141 @@ Object { "line": 1, }, "start": Object { - "column": 27, + "column": 26, "line": 1, }, }, "range": Array [ - 27, + 26, 28, ], "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 37, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Identifier", + "value": "n", + }, + Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "start": Object { + "column": 39, + "line": 1, + }, + }, + "range": Array [ + 39, + 40, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "start": Object { + "column": 41, + "line": 1, + }, + }, + "range": Array [ + 41, + 42, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 42, + "line": 1, + }, + }, + "range": Array [ + 42, + 43, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 43, + "line": 1, + }, + }, + "range": Array [ + 43, + 44, + ], + "type": "Punctuator", "value": ";", }, ],

+ Travis + GitHub license + NPM Version + NPM Downloads + Commitizen friendly + semantic-release +